Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 96 lines (69 sloc) 4.226 kb
f7cbef2 @trey0 README.rst: documented coordinate frames and transforms
trey0 authored
1 Installation
2 ============
3
09c38e9 @trey0 initial app creation from template
trey0 authored
4 Fill me in
5
f7cbef2 @trey0 README.rst: documented coordinate frames and transforms
trey0 authored
6 Coordinate Systems
7 ==================
8
9 MapFasten uses two main coordinate systems:
10
11 * The image coordinate system measures position in pixels (x, y) where
12 (0, 0) is the upper-left corner of the image, x increases to the
13 right, and y increases down.
14 * The Spherical Mercator coordinate system expresses position on the
15 Earth's surface. (x, y) coordinates. Roughly speaking, x increases to
16 the east and y increases to the north. The origin matches the origin
17 in lat/lon coordinates. The scale of the units approximates
18 displacement in meters. This system is also known as EPSG:3857 or
19 EPSG:900913.
20
21 Two-way conversions between lat/lon and Spherical Mercator can be found
22 in the ``latLonToMeters`` and ``metersToLatLon`` functions:
23
24 * `JavaScript coordinate conversions <https://github.com/geocam/geocamTiePoint/blob/master/geocamTiePoint/static/geocamTiePoint/js/coords.js>`_
25 * `Python coordinate conversions <https://github.com/geocam/geocamTiePoint/blob/master/geocamTiePoint/quadTree.py>`_
26
27 Some other references:
28
29 * `Google Maps Coordinates, Tile Bounds, and Projection <http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/>`_
30 * `PROJ.4 FAQ: Google Mercator <http://trac.osgeo.org/proj/wiki/FAQ#ChangingEllipsoidWhycantIconvertfromWGS84toGoogleEarthVirtualGlobeMercator>`_
31
32 Export Format
33 =============
34
35 Exporting an overlay produces a gzip-compressed tar archive containing
36 Google Maps image pyramid tiles from the aligned overlay along with
37 additional meta-data files. *NOTE: We may change the format of these
38 files going forward.*
39
40 Meta-Data Format: meta.json
41 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
42
43 The ``transform`` field represents a best-fit transform that maps image
44 coordinates to Spherical Mercator coordinates. Depending on the number
45 of tie points specified, the transform can be expressed in two forms:
46
47 * ``"type": "projective"``. This is a 2D projective transform. Used when
48 fewer than 7 tie point pairs are specified. The ``matrix`` field is a
49 3x3 transformation matrix ``M`` specified in row-major order. To apply
50 the transform:
51
52 * Start with image coordinates ``(x, y)``.
53
54 * Convert to a length-3 column vector ``u`` in homogeneous coordinates: ``u = (x, y, 1)``
55
56 * Matrix multiply ``(x0, y0, w) = M * u``.
57
58 * Normalize homogeneous coordinates: ``x' = x0 / w``, ``y' = y0 / w``.
59
60 * The resulting Spherical Mercator coordinates are ``(x', y')``.
61
62 * ``"type": "quadratic2"``. This transform is similar to the projective
63 transform but adds higher-order terms to achieve a better fit when
64 the overlay image uses a different map projection from the base
65 layer. Used when 7 or more tie point pairs are specified. Please
66 refer to the code for full details. Some points of interest:
67
68 * Note that despite the name, this transform is *not* exactly
69 quadratic. In order to ensure the transform has a simple analytical
70 inverse, corrections are applied serially, which incidentally
71 introduces some 4th-order and 6th-order terms.
72
73 * The ``matrix`` field has essentially the same interpretation as for
74 the 'projective' transform.
75
76 * In order to help with numerical stability during optimization, the
77 last step of the transform is to scale the result by 1e+7. Because
78 of this, the matrix entries will appear much smaller than those in
79 the projective transform.
80
81 * The coefficients for higher-order terms are encoded in the
82 ``quadraticTerms`` field. If all of those terms are 0, the
83 ``quadratic2`` transform reduces to a ``projective`` transform.
84
85 See the alignment transform reference implementations in the
86 ``ProjectiveTransform`` and ``QuadraticTransform2`` classes:
87
88 * `JavaScript alignment transforms <https://github.com/geocam/geocamTiePoint/blob/master/geocamTiePoint/static/geocamTiePoint/js/transform.js>`_
89 * `Python alignment transforms <https://github.com/geocam/geocamTiePoint/blob/master/geocamTiePoint/transform.py>`_
90
6ee25f5 @trey0 fixed comment at bottom of README
trey0 authored
91 .. o __BEGIN_LICENSE__
92 .. o Copyright (C) 2008-2010 United States Government as represented by
93 .. o the Administrator of the National Aeronautics and Space Administration.
94 .. o All Rights Reserved.
95 .. o __END_LICENSE__
Something went wrong with that request. Please try again.