microsoft / GlobalMLBuildingFootprints

Worldwide building footprints derived from satellite imagery
Other
1.38k stars 202 forks source link

Split a large geojsonl to smaller chunks and convert to shapefile #18

Closed giswqs closed 1 year ago

giswqs commented 2 years ago

Here are the commands that can be used to split a large geojsonl file into smaller chunks and convert them to shapefile using Linux and GDAL. Here is the video tutorial: https://youtu.be/Mu9QBvze7wY

split -l 100000 country.geojsonl country_ --additional-suffix=.geojsonl
for filename in ./*.geojsonl; do mkdir -p shapefiles; ogr2ogr -f "ESRI Shapefile" "./shapefiles/${filename/geojsonl/shp}" "$filename";done
gtdca98 commented 2 years ago

There's a bit but important comment about ypur idea. polygon's building-footprints are delivered spatially dispersed ... your code produce building-footprints spatially dispersed along the geo-area reffered.