1

I'm looking for a way to convert a GeoJSON File (from overpass-turbo.eu) directly into a Feature Class in an Esri geodatabase.

Normally I'm doing this by loading the GeoJSON into QGIS, Export it to a shapefile and then import it into ArcGIS Pro. There I can just export the data into my geodatabase. The problem is the limited space within the Attribute Table of shapefiles, which leads to a loss of data which I need in my current project.

Unfortunately I don't have access to the ArcGIS Data Interoperability Tool, so I have to find an open source way.

2

You can use the following code

import arcpy
import os
arcpy.env.workspace = "c:/data"
arcpy.JSONToFeatures_conversion("myjsonfeatures.json", os.path.join("outgdb.gdb", "myfeatures"))

For more details please refer to JSONToFeatures example

  • 2
    As explained in the help, if using GeoJSON as input, you need to supply the operational geometry_type parameter, specifying which type of geometry from the GeoJSON to convert. If you have multiple geometries inside the GeoJSON, you'll need to run the tool multiple times. – KHibma Jun 20 at 14:52
0

It is possible to use ogr2ogr:

ogr2ogr -f "FileGDB" output.gdb input.geojson

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.