In this tutorial, we’ll cover how you can do data conversion with ArcGIS Pro’s Conversion toolset.
Data conversion means that you will change data from one file format to another. This is often required when importing or exporting data out of Pro and use it in another environment. We’ll have a look at converting a shapefile to JSON format, using Pro’s Conversion tools.
Pro’s Conversion toolset contains seventeen different tools that not only convert between different file formats, but also between data types (such as raster to vector and vice versa). Also included are tools and scripts to convert to Esri-specific data formats such as GeoDatabase, GeoPackage and the Shapefile. Newly added to Pro 2.9 are the PDF to TIFF geoprocessing tool, the Features to Graphics and the Graphics to Features tool.
It should be noted that the Conversion toolset is not exhaustive: there are many different file formats for spatial data and only a few of them are included in the Conversion toolset. There’s also the ArcGIS Data Interoperability extension for Desktop, which is an integrated spatial extract, transform, and load (ETL) toolset that runs within the geoprocessing framework using Safe Software’s FME technology. This requires a separate license and is not covered here.
Step 1: Download the data and create a new, empty project in Pro
Open Pro and create a new project using a map template. We’ll be using the Natural Earth quick start kit dataset, that can be downloaded here. Add a folder connection by clicking on the folder icon in the Catalog pane and choose the data folder with the downloaded dataset. Add the ne_110m_admin_0_countries.shp file to the map window, which is found in the 110m_cultural folder.
Step 2: Find the Conversion geoprocessing toolbox Find the conversion geoprocessing toolbox by clicking the Analysis tab on the ribbon interface and then clicking the Tools icon. Dock the geoprocessing window to the left of the screen to keep it from closing. Open the Conversion toolbox and have a look at the different tools:
Step 3: Convert vector features to JSON
Specify a different output file name if necessary, or use the default option. Leave the two check boxes unchecked: choosing the “Formatted JSON” option will format the JSON output in human-readable way, which is not recommended when using the files for production purposes. The second option, GeoJSON will use a default spatial reference of WGS1984 for the JSON output, but this is not necessary for our example which already has an EPSG projection of 4326. This projection refers to the WGS 1984 coordinate system. Click “Run” to create the output. Find the output JSON file in the project folder:
Opening up the file in a code editor will show all the data from the attribute table in JSON format. I’ve highlighted the spatial reference info to be sure that is also included in the standard JSON format when converting a shapefile: