<br><br><div class="gmail_quote">On 13 September 2010 15:53, Peter Körner <span dir="ltr"><<a href="mailto:osm-lists@mazdermind.de">osm-lists@mazdermind.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Am 11.09.2010 08:26, schrieb Jukka Rahkonen:<div class="im"><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Pretty easy and in theory it works immediately after osm2pgsql import<br>
without any other preprocessing. However, I did not put it into mapfile<br>
because rendering fails after ST_PointOnSurface failing first with some<br>
polygons:<br>
NOTICE:  TopologyException: found non-noded intersection between<br>
LINESTRING (8569.5 4234.62, 8623.96 4373.11) and LINESTRING (8637.48<br>
4400.77, 8610.45 4345.45)at 8623.96 4373.1<br>
</blockquote>
<br></div>
Yes, that's a known problem (or feature?). OSM allows invalid geometries for polygons and mapnik can render them, but some postgis functions will fail. It is possible to use ST_IsValid but this adds a medium runtime penalty.<br>

<br>
To come around this we could add an isvalid coumn to the polygon table. This column can be filled via a trigger or via osm2pgsql. This would move the penalty to the import.<font color="#888888"></font><br></blockquote></div>
<br>There are two ways of dealing with invalid geometries.<br>I have used in the past either ConvexHull or buffer to make them valid for analysis purpose. That's what I did for the Corine Import for France.<br><br>Emilie Laffray<br>