Re: [OSM-dev] osm2pgsql invalid polygons

2012-05-07 Thread Tomas Straupis
So what is the general rule?
Inner polygons in multipolygon should not have shared vectors (or in
human readable format: inner polygons should not touch each
other)?

-- 
Tomas Straupis

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] osm2pgsql invalid polygons

2012-05-07 Thread Frederik Ramm

Hi,

On 05/07/2012 09:23 AM, Tomas Straupis wrote:

Inner polygons in multipolygon should not have shared vectors (or in
human readable format: inner polygons should not touch each
other)?


I'm confused now. The polygon that Ramunas mentioned, with two touching 
inner rings, should indeed be processed fine by osm2pgsql; we've long 
said that this particular violation of OCG simple features is ok for us 
and I thought that osm2pgsql handled that well.


Therefore when Ramunas wrote that he had to patch osm2pgsql to handle 
this, I assumed it must have been some other problem.


My current working assumption is that touching inner rings are ok and 
this is our one and only deviation from OGC simple features (and I 
thought osm2pgsql would already dissolve the two touching inners into 
one hole for the polygon).


Inner rings touching the outer ring, or intersections between any 
inner/outer rings, are not ok though.


Bye
Frederik

--
Frederik Ramm  ##  eMail frede...@remote.org  ##  N49°00'09 E008°23'33

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] osm2pgsql invalid polygons

2012-05-07 Thread Ramas
From user point this relation is correct but from geos point - not. The
problem is that this polygon(and many others) was skipped without any
warnings. You cannot fix it if you dont know where error is.

On 7 May 2012 01:17, Sven Geggus li...@fuchsschwanzdomain.de wrote:

 Ramas ies...@ramuno.lt wrote:

  how do you solve problem with skipped invalid polygons?

 Fix it in the osm database?

  with error:
  Self-intersection at or near point 2889220.240002 7470212.12

 This does not look as a valid polygon to me at leadt in OGC Simple
 Features terms.  This could arguably get fixed in osm2pgsql code
 because it is know how it is meant to be in this case, but it is not
 a valid OGC Simple Features polygon.

 Just add an additional way around 160596899 and 160596916 and declare
 this one of type inner.

  I patched osm2pgsql and it allows to import such polygons. Mapnik renders
  it correctly.

 Not a good Idea IMO because there is more than Mapnik and quite a lot
 of the spatial operations in postgis will not work with invalid
 geometries.

 Does we need such validations?

 I definitely think we do. If osm2pgsql does import and render invalid
 polygons they will never get fixes in the database.

 Sven

 --
 Trotz der zunehmenden Verbreitung von Linux erfreut sich der Bär,
 und - dank Knut - insbesondere der Eisbär, deutlich größerer
 Beliebtheit als der Pinguin. (Gefunden bei http://telepolis.de/)
 /me is giggls@ircnet, http://sven.gegg.us/ on the Web

 ___
 dev mailing list
 dev@openstreetmap.org
 http://lists.openstreetmap.org/listinfo/dev

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] osm2pgsql invalid polygons

2012-05-07 Thread Sven Geggus
Ramas ies...@ramuno.lt wrote:

 From user point this relation is correct but from geos point - not.

Whatever your definition of OK may be. The Problem with multipolygons in
their current form ist that there is no definition of a correct
multipolygon AFAIK.

As far as your Example is concerned this is (at least) marked as broken in OSM
Inspektor:

http://tools.geofabrik.de/osmi/?view=multipolygonlon=25.95446lat=55.55431zoom=18overlays=invalid_geometry_hull,duplicate_ways,intersections,intersection_lines,ring_not_closed_hull,ring_not_closed,unconnected_end_nodes,touching_inner_rings_hull,touching_inner_rings,role_mismatch_hull,role_mismatch,duplicate_tags_hull,duplicate_tags,multipolygons_type_is_boundary,type_is_boundary,ways,role_markers,way_end_nodes,way_nodes


Sven

-- 
Trotz der zunehmenden Verbreitung von Linux erfreut sich der Bär,
und - dank Knut - insbesondere der Eisbär, deutlich größerer
Beliebtheit als der Pinguin. (Gefunden bei http://telepolis.de/)
/me is giggls@ircnet, http://sven.gegg.us/ on the Web

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


[OSM-dev] osm2pgsql invalid polygons

2012-05-06 Thread Ramas
Hi devs,
how do you solve problem with skipped invalid polygons? Seems new geos lib
fails to validate relations like this:
http://www.openstreetmap.org/browse/relation/2148430

with error:
Self-intersection at or near point 2889220.240002 7470212.12

I patched osm2pgsql and it allows to import such polygons. Mapnik renders
it correctly. Does we need such validations?

Ramunas
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] osm2pgsql invalid polygons

2012-05-06 Thread Sven Geggus
Ramas ies...@ramuno.lt wrote:

 how do you solve problem with skipped invalid polygons? 

Fix it in the osm database?

 with error:
 Self-intersection at or near point 2889220.240002 7470212.12

This does not look as a valid polygon to me at leadt in OGC Simple
Features terms.  This could arguably get fixed in osm2pgsql code
because it is know how it is meant to be in this case, but it is not
a valid OGC Simple Features polygon.

Just add an additional way around 160596899 and 160596916 and declare
this one of type inner.

 I patched osm2pgsql and it allows to import such polygons. Mapnik renders
 it correctly. 

Not a good Idea IMO because there is more than Mapnik and quite a lot
of the spatial operations in postgis will not work with invalid
geometries.

Does we need such validations?

I definitely think we do. If osm2pgsql does import and render invalid
polygons they will never get fixes in the database.

Sven

-- 
Trotz der zunehmenden Verbreitung von Linux erfreut sich der Bär,
und - dank Knut - insbesondere der Eisbär, deutlich größerer
Beliebtheit als der Pinguin. (Gefunden bei http://telepolis.de/)
/me is giggls@ircnet, http://sven.gegg.us/ on the Web

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev