Skip to main content
1 of 4

Batch JSON to Features help

I have a folder on my local drive with 1,500+ JSON files (lines) that I need converted to shapefiles. (JSON to feaure tool in ArcGIS works great on a single JSON file) I've tried getting a batch model in Python to work, but I'm not getting any response from the script.

Any ideas?

(I'm using ArcGIS 10.2 and PyScripter)

import arcpy
import os

dirOfJSON = 'c:/temp/jsons'
outputDIrectory = 'c:/temp/jsonSHPs'

arcpy.env.workspace = dirOfJSON

for f in arcpy.ListFiles('.json'):
    j = os.path.join(dirOfJSON, f)
    outputShp = os.path.join(outputDIrectory, os.path.splitext(f)[0] + ".shp")
    print("Processing : {}".format(outputShp))
    arcpy.JSONToFeatures_conversion(j, outputShp)