Skip to content

Open source tools and public APIs for geodetic computations.

License

Notifications You must be signed in to change notification settings

grizzlei/geodeasy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

                      _ _____                
  __ _  ___  ___   __| | ____|__ _ ___ _   _ 
 / _` |/ _ \/ _ \ / _` |  _| / _` / __| | | |
| (_| |  __/ (_) | (_| | |__| (_| \__ \ |_| |
 \__, |\___|\___/ \__,_|_____\__,_|___/\__, |
 |___/                                 |___/ 

(This README is simply index.php except this line, converted to markdown with minor tweaks using codebeautify.org/html-to-markdown)

Geodeasy is an open source tool for a set of basic and complicated geodetic computations. Although all of its code is available, you can still use its public REST API instead.

Geodeasy online tools:

Destination calculation on ellipsoid
Great circle distance calculation on ellipsoid
Geographic to cartesian (earth-centered, earth-fixed) on ellipsoid
Cartesian to geographic (earth-centered, earth-fixed) on ellipsoid
Universal Transverse Mercator to geographic on ellipsoid
Geographic to Universal Transverse Mercator on ellipsoid
Transverse Mercator to geographic on ellipsoid
Geographic to Transverse Mercator on ellipsoid


API documentation and examples

A typical GET request to Geodeasy APIs:

https://geodeasy.org/api/v1/destination.php?latitude=35.123&longitude=41.1235&distance=12413&azimuth=22&a=6378137.0&b=6356752.314245

A typical response body from Geodeasy APIs:

{
    "payload": {
        "latitude": 35.22672767,
        "longitude": 41.17457877,
        "azimuth": 22.02942516
    },
    "error": {
        "code": 0,
        "what": "GEODEASY_NO_ERROR"
    },
    "warnings": []
}

If something goes wrong, a descriptive warning or a pair of error code and number will be returned.

Try out Geodeasy public REST API:

[Try] /api/v1/destination.php
Synopsis: Find latitude, longitude and the azimuth at the destination point on ellipsoid from given first point coordinates, azimuth and distance.
Parameters: latitude (°), longitude (°), azimuth (°), distance (m), ellipsoid parameters a and b.
Returns: latitude (°), longitude (°) and azimuth (°) at destination point.

[Try] /api/v1/great_circle_distance.php
Synopsis: Find the distance between two points on ellipsoid.
Parameters: ellipsoidal coordinates of first and second points (latitude1, longitude1, latitude2, longitude2), ellipsoid parameters a and b.
Returns: azimuth (°) at the first point, reverse azimuth (reverse_azimuth) (°) at the second point and the distance (m).

[Try] /api/v1/geographic_to_xyz.php
Synopsis: Convert ellipsoidal coordinates of a point to x, y and z (ECEF) coordinates.
Parameters: latitude (°), longitude (°) and ellipsoidal height of the point, ellipsoid parameters a and b.
Returns: x (m), y (m), z (m) of the point.

[Try] /api/v1/xyz_to_geographic.php
Synopsis: Convert cartesian coordinates to ellipsoidal coordinates; latitude, longitude and height.
Parameters: x (m), y (m), z (m) of the point and ellipsoid parameters a and b.
Returns: latitude (°), longitude (°) and ellipsoidal height of the given point.

[Try] /api/v1/geographic_to_utm.php
Synopsis: Convert ellipsoidal coordinates of a point to Universal Transverse Mercator (UTM) projection coordinates.
Parameters: latitude (°), longitude (°) and ellipsoid parameters a and b.
Returns: easting (m), northing (m), utm_zone and hemisphere.

[Try] /api/v1/utm_to_geographic.php
Synopsis: Convert Universal Transverse Mercator (UTM) projection coordinates to latitude, longitude on a given ellipsoid.
Parameters: easting (m), northing (m), UTM zone (utm_zone), hemisphere and ellipsoid parameters a and b.
Returns: latitude, longitude of the point.

[Try] /api/v1/geographic_to_tm.php
Synopsis: Convert ellipsoidal coordinates to Transverse Mercator projection coordinates.
Parameters: latitude (°) and longitude (°) of the point, origin latitude (lat0) (°), central meridian (lon0) (°), scale factor (k0) and ellipsoid parameters a and b.
Returns: easting (m), northing (m) and hemisphere of the point.

[Try] /api/v1/tm_to_geographic.php
Synopsis: Convert Transverse Mercator projection coordinates to ellipsoidal coordinates.
Parameters: easting (m), northing (m), hemisphere, origin latitude (lat0) (°), central meridian (lon0) (°), scale factor (k0) and ellipsoid parameters a and b.
Returns: latitude (°) and longitude (°) of the point.

[Try] /api/v1/geographic_to_lcc.php
Synopsis: Convert ellipsoidal coordinates to Lambert Conformal Conic (LCC) projection coordinates.
Parameters: latitude (°) and longitude (°) of the point, first standard parallel (lat1) (°), second standard parallel (lat2) (°), origin latitude (lat0) (°), central meridian (lon0) (°) and ellipsoid parameters a and b.
Returns: easting (m) and northing (m) of the point.

[Try] /api/v1/lcc_to_geographic.php


Source & License

You can find Geodeasy source code here: github.com/grizzlei/geodeasy

MIT License

Copyright (c) 2022 Hasan Karaman

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

This is a licence-free software, it can be used by anyone who try to build a better world.


hasan karaman (whoami) - https://hasankaraman.dev - [email protected] - 2022