what if you combine two geojson zipcode files?

What about something like this?

import json

fc = {
    'type': 'FeatureCollection',
    'features': []
}

with open("mt_montana_zip_codes_geo.min.json") as json_file:
    obj = json.load(json_file)
    fc['features'].extend(obj['features'])

with open("nd_north_dakota_zip_codes_geo.min.json") as json_file:
    obj = json.load(json_file)
    fc['features'].extend(obj['features'])

with open("merged.json", "w") as outfile:
    json.dump(fc, outfile)
    

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top