Giter VIP home page Giter VIP logo

Comments (7)

kylebarron avatar kylebarron commented on May 29, 2024

It's also weird how it's the near corner that happens to be lower res on multiple tiles

image

from pymartini.

kylebarron avatar kylebarron commented on May 29, 2024

Ok lets debug this tile, in the central grand canyon: zxy=12/772/1607.terrain. Full Url:

https://us-east-1-lambda.kylebarron.dev/dem/mesh/12/772/1607.terrain?url=terrarium&mesh_max_error=18.82

image

At first glance, you might think the mesh max error of 18.82 is too high, but even if you reduce it to 5, the near corner is still low-res
image

When visualized with quantized-mesh-viewer, the corner is still low-res, so we can rule out a rendering issue. (Note that the mesh being upside down is expected since it's designed to be the same coordinates as a png in this case for use with deck.gl)

image

from pymartini.

kylebarron avatar kylebarron commented on May 29, 2024

To be blatantly obvious, it's clear that the actual topography of that section of the canyon is detailed, so there should be a more detailed mesh
image

from pymartini.

kylebarron avatar kylebarron commented on May 29, 2024

Swapping the Mapbox terrain source with Terrarium tiles, it's clear the Terrarium tiles aren't wrong.
image

from pymartini.

kylebarron avatar kylebarron commented on May 29, 2024

Bug looks to be in the rescale_positions step. When I use

rescaled = rescale_positions(
    vertices, tile, bounds=bounds, flip_y=flip_y, column_row=True)

I see the correct mesh, just rotated
image

When I use

rescaled = rescale_positions(
    vertices, tile, bounds=bounds, flip_y=flip_y, column_row=False)

I see it in the "correct direction" (i.e. looking south (north?), which makes sense since I want it to be the same orientation as the PNG), but with incorrect mesh
image

from pymartini.

kylebarron avatar kylebarron commented on May 29, 2024

Ok so this is a bug in pymartini in rescale_positions. Specifically, when you set column_row=False you're using a different transposed matrix for the Martini errors step and for the terrain lookup step!

See how sparse the triangles are in the bottom right, but how there are so many in the flat area on the rim!

from pymartini.

kylebarron avatar kylebarron commented on May 29, 2024

So basically column_row should always be True so that you're using the same axis ordering for generating the mesh and the terrain lookup, and just add better documentation about whether a .T is needed before passing the tile to pymartini.

from pymartini.

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.