I am trying to use find_similar_locations module to find similarity between my input layer and search layer in python. However, i do not understand what format i should use for these layers in python. can anyone help me with an example?

939
6
09-20-2020 05:41 PM
by Anonymous User
Not applicable

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.

0 Kudos
6 Replies
DanPatterson
MVP Esteemed Contributor

Point features... as shown in the link in your link

Feature Input 


... sort of retired...
NoahSlocum
Esri Contributor

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 

by Anonymous User
Not applicable

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?

0 Kudos
by Anonymous User
Not applicable

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. 

0 Kudos
DanPatterson
MVP Esteemed Contributor
0 Kudos
NoahSlocum
Esri Contributor

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 

0 Kudos