Find places
Place finding is the process of searching for a place name or POI to find its address and location.
In this tutorial, you will create a script to search and display different places around the Santa Monica Mountains area.
The ArcGIS World Geocoding Service can find addresses and places, convert addresses to coordinates, and perform batch geocoding. If you want to add POIs (Points of Interest) to your analytical workflows, you can search for places such as coffee shops, gas stations, or restaurants. To find places, use the geocode function and pass in a location and search category (e.g. "Coffee Shop").
You can then visualize the results on a map, manipulate the results in a Pandas Dataframe
, and more.
Prerequisites
The ArcGIS API for Python tutorials use Jupyter Notebooks to execute Python code. If you are new to this environment, please see the guide to install the API and use notebooks locally.
Steps
Add the following code to model a GIS portal and import the geocode function from the ArcGIS API for Python.
Use dark colors for code blocks Add line. Add line. Create an anonymous connection to ArcGIS Online. Since the results are not stored, you do not need credentials to call the geocoding service.
Use dark colors for code blocks Add line. Pass the relevant parameters into the geocode function and get a FeatureSet as the result. In this example, the call requests the names, addresses, and locations of 25 coffee shops near a point in the Santa Monica Mountains. It also requests the results as a feature set so that they can be easily converted to a dataframe and mapped.
Use dark colors for code blocks Add line. Add line. Add line. Add line. Add line. Add line. Add line. Add line. Convert the results to a Pandas
Dataframe
by calling thesdf
property of aFeature
and show the first two locations.Set Use dark colors for code blocks Add line. Add line. Create a map to display the results.
Use dark colors for code blocks Add line. Add line. Once the map has loaded, draw the results.
Use dark colors for code blocks Add line. Add line. Add line.