AnsweredAssumed Answered

FeatureCollection to .json then import to ArcPro

Question asked by forrestkaye on Oct 31, 2019

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,

Attachments

Outcomes