Created
November 7, 2022 09:42
-
-
Save simboli/ff57bff0c1412a2437e07cf10d56967f to your computer and use it in GitHub Desktop.
geoJson loader Shapely 2.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from shapely.geometry import MultiPolygon, Poing, shape | |
bound_multply = [] | |
bound_names = [] | |
geoJsonFileName="Ariccia.geojson" | |
with open(fname, encoding="utf-8") as geoJsonFile: | |
GeoData = json.load(geoJsonFileName) | |
for bound in GeoData['features']: | |
if bound.get('properties').get('type')=='boundary': | |
bound_shape = shape(bound['geometry']) | |
bound_multply.append(bound_shape) | |
bound_names.append(bound['properties']['name']) | |
bound_polygon = MultiPolygon(bound_multply) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment