Giter Site home page Giter Site logo

Comments (2)

pka avatar pka commented on May 22, 2024

Your example looks right to me, but probably the algorithm is too simplistic.
When choosing the query for a given zoom level, it selects the first query entry with the requested zoom level within minzoom and maxzoom (https://github.com/pka/t-rex/blob/master/src/core/layer.rs#L68).
So if you place the default query at the end, it should work for now.

from t-rex.

pka avatar pka commented on May 22, 2024

After improving the algorithm to select a zoom dependent query, the behaviour for your example is still not clear between zoom levels 0 to 6. Shouldn't it be:

[[tileset.layer]]
name = "waterareas"
srid = 3857
geometry_field = "geom"
geometry_type = "MULTIPOLYGON"
fid_field = "osm_id"

  [[tileset.layer.query]]
  maxzoom = 6
  sql = """
  SELECT osm_id, ST_Multi(geometry) AS geom
  FROM osm_waterareas_gen0
  WHERE geometry && !bbox!"""

  [[tileset.layer.query]]
  minzoom = 7
  maxzoom = 10
  sql = """
  SELECT osm_id, ST_Multi(geometry) AS geom
  FROM osm_waterareas_gen1
  WHERE geometry && !bbox!"""

  [[tileset.layer.query]]
  minzoom = 11
  sql = """
  SELECT osm_id, ST_Multi(geometry) AS geom
  FROM osm_waterareas
  WHERE geometry && !bbox!"""

from t-rex.

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.