Omówienie interfejsu Elevation API
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Interfejs Elevation API to usługa, która zwraca dane o wysokości
położenie na Ziemi lub próbkowane dane o wysokości na ścieżkach.
Dlaczego warto korzystać z interfejsu Elevation API
Za pomocą interfejsu Elevation API możesz tworzyć aplikacje obsługujące
klienci korzystający z aktywności zależnej od wysokości n.p.m., aplikacji pozycjonujących i mających poziom usług
aplikacje obejmujące wartości ukształtowania terenu wzdłuż tras. Przykład:
możesz podać dane o wzrostach i stratach, aby ulepszyć aplikację sportową do takich aktywności jak
podczas wędrówek, jazdy na rowerze czy nurkowania.
Do czego służy interfejs Elevation API
Za pomocą interfejsu Elevation API możesz uwzględnić dane o wysokości w swoich danych
lub na mapie. Na przykład:
- Sprawdź wysokość konkretnego miejsca.
- Oblicz różnice wysokości wzdłuż trasy lub między dwoma
pkt.
Jak działa interfejs Elevation API
Interfejs Elevation API akceptuje żądanie w postaci zakodowanego adresu URL ze współrzędnymi szerokości i długości geograficznej
mogą być określane jako osobne lokalizacje lub ciągi wzdłuż ścieżki. Żądanie to,
na przykład zapytania o wysokość względną w centrum Denver w stanie Kolorado, które określają zwrot w formacie JSON.
https://maps.googleapis.com/maps/api/elevation/json
?locations=39.7391536%2C-104.9847034
&key=YOUR_API_KEY
Usługa pobiera wysokość dla podanych współrzędnych. A także interpoluje
wysokość dla lokalizacji bez ukształtowania terenu, zapewniając średnią wartość uzyskaną z czterech
najbliższe lokalizacje, które oferują dane o wysokości n.p.m. Określa też ogólny
dla danej lokalizacji.
Zasoby
W tabeli poniżej znajdziesz podsumowanie zasobów dostępnych w
interfejsu Elevation API wraz z zwracanymi danymi.
Zasoby danych |
Zwrócone dane |
Format zwrotu |
Współrzędne szerokości i długości geograficznej
Dane możesz podać jako zbiór danych z jednej lub kilku lokalizacji albo seria wzdłuż ścieżki. Ty
może też podać zakodowane współrzędne. Możesz przekazać do 512 współrzędnych.
|
Interfejs Elevation API określa względną wysokość w metrach.
do lokalnego średniego poziomu morza (LMSL). Wysokość może być zwracana jako wartość dodatnia
lub wartości ujemne, jak podano poniżej:
- Wartości dodatnie wskazują lokalizacje nad systemem zarządzania uczeniem
w tym dane dotyczące powierzchni
lub dna jezior położonych na dużej wysokości.
- Wartości ujemne wskazują lokalizacje, które są poniżej LMSL, w tym
na powierzchni i dnie oceanicznym.
- Rozdzielczość wskazuje odległość między punktem danych a
wysokość w metrach.
|
|
Jak korzystać z interfejsu Elevation API
1 |
Rozpocznij konfigurację. |
Zacznij od skonfigurowania
Projekt Google Cloud
i dokończ konfigurację.
z podanych instrukcji. |
2 |
Wyślij prośbę o podniesienie wysokości |
Po uzyskaniu klucza interfejsu API możesz zacząć testować interfejs Elevation API bezpośrednio na stronie
przeglądarki. Zobacz przykładowe żądania.
w przewodniku Pierwsze kroki.
|
3 |
Tworzenie bardziej złożonego żądania |
Po skonfigurowaniu projektu możesz wysłać żądanie, które dostarcza danych o lokalizacji
ścieżki konwersji. Patrz Określanie ścieżek
.
|
4 |
Podstawowe informacje o odpowiedziach |
Zapoznaj się z odpowiedziami dotyczącymi danych o wysokości, aby przygotować się do użycia takich danych w przypadku aplikacji. Zobacz
Odpowiedzi dotyczące wysokości względnej
.
|
5 |
Dodaj dane o wysokości do własnej aplikacji. |
Dzięki danym o wysokości możesz zwiększyć skuteczność aplikacji korzystających z lokalizacji, np. aplikacji sportowych
aktywności ani danych ankietowych.
|
Dostępne biblioteki klienta
Wywołaj ten interfejs API w języku
możesz wybrać za pomocą jednej z tych bibliotek klienta:
klient Java, Python, Go i Node.js dla Map Google;
Usługi to obsługiwane przez społeczność biblioteki klienckie udostępniane na zasadach open source
Licencja Apache 2.0
Pobierz je z GitHuba, gdzie znajdziesz też instrukcje instalacji i przykładowy kod.
Co dalej?
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-08-31 UTC.
[null,null,["Ostatnia aktualizacja: 2025-08-31 UTC."],[[["\u003cp\u003eThe Elevation API provides elevation data for locations on Earth, enabling applications with elevation-sensitive features.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve elevation for single points or calculate elevation differences along paths, useful for activities like hiking or biking.\u003c/p\u003e\n"],["\u003cp\u003eThe API accepts latitude/longitude coordinates and returns elevation data in meters relative to local mean sea level, with resolution information.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can access the Elevation API through various client libraries (Java, Python, Go, Node.js) and integrate it into their applications.\u003c/p\u003e\n"],["\u003cp\u003eTo get started, set up a Google Cloud project, try sample requests, and explore the documentation for detailed usage instructions.\u003c/p\u003e\n"]]],[],null,["The Elevation API is a service that returns elevation data for\na location on the earth, or sampled elevation data along paths.\n\nWhy use the Elevation API\n\nWith the Elevation API, you can develop applications to support your\ncustomers with elevation-sensitive activities, positioning applications, or low-surveying\napplications that include elevations and elevation changes along routes. For example,\nyou can provide elevation gain and loss data to enhance a sports application for activities such\nas hiking, biking, or scuba diving.\n\nWhat you can do with the Elevation API\n\nWith the Elevation API, you can include elevation data in your\napplications or on a map. For example:\n\n- Get the **elevation** for a particular place.\n- Calculate the **differences** in elevation along a route or between two points.\n\nHow the Elevation API works The Elevation API accepts a request as an encoded URL with latitude/longitude coordinates provided as either discrete locations, or as a series of locations along a path. This request, for example, queries elevation for the center of Denver, Colorado, specifying a return in JSON format. \n\n```scdoc\n https://maps.googleapis.com/maps/api/elevation/json\n ?locations=39.7391536%2C-104.9847034\n &key=YOUR_API_KEY\n```\n\nThe service derives the elevation for the provided coordinates. It also interpolates\nelevation for a location without elevation, providing an average returned from the four\nnearest locations that do provide elevation data. Finally, it determines the overall\nresolution for the location.\n\nResources\n\nThe following table summarizes the resources available through the\nElevation API along with the data it returns.\n\n| Data resources | Data returned | Return format |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|\n| **Latitude/longitude coordinates** You can provide data as a set of one or more locations, or as a series along a path. You can also provide encoded coordinates. Pass up to 512 coordinates. | The Elevation API provides **elevation in meters** relative to the **local mean sea level** (LMSL). Elevation can be returned as positive or negative values as indicated below: - **Positive values** indicate locations above LMSL, including surface locations or the bottom of high-altitude lakes. - **Negative values** indicate locations that are below LMSL, including locations on the surface or the ocean floor. - **Resolution** indicates the distance between the data point and the elevation, in meters. | - JSON - XML |\n\nHow to use the Elevation API\n\n|---|---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 1 | **Get set up.** | Start with [Set up your Google Cloud project](/maps/documentation/elevation/cloud-setup) and complete the setup instructions that follow. |\n| 2 | **Try an elevation request** | Once you have an API key, you can start testing out the Elevation API directly from your browser. See [Sample requests](/maps/documentation/elevation/start#sample-request) in the *Getting started* guide for details. |\n| 3 | **Compose a more complex request** | Once you are set up with a project, try a request that supplies a location data along a path. See [Specifying paths](/maps/documentation/elevation/requests-elevation#Paths) for details. |\n| 4 | **Understand response basics** | Explore the elevation data responses to prepare to use elevation data for your app. See [Elevation responses](/maps/documentation/elevation/requests-elevation#ElevationResponses) for details. |\n| 5 | **Incorporate elevation data into your own app!** | You can use elevation data to enhance location-based apps, such as apps for sports activities or for survey data. |\n\nAvailable client libraries\n\nCall this API in the language of\nyour choice through one of the following client libraries:\n\n- [Java\n Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-java)\n- [Python\n Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-python)\n- [Go Client\n for Google Maps Services](https://github.com/googlemaps/google-maps-services-go)\n- [Node.js\n Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-js)\n\nThe Java Client, Python Client, Go Client and Node.js Client for Google Maps\nServices are community-supported client libraries, open sourced under the\n[Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).\nDownload them from GitHub, where you can also find installation instructions and sample code.\n\nWhat's next\n\n- **Start using the Elevation API** : Go to [Set up your\n Google Cloud project](/maps/documentation/elevation/cloud-setup).\n- **Try getting path-based elevation data** : Go to [Specifying paths](/maps/documentation/elevation/requests-elevation#Paths)\n- **Follow best practices** : Go to [Web Service\n Best Practices](/maps/documentation/elevation/web-service-best-practices)."]]