User:Tagtheworld/Overpass und Osmconvert

From OpenStreetMap Wiki
Jump to: navigation, search

weitere Themen auf Unterseiten
Sprachen und Techniken
Overpass und Osmconvert

on the page taginfo you can gather important infosː

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ː



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 -->
    <!-- query part for: “amenity=school” -->
    <query type="node">
      <has-kv k="amenity" v="school"/>
      <bbox-query {{bbox}}/>
    <query type="way">
      <has-kv k="amenity" v="school"/>
      <bbox-query {{bbox}}/>
    <query type="relation">
      <has-kv k="amenity" v="school"/>
      <bbox-query {{bbox}}/>
  <!-- print results -->
  <print mode="body"/>
  <recurse type="down"/>
  <print mode="skeleton" order="quadtile"/>

if we do a request with osmconvertː


./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?