Giter Site home page Giter Site logo

Comments (4)

danielbarela avatar danielbarela commented on May 22, 2024

You are correct. The demo page zooms to the extent that is declared in the feature table. It is shown on a web Mercator map and that is why it appears to zoom to the entire world plus some because web Mercator only extends to ~85 and ~-85 degrees latitude.

from geopackage-js.

bosborn avatar bosborn commented on May 22, 2024

Hi @bradh ,

The Contents (gpkg_contents) table is the only place a feature table identifies the overall bounds of the data. Evaluating each feature row for it's envelope or bounds does not make sense for a zoom operation. There could be thousands of geometries in each feature table saved with or without individual envelopes specified.

Although the bounds in the Contents are optional, we recommend specifying the minimum data encompassing bounds. For your example, the entire world is specified as the feature table data bounds. If you update the gpkg_contents min_x, min_y, max_x, max_y values, zoom should work correctly for you.

from geopackage-js.

bradh avatar bradh commented on May 22, 2024

I'm fairly familiar with GeoPackage, it was more just user surprise.

I realise that its just a demo app, but keeping a bounding box during rendering wouldn't be that onerous.

from geopackage-js.

danielbarela avatar danielbarela commented on May 22, 2024

I would argue that the bounding box specified by the contents table is the one that should be used because what if the application does not actually load all of the data into the map and only queries for what is visible. Then there would be no way of knowing how many other features there are that fall outside of the current viewport. Additionally, some applications will query for a count of features in the current viewport and not display them if there are too many. This would also cause the application to not actually know the actual bounding box of the data. Since a contents table is required for all feature tables, and that table has a bounding box, I feel that the only reliable way of zooming, regardless of the implementation of how the features are loaded, is to use the bounding box provided. Otherwise why even bother having that in the contents table if everyone is going to just set it to the world extents?

from geopackage-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.