From the course: Python Scripting Using the ArcGIS API for Python

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Querying spatial data

Querying spatial data

- [Instructor] We can analyze and manage geospatial feature services with Python, using the ArcGIS API for Python. Often though, those feature layers that we want to work with can contain a lot of data. So it's useful to know how to filter them to create record sets that contain just the information needed before we try to process them. Let's look closely at the .query method of a feature layer object to see how to use it effectively to reduce the number of features we process. In the ArcGIS API for Python reference, you'll find that query method in the .features module, arcgis.features, the feature layer object, and then you'll find its query method. When I want to actually work with the data in a feature service, I first have to grab the feature service into a feature layer collection and then pull off the feature layer that I want. And then once I have the feature layer, I can request all the records in that feature layer. And I do that by using the query method of the feature…

Contents