Add script to fetch ALL pages with coordinates
This commit is contained in:
parent
b33b131f96
commit
f834111e1f
5
scripts/geojson/fetch_all_points.sh
Executable file
5
scripts/geojson/fetch_all_points.sh
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
json=`curl 'https://wiki.linux-forks.de/mediawiki/api.php?action=query&format=json&list=search&redirects=1&converttitles=1&srsearch=%7B%7BCo%7C&srlimit=max&srwhat=text&srprop=snippet'`
|
||||||
|
echo "["
|
||||||
|
echo $json | json_reformat | grep -B 2 'coordinates' | sed -n -e 's#.*o</span>|\([0-9\\-]\+\)|[0-9\\-]*|\([0-9\\-]\+\).*#"geometry": {"type": "Point", "coordinates": [\1,\2]}},#p' -e 's/.*title": "\([^"]*\).*/{ "type": "Feature", "properties": {"name": "\1"},/p'
|
||||||
|
echo "{}]"
|
Loading…
Reference in New Issue
Block a user