summaryrefslogtreecommitdiff
path: root/scripts/geojson/fetch.sh
diff options
context:
space:
mode:
authorMarkus Koch <markus@notsyncing.net>2020-04-27 17:37:12 +0200
committerMarkus Koch <markus@notsyncing.net>2020-04-27 17:38:19 +0200
commit05238dc5aec332970a082b84d174240c4262e95d (patch)
treee1afc96079cad81c4a8dd75eb01cec7a1eadd137 /scripts/geojson/fetch.sh
parentc7c4975a571d1974d3807755a064d8489b60ffa4 (diff)
downloadlifomapserver-05238dc5aec332970a082b84d174240c4262e95d.tar.gz
lifomapserver-05238dc5aec332970a082b84d174240c4262e95d.tar.bz2
lifomapserver-05238dc5aec332970a082b84d174240c4262e95d.zip
Add categories for markers
This commit obsoletes the many fetch scripts and combines them into a single script, creating a single json, but with category information.
Diffstat (limited to 'scripts/geojson/fetch.sh')
-rwxr-xr-xscripts/geojson/fetch.sh30
1 files changed, 0 insertions, 30 deletions
diff --git a/scripts/geojson/fetch.sh b/scripts/geojson/fetch.sh
deleted file mode 100755
index bd86239..0000000
--- a/scripts/geojson/fetch.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-fetch_category () {
- echo "Fetching $1" > /dev/stderr
- json=`curl "https://wiki.linux-forks.de/mediawiki/api.php?action=query&format=json&list=categorymembers&cmtitle=Category:$1&cmlimit=max" 2>/dev/null`
- cities=`echo "$json" | json_reformat | sed -n 's/.*"title":\s*"\([^"]*\).*/\1/p' | tr ' ' '_' | tr '\n' ' '`
- num=`echo $cities | tr ' ' '\n' | wc -l`
- i=0
- echo "["
- for city in $cities; do
- let i++
- echo -n -e "\rFetched $i/$num" > /dev/stderr
- ./fetch_single.sh "$city"
- done
- echo > /dev/stderr
- echo "{}]"
-}
-
-JSONDIR=../../htdocs/geojson
-
-mkdir -p $JSONDIR
-
-
-fetch_category Shops > $JSONDIR/shops.json
-fetch_category City > $JSONDIR/cities.json
-fetch_category Stations > $JSONDIR/stations.json
-fetch_category Parks > $JSONDIR/parks.json
-fetch_category Libraries > $JSONDIR/libraries.json
-fetch_category "CW_Complexes" > $JSONDIR/cw_complexes.json
-fetch_category Courts > $JSONDIR/courts.json
-fetch_category Waterway > $JSONDIR/waterway.json
-fetch_category Train_Depots > $JSONDIR/depots.json