Nowadays the standard web map that can be seen on various websites is constructed in Spherical Mercator projection. Web maps published in WGS84 are a specialty available for use in MapTiler Cloud. The best use of WGS84 is with your not post-processed data gathered from Navstar GPS, Galileo, GLONASS. Global coverage of WGS84 is not limited by ±85° of latitude as for Spherical Mercator.
Afterward, there are steps by step on how to create your own style for OpenStreetMap in WGS84.
Important notice
Where to find WGS84 tiles and map in MapTiler Cloud. How to use them. What are the benefits and drawbacks of using WGS84 tiles? And how can I apply my own style on WGS84 tiles?
OpenStreetMap in WGS84
This article answers questions such as:
-
Why WGS84 coordinate system should be used?
-
Where should it be used?
-
What advantages and disadvantages does it propose?
-
How to use style with WGS84 tiles?
The majority of web map applications use the Spherical Mercator (Pseudo-Mercator, Web Mercator) (EPSG::3857), which shows the world as a square that can be further thought of as a pixel. On the other hand, World Geodetic System 1984 (WGS84, EPSG::4326) is showing the world as a rectangle with an aspect ratio of 2:1. This geographic coordinate system (using latitude φ and longitude λ calculated from the mass center of the Earth) is accurate thanks to the new system of earth position gathering based on satellites on Medium Earth orbit - Navstar GPS (Global Positioning System).
The next two images are showing Tissot's Indicatrix for WGS84 and Spherical Mercator, where the red dots represent the length distortions for a single point. The larger the area of the point, the bigger the area of distortion. Ellipses, unlike the circles, represent distortion in the direction of the main axis.
The values of latitude and longitude are in the address panel e.g. for Zurich, Switzerland https://api.maptiler.com/maps/basic-4326/?key=ikPbJwwEEbaMHCvgAxpQ#10/47.4/8.5.
47.4° North latitude and 8.5° East longitude.
Implementation of the WGS84 geographic coordinate system into your map application can be done through MapTiler Cloud, where your map and tiles are prepared. It is possible to use vector tiles, raster tiles, Web Map Tile Service (OGC WMTS), or static map images.
All variants of serving WGS84 map are prepared for copy-paste usage. These are prepared as a sample code for the OpenLayers library or as end-nodes in TileJSON or XYZ format. For any other coordinate system than Spherical Mercator (EPSG::3857) is possible to use only the OpenLayers library which handles reprojecting.
After signing into your account and clicking on OpenMapTiles WGS84
you will be able to find sections “Use vector style”, “Raster tiles” “Web Map Tile Service” and “Static map as an image”
After clicking on “OpenLayers with vector tiles” under “Use vector style”, you will be able to copy an example code of implementation into your application.
The biggest advantage to having a background map in WGS84 is for overlaying spatial data also in WGS84. You do not have to transform data between WGS84 (in degrees) and Spherical Mercator (in meters). If you are gathering data from global positioning satellite systems (GNSS) such as Galileo, Navstar GPS, Glonass, … you do not have to post-process the data to put them on the map.
Both WGS84 (EPSG::4326) and Spherical Mercator (EPSG::3857) use the same spheroid (reference surface) WGS84 (yes, with the same name) EPSG::7030. It means that transformation between the geographic coordinate system (WGS84) and the projected coordinate system (Spherical Mercator) is lossless in terms of precision.
The data source for creating WGS84 tiles is OpenStreetMap. Even though WGS84 is able to project polar regions (anything between -90° -> -85.051° and 85.051° -> 90° ) it is limited by Spherical Mercator bounds (-180, -85.051129, 180, 85.051129), so the map close to the polar regions is empty.
Spherical Mercator projection preserves angles (needed for sailing navigation) but from the equator to both directions (north and south) area proportions are highly deformed (see Tissot’s Indicatrix above). WGS84 projection is equidistant along any meridian and the equator.
The biggest disadvantage is a more difficult setup for map applications, which has to be powered by the OpenLayers library.
How to create a style for WGS84
To customize or create a brand new style, it is possible to use MapTiler Customize or MapTiler Editor tools. For detailed information about MapTiler Customize please read the article Make your own map design. For more info about MapTiler Editor please read Advanced map customization.
Both tools are able to modify maps only in Spherical Mercator (EPSG::3857) but is possible to change source tiles.
When you created your desired style in MapTiler Customize or MapTiler Editor, then download it, open style.json,
and adjust just two rows at the very end:
-
name → there is
name
tag where you can change the name of your style for WGS84-
e. g. -
"name": "streets_wgs84"
-
-
url → under
source - openmaptiles - url
, where the original tiles have urlhttps://api.maptiler.com/tiles/v3/tiles.json?key={key}
and you just change it on https://api.maptiler.com/tiles/v3-4326/tiles.json?key={key}
"name": "streets_wgs84", "sources": { "maptiler_attribution": { "attribution": "<a href=\"https://www.maptiler.com/copyright/\" target=\"_blank\">© MapTiler</a> <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">© OpenStreetMap contributors</a>", "type": "vector" }, "openmaptiles": { "type": "vector", "url": "https://api.maptiler.com/tiles/v3-4326/tiles.json?key={key}" } }
3. Upload this new style.json
into your account from Maps - New Maps - Upload style
With these steps, you can get your new style function with WGS84 tiles
Conclusion
Usage and implementation of the WGS84 coordinate system for tiles is straightforward in MapTilerCloud. There are significant advantages of the usage of WGS84 such as direct usage of gathered data from GNSS like Navstar GPS, Galileo, GLONASS. The major disadvantage is slightly more demanding programming skills for implementation into your web application.
It is possible to create your own style for WGS84. The first step is to create the style for Spherical Mercator, then download it, manually adjust it and upload it back into MapTiler Cloud.
Useful links
GitHub - OpenMapTiles Cluster
Youtube - Create and host tiles in national coordinate systems
About coordinate systems
Tissot Indicatrix World Map Mercator Projection
OGC Vector Tiles
Map Projections
Comments
0 comments
Please sign in to leave a comment.