natural=water impliziert area=yes

Hallo Zusammen,

ich schreibe grade eine vb Konsolen Anwendung die mir die OSM Daten in eine MSSQL Datenbank importiert.

Es gibt da zwar ein Tool Osm2Mssql in der Version 0.3.5 aber das schafft beim Deutschland Extrakt die Wege und Relationen nicht. Zumindest bricht es immer mit Fehler ab.

Nun habe ich eine Frage zum erstellen der Wege Geometrien (Ways).

Das sind ja erst einmal alles Linestrings. Wenn aber Area=yes angegeben ist wird es automatisch zur Fläche (also Polygon).
Nun steht im Wiki das natural=water ein area=yes impliziert. Jetzt frage ich mich ob es da noch mehr so implizite Angaben gibt die ich nur nicht finde.

Vielleicht kann mir da ja jemand helfen.

Vielen Dank,

Markus

Beim Wasser fällt mir momentan nichts ein, ansonsten sind natürlich beispielsweise Gebäude und Wälder auch Flächen. Ein highway=cycleway impliziert bicycle=designated. Solche impliziten Tags gibt es viele.

Da viele Leute ihre Datenbank mit osm2pgsql füllen, dürfte dessen default.style den besten Anhaltspunkt liefern, was “üblicherweise” als Fläche betrachtet wird (alles was ein “polygon” in der 4. Spalte hat und kein “linear”). Das kann der einzelne Auswerter natürlich in seinem import-style ändern, aber ich glaube nicht, dass viele das machen.

Hmm aber gibt es da auch irgendwo eine Übersicht ?

Zumindest der Renderer der Offiziellen OSM MAp müsste da doch alle kennen ?

Oh super,

vielen Dank.

Das ist doch schon mal ein guter Anhaltspunkt an dem man sich Orientieren kann.

Hier ist ein Stück vom Style-File für osm2pgsql:


# OsmType  Tag          DataType     Flags
node,way   access       text         linear
node,way   addr:housename      text  linear
node,way   addr:housenumber    text  linear
node,way   addr:interpolation  text  linear
node,way   admin_level  text         linear
node,way   aerialway    text         linear
node,way   aeroway      text         polygon
node,way   amenity      text         polygon
node,way   area         text         # hard coded support for area=1/yes => polygon is in osm2pgsql
node,way   barrier      text         linear
node,way   bicycle      text
node,way   brand        text         linear
node,way   bridge       text         linear
node,way   boundary     text         linear
node,way   building     text         polygon
node       capital      text         linear
node,way   construction text         linear
node,way   covered      text         linear
node,way   culvert      text         linear
node,way   cutting      text         linear
node,way   denomination text         linear
node,way   disused      text         linear
node       ele          text         linear
node,way   embankment   text         linear
node,way   foot         text         linear
node,way   generator:source    text  linear
node,way   harbour      text         polygon
node,way   highway      text         linear
node,way   historic     text         polygon
node,way   horse        text         linear
node,way   intermittent text         linear
node,way   junction     text         linear
node,way   landuse      text         polygon
node,way   layer        text         linear
node,way   leisure      text         polygon
node,way   lock         text         linear
node,way   man_made     text         polygon
node,way   military     text         polygon
node,way   motorcar     text         linear
node,way   name         text         linear
node,way   natural      text         polygon  # natural=coastline tags are discarded by a hard coded rule in osm2pgsql
node,way   office       text         polygon
node,way   oneway       text         linear
node,way   operator     text         linear
node,way   place        text         polygon
node       poi          text
node,way   population   text         linear
node,way   power        text         polygon
node,way   power_source text         linear
node,way   public_transport text     polygon
node,way   railway      text         linear
node,way   ref          text         linear
node,way   religion     text         nocache
node,way   route        text         linear
node,way   service      text         linear
node,way   shop         text         polygon
node,way   sport        text         polygon
node,way   surface      text         linear
node,way   toll         text         linear
node,way   tourism      text         polygon
node,way   tower:type   text         linear
node	   traffic_sign	text	     linear
way        tracktype    text         linear
node,way   tunnel       text         linear
node,way   water        text         polygon
node,way   waterway     text         polygon
node,way   wetland      text         polygon
node,way   width        text         linear
node,way   wood         text         linear
node,way   z_order      int4         linear # This is calculated during import
way        way_area     real                # This is calculated during import

# Area tags
# We don't make columns for these tags, but objects with them are areas.
# Mainly for use with hstore
way         abandoned:aeroway       text    phstore
way         abandoned:amenity       text    phstore
way         abandoned:building      text    phstore
way         abandoned:landuse       text    phstore
way         abandoned:power         text    phstore
way         area:highway            text    phstore

überall wo “node,way xxx text polygon” steht, macht er bei geschlossenen Linestrings eine Fläche draus.

Gruss
walter

The osm2pgsql list is not entirely correct, though, because it is based on keys instead of tags. For example, natural=tree_row is linear despite using the natural key.

I think the list used by Overpass Turbo is currently the most comprehensive one:
http://wiki.openstreetmap.org/wiki/Overpass_turbo/Polygon_Features

Das Problem dabei ist, dass unser allerwichtigstes Qualitätssicherungstool und Hauptmotivation vieler Mapper geschlossene Wege mit natural=tree_row als Fehler betrachtet, weil es Baumreihen in der Tabelle mit den Linien erwartet. Insofern wäre ein area=no nützlich, wenn man einen Baumkreis mappen möchte.

Das gleiche Problem haben wir z.B. mit leisure=track: Eigentlich eher eine Linie, aber wegen “leisure ist Fläche” eben eine Fläche. Der Mapper passt sich dem Kartenstil an und mappt so lange, bis ihm die Karte mit der gewünschten Darstellung belohnt und ihm zeigt, dass er alles richtig gemacht hat. Er ignoriert dabei das Wiki, das für leisure=track Flächen eigentlich ausschliesst. (*)

Das ist natürlich kein sehr schöner Zustand. Aber eben “das übliche”.

Grüße, Max

(*) in allen Sprachversionen ausser Deutsch, sehe ich gerade…

Leider nicht ganz aktuell, kennt zum Beispiel power=station noch, nicht aber power=plant…

Ich wollte noch eben eine Bibliothek teilen die ich gefunden habe zu diesem Thema.

http://spatial.litesolutions.net/

Hier hat der Lukas Kabrt 1A Arbeit geleistet.

Das tolle hieran. Es gibt ein OSM Plugin das PBF Dateien lesen kann und mir die Entitäten schon aufbereitet zur Verfügung stellt.
Falls jemand an einer Windows Lösung im Bereich OSM sitzt sollte er sich dieses hier mal anschauen.

Wenn du das dem Autor sagst, wird das schnell geändert sein.