Opened 12 years ago
#858 new defect
Shape provider: crash reading rows
Reported by: | romicadascalescu | Owned by: | romicadascalescu |
---|---|---|---|
Priority: | major | Milestone: | 3.8.0 |
Component: | SHP Provider | Version: | 3.8.0 |
Severity: | 3 | Keywords: | |
Cc: | External ID: |
Description
Fixed a crash reading rows in a: SHP record mismatch?
A SHP file has the information inside organized like below:
- Header (100 bytes) (Rec Number) (Length of Shape) (Rec Number) (Length of Shape) .....
So normally we can read record by record from the file. The problem show up when we have gaps between records.
And that's the problem with this file:
- Header (100 bytes) (Rec Number) (Length of Shape) (-1) (unused space) (Rec Number) (Length of Shape) .....
Now this file had -1 however other files could have any random value. Also the provider when we read one record we read more records at a time (it's a cache mechanism) of max 50 records. The cache mechanism could not be resynchronized in case of gaps mainly because to resynchronize it needed information from the spatial index file (SHX). To fix this issue make SHP cache mechanism to use SHX data to move ensure we read from the right positions the records cached if possible.