Git Product home page Git Product logo

Comments (7)

carlodef avatar carlodef commented on August 16, 2024

You're giving longitude and latitude in the wrong order: srtm4.srtm4 receives the longitude as first argument, and the latitude as second argument: https://github.com/cmla/srtm4/blob/master/srtm4.py#L204

srtm4.srtm4(8.035, 46.503)
2773.88

from srtm4.

berndhahnebach avatar berndhahnebach commented on August 16, 2024

OMG, thanks for the information.

from srtm4.

berndhahnebach avatar berndhahnebach commented on August 16, 2024

You're giving longitude and latitude in the wrong order: srtm4.srtm4 receives the longitude as first argument, and the latitude as second argument: https://github.com/cmla/srtm4/blob/master/srtm4.py#L204

srtm4.srtm4(8.035, 46.503)
2773.88

but 2773 is not 2725 there is 50 meters difference ?

from srtm4.

glostis avatar glostis commented on August 16, 2024

@berndhahnebach, as stated in the docstring of the srtm4.srtm4 function, it returns:

height(s) in meters above the WGS84 ellipsoid (not the EGM96 geoid)

If you want the height above sea level, you're most probably looking for the height with respect to the geoid.
This geographiclib online utility shows you that at your point of interest, the offset between the ellipsoid and the geoid is 50 meters, which explains the discrepancy you observe.

from srtm4.

berndhahnebach avatar berndhahnebach commented on August 16, 2024

got it. Thanks for the information.

Do you know a python module to convert the WGS84 (srtm4) into EGM96 (what is written in standard maps)?

from srtm4.

glostis avatar glostis commented on August 16, 2024

Sure!

You can use the pyproj package that relies on PROJ to do the transformation.

This snippet should do more or less what you want:

import pyproj

# WGS84 with ellipsoid height as vertical axis
ellipsoid = pyproj.CRS.from_epsg(4979)
# WGS84 with Gravity-related height (EGM96)
geoid = pyproj.CRS("EPSG:4326+5773")

trf = pyproj.Transformer.from_crs(ellipsoid, geoid)
geoid_alts = trf.transform(lats, lons, ellipsoid_alts)  # beware of the order of arguments: lats, lons

from srtm4.

berndhahnebach avatar berndhahnebach commented on August 16, 2024

great!

from srtm4.

Related Issues (7)

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.