Opened 15 years ago
Closed 15 years ago
#2985 closed defect (fixed)
BNA inner ring contains only duplication of first point
Reported by: | antimirov | Owned by: | Even Rouault |
---|---|---|---|
Priority: | normal | Milestone: | 1.6.1 |
Component: | OGR_SF | Version: | 1.5.0 |
Severity: | normal | Keywords: | bna inner ring duplicates |
Cc: |
Description
Hi all,
I've found a bug in file "ogr/ogrsf_frmts/bna/ogrbnalayer.cpp". This issue is with converting my Shape file with polygons to BNA format using ogr2ogr.
I have a polygon of region in SHP which has a hole with city inside. In BNA file I see that polygon with the region closes and then the first point of inner ring repeat 743 times, just as many times as the number of points for the city in SHP file.
Please find attached the one-line patch with the fix for this problem. Inner loop incremented i
variable, though it should have used j
. On my data(Shapefiles with big country and several islands) fixed ogr2ogr now produces correct BNA with no duplicates.
Hope this patch is going to be accepted for SVN trunk.
Attachments (1)
Change History (4)
by , 15 years ago
Attachment: | bna_inner_ring_fix.patch added |
---|
comment:1 by , 15 years ago
Component: | OGR_SF → default |
---|
comment:2 by , 15 years ago
Owner: | changed from | to
---|
comment:3 by , 15 years ago
Component: | default → OGR_SF |
---|---|
Milestone: | → 1.6.1 |
Resolution: | → fixed |
Status: | new → closed |
Version: | svn-trunk → 1.5.0 |
Thanks for the patch (this is the first bug reported for the BNA driver I think, so I was wondering if it was really used;-)). Applied in trunk (r16945) and in branches/1.6 (r16946) just in time for the soon-to-be-released 1.6.1. Test added in r16947.
Actually, my test coverage report shows that it was untested code (http://even.rouault.free.fr/coverage/ogr/ogrsf_frmts/bna/ogrbnalayer.cpp.gcov.html), and as usual, untested code is broken code...
patch