FeatureCollection to .json then import to ArcPro

1057
1
Jump to solution
10-31-2019 11:10 AM
ForrestKaye
New Contributor III

I am having issues with importing a .json file from a runtime FeatureCollection to ArcPro or ArcMap.  Is this a supported workflow?  I have the .json file attached that is not working.

I am using ArcGIS Runtime SDK for Android 100.6.0. 

When reviewing the suggested solution when importing it to ArcPro I can confirm that the .json file has items listed (geometryType, spatialReference, fields, and features (with geometry and attributes) property):

 

Error in ArcPro:

 

001558: Error parsing .json file <value>.
Description
The JSON structure does not conform to ESRI-JSON standard for feature sets.

Solution
Review the JSON structure in the input file. The JSON must have at least the geometryType, spatialReference, fields, and features (with geometry and attributes) property.

			File outFile = new File(FILE_PATH);
			if (featureCollectionTable.getTotalFeatureCount() > 0) {
				Iterable<FeatureCollectionTable> featureCollectionTables = Arrays.asList(featureCollectionTable);
				FeatureCollection featureCollection = new FeatureCollection(featureCollectionTables);
				String jsonString = featureCollection.toJson();

				//saving file....
				FileOutputStream out = new FileOutputStream(outFile);
				byte[] bytes = jsonString.getBytes();
				out.write(bytes);
				out.flush();
				out.close();
			}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

Thanks,

1 Solution

Accepted Solutions
ForrestKaye
New Contributor III

In case anyone cares this is officially a bug in the SDK as confirmed by ESRI.  I hope this gets fixed in the next release of quartz.  Thanks. 

View solution in original post

0 Kudos
1 Reply
ForrestKaye
New Contributor III

In case anyone cares this is officially a bug in the SDK as confirmed by ESRI.  I hope this gets fixed in the next release of quartz.  Thanks. 

0 Kudos