Web Mercator Projection and Raster Tile Maps
Total Page:16
File Type:pdf, Size:1020Kb
Annual Conference – 2017 – Ottawa May 31- June 2, 2017 Web Mercator Projection & Raster Tile Maps Two cornerstones of Online Map Service Providers Emmanuel Stefanakis Dept. of Geodesy & Geomatics Engineering University of New Brunswick [email protected] Online Map Service Providers O Available for ~12 years O Well established (difficult to remember how life was without them) 2 Online Map Service Providers 3 Online Map Service Providers Challenges ? • Technological • Cartographical 4 Online Map Service Providers Framework Request (where/what/resolution) CLIENT SERVER HTTP Map Product Map Service End-users Map Repository (Data+Images) 5 Technological Challenges O High and steadily increasing demand O Voluminous data (vectors and images) O Bandwidth limitations O Concurrent access O Security issues O Data protection 6 Cartographical Challenges O Visualize the map on Web browser O flat/rectangular monitor O Multi-resolution representation O various zoom levels O Multi-theme mapping O various themes (layers) O Multi-language mapping O various languages 7 Online Map Service Providers Web Mercator Projection Raster Tile Maps 8 Map Product Flat Monitor Request (where/what/resolution) CLIENT SERVER HTTP Map Product Map Service Map Repository (Data+Images) 9 Map Projection O A function f ... φ Y λ (Χ,Υ) ƒ(φ, λ) X 10 Choose a Map Projection 11 Choose a Cylindrical O Best fit O Rectangular grid 12 Conical Projection ? 13 Conical Projection ? 14 Cylindrical Projection ? 15 Cylindrical Projection O Simulation of a cylindrical projection 16 Cylindrical Projection O Simulation of a cylindrical projection 17 Which Cylindrical? Plate Carree Miller’s Mercator 18 Mercator Projection O Most popular O Conformal O Easy math (low complexity) O …to serve high demand 19 Mercator Projection O Conformal O Support navigation in Seas 1512-1594 2πRcos(φ) < 2πR 2πR φ 2πR 2πR Y λ X 20 Mercator Projection 2πR 2πR 21 Mercator Projection Scale factor on horizontal (along parallels at φ): 2πRcos(φ) 2πR Mercator’s goal preserve shapes/directions 22 Mercator Projection Scale factor on horizontal (along parallels at φ): 2πRcos(φ) 2πR Mercator applied… Scale factor on vertical (along meridians at φ): 2πRcos(φ) 2πR 23 Mercator Projection All parallels have the same length = equator (2πR) φ At latitude φ the scale factor on the parallel is equal to: 2πR secφ 2πRcosφ 24 Mercator Projection Mercator applied the same factor on the parallels… φ2 dN The actual distance between φ1 two parallels at latitude φ is equal to: dN = R dφ He made it equal to: dN = R secφ dφ 25 Mercator Projection By integrating the last formula we get: (sphere) φ o φ N R secφ dφ Rlntan45 0 2 North pole φ N equator South pole 2πR 26 Mercator Projection O Spherical Formulas Easting Northing P(Es , Ns) P(φs , λs) Spherical Formulas Sphere 27 Mercator Projection O Ellipsoidal Formulas Easting Northing P(Ee , Ne) P(φe , λe) Ellipsoidal Formulas WGS’84 28 Mercator Projection O Spherical Formulas Easting Northing O Ellipsoidal Formulas Easting Northing 29 Adopt Mercator Projection Request (where/what/resolution) CLIENT SERVER HTTP Map Product Map Service O Ellipsoid Coordinates O Mercator Projection Map Repository (Data+Images) 30 Web Mercator O Make it even less computational expensive O Ellipsoid Coordinates – Spherical Formulas P(φ , λ ) e e P(E, N) WGS’84 Spherical Formulas P(φs , λs) Web Mercator Sphere 31 Online Map Service Providers Web Mercator Projection 32 Web Mercator (vs) Mercator O Mercator basic properties are lost O Non-Conformal O Loxodromes Not straight lines O Rationale (Google) O Simpler calculations O Map to be projected on a computer monitor O No body can notice the differences 33 34 Criticism O Geodesy Subcommittee of the Oil and Gas Producers (aka EPSG) rejected it in 2008 as “technically flawed” & “an inappropriate geodesy and cartography” O National Geospatial-Intelligence Agency of the US Department of Defense declared it as “unacceptable for any official use, because a general lack of understanding of its properties has caused considerable confusion and misuse” 35 A Code for Web Mercator O An unofficial code “900913” (GOOGLE spelled with numbers) was initially assigned O Later, EPSG introduced an official identifier: EPSG:3857 -- WGS84 Web Mercator (Auxiliary Sphere) 36 Web Mercator Map of the World O Absolute square… 85.051129 North O Very convenient in panning, tiling, and indexing 40,075,017.25 85.051129 South 40,075,017.25 37 Online Map Service Providers Challenges ? • Technological • Cartographical 38 How to deliver the map product? Request (where/what/resolution) CLIENT SERVER HTTP Map Product Map Service Map Repository (Data+Images) 39 How to deliver the map product? One map? SERVER Map Service Map Repository (Data+Images) Web Mercator 40 How to deliver the map product? One map? SERVER Map Service Map Repository (Data+Images) Map product: Web Mercator Various areas 41 How to deliver the map product? One map? SERVER Map Service Map Repository (Data+Images) Map product: Web Mercator Various resolution 42 How to deliver the map product? One map? SERVER Map Service Map Repository (Data+Images) Map product: Various theme Web Mercator Various language 43 One map ? Multiple themes SERVER Multiple Languages Map Service On-the-fly rendering ? Map Repository (Data+Images) 44 On-the-fly generalization ? 45 Use of Map Tiles Request (where/what/resolution) CLIENT SERVER HTTP Map Product Map Service One map not an option Preprocessing generation of map tiles Map Repository (Data+Images) 46 Online Map Service Providers Raster Tile Maps 47 Use of Map Tiles Request (where/what/resolution) CLIENT SERVER HTTP Map Product Map Service Preprocessing generation of tiles Map Repository (Data+Images) 48 Tiled maps O A series of precompiled maps… O for… various areas O in… various resolutions Map Repository (Data+Images) 49 Tiled maps – An old practice O Old practice… O Sheet Division and Organization of Topographic maps Map Repository (Data+Images) 50 Sheet Division & Organization O Topographic Maps 51 Sheet Division & Organization O NRCan: National Topographic Map Index 52 Web Mapping Tiled Maps O Web mapping O rapid growth of map data availability O rapid growth of demand O Use of map tiles (slippy maps) O pre-computation and caching of map image tiles O map servers use far fewer resources than maps rendered on demand O delivery only limited by the bandwidth of the connection with the map server 53 Tiled Maps O Google… O was the first major mapping provider to adopt the tiled web maps O Others followed… O Bing and OpenStreetMap, Esri and Oracle O provide functionality for map tiling and caching of vector layers and/or raster images 54 Google Maps O Conventions… O All map tiles O Square-shaped and equal-sized O 256x256 pixels O World rendered in a single tile at the outer most zoom level: 0 O Projection: Web Mercator O latitude values [-85.0511, +85.0511] degrees 55 Google Maps column row x 0,0 1,0 2,0 3,0 0,0 1,0 0,1 1,1 2,1 3,1 y 0,0 0,2 1,2 2,2 3,2 0,1 1,1 0,3 1,3 2,3 3,3 Zoom Level: 0 Zoom Level: 1 Zoom Level: 2 Number of Tiles: 1 Number of Tiles: 4 Number of Tiles: 16 56 Bing Maps O Quadtree encoding: Quadkeys 57 Google Maps – Zoom Level [0-24] 58 59 to Zoom Level 23… http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/ 60 #Tiles & Pixel size / LEVEL TILES/LEVEL Pixel Size (m) Zoom Level 0 1 156,543.034 1 4 78,271.517 2 16 39,135.758 3 64 19,567.879 4 256 9,783.940 5 1,024 4,891.970 6 4,096 2,445.985 7 16,384 1,222.992 8 65,536 611.496 9 262,144 305.748 10 1,048,576 152.874 11 4,194,304 76.437 12 16,777,216 38.219 13 67,108,864 19.109 14 268,435,456 9.555 15 1,073,741,824 4.777 16 4,294,967,296 2.389 17 17,179,869,184 1.194 18 68,719,476,736 0.597 19 274,877,906,944 0.299 20 1,099,511,627,776 0.149 21 4,398,046,511,104 0.075 22 17,592,186,044,416 0.037 23 70,368,744,177,664 0.019 Each tile: 256x256 pixels 24 281,474,976,710,656 0.009 4 ^ LEVEL 2πR/(256*2^LEVEL) GRS80 (eq) 6,378,137.00 m Circumference (2πR) 40,075,016.69 m 61 Map Tile Management Kotsollaris, M., 2017. A Scalable Web Tiled Map Management System. MScE Thesis. University of New Brunswick. 62 Interoperability across multiple Map Providers http://docs.opengeospatial.org/wp/16-019r4/16-019r4.html 63 Online Map Service Providers Web Mercator Projection Raster Tile Maps 64 References O Stefanakis, E., 2015. Web Mercator: the de facto standard, the controversy, and the opportunity. GoGeomatics. Magazine of GoGeomatics Canada. October 2015. O Stefanakis, E., 2015. Map Tiles and Cached Map Services. GoGeomatics. Magazine of GoGeomatics Canada. December 2015. O MapTiler. Tiles à la Google Maps: Coordinates, Tile Bounds and Projection. http://www.maptiler.org/google-maps-coordinates-tile- bounds-projection/ O Tilesets: Google Maps Structure – MicroImages. http://www.microimages.com/documentation/TechGuides/78goo gleMapsStruc.pdf 65 .