4

If you open this url

http://www.openstreetmap.org/?mlat=50.6524658203125&mlon=9.4482421875&zoom=13

you are in a forest in germany. I downloaded the complete Open-Streetmap Data for Germany. I can find the waynodes for the tracks in this area... But not for the forest itself

Cna anyone help? Which way (id) defines the forest under the marker?

Or is it just the Background image for areas where's nothing defined?

1

2 Answers 2

6

You will not find the forest in the ways list because it is build as a multipolygon relation:

http://www.openstreetmap.org/relation/403306

Full text of the xml:

  <relation id='403306' timestamp='2012-01-17T23:33:35Z' uid='302852' user='be-ju' visible='true' version='26' changeset='10423448'>
    <member type='way' ref='132144354' role='outer' />
    <member type='way' ref='145307496' role='outer' />
    <member type='way' ref='145307467' role='outer' />
    <member type='way' ref='132144347' role='outer' />
    <member type='way' ref='132144358' role='outer' />
    <member type='way' ref='30605404' role='inner' />
    <member type='way' ref='31776954' role='inner' />
    <member type='way' ref='34962555' role='inner' />
    <member type='way' ref='45200953' role='inner' />
    <member type='way' ref='45200956' role='inner' />
    <member type='way' ref='47189443' role='inner' />
    <member type='way' ref='49748068' role='inner' />
    <member type='way' ref='49753651' role='inner' />
    <member type='way' ref='52704700' role='inner' />
    <member type='way' ref='52704705' role='inner' />
    <member type='way' ref='52704706' role='inner' />
    <member type='way' ref='55638793' role='inner' />
    <member type='way' ref='55741659' role='inner' />
    <member type='way' ref='55741754' role='inner' />
    <member type='way' ref='55782868' role='inner' />
    <member type='way' ref='59273778' role='inner' />
    <member type='way' ref='60172815' role='inner' />
    <member type='way' ref='60173689' role='inner' />
    <member type='way' ref='60173735' role='inner' />
    <member type='way' ref='70606150' role='inner' />
    <member type='way' ref='70609895' role='inner' />
    <member type='way' ref='72403561' role='inner' />
    <member type='way' ref='72403567' role='inner' />
    <member type='way' ref='90701038' role='inner' />
    <member type='way' ref='90703459' role='inner' />
    <member type='way' ref='90703461' role='inner' />
    <member type='way' ref='90703467' role='inner' />
    <member type='way' ref='90703470' role='inner' />
    <member type='way' ref='91066302' role='inner' />
    <member type='way' ref='91321239' role='inner' />
    <member type='way' ref='91321243' role='inner' />
    <member type='way' ref='91323839' role='inner' />
    <member type='way' ref='91323854' role='inner' />
    <member type='way' ref='91327023' role='inner' />
    <member type='way' ref='91327024' role='inner' />
    <member type='way' ref='91512913' role='inner' />
    <member type='way' ref='91512914' role='inner' />
    <member type='way' ref='91512915' role='inner' />
    <member type='way' ref='91512916' role='inner' />
    <member type='way' ref='91512918' role='inner' />
    <member type='way' ref='91512919' role='inner' />
    <member type='way' ref='91512920' role='inner' />
    <member type='way' ref='91512921' role='inner' />
    <member type='way' ref='91514545' role='inner' />
    <member type='way' ref='91517126' role='inner' />
    <member type='way' ref='91517128' role='inner' />
    <member type='way' ref='91517130' role='inner' />
    <member type='way' ref='91517132' role='inner' />
    <member type='way' ref='91517133' role='inner' />
    <member type='way' ref='91517135' role='inner' />
    <member type='way' ref='91517137' role='inner' />
    <member type='way' ref='91517140' role='inner' />
    <member type='way' ref='91517918' role='inner' />
    <member type='way' ref='91517921' role='inner' />
    <member type='way' ref='91517931' role='inner' />
    <member type='way' ref='91517935' role='inner' />
    <member type='way' ref='91518210' role='inner' />
    <member type='way' ref='91518211' role='inner' />
    <member type='way' ref='91577434' role='inner' />
    <member type='way' ref='91577435' role='inner' />
    <member type='way' ref='91577436' role='inner' />
    <member type='way' ref='91577448' role='inner' />
    <member type='way' ref='91577453' role='inner' />
    <member type='way' ref='91577458' role='inner' />
    <member type='way' ref='91577484' role='inner' />
    <member type='way' ref='91577505' role='inner' />
    <member type='way' ref='91579362' role='inner' />
    <member type='way' ref='91579421' role='inner' />
    <member type='way' ref='91579429' role='inner' />
    <member type='way' ref='91579435' role='inner' />
    <member type='way' ref='91579437' role='inner' />
    <member type='way' ref='93218137' role='inner' />
    <member type='way' ref='91072692' role='inner' />
    <member type='way' ref='91072698' role='inner' />
    <tag k='landuse' v='forest' />
    <tag k='note' v='c' />
    <tag k='type' v='multipolygon' />
  </relation>

If you have a local Postgis database filled with osm2pgsql you will find it in the planet_osm_polygon table with osm_id=-403306.

Most OSM importers still do not handle multipolygon relations correctly. If you need the way nodes, you have to download all ways that are part of the relation, then all nodes of those ways.

The members with role outer form one or several outer rings. You can not rely on the order in the file; the last node of the first member does not have to be the first node of the second. Same goes for the inner members.

As a consequence, you have to re-build the complete import logic of osm2pgsql. It is at least open source: https://github.com/openstreetmap/osm2pgsql

As a reference, you can take the OSM editor JOSM, and download a small part of the area of your interest.

15
  • Not planet_osm_poygon?
    – Jendrusk
    Commented Jun 12, 2014 at 5:16
  • You are right, into planet_osm_line will go the route relations with negative ID.
    – AndreJ
    Commented Jun 12, 2014 at 6:14
  • Hi thanks.. ive imported the osm file by myself with a custom script... is there a sepcial xml-tag for these multipolygons?
    – wutzebaer
    Commented Jun 12, 2014 at 7:00
  • 1
    You will find it at the end of the osm file: <relation id='403306' timestamp='2012-01-17T23:33:35Z' uid='302852' user='be-ju' visible='true' version='26' changeset='10423448'> ... <tag k='type' v='multipolygon' /> . The landuse tags can be on the relation, or on the members with role=outer.
    – AndreJ
    Commented Jun 12, 2014 at 7:12
  • 1
    No, there is nothing except administrative boundaries around it. The slight grey you see is from the coastlines of Europe. These are not rendered from the database, but from polygon shapefiles to avoid leaks: wiki.openstreetmap.org/wiki/Coastline
    – AndreJ
    Commented Jun 20, 2014 at 5:10
1

This should be a query in the land use layer.

Run this query.

landuse = forest

and this covers coniferous (pine forest) / deciduous (deciduous forest) / mixed (mixed forest)

This is the info

http://wiki.openstreetmap.org/wiki/DE:Tag:landuse%3Dforest

http://wiki.openstreetmap.org/wiki/Key:landuse

1
  • +1 for helpfull links which are hard to find when staring from wiki-homepage
    – wutzebaer
    Commented Jun 12, 2014 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.