-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Converting from GeoJson to ESRI Feature Set causes malformed ring data #600
Comments
Please post your conda environment installs settings by doing:
Also please post your JSON files. Are you using an environment with ArcPy or Not? If so, what version of Pro are you using? |
ArcPy is not being used and the python API is being run external of Pro. We are trying to run this on a AWS Lambda function. Looking at The arcgis library was installed by running: The json files used have been included below. |
I've discovered a possibly related issue within the feature.py module. I've posted a geonet question about it here: https://community.esri.com/thread/257817-featuresetfromgeojson-bug Specifically, within the feature.py code snippet posted by the OP:
It appears that geom is being set as an arcpy geometry object, and then geom is passed within the Geometry parameter as json.loads(geom). It appears that under certain circumstances this code is run and it causes json.loads to crash because json.loads is expecting 'str, bytes or bytearray' and not an arcpy geometry object. |
A fix will be in the next release of the ArcGIS API for Python. Thanks for the detailed post on how to reproduce your issue. |
I'm still seeing this issue in releases 1.8 and 1.9 where the conversion of a multipolygon to feature set will cause malformed data because a null value is being add for each ring in features\feature.py at lines 1058-1060: This will always append a null value to the list because the index will always be True with enumerate. Commenting out the code that add the null value to the list fixes the error. This bug currently keeps me from uploading the data to ArcGIS Online with the error "The specified geometry is not in the correct format. Object reference not set to an instance of an object." |
Using Python API 1.7.1 I have attempted to use the feature layer method edit_features() with a set of features that have been converted from GeoJson to an ESRI Feature Set. In doing so this error message was returned:
While looking at the converted ESRI Feature Set, the ring data had nulls inserted into the data. Upon closer inspection of the from_geojson() FeatureSet method in /arcgis/featues/featury.py a few lines caught my attention.
This seems to append a None value to the beginning of every new ring set. I’m not sure whether the reasoning for this is for internal api usage. However, when using this method within my context the rings with null entries will not be accepted by the edit_features() method. Instead, I would be expecting it to be placed within an array for the relevant ring geometries, and for the set of rings to also be placed in an array
Below I have provided code I used to test this issue.
The text was updated successfully, but these errors were encountered: