[postgis-tickets] [PostGIS] #2283: shp2pgsql may be parsing shp's multipolygon incorrectly

PostGIS trac at osgeo.org
Thu Apr 25 01:14:18 PDT 2013


#2283: shp2pgsql may be parsing shp's multipolygon incorrectly
---------------------------+------------------------------------------------
 Reporter:  qtxie          |       Owner:  mcayland
     Type:  defect         |      Status:  new     
 Priority:  high           |   Milestone:          
Component:  loader/dumper  |     Version:  trunk   
 Keywords:  multipolygon   |  
---------------------------+------------------------------------------------
 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.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2283>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list