Packages

case class RasterExtent(extent: Extent, cellwidth: Double, cellheight: Double, cols: Int, rows: Int) extends GridExtent[Int] with Product with Serializable

RasterExtent objects represent the geographic extent (envelope) of a raster.

The Raster extent has two coordinate concepts involved: map coordinates and grid coordinates. Map coordinates are what the Extent class uses, and specifies points using an X coordinate and a Y coordinate. The X coordinate is oriented along west to east such that the larger the X coordinate, the more eastern the point. The Y coordinate is along south to north such that the larger the Y coordinate, the more Northern the point.

This contrasts with the grid coordinate system. The grid coordinate system does not actually reference points on the map, but instead a cell of the raster that represents values for some square area of the map. The column axis is similar in that the number gets larger as one goes from west to east; however, the row axis is inverted from map coordinates: as the row number increases, the cell is heading south. The top row is labeled as 0, and the next 1, so that the highest indexed row is the southern most row of the raster. A cell has a height and a width that is in terms of map units. You can think of it as each cell is itself an extent, with width cellwidth and height cellheight. When a cell needs to be represented or thought of as a point, the center of the cell will be used. So when gridToMap is called, what is returned is the center point, in map coordinates.

Map points are considered to be 'inside' the cell based on these rules:

  • If the point is inside the area of the cell, it is included in the cell.
  • If the point lies on the north or west border of the cell, it is included in the cell.
  • If the point lies on the south or east border of the cell, it is not included in the cell, it is included in the next southern or eastern cell, respectively.

