Giter VIP home page Giter VIP logo

Comments (4)

davidmtech avatar davidmtech commented on June 5, 2024

There are two kinds of heights. One which is over ellipsoid and one which over geoid. In this case you are using map where are coordinates provided in navigational spacial system which has heights over ellipsoid. You can take advantage that current map has public spacial system with heights over geoid and convert height by following function:

var newCoords = map.convertCoordsFromPublicToNav([14.3836691, 50.0485568, 333]);

I have modified your example which now gives more accurate results. Final result is also depended on the precision of the point coordinates and on the precision of the terrain geometry:
https://jsfiddle.net/mj26qkrw/

More about spatial coordinate systems in VTS can be found there:
http://vtsdocs.melown.com/en/latest/reference/concepts.html

from vts-browser-js.

alam-R avatar alam-R commented on June 5, 2024

Thank you very much David!
Indeed this method solves the problem of the height mismatch.
However if you run this method again with the same arguments then the result of the conversion is different for the height!?
We have created this demo:
https://jsfiddle.net/alamR/9xr5tx63/22/

You could check the console and notice the different values of height every time you click the custom button 'Clickme'.

from vts-browser-js.

davidmtech avatar davidmtech commented on June 5, 2024

Sorry, I forgot that function for conversion has second parameter which defines whether height is 'fix' or 'float'. Default mode is 'float' and height is computed from currently available data. Usually available data are not best match so more detailed data are loaded on the background. That is reason different values. Fixed function call:

var newCoords = map.convertCoordsFromPublicToNav([14.3836691, 50.0485568, 333], 'fix');

Fixed demos:
https://jsfiddle.net/5n97gm3y/
https://jsfiddle.net/mj26qkrw/12/

from vts-browser-js.

alam-R avatar alam-R commented on June 5, 2024

Thank you so much David!!
Now it is working as expected 👍 👍

from vts-browser-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.