Class Index | File Index

Classes


Class eniro.maps.Srs


Defined in: Srs.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
eniro.maps.Srs(id, name)
Unit of a Spatial Reference System.
Field Summary
Field Attributes Field Name and Description
<static> <constant>  
eniro.maps.Srs.SPHMERC
Spherical Mercator, Google style - EPSG:900913.
<static> <constant>  
eniro.maps.Srs.WGS84
World Geodetic System (WGS84) - EPSG:4326.
Method Summary
Method Attributes Method Name and Description
 
approxEquals(x1, y1, x2, y2, tol)
Compares the two given values in this Srs and tells if they are approximately equal.
 
equals(other)
Compare this instance with another instance.
 
Returns the SRS ID.
 
Returns the SRS human readable name.
Class Detail
eniro.maps.Srs(id, name)
Unit of a Spatial Reference System. Instances of this class is used in Coordinate to type the coordinate system.
Parameters:
{string} id
The identifier of the spatial reference system such as 'EPSG:4326'
{string} name
Human readable name of this system such as 'WGS84'.
Field Detail
<static> <constant> eniro.maps.Srs.SPHMERC
Spherical Mercator, Google style - EPSG:900913.

<b>TMS Global Mercator Profile</b>
---------------------------
Spherical Mercator projection, EPSG:900913 (EPSG:gOOglE, Google
Maps Global Mercator), EPSG:3785, OSGEO:41001.
Such tiles are compatible with Google Maps, Microsoft Virtual
Earth, Yahoo Maps, UK Ordnance Survey OpenSpace API, ...  and you
can overlay them on top of base maps of those web mapping
applications.
Pixel and tile coordinates are in TMS notation (origin [0,0] in
bottom-left).
<b>What coordinate conversions do we need for TMS Global Mercator tiles</b>
    LatLon      <->       Meters      <->     Pixels    <->       Tile
WGS84 coordinates   Spherical Mercator  Pixels in pyramid  Tiles in pyramid
    lat/lon            XY in metres     XY pixels Z zoom      XYZ from TMS
   EPSG:4326           EPSG:900913
    .----.              ---------               --                TMS
   /      \     <->     |       |     <->     /----/    <->      Google
   \      /             |       |           /--------/          QuadTree
    -----               ---------         /------------/
  KML, public         WebMapService         Web Clients      TileMapService
<b>What is the coordinate extent of Earth in EPSG:900913?</b>
[-20037508.342789244, -20037508.342789244, 20037508.342789244,
20037508.342789244] Constant 20037508.342789244 comes from the
circumference of the Earth in meters, which is 40 thousand
kilometers, the coordinate origin is in the middle of extent.  In
fact you can calculate the constant as: 2 * math.pi * 6378137 / 2.0
$ echo 180 85 | gdaltransform -s_srs EPSG:4326 -t_srs EPSG:900913
Polar areas with abs(latitude) bigger then 85.05112878 are clipped
off.
<b>What are zoom level constants (pixels/meter) for pyramid with EPSG:900913?</b>
whole region is on top of pyramid (zoom=0) covered by 256x256
pixels tile, every lower zoom level resolution is always divided by
two initialResolution = 20037508.342789244 * 2 / 256 =
156543.03392804062
<b>What is the difference between TMS and Google Maps/QuadTree tile name convention?</b>
The tile raster itself is the same (equal extent, projection, pixel
size), there is just different identification of the same raster
tile.  Tiles in TMS are counted from [0,0] in the bottom-left
corner, id is XYZ.  Google placed the origin [0,0] to the top-left
corner, reference is XYZ.  Microsoft is referencing tiles by a
QuadTree name, defined on the website:
http://msdn2.microsoft.com/en-us/library/bb259689.aspx
<b>The lat/lon coordinates are using WGS84 datum, yeh?</b>
Yes, all lat/lon we are mentioning should use WGS84 Geodetic Datum.
Well, the web clients like Google Maps are projecting those
coordinates by Spherical Mercator, so in fact lat/lon coordinates
on sphere are treated as if the were on the WGS84 ellipsoid.
From MSDN documentation:
To simplify the calculations, we use the
spherical form of projection, not the ellipsoidal form. Since the
projection is used only for map display, and not for displaying
numeric coordinates, we don't need the extra precision of an
ellipsoidal projection. The spherical projection causes
approximately 0.33 percent scale distortion in the Y direction,
which is not visually noticable.
See:
Documentation copied from http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/globalmaptiles.py

<static> <constant> eniro.maps.Srs.WGS84
World Geodetic System (WGS84) - EPSG:4326.
See:
http://en.wikipedia.org/wiki/World_Geodetic_System
Method Detail
approxEquals(x1, y1, x2, y2, tol)
Compares the two given values in this Srs and tells if they are approximately equal.
Parameters:
{number} x1
Coordinate 1 x.
{number} y1
Coordinate 1 y.
{number} x2
Coordinate 2 x.
{number} y2
Coordinate 2 y.
{number} tol
Tolerance of error in meters. This is set to things like 10, 100 or 1000.
Returns:
true if the two values are approximately equal given the tolerance.

{boolean} equals(other)
Compare this instance with another instance.
Parameters:
{eniro.maps.Srs} other
The instance to compare this instance to.
Returns:
{boolean} true If this instance is equal to the given one.

{string} getId()
Returns the SRS ID.
Returns:
{string} The SRS ID such as 'EPSG:4326' (WGS84), or 'EPSG:900913' (Spherical Mercator google name).

{string} getName()
Returns the SRS human readable name.
Returns:
{string} The SRS human readable name.

Documentation generated by JsDoc Toolkit 2.3.2 on Mon Mar 30 2020 12:10:04 GMT+0200 (CEST)