User:Tagtheworld/Overpass und Osmconvert
Jump to navigation
Jump to search
weitere Themen auf Unterseiten |
---|
Sprachen und Techniken |
Overpass und Osmconvert |
PHP |
on the page taginfo you can gather important infosː
https://taginfo.openstreetmap.org/tags/amenity=school
countl Objekte all: 592443 0.02%
2014-06-23 23:58 UTC
Typ Anzahl Objekte Alle
all: 592672 0.02% -
[Node] Node 325997 - 0.36%
[Way] Way 260585 - 0.11%
[Relation] Relation 6090 - 0.23%
here you can derive an request - running in overpass-apiː
http://overpass-turbo.eu/?key=amenity&value=school&template=key-value
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
SOME REQUESTS;
http://overpass-turbo.eu/?key=amenity&value=school&template=key-value
<!--
This query looks for nodes, ways and relations
with the given key/value combination.
Choose your region and hit the Run button above!
-->
<osm-script output="json" timeout="25">
<!-- gather results -->
<union>
<!-- query part for: “amenity=school” -->
<query type="node">
<has-kv k="amenity" v="school"/>
<bbox-query {{bbox}}/>
</query>
<query type="way">
<has-kv k="amenity" v="school"/>
<bbox-query {{bbox}}/>
</query>
<query type="relation">
<has-kv k="amenity" v="school"/>
<bbox-query {{bbox}}/>
</query>
</union>
<!-- print results -->
<print mode="body"/>
<recurse type="down"/>
<print mode="skeleton" order="quadtile"/>
</osm-script>
if we do a request with osmconvertː
BELGIUM:
wget http://download.geofabrik.de/europe/belgium-latest.osm.pbf
./osmconvert belgium-latest.osm.pbf -o=belgium.o5m
./osmfilter belgium.o5m --keep="amenity=school" -o=belgium-schools.o5m
./osmconvert belgium-schools.o5m --all-to-nodes -o=belgium-schools_nodes.o5m
./osmfilter belgium-schools_nodes.o5m --keep="amenity=school" -o=belgium-schools-results.o5m
./osmconvert belgium-schools-results.o5m --csv="@id @lon @lat name addr:street addr:housenumber addr:city website email" --csv-headline -o=belgium-schools-results.csv
see this is an excel-file; i tis formated in csv-file:
question: how to store the results - and to update the database?