Closed chrisranderson closed 5 years ago
If I understand you correctly, this is already possible by specifying the index of each random feature you want (notice the single- rather than plural-tense):
reader.shapeRecord(13321)
reader.shapeRecord(482)
reader.shapeRecord(953)
I do see shapeRecord
in the Reader
class, I guess that's what you mean. I do see that in the README now - I missed it there and didn't notice it in autocomplete. Sorry about that. It could be rare that people Google "random access" to describe what I was trying to do; would it be helpful to add that to the README?
Maybe an alias of getShapeRecord
on the Reader class would be useful since we both thought that's what the name of the method was. :)
Yes, that's right, not sure why I wrote 'get' in there. Feel free to insert the relevant language where you see fit in the README and create a PR, then if it looks good I'll merge it.
Probably wait on the alias for now. But I think adding a quickstart tutorial, more easily available docs + reference API on ReadTheDocs would go a long way in making it easier to look up the functionality. Hope to get that added sometime soon.
This would be great for my use case - using a large shapefile and fairly often wanting to return specific geometries instead of iterating through entire thing looking for it. I'm picturing something like
reader.getShapeRecords([13321, 482, 953])
.I don't understand the shapefile format - is this possible? Simple to implement?