shapeAt method
Returns the shape at the specified byte distance from the beginning of the file. Mind that:
- it's your responsibility to ensure the offset corresponds to the actual beginning of a shape struct
- once you call this, reading with hasNext/next on sparse shapefiles will be broken (we don't know anymore at which shape we are)
Implementation
dynamic shapeAt(int offset) async {
disableShxUsage();
if (randomAccessEnabled) {
await goTo(offset);
var rec = await nextRecord();
return rec?.shape();
}
throw StateError("Random Access not enabled");
}