Last active
August 30, 2023 23:57
-
-
Save pollardld/826649c275452a82fe1c45b7e734ac71 to your computer and use it in GitHub Desktop.
GeoJSON to GeoPDF with Python Subprocess
This file contains 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 subprocess | |
# Step 2: Convert GeoJSON to GeoTIFF | |
# ATTRIBUTE_FIELD = ? | |
subprocess.run([ | |
"gdal_rasterize", | |
"-a", "ATTRIBUTE_FIELD", | |
"-ts", "WIDTH", "HEIGHT", | |
"-l", "LAYER_NAME", | |
"i.geojson", | |
"o.tif" | |
]) | |
# Step 2: Convert GeoTIFF to GeoPDF | |
subprocess.run([ | |
"gdal_translate", | |
"-of", "PDF", | |
"o.tif", | |
"GeoPDF.pdf" | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment