[OSM-dev] osm2pgsql bug on type=boundary/type=multipolygon ?
sly (sylvain letuffe)
liste at letuffe.org
Wed Jun 17 15:24:04 BST 2009
Hi,
Sorry in advance if I'm in the wrong place (please point me to the bug
tracking system if there's one)
I might have found a bug in the current osm2pgsql code that handle boundary
relations, but I'm not smart enough to kick his ass.
Happens when :
- handling type=boundary/multipolygon relations (with advance multipolygon
sytem having more than one outer ring)
- During diff append mode
- To reproduce : Moving juste one node of one way and the POLYGON doesn't get
updated
Details :
1) osm2pgsql SVN version 0.66-15819M
2) Creating the 2 outer ways+relation
$ osm2pgsql -s -S ./default.style -l -d not_osm creation.osc
3) not_osm=# select astext(way),name from planet_osm_polygon; select
astext(way),name from planet_osm_line;
astext | name
----------------------------+------
POLYGON((0 4,2 2,1 1,0 4)) | test
(1 row)
astext | name
-----------------------------+------
LINESTRING(1 1,0 4) |
LINESTRING(1 1,2 2,0 4) |
LINESTRING(0 4,1 1,2 2,0 4) | test
(3 rows)
No problem, except duplicates, but I suppose it's a feature
4) Moving one node (0 4) to (0 5):
$ osm2pgsql -a -s -S ./default.style -l -d not_osm move_one_node.osc
not_osm=# select astext(way),name from planet_osm_polygon; select
astext(way),name from planet_osm_line;
astext | name
----------------------------+------
POLYGON((0 4,2 2,1 1,0 4)) | test
(1 row)
astext | name
-----------------------------+------
LINESTRING(0 4,1 1,2 2,0 4) | test
LINESTRING(1 1,2 2,0 5) |
LINESTRING(1 1,0 5) |
(3 rows)
Both individual way got updated, but the relation and it's linestring
representation wasn't
All the same with type=multipolygon :
not_osm=# select astext(way),name from planet_osm_polygon; select
astext(way),name from planet_osm_roads;
astext | name
----------------------------+------
POLYGON((0 4,2 2,1 1,0 4)) | test
(1 row)
astext | name
-------------------------+------
LINESTRING(1 1,2 2,0 5) |
LINESTRING(1 1,0 5) |
(2 rows)
The linestring representation of the relation is not there, but it's polygon
version in planet_osm_polygon is not updated
Thanks for reading, and/or pointing me to the good place
--
sly
Sylvain Letuffe liste at letuffe.org
qui suis-je : http://slyserv.dyndns.org
-------------- next part --------------
<?xml version="1.0" encoding="UTF-8"?>
<osmChange version="0.6" generator="OpenStreetMap server">
<create>
<node id="422857705" lat="1" lon="1" changeset="1545021" user="sly" uid="24572" visible="true" timestamp="2009-06-17T13:40:33Z" version="1"/>
</create>
<create>
<node id="422857706" lat="2" lon="2" changeset="1545021" user="sly" uid="24572" visible="true" timestamp="2009-06-17T13:40:33Z" version="1"/>
</create>
<create>
<node id="422857707" lat="4" lon="0" changeset="1545021" user="sly" uid="24572" visible="true" timestamp="2009-06-17T13:40:33Z" version="1"/>
</create>
<create>
<way id="36232345" visible="true" timestamp="2009-06-17T13:40:33Z" user="sly" uid="24572" version="1" changeset="1545021">
<nd ref="422857705"/>
<nd ref="422857706"/>
<nd ref="422857707"/>
<tag k="boundary" v="administrative"/>
<tag k="admin_level" v="8"/>
</way>
</create>
<create>
<way id="36232346" visible="true" timestamp="2009-06-17T13:40:33Z" user="sly" uid="24572" version="1" changeset="1545021">
<nd ref="422857705"/>
<nd ref="422857707"/>
<tag k="boundary" v="administrative"/>
<tag k="admin_level" v="8"/>
</way>
</create>
<create>
<relation id="158473" visible="true" timestamp="2009-06-17T13:40:33Z" user="sly" uid="24572" version="1" changeset="1545021">
<member type="way" ref="36232346" role=""/>
<member type="way" ref="36232345" role=""/>
<tag k="name" v="test"/>
<tag k="boundary" v="administrative"/>
<tag k="type" v="boundary"/>
</relation>
</create>
</osmChange>
-------------- next part --------------
<?xml version="1.0" encoding="UTF-8"?>
<osmChange version="0.6" generator="OpenStreetMap server">
<modify>
<node id="422857707" lat="5" lon="0" changeset="1545024" user="sly" uid="24572" visible="true" timestamp="2009-06-17T13:40:41Z" version="2"/>
</modify>
</osmChange>
More information about the dev
mailing list