A find location analysis resulting in a new layer with parks 150 meters from a bike route.
What is a find existing locations analysis?
A find existing location analysis is the process of selecting and copying features that satisfy one or more SQL and/or spatial expressions. To execute the analysis, use the spatial analysis service and the FindExistingLocations operation.
Real-world examples of this analysis include the following:
Finding neighborhoods within a specified distance from schools or police stations.
Selecting specific points of interest within a larger dataset.
Finding road access that cannot be on or within view of a protected area.
How to perform a find location analysis
The general steps to performing a find existing locations analysis are as follows:
Review the parameters for the FindExistingLocations operation.
Determine if you would like the results as a feature collection (dynamic) or hosted feature layer (stored).
Send a request to get the spatial analysis service URL.
Execute a job request with the following URL and parameters:
The point, polyline, or polygon feature data that will be used to construct the query.
[{"url":"https://services.arcgis.com/nSZVuSZjHpEZZbRo/arcgis/rest/services/OSM_POI/FeatureServer/0","name":"OpenStreetMap - Points of interest (bèta) - Punten"}]
expressions
The SQL or spatial query.
[{"operator":"","layer":0,"where":"service = 'Eten en Drinken'"}]
Key parameters
Name
Description
Examples
outputName
A string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).
{"serviceProperties": {"name": "<SERVICE_NAME>"}}
context
A bounding box or output spatial reference for the analysis.
"extent":{"xmin:", "ymin:", "xmax:", "ymax:"}
Code examples
Find neighborhoods (spatial query)
This example uses the FindExistingLocations operation to construct a spatial query that selects and returns all the neighborhoods within a half mile of a police station.
For the analysis, the inputLayers value is the Police stations and San Francisco Neighborhoods hosted feature layers. The expression value is: SF Neighborhoods within a distance of 0.5 Miles from Police Stations.
Find existing locations using a spatial query to return neighborhoods within 0.5 miles of police stations.
APIs
ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
This example uses the FindExistingLocations operation to construct a SQL query that selects and returns the restaurants within the OpenStreetMap-Points of interest (bèta) hosted layer.
For the analysis, the inputLayers value is the OpenStreetMap-Points of interest (bèta) hosted layer. The expression value is: "where":"service = 'Hotels en Pensions'".
Find existing locations using a SQL query to return hotels in Amsterdam.
APIs
ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
Learn how to perform related analyses interactively with Map Viewer and programmatically with ArcGIS API for Python, ArcGIS REST JS, and ArcGIS REST API.