Skip to content

Instantly share code, notes, and snippets.

@cquest
Created February 24, 2017 13:17
Show Gist options
  • Save cquest/adc499132354bc55e5e3df589ed8e9d2 to your computer and use it in GitHub Desktop.
Save cquest/adc499132354bc55e5e3df589ed8e9d2 to your computer and use it in GitHub Desktop.
Script d'extraction des métadonnées du Géoportail de l'Urbanisme
psql -Atc "select insee from insee_cog_2015;" | \
parallel -j 8 \
wget -q -nc "https://www.geoportail-urbanisme.gouv.fr/document/info/?partition=DU_{}" -O {}.json
: > gpu.sjson; for f in *.json; do insee=$(echo $f |sed 's/.json//'); sed "s/\"success\"/\"insee\":\"$insee\", \"success\"/" $f >> gpu.sjson; done
jq -sc '.' gpu.sjson > gpu.json
@2803media
Copy link

On dirait que le lien pour les partitions n'est plus valide suite à la mise à jour du portail de l'urbanisme!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment