Dear All,
I am writing codes to add more features to an agol hosted point layer using arcgis API for Python. It is a seemingly straightforward task, but I encountered problem to deal with geometry's spatial reference.
the coordinates of my source points and target agol layer are in deferent spatial references system, source is in WJID 4326 and the target is in WKID 3857. Well, I have two questions:
First, could I add feature(s) with different SR to an Agol featureLayer (using featureLayer.edit_features(adds=newFeatureDict). I thought that it could not (I am an old GIS guy). However, the input of new feature has the option for define SR for each feature. It is not mentioned in the documents "the new feature must have the same sr with the target featureLayer. This made me wondering if there is a "internal on the fly transformation" for the method. I tried and the new points landed in African instead to Ohio!
Second, How to use the arcgis.geometry.project to re-project geometry from one sr to another. in the documentation, there is a very simple and straightforward module (arcgis.geometry.project) dedicated for this purpose. But it did not work and returns a error message. I even tried using the example copied from the documentation. it returns the sample error.
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)
Exception: 'NoneType' object has no attribute '_tools'
I called ESRI tech support and as usaul, I am still waiting ...... Please help!
Ming