Opened 22 years ago

Last modified 21 years ago

#213 closed defect (fixed)

shape-file polygons with multiple outer rings

Reported by: ismar@… Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc: neteler@…, blazek@…

Description

Hi Frank, 
Since this is my first bug submission please excuse any mistakes.
I'm using OGR to read and display shape files as a part of a bigger project 
done in VC++. 
I have some problems which I tend to contribute to a possible insufficiency in 
the OGR shape file relating to reading of polygon shapes with interior rings. 
Namely, function SHPReadOGRObject in shape2ogr.cpp assumes that the first ring 
in a polygon is the outer one. Now, while reading the ESRI documentation on 
shape files I've come across a piece of info. which states that a polygon may 
contain multiple outer rings. The doc. also mentions that the order of vertices 
in a ring is different for outer and inner rings which kind of suggests one way 
of checking if a ring is an outer or an inner one. I just wanted your opinion 
on this and if you think that there would be another way of checking it.
Finally, the bug manifest itself when for example countries that have islands 
(such as Russia) are to be displayed due to (in my opinion as least) the fact 
that the islands are read in by OGR as inner rings rather then as outer ones 
belonging to the same polygon.
regards Ismar

Change History (4)

comment:1 by blazek@…, 21 years ago

This is realy serious bug. All applications using shapefile are producing wrong results. And what is worse, often such errorsare not obvious, e.g. calculating area of polygon, more outer rings are not sum but subtracted!!!I think, that to fix this bug should have the highest priority!Radim

comment:2 by blazek@…, 21 years ago

I have tried to fix that:http://mpa.itc.it/radim/shape2ogr.cpp-1.1.9-fix-1Radim

comment:3 by neteler@…, 21 years ago

Frank,

excuse me to bother you. Would it be possible to apply
the patch of Radim to fix the reported problem?

Thanks in advance,

 Markus

comment:4 by warmerdam, 21 years ago

Radim,

I have applied the patch with one tweak to produce MultiPolygons instead of
GeometryCollections.  However, I am still somewhat uncomfortable with the change
and I hope to review it to see if there are any efficiency gains I can make. 
I am concerned about doing alot of extra computation work during reading of
large complex polygons. 

Thanks for the contribution, and sorry for taking to long to apply it. 


Note: See TracTickets for help on using tickets.