xbikuna / nettopologysuite

Automatically exported from code.google.com/p/nettopologysuite
0 stars 0 forks source link

Error while reading NullShape with new ShapeReader + DBF encoding problems #181

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi.

A few weeks ago me and my team uploaded a new Shapefile reader classes 
containing additional functionality, which you guys added to the 
ShapeFile.Extended DLL.

Since then we discovered a bug in our code - it didn't handle Shapefiles that 
had Null shapes in them.
In addition, we noticed your code throws an exception when given a valid 
shapefile that is of type NullShape.

We fixed the former by adding support in our code for this kind of shapefiles, 
and the latter by adding a new "mock" ShapeHandler called NullShapeHandler, 
which has no functionality but acts seamless as an abstract ShapeHandler.

Also, we had some problems reading DBF files with Hebrew data, so we fixed the 
DbaseHeader class to support that and refactored it to use something more 
understandable and time-efficient than a matrix of objects for the LDID <-> 
Codepage mappings.
In addition we noticed that both ANSI values (0x3 and 0x57) were mapped to 
codepage 1252, which worked on every computer running Eurupean languanges, but 
on our Hebrew computer it produced Jibberish, so we changed to to take the 
native computer's codePage, which is what ANSI should be.

Of course all tests pass, and we added some more for the NullShape fix.

We hope you accept that patch.

Avi.

Original issue reported on code.google.com by avraha...@gmail.com on 24 Apr 2014 at 5:39

Attachments:

GoogleCodeExporter commented 8 years ago
Forgot to mention - I added the additional shapefiles used for the testing in 
the RAR file, didn't find a way to add them to the patch file.

Original comment by avraha...@gmail.com on 24 Apr 2014 at 5:42

GoogleCodeExporter commented 8 years ago
I try to patch the code as soon as possible, thanks for submission.

Original comment by diegogu...@gmail.com on 26 Apr 2014 at 4:32

GoogleCodeExporter commented 8 years ago
Thanks.

Could you just update me (with a comment in this thread) when you do?

Original comment by avraha...@gmail.com on 26 Apr 2014 at 6:46

GoogleCodeExporter commented 8 years ago
of course, I update this issue with progresses on applying your patch

Original comment by diegogu...@gmail.com on 27 Apr 2014 at 9:20

GoogleCodeExporter commented 8 years ago
applied with r1224.
all looks ok to me, except DBaseFileHeader changes that looks a little bit 
"invasive" to be sure that old code doesn't break.
anyway, all tests are green.
added also ShapeFile.Extended project to teamcity build for 4.0+ releases.

Original comment by diegogu...@gmail.com on 28 Apr 2014 at 7:42

GoogleCodeExporter commented 8 years ago
The DBaseFileHeader changes look extensive, but if you look again its mostly 
refactoring the code.
The changes to the logic are minor.

Original comment by avraha...@gmail.com on 1 May 2014 at 1:02