|
| 1 | +The raster module |
| 2 | +~~~~~~~~~~~~~~~~ |
| 3 | + |
| 4 | +The :doc:`raster <Format>` module can read and write Rasters. |
| 5 | + |
| 6 | +.. code-block:: javascript |
| 7 | +
|
| 8 | + >> var Format = require("geoscript/raster").Format; |
| 9 | +
|
| 10 | +:class:`raster.Format` |
| 11 | +==================== |
| 12 | + |
| 13 | +.. class:: raster.Format(config) |
| 14 | + |
| 15 | + Create a new Format. The config must contain a source representing the file or URL. |
| 16 | + |
| 17 | +Properties |
| 18 | +---------- |
| 19 | + |
| 20 | +.. attribute:: Format.name |
| 21 | + |
| 22 | + ``String`` |
| 23 | + The type of Format (GeoTIFF, WorldImage). |
| 24 | + |
| 25 | +.. attribute:: Format.names |
| 26 | + |
| 27 | + ``Array`` |
| 28 | + Array of Raster names. Most Formats will only contain one Raster. |
| 29 | + |
| 30 | +Methods |
| 31 | +------- |
| 32 | + |
| 33 | +.. function:: Format.read(config) |
| 34 | + |
| 35 | + :arg config: ``Object`` An object literal with parameters |
| 36 | + |
| 37 | + name: The name of the Raster (optional). Required if there are more than one Raster in the Format. |
| 38 | + |
| 39 | + proj: The Projection of the Raster (optional). |
| 40 | + |
| 41 | + bounds: The Bounds to read a subset of the entire Raster. Optional, but if included size must also be included. |
| 42 | + |
| 43 | + size: An array of width and height of the Raster. Optional, buf if included bound must also be included. |
| 44 | + |
| 45 | +.. function:: Format.write(raster, config) |
| 46 | + |
| 47 | + :arg raster: :class:`raster.Raster` The Raster to write to this Format. |
| 48 | + |
| 49 | + :arg config: ``Object`` An object literal of write parameters. |
| 50 | + |
| 51 | +:class:`raster.Raster` |
| 52 | +==================== |
| 53 | + |
| 54 | +.. class:: raster.Raster |
| 55 | + |
| 56 | + A Raster is a spatial data set represented by a grid of cells organized in one or more bands. |
| 57 | + |
| 58 | +Properties |
| 59 | +---------- |
| 60 | + |
| 61 | +.. attribute:: Raster.name |
| 62 | + |
| 63 | + ``String`` |
| 64 | + Get the name of the Raster. |
| 65 | + |
| 66 | +.. attribute:: Raster.proj |
| 67 | + |
| 68 | + :class:`proj.Projection` |
| 69 | + Get the Projection. |
| 70 | + |
| 71 | + |
| 72 | +.. attribute:: Raster.bounds |
| 73 | + |
| 74 | + :class:`geom.Bounds` |
| 75 | + Get the Bounds. |
| 76 | + |
| 77 | +.. attribute:: Raster.size |
| 78 | + |
| 79 | + `Array` |
| 80 | + Get the size of the Raster as an Array of two numbers: width and height |
| 81 | + |
| 82 | +.. attribute:: Raster.cols |
| 83 | + |
| 84 | + `Number` |
| 85 | + Get the number of columns or the width or the Raster |
| 86 | + |
| 87 | +.. attribute:: Raster.rows |
| 88 | + |
| 89 | + `Number` |
| 90 | + Get the number of row or the height or the Raster |
| 91 | + |
| 92 | +.. attribute:: Raster.bands |
| 93 | + |
| 94 | + `Array` of :class:`raster.Bands` |
| 95 | + Get an array of Bands |
| 96 | + |
| 97 | +Methods |
| 98 | +------- |
| 99 | + |
| 100 | +.. function:: Raster.getPoint(x,y) |
| 101 | + |
| 102 | + :arg x: ``Number`` The pixel's x position |
| 103 | + |
| 104 | + :arg y: ``Number`` The pixel's y position |
| 105 | + |
| 106 | + Get a :class:`geom.Point` for the pixel. |
| 107 | + |
| 108 | +.. function:: Raster.getValue(pointOrPixel) |
| 109 | + |
| 110 | + :arg pointOrPixel: ``Object`` The pixel or :class:`geom.Point` |
| 111 | + |
| 112 | + :arg type: ``String`` The type of value to return (double, int, float, byte, boolean) |
| 113 | + |
| 114 | + Get a value for each band from the Raster. |
| 115 | + |
| 116 | + |
| 117 | +:class:`raster.Band` |
| 118 | +==================== |
| 119 | + |
| 120 | +.. class:: raster.Band |
| 121 | + |
| 122 | + An individual layer from a Raster. |
| 123 | + |
| 124 | +Properties |
| 125 | +---------- |
| 126 | + |
| 127 | +.. attribute:: Band.min |
| 128 | + |
| 129 | + ``Number`` |
| 130 | + Get the minimum value from this Band. |
| 131 | + |
| 132 | +.. attribute:: Band.max |
| 133 | + |
| 134 | + ``Number`` |
| 135 | + Get the maximum value from this Band. |
| 136 | + |
| 137 | +.. attribute:: Band.noData |
| 138 | + |
| 139 | + ``Array`` |
| 140 | + Get the array of no data values. |
| 141 | + |
| 142 | + |
| 143 | + |
| 144 | +.. attribute:: Band.scale |
| 145 | + |
| 146 | + ``Number`` |
| 147 | + Get the scale. |
| 148 | + |
| 149 | +.. attribute:: Band.scale |
| 150 | + |
| 151 | + ``Number`` |
| 152 | + Get the scale. |
| 153 | + |
| 154 | +.. attribute:: Band.type |
| 155 | + |
| 156 | + ``Number`` |
| 157 | + Get the Raster type. |
| 158 | + |
| 159 | +.. attribute:: Band.description |
| 160 | + |
| 161 | + ``Number`` |
| 162 | + Get the Raster description. |
| 163 | + |
| 164 | +Methods |
| 165 | +------- |
| 166 | + |
| 167 | +.. function:: Band.isNoData(value) |
| 168 | + |
| 169 | + :arg value: ``Object`` The value to check |
| 170 | + |
| 171 | + Determine whether the value is a no data value. |
0 commit comments