Use Range Requests for Flatgeobuf to retrieve a subset of a given dataset #2280
brianbancroft
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
You're correct that we don't today support this. I think the ideal way for this to work is with a multi-step API so that an initial loader call can read just the flatgeobuf header. Then the user can inspect the returned metadata to see whether the flatgeobuf file supports geospatial filters (i.e. only if the flatgeobuf file contains a spatial index), as well as the full bounding box of the file. We could also support this in our existing "single-shot" API, though if the file didn't contain the required metadata we might end up reading the whole file anyways |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I enjoy the simplicity and consistency of the loaders.gl library, but one of the most useful features of the flatgeobuf format is the ability to retrieve subsets of the source data by geographic bounding box, which the library accomplishes through HTTP range requests. I have looked through the codebase and documentation, and have not found any similar ability in loaders.gl.
The following is an example of how flatgeobuf uses geographic bounding boxes to load data from a gigabytes-sized source:
https://github.com/flatgeobuf/flatgeobuf/blob/master/examples/maplibre/large.html#L83
As far as my own use-cases, there are times when I reach for a geojson-type source over other sources when it comes to displaying on a mapbox/maplibre/ol map, esp when it comes to maintaining large sets of data, or when I want the labels to show on a map at all times. Flatgeobuf has filled that need, for the clunkiness of its node/js implementation. If loaders.gl/flatgeobuf allows for requests by bbox, I believe that it would make your already-clean implementation much more popular for this niche.
Beta Was this translation helpful? Give feedback.
All reactions