Coordinates API
This article provides an overview of the Coordinates API from MapTiler. It describes individual path and query parameters, and it also shows how to search, transform, and export item objects.
To use the Coordinates API, you need to sign up for a MapTiler Cloud account and obtain an API key. This key is used to authenticate your requests in the platform and it can help you track usage in the Analytics tool. The key also enhances your app’s security.
About Coordinates API
MapTiler Coordinates API has been introduced for improved security, scalability, and sustainability. This new API requires registration but remains free. 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 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-SECURE-KEY
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, please visit 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.
Conclusion
Overall, the MapTiler Coordinates API offers a comprehensive set of functionalities for working with geographical coordinates, mainly searching 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.
Useful links
Migrate from EPSG.io to MapTiler Coordinates API
EPSG Geodetic parameter dataset
MapTiler Coordinates API
Related guides
- Automatically created API key
- Check if MapLibre GL JS is supported
- Coordinates API
- Dataset upload - formats and limits
- Difference between 256x256, 512x512, and HiDPI/Retina rasterized tiles
- Exported Tiles Multiplier
- Generalization in maps
- How are the tile requests cached in web browser?
- How MapTiler map tiles are Generated and Delivered
- How to add Geocoding control to Maplibre GL JS map