Height kinds: ellipsoidal / AMSL / AGL (SP1)
curl --request POST \
--url https://api.eddy.engineer/v1/spatial.height.convert \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"items": [
{
"height": {
"kind": "<string>",
"value": 123,
"geoid": "<string>"
},
"lat": 123,
"lon": 123,
"to": {
"kind": "<string>",
"geoid": "<string>"
},
"ground_ellipsoidal": 123,
"terrain": "<string>"
}
]
}
'import requests
url = "https://api.eddy.engineer/v1/spatial.height.convert"
payload = { "items": [
{
"height": {
"kind": "<string>",
"value": 123,
"geoid": "<string>"
},
"lat": 123,
"lon": 123,
"to": {
"kind": "<string>",
"geoid": "<string>"
},
"ground_ellipsoidal": 123,
"terrain": "<string>"
}
] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
height: {kind: '<string>', value: 123, geoid: '<string>'},
lat: 123,
lon: 123,
to: {kind: '<string>', geoid: '<string>'},
ground_ellipsoidal: 123,
terrain: '<string>'
}
]
})
};
fetch('https://api.eddy.engineer/v1/spatial.height.convert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/spatial.height.convert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'height' => [
'kind' => '<string>',
'value' => 123,
'geoid' => '<string>'
],
'lat' => 123,
'lon' => 123,
'to' => [
'kind' => '<string>',
'geoid' => '<string>'
],
'ground_ellipsoidal' => 123,
'terrain' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/spatial.height.convert"
payload := strings.NewReader("{\n \"items\": [\n {\n \"height\": {\n \"kind\": \"<string>\",\n \"value\": 123,\n \"geoid\": \"<string>\"\n },\n \"lat\": 123,\n \"lon\": 123,\n \"to\": {\n \"kind\": \"<string>\",\n \"geoid\": \"<string>\"\n },\n \"ground_ellipsoidal\": 123,\n \"terrain\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/spatial.height.convert")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"height\": {\n \"kind\": \"<string>\",\n \"value\": 123,\n \"geoid\": \"<string>\"\n },\n \"lat\": 123,\n \"lon\": 123,\n \"to\": {\n \"kind\": \"<string>\",\n \"geoid\": \"<string>\"\n },\n \"ground_ellipsoidal\": 123,\n \"terrain\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/spatial.height.convert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"height\": {\n \"kind\": \"<string>\",\n \"value\": 123,\n \"geoid\": \"<string>\"\n },\n \"lat\": 123,\n \"lon\": 123,\n \"to\": {\n \"kind\": \"<string>\",\n \"geoid\": \"<string>\"\n },\n \"ground_ellipsoidal\": 123,\n \"terrain\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"geoid_hash": "<string>",
"geoid_height": 123,
"ground_ellipsoidal": 123,
"height": {
"kind": "<string>",
"value": 123,
"geoid": "<string>"
},
"method": "<string>"
}
]
}Maps
Height kinds: ellipsoidal / AMSL / AGL (SP1)
A height never travels without its kind. Each item converts a {value, kind[, geoid]} at (lat, lon degrees) to another kind through the ellipsoidal hub: AMSL = ellipsoidal − N with N read from the named geoid by GeographicLib's 12-node cubic fit (SP1.c; the default, the grid's stated maximum error 0.169 m) or bilinearly when `geoid_interpolation` says so (the vendored EGM96 15-minute grid, `egm96-15`; its content hash and the reading used are in the answer), AGL = ellipsoidal − the ground's ellipsoidal height, which the caller supplies as `ground_ellipsoidal` or names a terrain raster for (`terrain`, SP2). Missing ground → HEIGHT_NO_TERRAIN; an unknown geoid → GEOID_UNKNOWN; a latitude outside ±90° → GEOID_RANGE.
POST
/
v1
/
spatial.height.convert
Height kinds: ellipsoidal / AMSL / AGL (SP1)
curl --request POST \
--url https://api.eddy.engineer/v1/spatial.height.convert \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"items": [
{
"height": {
"kind": "<string>",
"value": 123,
"geoid": "<string>"
},
"lat": 123,
"lon": 123,
"to": {
"kind": "<string>",
"geoid": "<string>"
},
"ground_ellipsoidal": 123,
"terrain": "<string>"
}
]
}
'import requests
url = "https://api.eddy.engineer/v1/spatial.height.convert"
payload = { "items": [
{
"height": {
"kind": "<string>",
"value": 123,
"geoid": "<string>"
},
"lat": 123,
"lon": 123,
"to": {
"kind": "<string>",
"geoid": "<string>"
},
"ground_ellipsoidal": 123,
"terrain": "<string>"
}
] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
height: {kind: '<string>', value: 123, geoid: '<string>'},
lat: 123,
lon: 123,
to: {kind: '<string>', geoid: '<string>'},
ground_ellipsoidal: 123,
terrain: '<string>'
}
]
})
};
fetch('https://api.eddy.engineer/v1/spatial.height.convert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/spatial.height.convert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'height' => [
'kind' => '<string>',
'value' => 123,
'geoid' => '<string>'
],
'lat' => 123,
'lon' => 123,
'to' => [
'kind' => '<string>',
'geoid' => '<string>'
],
'ground_ellipsoidal' => 123,
'terrain' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/spatial.height.convert"
payload := strings.NewReader("{\n \"items\": [\n {\n \"height\": {\n \"kind\": \"<string>\",\n \"value\": 123,\n \"geoid\": \"<string>\"\n },\n \"lat\": 123,\n \"lon\": 123,\n \"to\": {\n \"kind\": \"<string>\",\n \"geoid\": \"<string>\"\n },\n \"ground_ellipsoidal\": 123,\n \"terrain\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/spatial.height.convert")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"height\": {\n \"kind\": \"<string>\",\n \"value\": 123,\n \"geoid\": \"<string>\"\n },\n \"lat\": 123,\n \"lon\": 123,\n \"to\": {\n \"kind\": \"<string>\",\n \"geoid\": \"<string>\"\n },\n \"ground_ellipsoidal\": 123,\n \"terrain\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/spatial.height.convert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"height\": {\n \"kind\": \"<string>\",\n \"value\": 123,\n \"geoid\": \"<string>\"\n },\n \"lat\": 123,\n \"lon\": 123,\n \"to\": {\n \"kind\": \"<string>\",\n \"geoid\": \"<string>\"\n },\n \"ground_ellipsoidal\": 123,\n \"terrain\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"geoid_hash": "<string>",
"geoid_height": 123,
"ground_ellipsoidal": 123,
"height": {
"kind": "<string>",
"value": 123,
"geoid": "<string>"
},
"method": "<string>"
}
]
}