Back to data catalog
Geocoding and reverse-geocoding based on OpenStreetMap®-data
OpenAPI Spec
Explore the OpenAPI spec for OpenEPI Geocoding API
Git Repository
Explore the source code behind OpenEPI Geocoding API
Client Libraries
Explore the client libraries for OpenEPI Geocoding API
Documentation
Explore the documentation for OpenEPI Geocoding API
The API is exclusively fetching data from https://photon.komoot.io. The service is based on OpenStreetMap® data, which is licensed under the Open Data Commons Open Database License (ODbL) , by the OpenStreetMap Foundation (OSMF) .
The data obtained from https://photon.komoot.io is presented as is, without any further processing or modification.
Returns a GeoJSON FeatureCollection of places matching the search query
1from openepi_client import GeoLocation
2from openepi_client.geocoding import GeocodeClient
3from openepi_client.geocoding import AsyncGeocodeClient
4
5# sync
6
7# Searching for the coordinates to a named place
8feature_collection = GeocodeClient.geocode(q="Kigali, Rwanda")
9# Geocode with priority to a lat and lon
10feature_collection = GeocodeClient.geocode(q="Kigali, Rwanda", geolocation=GeoLocation(lat=51.5074, lon=0.1278))
11
12# async
13
14# Searching for coordinates for a location
15feature_collection = await AsyncGeocodeClient.geocode(q="Kigali, Rwanda")
16# Geocode with priority to a lat and lon
17feature_collection = await AsyncGeocodeClient.geocode(q="Kigali, Rwanda", geolocation=GeoLocation(lat=51.5074, lon=0.1278))
1import io.openepi.geocoding.api.GeocodingApi;
2import io.openepi.geocoding.model.FeatureCollection;
3import io.openepi.common.ApiException;
4
5public class Main {
6 public static void main(String[] args) {
7 GeocodingApi api = new GeocodingApi();
8 try {
9 FeatureCollection response = api.geocodingGet("Berlin");
10
11 // Prints the coordinates of the first result
12 System.out.println(response.getFeatures().get(0).getGeometry().getPoint().getCoordinates());
13 } catch (ApiException e) {
14 System.err.println("Exception when calling GeocodingApi#geocodingGet");
15 e.printStackTrace();
16 }
17 }
18}
1import { GeocoderClient } from 'openepi-client';
2
3const client = new GeocoderClient();
4
5client.getGeocoding({ q: 'Berlin' }).then((result) => {
6 const { data, error } = result;
7 if (error) {
8 console.error(error);
9 } else {
10 console.log(data);
11 }
12});
Returns a GeoJSON FeatureCollection of places near the provided coordinate
1from openepi_client import GeoLocation
2from openepi_client.geocoding import GeocodeClient
3from openepi_client.geocoding import AsyncGeocodeClient
4
5# sync
6feature_collection = GeocodeClient.reverse_geocode(geolocation=GeoLocation(lat=51.5074, lon=0.1278))
7
8# async
9feature_collection = await AsyncGeocodeClient.reverse_geocode(geolocation=GeoLocation(lat=51.5074, lon=0.1278))
1import io.openepi.geocoding.api.GeocodingApi;
2import io.openepi.geocoding.model.FeatureCollection;
3import io.openepi.common.ApiException;
4import java.math.BigDecimal;
5
6public class Main {
7 public static void main(String[] args) {
8 GeocodingApi api = new GeocodingApi();
9 try {
10 BigDecimal lat = new BigDecimal("52.5200");
11 BigDecimal lon = new BigDecimal("13.4050");
12 FeatureCollection response = api.reverseGeocodingReverseGet(lat, lon, null, null);
13
14 // Prints the name of the first result
15 System.out.println(response.getFeatures().get(0).getProperties().getName());
16 } catch (ApiException e) {
17 System.err.println("Exception when calling GeocodingApi#reverseGeocodingReverseGet");
18 e.printStackTrace();
19 }
20 }
21}
1import { GeocoderClient } from 'openepi-client';
2
3const client = new GeocoderClient();
4
5client.getGeocoding({ lon: 22.260536, lat: 4.882569 }).then((result) => {
6 const { data, error } = result;
7 if (error) {
8 console.error(error);
9 } else {
10 console.log(data);
11 }
12});