Summary
JavaScript Object Notation (JSON) is a text-based, lightweight data interchange format used to share GIS data between ArcGIS and other systems. The JSON To Features tool creates a feature class from a JSON file, but not from a JSON URL. However, the ArcGIS Data Interoperability extension for Desktop provides the function to convert a JSON URL to a feature class using the Spatial ETL tool. The output feature class contains the fields, geometry type, and spatial reference as defined in the JSON URL.
The script below shows some parts of a JSON URL containing the X (longitude) and Y (latitude) coordinates of each feature.
[
{
"json_featuretype":"Metadata"
,"ExtractDate":"2018-10-23"
,"ExtractFrequency":"Daily"
}
,{
"json_featuretype":"CurrentIssues"
,"STREETNUMBER":"320"
,"STREET":"PALM STREET"
,"TOTALUNITS":60
,"BUSINESSOPERATOR":"0707"
,"TOTALOUTSTANDING":1
,"LATITUDE":49.28261413
,"LONGITUDE":-123.10664756
}
,{
"json_featuretype":"CurrentIssues"
,"STREETNUMBER":"404"
,"STREET":"PALM STREET"
,"TOTALUNITS":71
,"BUSINESSOPERATOR":"Central City"
,"TOTALOUTSTANDING":1
,"LATITUDE":49.2816849
,"LONGITUDE":-123.10713559
}
,{
"json_featuretype":"CurrentIssues"
,"STREETNUMBER":"1656"
,"STREET":"COCOA STREET"
,"TOTALUNITS":46
,"BUSINESSOPERATOR":"Housing Society"
,"TOTALOUTSTANDING":2
,"LATITUDE":49.27733406
,"LONGITUDE":-123.07200187
}
Procedure
The following instructions describe how to convert a JSON URL to a feature class using the ArcGIS Data Interoperability extension in ArcMap:
Note:
A Data Interoperability license is required to create the spatial ETL tool.
- Create a spatial ETL tool in the Catalog pane and specify the following FME reader and writer parameters.
- In the Reader section, set the Format to JSON (JavaScript Object Notation).
- For the Dataset, specify the JSON URL.
- In the Writer section, set the Format to Esri Geodatabase (File Geodb ArcObjects) to convert the JSON URL to a file geodatabase feature class.
- For the Dataset, browse to an existing file geodatabase to locate the converted feature class.
- Click OK. The Spatial ETL Tool window appears.
- In the Spatial ETL Tool window, add the VertexCreator transformer to the workspace canvas from the Transformer Gallery window. To open the window, click View > Windows > Transformer Gallery.
- Drag and drop to add the VertexCreator transformer and connect it to the reader.
- In the VertexCreator Parameters dialog box, map the X Value and Y Value parameters with the longitude and latitude attribute values given in the JSON URL respectively.
- Click OK.
- Add a CoordinateSystemSetter transformer to tag all features with a coordinate system.
- Drag and drop to add the CoordinateSystemSetter transformer and connect it to the previous transformer output.
- In the CoordinateSystemSetter Parameters dialog box, select the Coordinate System.
- Click OK.
- Add an AttributeCreator transformer to import the attributes from the JSON URL to the output features.
- Drag and drop to add the AttributeCreator transformer and connect it to the previous transformer output.
- In the AttributeCreator Parameters dialog box, click Import. An Import Wizard dialog box opens.
- In the Format parameter, select JSON (JavaScript Object Notation).
- In the Dataset parameter, insert the JSON URL and click Next.
- Specify whether to import data from the names or values of attributes in the selected feature type(s), and click Next.
- Select the attributes to import in the New Attribute and Attribute Value sections, and click Import.
- Click OK to close the AttributeCreator Parameters dialog box.
- Manually connect the output and attributes from the AttributeCreator transformer to the writer.
- Double-click the writer to edit the output feature type properties.
- In the General tab, select the Geometry type. For example, select geodb_point to convert the JSON URL to a point feature class.
- Click OK.
- Click Save , and click Run . The output feature class is located in the file geodatabase specified in Step 1(d). To view the data, add the feature class into ArcMap.
The image below shows a point feature class converted from a JSON URL in ArcMap.