Skip to content

GeoidHeight4J is a pure Java library for calculating geoid heights and converting between geoid and ellipsoid. Ported from GeographicLib.

License

Notifications You must be signed in to change notification settings

Aknbb/geoidheight4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

GeoidHeight4J

GeoidHeight4J is a pure Java library that provides tools to compute geoid heights and convert heights between the geoid and ellipsoid. This library is a Java port of the Geoid class from the GeographicLib project. GeoidHeight4J is ideal for applications requiring precise geoid height calculations, such as geographic information systems (GIS) and geodetic applications.

The reason why the class variables in this class are written with abbreviations like _rlonres and _v00 is that they are intentionally kept the same as the variable names in the Geoid.hpp file.

You can use the Geoid Height Document and Geoid Class Reference links to access EGM data and learn more about the Geoid.

Features

  • Geoid Height Calculation: Compute the height of the geoid above the ellipsoid for a given latitude and longitude.
  • Height Conversion: Convert heights between the geoid and ellipsoid reference surfaces.
  • Interpolation Methods: Supports bilinear and cubic interpolation for height computations.

Usage

Example Code:

import your.package.Geoid;

public class Main {
    public static void main(String[] args) {
        // Initialize the Geoid object with the model name and path to data
        Geoid geoid = new Geoid("egm2008-5", "/home/aknbb/Desktop/geoid-data", true, false);

        // Example: Compute the geoid height at a specific latitude and longitude
        double latitude = 37.97150021753285;  // Latitude in degrees
        double longitude = 34.62309350397177;  // Longitude in degrees
        double geoidHeight = geoid.computeGeoidHeight(latitude, longitude);
        // 35.20602975851298 meters for egm2008-5.pgm data with cubic interpolation
        System.out.println("Geoid height above ellipsoid: " + geoidHeight + " meters"); 
    }
}

API Overview

Method Description
Geoid(String name, String path, boolean cubic, boolean threadsafe) Initializes the Geoid object with the given parameters.
double computeGeoidHeight(double latitude, double longitude) Computes the height of the geoid above the ellipsoid for the given latitude and longitude.
double convertHeight(double latitude, double longitude, double heightOfThePoint, ConvertFlag direction) Converts height between geoid and ellipsoid references.
void cacheArea(double south, double west, double north, double east) Caches the geoid data for a specific area to improve performance.
void cacheAll() Caches all geoid data into memory to optimize computations across the entire dataset.
void cacheClear() Clears the cache for the geoid model.

For more detailed information, refer to the Javadoc content in the Geoid class or visit GeographicLib's documentation.

License

This project is licensed under the MIT License.

Contact

Feel free to explore my Tile Layout Converter project and get in touch if you have any questions or collaboration ideas. You can reach out to me via akinbuyukbulut@gmail.com or connect with me on LinkedIn and GitHub.

About

GeoidHeight4J is a pure Java library for calculating geoid heights and converting between geoid and ellipsoid. Ported from GeographicLib.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages