AnsweredAssumed Answered

Error when running example code from geometry.project (ArcGIS API for Python)

Question asked by mikie.kelly on Feb 23, 2019
Latest reply on Feb 25, 2019 by mikie.kelly

Hello community,

 

Any ideas why the following code doesn't work?

 

from arcgis import geometry

input_geometry = [{
  "xmin": 191038.7271550147,
  "ymin": 493884.06809108134,
  "xmax": 1011248.7009082956,
  "ymax": 971193.3560429906,
  "spatialReference": {
    "wkid": 2157,
    "latestWkid": 2157
  }
}]
projected_extent = geometry.project(geometries=input_geometry,
                                    in_sr=2157,
                                    out_sr=4326)
print(projected_extent)

 

I get the following error message:

 

 

AttributeError: 'NoneType' object has no attribute '_tools'

 

The same error appears when I run the example code snippet in the documentation on which this is based:

 

from arcgis.geometry import project

input_geom = [{'x': -17568824.55, 'y': 2428377.35}, {'x': -17568456.88, 'y': 2428431.352}]
result = project(geometries=input_geom, in_sr=3857, out_sr=4326)

print(result)

 

I could construct the request myself, but would rather use the API.

 

Any suggestions appreciated!

 

Cheers,

 

Mikie

Outcomes