geotrellis

RasterExtent

case class RasterExtent(extent: Extent, cellwidth: Double, cellheight: Double, cols: Int, rows: Int) extends 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:

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
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RasterExtent
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def adjustTo(tileLayout: TileLayout): RasterExtent

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

    Adjusts a raster extent so that in can encompass the tile layout. Will warp the extent, but keep the resolution, and preserve nort and west borders

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. val cellheight: Double

  9. val cellwidth: Double

  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. val cols: Int

  12. 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.

  13. def compare(other: RasterExtent): Int

    Compare this object with another GeoAttrs object, as per the comparison rules in Extent#compare.

  14. def containsPoint(x: Double, y: Double): Boolean

    Determine if the underlying extent contains the given point.

  15. def createAligned(targetExtent: Extent): RasterExtent

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

    Returns a RasterExtent that lines up with this RasterExtent's resolution, and grid layout. i.e., 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.

  16. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. val extent: Extent

  18. def extentFor(gridBounds: GridBounds): Extent

  19. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  21. def gridBoundsFor(subExtent: Extent): GridBounds

    Gets the GridBounds for this RasterExtent that is the smallest subgrid containing all points within the extent.

    Gets the GridBounds for this RasterExtent 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 RasterExtent for a discussion of grid and extent boundary concepts.

  22. final def gridColToMap(col: Int): Double

  23. final def gridRowToMap(row: Int): Double

  24. final def gridToMap(col: Int, row: Int): (Double, Double)

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

  25. val height: Double

  26. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  27. final def mapToGrid(mapCoord: (Double, Double)): (Int, Int)

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

  28. final def mapToGrid(x: Double, y: Double): (Int, Int)

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

  29. final def mapXToGrid(x: Double): Int

    Convert map coordinate x to grid coordinate column.

  30. final def mapXToGridDouble(x: Double): Double

  31. final def mapYToGrid(y: Double): Int

    Convert map coordinate y to grid coordinate row.

  32. final def mapYToGridDouble(y: Double): Double

  33. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  34. final def notify(): Unit

    Definition Classes
    AnyRef
  35. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  36. val rows: Int

  37. def size: Int

    The size of the extent, e.

    The size of the extent, e.g. cols * rows.

  38. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  39. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. val width: Double

  43. 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.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped