Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions transition-valleys/00_get_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

# gets the source data set directly from uMap
wget http://u.osmfr.org/en/map/113474/geojson/ -O 113474.geojson
9 changes: 9 additions & 0 deletions transition-valleys/10_inspect_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

head 113474.geojson
jq 'keys' < 113474.geojson
jq .properties < 113474.geojson
jq .properties.datalayers < 113474.geojson
jq .properties.datalayers[].id < 113474.geojson
jq .properties.urls < 113474.geojson
jq .properties.urls.datalayer_view < 113474.geojson
5 changes: 5 additions & 0 deletions transition-valleys/20_get_layer_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
jq .properties.urls.datalayer_view < 113474.geojson | sed s/\"//g > url_template
# this one took a while to find http://stackoverflow.com/questions/22589438/xargs-command-substitution-with-pipe-doesnt-work
jq .properties.datalayers[].id < 113474.geojson | xargs -I {} sed s/{pk}/{}/g url_template | xargs -I {} echo https://umap.openstreetmap.fr{} | xargs -I {} sh -c "wget {} -O \$( echo {} | sed -r -e 's/[^0-9]//g' ).geojson"

2 changes: 2 additions & 0 deletions transition-valleys/30_inspect_layer_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
jq .properties.datalayers[].id < 113474.geojson | xargs -I {} echo {}.geojson | xargs -L 1 jq keys
Loading