[Tile-serving] [osm2pgsql] Invalid multipolygon or osm2pgsql issue? (#185)
mboeringa
notifications at github.com
Wed Sep 24 11:37:03 UTC 2014
Please note this is a copy of an issue first posted in the github openstreetmap-carto repository (https://github.com/gravitystorm/openstreetmap-carto/issues/973). Since I was referred here with a statement that this was unlikely to be an issue in OSM CartoCSS, and more likely an issue with osm2pgsql ***or*** a data error, I re-post it here as suggested. See the other issue tracker for the comments.
Also note that I have no facilities to do any further testing, as per pnorman's suggestion in the other linked issue. I don't have a postgresql database installed, nor ever used osm2pgsql. The issue is based on observations on the main OSM website, and some testing and reviewing in JOSM.
*** ***BEGIN ORIGINAL POST AND ISSUE:*** ***
I have been looking at a multipolygon discussed on the Dutch section of the OpenStreetMap forums (http://forum.openstreetmap.org/viewtopic.php?pid=386882#p386882 - "Cartierheide bij Eersel")
It is a stretch of natural=heath with a number of inner ways tagged as landuse=forest, and one small patch of natural=water. See image below (and http://www.openstreetmap.org/relation/3393792).


As you can see, 3 of the inner ways aren't displaying, they're blank/white. Zooming in on one of them, and choosing map contents on the site, it shows that this is just normally tagged with landuse=forest, so no reason why it wouldn't display:

I have also been looking at this multipolygon relation in JOSM. I noticed first that the direction of the inner ways are not consistent, some run clockwise, others counter-clockwise. Now this would be a big "no-no" in many spatial data formats, but since for example this Wiki (http://wiki.openstreetmap.org/wiki/Relation:multipolygon) page clearly states that
"*direction of the ways* ***does not matter***"
I think we can safely dismiss this observation as the cause of the rendering issue.
However, I then zoomed in on one the inner ways, in the lower right corner, in JOSM. See the following two images.


It seems this inner way shares a node with the outer way, and thus "touches" it. According to the same Wiki page mentioned above about multipolygon relations
"*Inner polygons* ***must not overlap with outer polygons or touch them***"
which seems to indicate this multipolygon as "***invalid***". Despite this, the relation multipolygon itself renders correctly, just the inner ways don't all render.
*Could this "touching" nonetheless be the cause of the problems?*
One question that pops up now for me, is where the information for the display of the "map contents" is coming from: since I am able to select the blank/empty inner ways on the main OSM website and get back identification results, I assume osm2pgsql has successfully imported the data in the rendering database, and this "content" is based on the rendering database? ***Are these assumptions right?*** I don't know enough technically of the site to interpret this.
If so, this might be rendering error, possibly caused by the touching and maybe an issue interpreting what is inside or outside for such an invalid multipolygon.
Or is the "map contents" data not based on the rendering database, but on the main database (which come to think of it may be more likely, as it shows all relation data...?), and does osm2pgsql fail to import some of these inner ways, likely again because the multipolygon is invalid?
---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/185
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20140924/9ee87aef/attachment.html>
More information about the Tile-serving
mailing list