[348] | 1 | .. _api-zoo-projection: |
---|
| 2 | |
---|
| 3 | ZOO.Projection |
---|
| 4 | ============== |
---|
| 5 | |
---|
| 6 | Class for coordinate transforms between coordinate systems. |
---|
| 7 | |
---|
| 8 | Properties |
---|
| 9 | ---------- |
---|
| 10 | |
---|
| 11 | .. list-table:: |
---|
| 12 | :widths: 30 50 |
---|
| 13 | :header-rows: 1 |
---|
| 14 | |
---|
| 15 | * - NAME |
---|
| 16 | - DESCRIPTION |
---|
| 17 | * - :ref:`proj <proj>` |
---|
| 18 | - {Number} Proj4js.Proj instance. |
---|
| 19 | * - :ref:`projCode <projCode>` |
---|
| 20 | - {String} |
---|
| 21 | |
---|
| 22 | Functions |
---|
| 23 | --------- |
---|
| 24 | |
---|
| 25 | .. list-table:: |
---|
| 26 | :widths: 12 50 |
---|
| 27 | :header-rows: 1 |
---|
| 28 | |
---|
| 29 | * - NAME |
---|
| 30 | - DESCRIPTION |
---|
| 31 | * - :ref:`ZOO.Projection <ZOO.Projection>` |
---|
| 32 | - This class offers several methods for interacting with a wrapped zoo-pro4js projection object. |
---|
| 33 | * - :ref:`getCode <getCode>` |
---|
| 34 | - Get the string SRS code. |
---|
| 35 | * - :ref:`getUnits <getUnits>` |
---|
| 36 | - Get the units string for the projection -- returns null if zoo-proj4js is not available. |
---|
| 37 | * - :ref:`toString <toString>` |
---|
| 38 | - Convert projection to string (getCode wrapper). |
---|
| 39 | * - :ref:`equals <equals>` |
---|
| 40 | - Test equality of two projection instances. |
---|
| 41 | * - :ref:`destroy <destroy>` |
---|
| 42 | - Destroy projection object. |
---|
| 43 | * - :ref:`transform <transform>` |
---|
| 44 | - Transform a point coordinate from one projection to another. |
---|
| 45 | |
---|
| 46 | **Properties** |
---|
| 47 | |
---|
| 48 | .. _proj: |
---|
| 49 | |
---|
| 50 | proj |
---|
| 51 | ``{Object}`` Proj4js.Proj instance. |
---|
| 52 | |
---|
| 53 | .. _projCode: |
---|
| 54 | |
---|
| 55 | projCode |
---|
| 56 | ``{String}`` |
---|
| 57 | |
---|
| 58 | **Functions** |
---|
| 59 | |
---|
| 60 | .. _ZOO.Projection: |
---|
| 61 | |
---|
| 62 | ZOO.Projection |
---|
| 63 | This class offers several methods for interacting with a wrapped zoo-pro4js projection object. |
---|
| 64 | |
---|
| 65 | *Parameters* |
---|
| 66 | |
---|
| 67 | | ``projCode {String}`` A string identifying the Well Known Identifier for the projection. |
---|
| 68 | | ``options {Object}`` An optional object to set additional properties. |
---|
| 69 | |
---|
| 70 | *Returns* |
---|
| 71 | |
---|
| 72 | :ref:`{ZOO.Projection} <api-zoo-projection>` A projection object. |
---|
| 73 | |
---|
| 74 | .. _getCode: |
---|
| 75 | |
---|
| 76 | getCode |
---|
| 77 | :: |
---|
| 78 | |
---|
| 79 | getCode: function() |
---|
| 80 | |
---|
| 81 | Get the string SRS code. |
---|
| 82 | |
---|
| 83 | *Returns* |
---|
| 84 | |
---|
| 85 | ``{String}`` The SRS code. |
---|
| 86 | |
---|
| 87 | .. _getUnits: |
---|
| 88 | |
---|
| 89 | getUnits |
---|
| 90 | :: |
---|
| 91 | |
---|
| 92 | getUnits: function() |
---|
| 93 | |
---|
| 94 | Get the units string for the projection -- returns null if zoo-proj4js is not available. |
---|
| 95 | |
---|
| 96 | *Returns* |
---|
| 97 | |
---|
| 98 | ``{String}`` The units abbreviation. |
---|
| 99 | |
---|
| 100 | .. _toString: |
---|
| 101 | |
---|
| 102 | toString |
---|
| 103 | :: |
---|
| 104 | |
---|
| 105 | toString: function() |
---|
| 106 | |
---|
| 107 | Convert projection to string (getCode wrapper). |
---|
| 108 | |
---|
| 109 | *Returns* |
---|
| 110 | |
---|
| 111 | ``{String}`` The projection code. |
---|
| 112 | |
---|
| 113 | .. _equals: |
---|
| 114 | |
---|
| 115 | equals |
---|
| 116 | :: |
---|
| 117 | |
---|
| 118 | equals: function(projection) |
---|
| 119 | |
---|
| 120 | Test equality of two projection instances. Determines equality based soley on the projection code. |
---|
| 121 | |
---|
| 122 | *Returns* |
---|
| 123 | |
---|
| 124 | ``{Boolean}`` The two projections are equivalent. |
---|
| 125 | |
---|
| 126 | .. _destroy: |
---|
| 127 | |
---|
| 128 | destroy |
---|
| 129 | :: |
---|
| 130 | |
---|
| 131 | destroy: function() |
---|
| 132 | |
---|
| 133 | Destroy projection object. |
---|
| 134 | |
---|
| 135 | .. _transform: |
---|
| 136 | |
---|
| 137 | transform |
---|
| 138 | :: |
---|
| 139 | |
---|
| 140 | ZOO.Projection.transform = function(point,source,dest) |
---|
| 141 | |
---|
| 142 | Transform a point coordinate from one projection to another. Note that the input point is |
---|
| 143 | transformed in place. |
---|
| 144 | |
---|
| 145 | *Parameters* |
---|
| 146 | |
---|
| 147 | | ``point {{ZOO.Geometry.Point> | Object}`` An object with x and y properties representing coordinates in those dimensions. |
---|
| 148 | | ``sourceProj {ZOO.Projection}`` Source map coordinate system |
---|
| 149 | | ``destProj {ZOO.Projection}`` Destination map coordinate system |
---|
| 150 | |
---|
| 151 | *Returns* |
---|
| 152 | |
---|
[177] | 153 | ``point {object}`` A transformed coordinate. The original point is modified. |
---|