tmontaigu / shapefile-rs

Rust library to read & write shapefiles
MIT License
59 stars 19 forks source link

Fix: Use the `shx` file when iterating shapes #27

Closed tmontaigu closed 2 years ago

tmontaigu commented 3 years ago

Some shapefiles may have 'garbage' bytes between shapes and as a result, our 'ShapeReader` which only read sequentially would not skip those garbages bytes and errors (in debug mode or other problems in release) would occur.

We fix this by using the info of the shx file (if present) to seek to the true start of a shape.

(Technicaly) BREAKING CHANGE: Added Seek trait to the bounded traits of the read_* and iter* methods of ShapeReader

Fixes #25