Opened 12 years ago

Closed 3 years ago

#2273 closed defect (invalid)

TopoGeo_AddPolygon returns more polygons second call

Reported by: robe Owned by: strk
Priority: medium Milestone: PostGIS Fund Me
Component: topology Version: master
Keywords: Cc:

Description

I'm guessing this ticket might be related to #2175.

I've got data I downloaded from: http://metro.teczno.com/#chennai

and then I prepared a test set (which I'll attach), by doing this:

SELECT gid, geom INTO test_wet
FROM (SELECT gid, (ST_Dump(geom)).geom 
FROM osm_polygon
WHERE "natural" IN('wetland', 'water', 'high-water')) As f;

Now creating a topology:

SELECT CreateTopology('test_chennai', 4326);
-- first run 40,622ms 455 rows, second run 32,807ms, 614 rows, 3rd run 33,415ms 614 rows
SELECT gid, TopoGeo_AddPolygon('test_chennai', geom) As face_id
FROM test_wet;

Shouldn't I get the same number of rows on each call and just have the original rows created returned to me or is it an artifact of objects being created and splitting midstream in which case I guess we just need to document the behavior.

I'm running and I thought we used to report topology version

POSTGIS="2.1.0SVN r11252" GEOS="3.4.0dev-CAPI-1.8.0 r0" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.2, released 2012/10/08" LIBXML="2.7.8" LIBJSON="UNKNOWN" TOPOLOGY RASTER

Attachments (1)

test_wet.zip (486.8 KB ) - added by robe 12 years ago.

Download all attachments as: .zip

Change History (7)

by robe, 12 years ago

Attachment: test_wet.zip added

comment:1 by robe, 12 years ago

Component: postgistopology
Owner: changed from pramsey to strk

comment:2 by robe, 11 years ago

Milestone: PostGIS 2.1.0PostGIS 2.2.0

comment:3 by strk, 11 years ago

For faces no, it shouldn't really be related to #2175. Can you get some stats about the area size of those faces ? There could be a problem of tolerance, maybe ? Reducing the dataset would help further understanding the issue.

comment:4 by strk, 9 years ago

Milestone: PostGIS 2.2.0PostGIS Future

comment:5 by robe, 7 years ago

Milestone: PostGIS FuturePostGIS Fund Me

Milestone renamed

comment:6 by strk, 3 years ago

Resolution: invalid
Status: newclosed

I've tried this testcase with current PostGIS version. First run returns 455 rows (which are *faces*) second run returns 614 rows (as all subsequent ones).

Thinking a bit about it I'm not fully surprised, because when a TopoGeometry is initially created may be composed by a single face but upon creating *more* TopoGeometry (subsequent records) the single face may be split into more faces, which is why by the end of the load statement there would be more faces for polygons.

You can see this by querying the number of faces at the end of the first load, without re-loading the data:

SELECT gid, TopoGeo_AddPolygon('test_chennai', geom) As face_id FROM test_wet; -- returns 455 rows
SELECT count(*) FROM test_chennai.face where face_id > 0; -- returns 636
Note: See TracTickets for help on using tickets.