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)

bna_inner_ring_fix.patch (682 bytes ) - added by antimirov 15 years ago.
patch

Download all attachments as: .zip

Change History (4)

by antimirov, 15 years ago

Attachment: bna_inner_ring_fix.patch added

patch

comment:1 by antimirov, 15 years ago

Component: OGR_SFdefault

comment:2 by Even Rouault, 15 years ago

Owner: changed from warmerdam to Even Rouault

comment:3 by Even Rouault, 15 years ago

Component: defaultOGR_SF
Milestone: 1.6.1
Resolution: fixed
Status: newclosed
Version: svn-trunk1.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...

Note: See TracTickets for help on using tickets.