I am trying to convert a JSON
file into a feature. My code was working fine until today and now I am getting the following error – ExecuteError: ERROR 001558: Error parsing json file '<filepath>'. The workspace is not connected.
.
I tried it manually in ArcMap
using this proceedure:
- I first checked that the JSON file looked correct (had all the prerequisites like geometryType, Features, etc…).
- In arcMap (10.5), I went to toolbox > Conversion Tools > JSON > JSON To Features.
- I input the filepath to the .json file and then made sure the output went to a .gdb.
- I double checked the filepaths.
Same results: ERROR 001558. I even tried the default output, which went to the ArcGIS\Default.gdb. I also got the same error:
ExecuteError: ERROR 001558: Error parsing json file ''. The
workspace is not connected. Failed to execute (JSONToFeatures).
In researching this issue, I found the ArcGIS Pro page on 001558: Error parsing .json file <value>
which states that the The JSON must have at least the geometryType, spatialReference, fields, and features (with geometry and attributes) property.
I checked the data and it has
geometryType
, spatialReference
, fields
, and features
which have attributes
and geometry
.
{"displayFieldName": "CSLF_ID",
"fieldAliases": {...},
"geometryType": "esriGeometryPolygon",
"spatialReference": {
"wkid": 102100,
"latestWkid": 3857
},
"fields": [...],
"features": [
{"attributes": {...},
"geometry": {...}
},...]}
So, I am wondering if there might be something else causing the error. Or can anyone see an issue with the JSON file above?
Best Answer
I know it's a bit late, but I had the same problem.
How the problem raised:
I was downloading my data as GeoJSON for different areas with multiple requests. To import all the data at once in ArcGIS Pro my downloader-script combined all entries under "features". Some features were downloaded by multiple requests so by adding all into one array caused some features to have been added twice.
The solution:
Make sure that all features you have in that array have unique OBJECTIDs (feature→attributes→OBJECTID).
In my case I checked for every feature if one with the same OBJECTID already exists in the final GeoJSON before adding it.