I am trying to use the module find_similar_locations listed here:
arcgis.geoanalytics.find_locations module — arcgis 1.8.2 documentation
My intention is to find similar locations for entries in search layer compared to input layer, based on some common analysis fields. I am however, unfamiliar on what format i should be using for these layers. Can anyone help with an example, or provide a link to this documentation.
Hi sabarish balakrishnan, please see the example here Find Similar Locations—Portal for ArcGIS | Documentation for ArcGIS Enterprise as well as the link Dan shared above.
If you are not working with a large dataset, you can also consider using the non-GeoAnalytics version of the tool: arcgis.features.find_locations module — arcgis 1.8.2 documentation
Noah Slocum Thank you.
I am very very new to GIS and i am confused a bit. In the page Find Similar Locations—Portal for ArcGIS | Documentation for ArcGIS Enterprise, the example again shows store layer, locations, features etc. What I am trying to do is I have two csv files with a bunch of locations in both, and demographics for all locations in the respective files. I just need to use the find_similar_location. Do I create my own layer from this data first? Is there a way, i can input the csv data directly in the find_similar_location function?
Also, should i have enterprise access to use this feature? I finally added the layers through my account. this is what my code is?
stores_layer = FeatureLayer('https://services3.arcgis.com/U26uBjSD32d7xvm2/arcgis/rest/services/output_whataburger/FeatureServer')
locations = FeatureLayer ('https://services3.arcgis.com/U26uBjSD32d7xvm2/arcgis/rest/services/output_tractor/FeatureServer')
similar_location_result = find_locations.find_similar_locations(input_layer = stores_layer,
search_layer = locations,
analysis_fields = "TOTPOP_CY")
Error:
AttributeError: 'PropertyMap' instance has no attribute 'geoanalytics'
On searching this forum, I find access as one of the reasons i might be getting this error.
two variants apparently, desktop and server
An overview of the GeoAnalytics Desktop toolbox—ArcGIS Pro | Documentation
An overview of the GeoAnalytics Server toolbox—ArcGIS Pro | Documentation
sabarish balakrishnan, I am glad you were able to get your CSVs into a feature service layer. However, if you do not have a GeoAnalytics Server available to use, you won't be able to run the tool. You can check this using arcgis.geoanalytics.
is_supported()
.
I would recommend using the standard feature analysis tool instead if you do not have a GeoAnalytics Server, which is in a different module in the ArcGIS API for Python. See arcgis.features.find_locations.
find_similar_locations
and Find Similar Locations—Portal for ArcGIS | Documentation for ArcGIS Enterprise