Skip to content

Instantly share code, notes, and snippets.

@ThomasG77
Last active January 19, 2022 13:02
Show Gist options
  • Save ThomasG77/861f6687b3916be94703aa764a556bb6 to your computer and use it in GitHub Desktop.
Save ThomasG77/861f6687b3916be94703aa764a556bb6 to your computer and use it in GitHub Desktop.
wget --content-disposition "https://opendata.arcgis.com/api/v3/datasets/002f14c0cf28435296a341d9921adf99_0/downloads/data?format=shp&spatialRefId=2154"
unzip EMPRISE_BATIE_PARIS.zip
export SHAPE_ENCODING="WINDOWS-1252"
ogr2ogr emprise_batie_paris_with_attribute.shp -dialect SQLite -sql "SELECT *, CASE WHEN c_toitdom = 1 THEN 'tuiles' WHEN c_toitdom = 2 THEN 'zinc' WHEN c_toitdom = 3 THEN 'ardoise' WHEN c_toitdom = 4 THEN 'béton' WHEN c_toitdom = 5 THEN 'terrasses végétales' WHEN c_toitdom = 99 THEN 'non renseigné' END c_toitdoml FROM EMPRISE_BATIE_PARIS" EMPRISE_BATIE_PARIS.shp -lco ENCODING=UTF-8
mapshaper emprise_batie_paris_with_attribute.shp \
-colorizer name=calcFill colors='#842e1b,#bac4c8,#5a5e6b,#808076,#a3b553,black' categories='tuiles,zinc,ardoise,béton,terrasses végétales,non renseigné' \
-style fill='calcFill(c_toitdoml)' stroke='#aaa' stroke-width=0.1 \
-o output_toit_dominant.svg
rsvg-convert -h 900 output_toit_dominant.svg > output_toit_dominant.png
mapshaper emprise_batie_paris_with_attribute.shp \
-style fill=grey stroke='#aaa' stroke-width=0.1 \
-o output_bw.svg
rsvg-convert -h 900 output_bw.svg > output_bw.png
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment