Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GEOT-2791] Fixed IllegalArgument in buffer when reading a sparse shape file #134

Merged
merged 4 commits into from
Mar 31, 2013

Conversation

DieterDePaepe
Copy link
Contributor

The original implementation assumed all entries a shape file were in order, which does not hold up for sparse shape files. This resulted in an IllegalArgument when setting the buffer. This in turn resulted in not all entries being read.

This patch ensures the buffer is either addressable, or reloads it from the Channel being read.

@aaime
Copy link
Member

aaime commented Feb 16, 2013

Thanks for the patch. You actually have to add a test proving the patch works and making sure reading sparse files won't fail again (with a small test shapefile) in order for the change to be committed. The test should fail without the patch, and work with it.

@DieterDePaepe
Copy link
Contributor Author

Test has been included.

@aaime
Copy link
Member

aaime commented Mar 9, 2013

Hi, I've spent some time last weekend looking at the patch. It looks good, and it works. However... I have a problem.
The current shapefile module is about to be retired, and replaced with shapefile-ng, a refactor of it that replaces the higher level classes (store and friends) and tries to clean up the module.
I've tried to port your patch there, but I can't make it work. At the same time, the test you provided shows shapefile-ng is affected by the problem you've reported.

Don't you happen to have some time to have a look there too, by any chance?
https://github.com/geotools/geotools/tree/master/modules/unsupported/shapefile-ng

@DieterDePaepe
Copy link
Contributor Author

I'll try to patch up the shapefile-ng when I have some time. Hopefully somewhere next week.

@aaime
Copy link
Member

aaime commented Mar 12, 2013

Nice, much appreciated

…ion in buffer when reading sparse shape files.
@aaime
Copy link
Member

aaime commented Mar 31, 2013

Thank you, very good :-)

aaime added a commit that referenced this pull request Mar 31, 2013
[GEOT-2791] Fixed IllegalArgument in buffer when reading a sparse shape file
@aaime aaime merged commit 2f1795c into geotools:master Mar 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants