Coordinates
This page provides an overview of the Coordinates API from MapTiler. The API offers a comprehensive set of functionalities for working with geographical coordinates, such as searching the coordinate system and transforming coordinates between coordinate systems. In combination with other MapTiler services, such as Geocoding, IP Geolocation API, and elevation lookup, makes it easier to build location-aware applications or services.
To use the Coordinates API, you need to get an API key from MapTiler Cloud. This key is used to authenticate your requests in the platform and it can help you track usage in the Analytics tool.
About Coordinates API
MapTiler Coordinates API has been introduced for improved security, scalability, and sustainability. This new API requires registration but remains free for non-commercial use. Commercial use requires a paid MapTiler Cloud plan. MapTiler Coordinates API is a service that allows users to perform various operations related to any coordinates. This API enables developers to convert coordinates from one coordinate system to another. The Coordinates API provides, among othe features, lookup and transformation of coordinates. The documentation examples are listed below:
- Lookup: https://docs.maptiler.com/cloud/api/coordinates/#search-coordinate-systems
- Transformation: https://docs.maptiler.com/cloud/api/coordinates/#transform-coordinates
Coordinates transformation
The universal transform URL format is:
https://api.maptiler.com/coordinates/transform/{COORDS}.json?s_srs={CODE}&to_srs={CODE}
Parameters | Description | Example |
---|---|---|
COORDS | Pair (x,y ) or triplets (x,y,x ) of coordinates separated by comma (, ) |
17,50 17,50,300 |
s_srs | Source coordinate reference system | 4326 |
t_srs | Target coordinate reference system definition | 5514 |
ops | List of coordinate of operations separated by | |
1623 |
Example of a coordinate transformation URL call:
https://api.maptiler.com/coordinates/transform/17,50.json?s_srs=4326&t_srs=5514&ops=1623
Batch coordinates transformation
MapTiler Coordinates API supports batch transform coordinates, transforming more than one point pair (x,y
) or triplets (x,y,z
) request in a single API call. You can perform batch coordinate transformation by calling the standard Coordinate API transform endpoint https://api.maptiler.com/coordinates/transform/{COORDS}.json
. Just make sure you use semicolons ;
to separate individual point pairs (up to 50 points).
Example
Request
https://api.maptiler.com/coordinates/transform/17,50;17.1,50.1.json?s_srs=4326&t_srs=5514?key=YOUR_MAPTILER_API_KEY_HERE
Response
{
"transformer_selection_strategy": "auto",
"results": [
{
"x": -560595.6992028592,
"y": -1074706.2565340507,
"z": 0
},
{
"x": -552340.3607729311,
"y": -1064368.376869001,
"z": 0
}
]
}
The result is JSON format with nested point pairs under the results
key.
For more details, go to the Coordinates API Transform documentation.
Searching coordinate systems
The universal transform URL format is:
https://api.maptiler.com/coordinates/search/{QUERY}.json?PARAMS
Parameters | Description | Example |
---|---|---|
QUERY | Query on CRS | 2056.json swiss.json czechia deprecated:1.json |
PARAMS | Parameter for showing exports in WKT and Proj4, limit the number of results of show transformations. | swiss.json?limit=1 exports=true&limit=5 |
Example
Request
https://api.maptiler.com/coordinates/search/swiss lv95.json?exports=true
Response
{
"results": [
{
"id": {
"authority": "EPSG",
"code": 2056
},
"kind": "CRS-PROJCRS",
"name": "CH1903+ / LV95",
"exports": {
"proj4": "+proj=somerc +lat_0=46.9524055555556 +lon_0=7.43958333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs +type=crs",
"wkt": "PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1903+\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128],TOWGS84[674.374,15.056,405.346,0,0,0,0]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"latitude_of_center\",46.9524055555556],PARAMETER[\"longitude_of_center\",7.43958333333333],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2600000],PARAMETER[\"false_northing\",1200000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2056\"]]"
},
"unit": "metre",
"accuracy": 1,
"area": "Liechtenstein; Switzerland.",
"bbox": [
5.96,
45.82,
10.49,
47.81
],
"deprecated": false,
"default_transformation": {
"authority": "EPSG",
"code": 1676
},
"transformations": [
1509,
1647,
1676,
8457
]
}
],
"total": 1
}
More details about the search and its parameters is available at Coordinates API Search Documentation.