-
Notifications
You must be signed in to change notification settings - Fork 4
Add flatgeobuf support #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for visualizing FlatGeobuf assets in STAC layers. The implementation enables rendering of FlatGeobuf files (an efficient binary format for geographic data) alongside existing formats like GeoJSON and GeoTIFF.
- Adds flatgeobuf package dependency and imports the OpenLayers loader
- Implements
addFlatGeobuf_method to create vector layers from FlatGeobuf assets - Updates asset visualization logic to detect and render FlatGeobuf format
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ol/layer/STAC.js | Adds FlatGeobuf support with new import, media type check, and visualization methods |
| package.json | Adds flatgeobuf ^4.3.1 dependency |
| examples/stac-item-flatgeobuf.js | Provides example implementation showing FlatGeobuf asset rendering |
| examples/stac-item-flatgeobuf.html | HTML template for the FlatGeobuf example |
| CHANGELOG.md | Documents the new FlatGeobuf visualization feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| try { | ||
| const source = new VectorSource(); | ||
| const loader = createLoader( | ||
| null, |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first parameter to createLoader is null. According to the flatgeobuf OpenLayers API, this should be the feature projection. Consider passing a proper projection here or document why null is acceptable.
| null, | |
| getProjection(this), |
| const loader = createLoader( | ||
| null, | ||
| source, | ||
| asset.getAbsoluteUrl(), | ||
| bboxStrategy, | ||
| ); | ||
| source.setLoader(loader); |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The createLoader function is called with the source as the second parameter, but then source.setLoader is called immediately after. This appears redundant - createLoader typically either returns a loader to be set manually OR sets it on the source internally. Verify the correct usage pattern for flatgeobuf's createLoader API.
| const loader = createLoader( | |
| null, | |
| source, | |
| asset.getAbsoluteUrl(), | |
| bboxStrategy, | |
| ); | |
| source.setLoader(loader); | |
| createLoader( | |
| null, | |
| source, | |
| asset.getAbsoluteUrl(), | |
| bboxStrategy, | |
| ); |
| title: STAC Item with FlatGeobuf assets | ||
| shortdesc: Rendering a STAC Item with FlatGeobuf assets | ||
| docs: > | ||
| Geometry and FlatGeobuf Assets from SpatioTemporal Asset Catalog (STAC) Items can be rendered as layer group. |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammatical improvement: 'as layer group' should be 'as a layer group'.
| Geometry and FlatGeobuf Assets from SpatioTemporal Asset Catalog (STAC) Items can be rendered as layer group. | |
| Geometry and FlatGeobuf Assets from SpatioTemporal Asset Catalog (STAC) Items can be rendered as a layer group. |
672db15 to
9ab97fe
Compare
Just doesn't work yet at all 🙈 No requests are made.