AnsweredAssumed Answered

ArcGIS API for Python - geometry.project

Question asked by krank42 on Jul 31, 2018
Latest reply on Dec 12, 2018 by cmosnick-esristaff

Hi to all,

I tried this script with ArcGIS API from Python 1.4.2 like arcgis.geometry module — arcgis 1.4.2 documentation .

from arcgis.gis import GIS

from arcgis import geometry

input_geom = [{"x": -17568824.55, "y": 2428377.35}, {"x": -17568456.88, "y": 2428431.352}]

result = geometry.project(geometries = input_geom, in_sr = 3857, out_sr = 4326)

I get this error:


--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-8-a89d8e1c23f7> in <module>() ----> 1 result = geometry.project(geometries = input_geom, in_sr = 3857, out_sr = 4326, ) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\geometry\functions.py in project(geometries, in_sr, out_sr, transformation, transform_foward, gis) 646 if gis is None: 647 gis = arcgis.env.active_gis --> 648 return gis._tools.geometry.project( 649 geometries, 650 in_sr, AttributeError: 'NoneType' object has no attribute '_tools'


What I'm doing wrong?

 

Thanks Karsten

Outcomes