Frequently asked question

Is it possible to import a generic JSON file using the JSON to Feature tool in ArcGIS Pro?

Last Published: May 11, 2021

Answer

No, it is not possible to import a generic JSON file using the JSON to Feature tool in ArcGIS Pro. A generic JSON file does not follow any standard for data organization. However, GeoJSON is a specified format for encoding a variety of geographic data structures. ArcGIS products are compatible with EsriJSON files and GeoJSON files. Using a generic JSON file with the JSON to Feature tool produces an error. Refer to ArcGIS Pro: 001558: Error parsing .json file <value> for more information. As a workaround, create a spatial ETL tool to import the generic JSON file as a feature class in ArcGIS Pro.

Note:
A Data Interoperability license is required to create the spatial ETL tool.
  1. Create a spatial ETL tool in the Catalog pane, and specify the following FME Reader and Writer parameters.
    1. In the Reader section, set Format to Text File.
    2. For Dataset, specify the JSON file. In the Select Source Text File(s) dialog box, select All files to view the JSON file.
    3. In the Writer section, set Format to Esri Geodatabase (File Geodb ArcObjects) to convert the JSON file to a file geodatabase feature class.
    4. For Dataset, browse to an existing file geodatabase to locate the converted feature class.
    5. Click OK. The Spatial ETL Tool window displays.
  2. To extract the JSON file content to feature attributes, add the JSONFragmenter transformer from the Transformer Gallery window, and connect it to Reader.
Note:
To open the Transformer Gallery window, click View > Windows > Transformer Gallery.
  1. In the JSONFragmenter Parameters dialog box, set the JSON Attribute to text_line_data.
  2. For JSON Query, type json[*].
  3. For Flatten Query Result Into Attributes, select Yes from the drop-down list, and ensure Recursively Flatten Objects/Arrays is set to Yes.
  4. Right-click on the JSONFragmenter transformer > Run > Run To This.
The JSONFragmenter Parameters dialog box to extract the JSON file content to feature attributes
  1. Add the AttributeExposer transformer, and connect it to the previous transformer output.
    1. In the AttributeExposer Parameters dialog box, click Import > select From Feature Cacheā€¦.
    2. From the Import Wizard dialog box, select the required attributes.
    3. Click Import to close the Import Wizard dialog box.
    4. Click OK to close the AttributeExposer Parameters dialog box.
The AttributeExposer Parameters dialog box to display attributes
  1. Add the VertexCreator transformer to append the coordinates to points and connect it to the previous transformer output.
    1. In the VertexCreator Parameters dialog box, map the X Value and Y Value parameters with the longitude and latitude attribute values from the JSON file respectively.
    2. Click OK.
The VertexCreator Parameters dialog box to append the coordinates to points
  1. Add a CoordinateSystemSetter transformer to tag all theĀ features with a coordinate system. Connect it to the previous transformer output.
    1. In the CoordinateSystemSetter Parameters dialog box, select a value from the Coordinate System drop-down list.
    2. Click OK.
The CoordinateSystemSetter Parameters dialog box to set coordinate system
  1. Add an AttributeCreator transformer to import the attributes from the JSON file to output features.
    1. In the AttributeCreator Parameters dialog box, type the preferred field name in New Attribute.
    2. For Attribute Value, click the drop-down list, and select Attribute Value to select the related attributes.
    3. Click OK to close the AttributeCreator Parameters dialog box.
The AttributeCreator Parameters dialog box import attributes as JSON
  1. Manually connect the output and attributes from the AttributeCreator transformer to Writer.
The data flow diagram
  1. Double-click Writer to edit the output feature type properties.
    1. In the General tab, select the Geometry type. For example, select geodb_point to convert the JSON file to a point feature class.
    2. Click OK.
The Feature Type dialog box to edit the output feature type properties
  1. Click the Save The Save icon icon, and click the Run,The Run icon icon . The output feature class is in the file geodatabase specified in Step 1d.
  2. To view the data, add the feature class in ArcGIS Pro.

The image below shows a point feature class converted from a JSON file in ArcGIS Pro.

The point feature class converted from a JSON file in ArcGIS Pro

Article ID: 000025450

Software:
  • Third Party Product
  • ArcGIS Pro 2 7 x
  • ArcGIS Pro 2 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options