ArcGIS geo enrichment

490
3
12-13-2022 12:59 AM
SulemanButt
New Contributor

Hi i wanted to know if "arcgis.geoenrichment" is free?

my code:

from arcgis.gis import GIS
from arcgis.geoenrichment import Country
 
# hid credentials
gis = GIS(username='*********', password='*********')

pk = Country.get('PK')
pk_states = [state for state in pk.subgeographies.states.items()]
# pk_places = [place for place in pk.subgeographies.states['Punjab'].places.items()][:5]
 
errors i am facing:
1.
Traceback (most recent call last):
File "test.py", line 7, in <module>
pk_states = [state for state in pk.subgeographies.states.items()]
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/geoenrichment/enrichment.py", line 227, in __getattribute__
val = object.__getattribute__(self, name)
AttributeError: 'NamedArea' object has no attribute 'states'
 
2.
Traceback (most recent call last):
File "test.py", line 6, in <module>
pk = Country.get('US').subgeographies.states
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/geoenrichment/enrichment.py", line 230, in __getattribute__
self._fetch_subgeographies(name)
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/geoenrichment/enrichment.py", line 237, in _fetch_subgeographies
df = standard_geography_query(
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/geoenrichment/enrichment.py", line 102, in wrapped
return fn_to_call(*args, **kwargs)
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/geoenrichment/enrichment.py", line 1802, in _standard_geography_query_gis
return ge.standard_geography_query(
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/geoenrichment/_ge.py", line 1225, in standard_geography_query
res = self._gis._con.post(path=url, postdata=params)
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/gis/_impl/_con/_connection.py", line 1407, in post
return self._handle_response(
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/gis/_impl/_con/_connection.py", line 900, in _handle_response
self._handle_json_error(data["error"], errorcode)
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/gis/_impl/_con/_connection.py", line 923, in _handle_json_error
raise Exception(errormessage)
Exception: User does not have permissions to access this resource.
0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

It requires an arcgis pro license with geoenrichment capabilities enabled on your account or the data doesn't exist for the country in question

00310: GeoEnrichment service is not configured—ArcGIS Pro | Documentation

00312: Country cannot be determined for the Statistical Data Collection or the country is not availa...

plus other links


... sort of retired...
0 Kudos
SulemanButt
New Contributor

Just confirming.... do i need to buy a plan or geo-enrichment service to use this info? If yes then can you share me the link where i could buy this service please??

0 Kudos
DanPatterson
MVP Esteemed Contributor

From the web

GeoEnrichment service—ArcGIS REST APIs | ArcGIS Developers

under Access the Service gives the requirements


... sort of retired...
0 Kudos