Note that based on these rules, the eastern and southern borders of an Extent are not actually considered to be part of the RasterExtent.

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RasterExtent
  2. Product
  3. Equals
  4. GridExtent
  5. GridIntegral
  6. Grid
  7. Serializable
  8. Serializable
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RasterExtent(extent: Extent, cellwidth: Double, cellheight: Double, cols: Int, rows: Int)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def adjustTo(tileLayout: TileLayout): GridExtent[Int]

    Adjusts a raster extent so that it can encompass the tile layout.

    Adjusts a raster extent so that it can encompass the tile layout. Will resample the extent, but keep the resolution, and preserve north and west borders

    Definition Classes
    GridExtent
  5. def alignTargetPixels: GridExtent[Int]

    This method copies gdalwarp -tap logic:

    This method copies gdalwarp -tap logic:

    The actual code reference: https://github.com/OSGeo/gdal/blob/v2.3.2/gdal/apps/gdal_rasterize_lib.cpp#L402-L461 The actual part with the -tap logic: https://github.com/OSGeo/gdal/blob/v2.3.2/gdal/apps/gdal_rasterize_lib.cpp#L455-L461

    The initial PR that introduced that feature in GDAL 1.8.0: https://trac.osgeo.org/gdal/attachment/ticket/3772/gdal_tap.patch A discussion thread related to it: https://lists.osgeo.org/pipermail/gdal-dev/2010-October/thread.html#26209

    Definition Classes
    GridExtent
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def canEqual(a: Any): Boolean
    Definition Classes
    GridExtent
  8. def cellSize: CellSize
    Definition Classes
    GridExtent
  9. val cellheight: Double
    Definition Classes
    RasterExtentGridExtent
  10. val cellwidth: Double
    Definition Classes
    RasterExtentGridExtent
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  12. val cols: Int
    Definition Classes
    RasterExtentGridExtentGrid
  13. def combine(that: RasterExtent): RasterExtent

    Combine two different RasterExtents (which must have the same cellsizes).

    Combine two different RasterExtents (which must have the same cellsizes). The result is a new extent at the same resolution.

  14. def combine(that: GridExtent[Int]): GridExtent[Int]

    Combine two different GridExtents (which must have the same cellsizes).

    Combine two different GridExtents (which must have the same cellsizes). The result is a new extent at the same resolution.

    Definition Classes
    GridExtent
  15. def createAlignedGridExtent(targetExtent: Extent, alignmentPoint: Point): GridExtent[Int]

    Returns a GridExtent that with this grid's resolution.

    Returns a GridExtent that with this grid's resolution.

    This function will generate an extent that lines up with a grid having an origin at the given point and grid cells of the size given by the cellSize of the GridExtent. The resulting GridExtent, in general, will not be equal to targetExtent, but will have the smallest extent that lines up with the grid and also covers targetExtent.

    Definition Classes
    GridExtent
  16. def createAlignedGridExtent(targetExtent: Extent): GridExtent[Int]

    Returns a GridExtent that lines up with this grid's resolution and grid layout.

    Returns a GridExtent that lines up with this grid's resolution and grid layout.

    This function will generate an extent that lines up with the grid indicated by the GridExtent, having an origin at the upper-left corner of the extent, and grid cells having the size given by cellSize. The resulting GridExtent, in general, will not be equal to targetExtent, but will have the smallest extent that lines up with the grid and also covers targetExtent.

    Definition Classes
    GridExtent
  17. def createAlignedRasterExtent(targetExtent: Extent): RasterExtent

    Returns a geotrellis.raster.RasterExtent that lines up with this RasterExtent's resolution, and grid layout.

    Returns a geotrellis.raster.RasterExtent that lines up with this RasterExtent's resolution, and grid layout.

    For example, the resulting RasterExtent will not have the given extent, but will have the smallest extent such that the whole of the given extent is covered, that lines up with the grid.

    Definition Classes
    GridExtent
  18. def dimensions: Dimensions[Int]
    Definition Classes
    GridIntegralGrid
  19. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. def equals(that: Any): Boolean
    Definition Classes
    GridExtent → AnyRef → Any
  21. val extent: Extent
    Definition Classes
    RasterExtentGridExtent
  22. def extentFor(cellBounds: GridBounds[Int], clamp: Boolean = true): Extent

    Gets the Extent that matches the grid bounds passed in, aligned with this GridExtent.

    Gets the Extent that matches the grid bounds passed in, aligned with this GridExtent.

    The 'clamp' parameter determines whether or not to clamp the Extent to the extent of this GridExtent; defaults to true. If true, the returned extent will be contained by this GridExtent's extent, if false, the Extent returned can be outside of this GridExtent's extent.

    cellBounds

    The extent to get the grid bounds for

    clamp

    A boolean which controls the clamping behavior

    Definition Classes
    GridExtent
  23. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  25. def gridBoundsFor(subExtent: Extent, clamp: Boolean = true): GridBounds[Int]

    Gets the GridBounds aligned with this GridExtent that is the smallest subgrid containing all points within the extent.

    Gets the GridBounds aligned with this GridExtent that is the smallest subgrid containing all points within the extent. The extent is considered inclusive on it's north and west borders, exclusive on it's east and south borders. See geotrellis.raster.RasterExtent for a discussion of grid and extent boundary concepts.

    The 'clamp' flag determines whether or not to clamp the GridBounds to the RasterExtent; defaults to true. If false, GridBounds can contain negative values, or values outside of this GridExtent's boundaries.

    subExtent

    The extent to get the grid bounds for

    clamp

    A boolean

    Definition Classes
    GridExtent
  26. final def gridColToMap(col: Int): Double

    For a given column, find the corresponding x-coordinate in the grid of the present GridExtent.

    For a given column, find the corresponding x-coordinate in the grid of the present GridExtent.

    Definition Classes
    GridExtent
  27. final def gridRowToMap(row: Int): Double

    For a given row, find the corresponding y-coordinate in the grid of the present GridExtent.

    For a given row, find the corresponding y-coordinate in the grid of the present GridExtent.

    Definition Classes
    GridExtent
  28. final def gridToMap(col: Int, row: Int): (Double, Double)

    The map coordinate of a grid cell is the center point.

    The map coordinate of a grid cell is the center point.

    Definition Classes
    GridExtent
  29. def hashCode(): Int
    Definition Classes
    GridExtent → AnyRef → Any
  30. def isGridExtentAligned: Boolean

    Tests if the grid is aligned to the extent.

    Tests if the grid is aligned to the extent. This is true when the extent is evenly divided by cellheight and cellwidth.

    Definition Classes
    GridExtent
  31. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  32. final def mapToGrid(p: Point): (Int, Int)

    Convert a point to grid coordinates (col, row).

    Convert a point to grid coordinates (col, row).

    Definition Classes
    GridExtent
  33. final def mapToGrid(mapCoord: (Double, Double)): (Int, Int)

    Convert map coordinate tuple (x, y) to grid coordinates (col, row).

    Convert map coordinate tuple (x, y) to grid coordinates (col, row).

    Definition Classes
    GridExtent
  34. final def mapToGrid(x: Double, y: Double): (Int, Int)

    Convert map coordinates (x, y) to grid coordinates (col, row).

    Convert map coordinates (x, y) to grid coordinates (col, row).

    Definition Classes
    GridExtent
  35. final def mapXToGrid(x: Double): Int

    Convert map coordinate x to grid coordinate column.

    Convert map coordinate x to grid coordinate column.

    Definition Classes
    GridExtent
  36. final def mapXToGridDouble(x: Double): Double

    Convert map coordinate x to grid coordinate column.

    Convert map coordinate x to grid coordinate column.

    Definition Classes
    GridExtent
  37. final def mapYToGrid(y: Double): Int

    Convert map coordinate y to grid coordinate row.

    Convert map coordinate y to grid coordinate row.

    Definition Classes
    GridExtent
  38. final def mapYToGridDouble(y: Double): Double

    Convert map coordinate y to grid coordinate row.

    Convert map coordinate y to grid coordinate row.

    Definition Classes
    GridExtent
  39. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  40. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  41. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  42. def rasterExtentFor(gridBounds: GridBounds[Int]): RasterExtent

    Returns a new RasterExtent which represents the GridBounds in relation to this RasterExtent.

  43. val rows: Int
    Definition Classes
    RasterExtentGridExtentGrid
  44. def size: Int
    Definition Classes
    GridIntegralGrid
  45. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  46. def toGridType[M](implicit arg0: Integral[M]): GridExtent[M]
    Definition Classes
    GridExtent
  47. def toRasterExtent(): RasterExtent

    Creates a RasterExtent out of this GridExtent.

    Creates a RasterExtent out of this GridExtent.

    Definition Classes
    GridExtent
    Note

    Use with caution: if the number of columns or rows are larger than Int.MaxValue, this will throw an exception. Also, if columns * rows > Int.MaxValue, this will create a RasterExtent for a raster that could not be backed by any of the Array-backed tile types.

  48. def toString(): String
    Definition Classes
    GridExtent → AnyRef → Any
  49. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  52. def withDimensions(targetCols: Int, targetRows: Int): RasterExtent

    Returns a RasterExtent with the same extent and the given number of columns and rows.

    Returns a RasterExtent with the same extent and the given number of columns and rows.

    Definition Classes
    RasterExtentGridExtent
  53. def withResolution(cellSize: CellSize): RasterExtent

    Returns a RasterExtent with the same extent, but a modified number of columns and rows based on the given cell height and width.

    Returns a RasterExtent with the same extent, but a modified number of columns and rows based on the given cell height and width.

    Definition Classes
    RasterExtentGridExtent
  54. def withResolution(targetCellWidth: Double, targetCellHeight: Double): RasterExtent

    Returns a RasterExtent with the same extent, but a modified number of columns and rows based on the given cell height and width.

    Returns a RasterExtent with the same extent, but a modified number of columns and rows based on the given cell height and width.

    Definition Classes
    RasterExtentGridExtent

Inherited from Product

Inherited from Equals

Inherited from GridExtent[Int]

Inherited from GridIntegral[Int]

Inherited from Grid[Int]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped