Skip to content

Commit

Permalink
Initial refresh to existing raster docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjohns-databricks committed Jan 21, 2024
1 parent 4d3c109 commit becbea8
Show file tree
Hide file tree
Showing 55 changed files with 684 additions and 1,055 deletions.
1,179 changes: 401 additions & 778 deletions docs/source/api/raster-functions.rst

Large diffs are not rendered by default.

444 changes: 225 additions & 219 deletions python/mosaic/api/raster.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ object RST_BandMetaData extends WithExpressionInfo {

override def name: String = "rst_bandmetadata"

override def usage: String = "_FUNC_(expr1, expr2) - Extracts metadata from a raster band."
override def usage: String = "_FUNC_(expr1, expr2) - Extracts metadata from a raster tile band."

override def example: String =
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ object RST_BoundingBox extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns the bounding box of the raster.
|_FUNC_(expr1) - Returns the bounding box of the raster tile.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ object RST_Clip extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns a raster clipped by provided vector.
|_FUNC_(expr1) - Returns a raster tile clipped by provided vector.
|""".stripMargin

override def example: String =
"""
| Examples:
| > SELECT _FUNC_(raster, vector);
| > SELECT _FUNC_(raster_tile, vector);
| {index_id, clipped_raster, parentPath, driver}
| {index_id, clipped_raster, parentPath, driver}
| ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object RST_CombineAvg extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns a raster that is a result of combining an array of rasters using average of pixels.
|_FUNC_(expr1) - Combine an array of raster tiles using average of pixels.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ object RST_CombineAvgAgg {
db.orNull,
"rst_combine_avg_agg",
"""
| _FUNC_(tiles)) - Combines rasters into a single raster using average.
| _FUNC_(tiles)) - Aggregate to combine raster tiles using an average of pixels.
""".stripMargin,
"",
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ object RST_DerivedBand extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns a raster that is a result of combining an array of rasters using provided python function.
|_FUNC_(expr1) - Combine an array of raster tiles using provided python function.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ object RST_DerivedBandAgg {
db.orNull,
"rst_derived_band_agg",
"""
| _FUNC_(tiles)) - Combines rasters into a single raster using provided python function.
| _FUNC_(tiles)) - Aggregate which combines raster tiles using provided python function.
""".stripMargin,
"",
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object RST_FromBands extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns a raster that is a result of stacking and resampling input bands.
|_FUNC_(expr1) - Returns raster tiles that are a result of stacking and resampling input bands.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ object RST_FromContent extends WithExpressionInfo {
override def example: String =
"""
| Examples:
| > SELECT _FUNC_(raster, driver, sizeInMB);
| {index_id, raster, parentPath, driver}
| > SELECT _FUNC_(raster_bin, driver, size_in_mb);
| {index_id, raster, parent_path, driver}
| ...
| """.stripMargin

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ object RST_FromFile extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns a set of new rasters with the specified tile size (tileWidth x tileHeight).
|_FUNC_(expr1) - Returns a set of new raster tiles within threshold in MBs.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object RST_GeoReference extends WithExpressionInfo {

override def name: String = "rst_georeference"

override def usage: String = "_FUNC_(expr1) - Extracts geo reference from a raster."
override def usage: String = "_FUNC_(expr1) - Extracts geo reference from a raster tile."

override def example: String =
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,14 @@ object RST_GetNoData extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns a raster clipped by provided vector.
|_FUNC_(expr1) - Returns no data values for raster tile bands.
|""".stripMargin

override def example: String =
"""
| Examples:
| > SELECT _FUNC_(raster_tile);
| {index_id, clipped_raster, parentPath, driver}
| {index_id, clipped_raster, parentPath, driver}
| [0.0, -9999.0, ...]
| ...
| """.stripMargin

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object RST_GetSubdataset extends WithExpressionInfo {

override def name: String = "rst_getsubdataset"

override def usage: String = "_FUNC_(expr1, expr2) - Extracts subdataset raster."
override def usage: String = "_FUNC_(expr1, expr2) - Extracts subdataset raster tile."

override def example: String =
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object RST_Height extends WithExpressionInfo {

override def name: String = "rst_height"

override def usage: String = "_FUNC_(expr1) - Returns height of the raster."
override def usage: String = "_FUNC_(expr1) - Returns height of the raster tile."

override def example: String =
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ object RST_InitNoData extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns a raster clipped by provided vector.
|_FUNC_(expr1) - Initializes the nodata value of the raster bands.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object RST_IsEmpty extends WithExpressionInfo {

override def name: String = "rst_isempty"

override def usage: String = "_FUNC_(expr1) - Returns true if the raster is empty."
override def usage: String = "_FUNC_(expr1) - Returns true if the raster tile is empty."

override def example: String =
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ object RST_MapAlgebra extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1, expr2) - Performs map algebra on the rasters.
|_FUNC_(expr1, expr2) - Performs map algebra on the raster tiles.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object RST_MemSize extends WithExpressionInfo {

override def name: String = "rst_memsize"

override def usage: String = "_FUNC_(expr1) - Returns number of bytes for in memory representation of the raster."
override def usage: String = "_FUNC_(expr1) - Returns number of bytes for in memory representation of the raster tile."

override def example: String =
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ object RST_Merge extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns a raster that is a result of merging an array of rasters.
|_FUNC_(expr1) - Merge (mosaic) an array of raster tile columns.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ object RST_MergeAgg {
db.orNull,
"rst_merge_agg",
"""
| _FUNC_(tiles)) - Merges rasters into a single raster.
| _FUNC_(tiles)) - Aggregate merge of raster tiles.
""".stripMargin,
"",
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object RST_MetaData extends WithExpressionInfo {

override def name: String = "rst_metadata"

override def usage: String = "_FUNC_(expr1) - Extracts metadata from a raster dataset."
override def usage: String = "_FUNC_(expr1) - Extracts metadata from a raster tile dataset."

override def example: String =
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ object RST_NDVI extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1, expr2, expr3) - Returns a raster contains NDVI index computed by bands provided by red_index and nir_index.
|_FUNC_(expr1, expr2, expr3) - NDVI index computed by raster tile red_index and nir_index bands.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object RST_NumBands extends WithExpressionInfo {

override def name: String = "rst_numbands"

override def usage: String = "_FUNC_(expr1) - Returns number of bands in the raster."
override def usage: String = "_FUNC_(expr1) - Returns number of bands in the raster tile."

override def example: String =
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object RST_PixelHeight extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns pixel height in the raster.
|_FUNC_(expr1) - Returns pixel height in the raster tile.
|The width is a hypotenuse of a right triangle formed by scaleY and skewX.
|""".stripMargin

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object RST_PixelWidth extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns pixel width in the raster.
|_FUNC_(expr1) - Returns pixel width in the raster tile.
|The width is a hypotenuse of a right triangle formed by scaleX and skewY.
|""".stripMargin

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object RST_RasterToGridAvg extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1, expr2) - Returns a collection of grid index cells with the average pixel value for each band of the raster.
|_FUNC_(expr1, expr2) - Returns a collection of grid index cells with the average pixel value for each band of the raster tile.
| The output type is array<array<struct<index: long, measure: double>>>.
| Raster mask is taken into account and only valid pixels are used for the calculation.
|""".stripMargin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object RST_RasterToGridCount extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1, expr2) - Returns a collection of grid index cells with the number of pixels per cell for each band of the raster.
|_FUNC_(expr1, expr2) - Returns a collection of grid index cells with the number of pixels per cell for each band of the raster tile.
| The output type is array<array<struct<index: long, measure: int>>>.
| Raster mask is taken into account and only valid pixels are used for the calculation.
|""".stripMargin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object RST_RasterToGridMax extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1, expr2) - Returns a collection of grid index cells with the max pixel value per cell for each band of the raster.
|_FUNC_(expr1, expr2) - Returns a collection of grid index cells with the max pixel value per cell for each band of the raster tile.
| The output type is array<array<struct<index: long, measure: double>>>.
| Raster mask is taken into account and only valid pixels are used for the calculation.
|""".stripMargin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object RST_RasterToGridMedian extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1, expr2) - Returns a collection of grid index cells with the median pixel value per cell for each band of the raster.
|_FUNC_(expr1, expr2) - Returns a collection of grid index cells with the median pixel value per cell for each band of the raster tile.
| The output type is array<array<struct<index: long, measure: double>>>.
| Raster mask is taken into account and only valid pixels are used for the calculation.
|""".stripMargin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object RST_RasterToGridMin extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1, expr2) - Returns a collection of grid index cells with the min pixel value per cell for each band of the raster.
|_FUNC_(expr1, expr2) - Returns a collection of grid index cells with the min pixel value per cell for each band of the raster tile.
| The output type is array<array<struct<index: long, measure: double>>>.
| Raster mask is taken into account and only valid pixels are used for the calculation.
|""".stripMargin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ object RST_RasterToWorldCoord extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1, expr2, expr3) - Returns the (x, y) pixel in world coordinates using geo transform of the raster.
|_FUNC_(expr1, expr2, expr3) - Returns the (x, y) pixel in world coordinates using geo transform of the raster tile.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ object RST_RasterToWorldCoordX extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1, expr2, expr3) - Returns the x coordinate of the pixel in world coordinates using geo transform of the raster.
|_FUNC_(expr1, expr2, expr3) - Returns the x coordinate of the pixel in world coordinates using geo transform of the raster tile.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ object RST_RasterToWorldCoordY extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1, expr2, expr3) - Returns the y coordinate of the pixel in world coordinates using geo transform of the raster.
|_FUNC_(expr1, expr2, expr3) - Returns the y coordinate of the pixel in world coordinates using geo transform of the raster tile.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object RST_ReTile extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1, expr2, expr3) - Returns a set of new rasters with the specified tile size (tileWidth x tileHeight).
|_FUNC_(expr1, expr2, expr3) - Returns a set of new raster tile with the specified size (tileWidth x tileHeight).
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object RST_Rotation extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns the rotation angle of the raster with respect to equator.
|_FUNC_(expr1) - Returns the rotation angle of the raster tile with respect to equator.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object RST_SRID extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns SRID of the raster.
|_FUNC_(expr1) - Returns SRID of the raster tile.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ object RST_ScaleX extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns scale X in the raster.
|_FUNC_(expr1) - Returns scale X in the raster tile.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ object RST_ScaleY extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns scale Y in the raster.
|_FUNC_(expr1) - Returns scale Y in the raster tile.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ object RST_SetNoData extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1, expr2) - Returns a raster clipped by provided vector.
|_FUNC_(expr1, expr2) - Sets the nodata value of the raster tile for all bands.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ object RST_SkewX extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns skew X in the raster.
|_FUNC_(expr1) - Returns skew X in the raster tile.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ object RST_SkewY extends WithExpressionInfo {

override def usage: String =
"""
|_FUNC_(expr1) - Returns skew Y in the raster.
|_FUNC_(expr1) - Returns skew Y in the raster tile.
|""".stripMargin

override def example: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object RST_Subdatasets extends WithExpressionInfo {

override def name: String = "rst_subdatasets"

override def usage: String = "_FUNC_(expr1) - Extracts subdataset paths and descriptions from a raster dataset."
override def usage: String = "_FUNC_(expr1) - Extracts subdataset paths and descriptions from a raster tile dataset."

override def example: String =
"""
Expand Down
Loading

0 comments on commit becbea8

Please sign in to comment.