Skip to content
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

Improve data access #62

Open
jsanz opened this issue Mar 22, 2022 · 1 comment
Open

Improve data access #62

jsanz opened this issue Mar 22, 2022 · 1 comment

Comments

@jsanz
Copy link
Collaborator

jsanz commented Mar 22, 2022

In order to scale better the website performance, we could consider switching from GeoJSON to flatgeobuff as it performs better and it is a more compact transport format.

Change should be pretty easy to do according to this snippet from the OpenLayers example:

// data source for map
const source = new ol.source.Vector({
    loader: async function () {
        // Fetch the flatgeobuffer
        const response = await fetch('/test/data/UScounties.fgb')
        // ...and parse all its features
        for await (let feature of flatgeobuf.deserialize(response.body)) {
            feature.getGeometry().transform('EPSG:4326', 'EPSG:3857')
            // add each feature to the map, after projecting it to
            this.addFeature(feature)
        }
    }
});

Opinions?

@jsanz
Copy link
Collaborator Author

jsanz commented Aug 25, 2023

Another option would be to research how to use PMTiles, probably through tippecanoe to produce a single file source of vector tiles that can be deployed easily as a static dataset.

@jsanz jsanz changed the title Transition to use flatgeobuf Improve data access Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant