Opened 12 years ago
Closed 9 years ago
#2283 closed defect (fixed)
shp2pgsql may be parsing shp's multipolygon incorrectly
Reported by: | qtxie | Owned by: | mcayland |
---|---|---|---|
Priority: | high | Milestone: | PostGIS 2.2.0 |
Component: | utils/loader-dumper | Version: | master |
Keywords: | multipolygon | Cc: |
Description
I find shp2pgsql may be parsing shp's multipolygon incorrectly, which will generate two overlapped innter rings. Please see the picture in attachment.
The algorithm to put the inner rings into the list of the outer rings may be wrong. In function:
file: shp2pgsql-core.c int FindPolygons(SHPObject *obj, Ring ***Out); { ... /* Put the inner rings into the list of the outer rings */ /* of which they are within */ for (pi = 0; pi < in_index; pi++) { // May be wrong to do those. // Some inner rings insert to the wrong outer ring .... }
According 'ESRI_shapefile_technical_description.pdf', the rings along with a outer ring is the inner rings belong with it, so we don't need to find the inner ring manually.
Attachments (2)
Change History (8)
by , 12 years ago
Attachment: | hole_correct.JPG added |
---|
comment:1 by , 12 years ago
Milestone: | → PostGIS 2.0.4 |
---|
comment:2 by , 11 years ago
Milestone: | PostGIS 2.0.4 → PostGIS 2.1.1 |
---|
comment:3 by , 11 years ago
Milestone: | PostGIS 2.1.1 → PostGIS 2.2.0 |
---|
sounds complicated -- too much so for a micro release
comment:4 by , 9 years ago
Confirmed, this polygon
MULTIPOLYGON( ((0 0,100 0,100 100,0 100,0 0),(10 10,90 10,90 90,10 90,10 10)), ((20 20,20 80,80 80,80 20,20 20),(30 30,30 70,70 70,70 30,30 30)) )
when exported to shape and then reimported, turns into this one
MULTIPOLYGON( ((0 0,0 100,100 100,100 0,0 0),(10 10,90 10,90 90,10 90,10 10),(30 30,70 30,70 70,30 70,30 30)), ((20 20,20 80,80 80,80 20,20 20)) )
Note:
See TracTickets
for help on using tickets.
Correct split the multipolygon