Class/Object

geotrellis.raster

GridExtent

Related Docs: object GridExtent | package raster

Permalink

class GridExtent[N] extends Grid[N] with Serializable

Represents an abstract grid over geographic extent. Critically while the number of cell rows and columns is implied by the constructor arguments, they are intentionally not expressed to avoid Int overflow for large grids.

The constructor will throw java.lang.IllegalArgumentException if the provided extent and cell size do not match the provided cols and rows (dimensions).

Linear Supertypes
Grid[N], Serializable, Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GridExtent
  2. Grid
  3. Serializable
  4. Serializable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new GridExtent(extent: Extent, cellSize: CellSize)(implicit arg0: Integral[N])

    Permalink
  2. new GridExtent(extent: Extent, cols: N, rows: N)(implicit arg0: Integral[N])

    Permalink
  3. new GridExtent(extent: Extent, cellwidth: Double, cellheight: Double, cols: N, rows: N)(implicit arg0: Integral[N])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def adjustTo(tileLayout: TileLayout): GridExtent[N]

    Permalink

    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

  5. def alignTargetPixels: GridExtent[N]

    Permalink

    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

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def canEqual(a: Any): Boolean

    Permalink
  8. def cellSize: CellSize

    Permalink
  9. val cellheight: Double

    Permalink
  10. val cellwidth: Double

    Permalink
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. val cols: N

    Permalink
    Definition Classes
    GridExtentGrid
  13. def combine(that: GridExtent[N]): GridExtent[N]

    Permalink

    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.

  14. def createAlignedGridExtent(targetExtent: Extent, alignmentPoint: Point): GridExtent[N]

    Permalink

    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.

  15. def createAlignedGridExtent(targetExtent: Extent): GridExtent[N]

    Permalink

    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.

  16. def createAlignedRasterExtent(targetExtent: Extent): RasterExtent

    Permalink

    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.

  17. def dimensions: Dimensions[N]

    Permalink
    Definition Classes
    Grid
  18. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. def equals(that: Any): Boolean

    Permalink
    Definition Classes
    GridExtent → AnyRef → Any
  20. val extent: Extent

    Permalink
  21. def extentFor(cellBounds: GridBounds[N], clamp: Boolean = true): Extent

    Permalink

    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 controlls the clamping behvior

  22. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  24. def gridBoundsFor(subExtent: Extent, clamp: Boolean = true): GridBounds[N]

    Permalink

    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

  25. final def gridColToMap(col: N): Double

    Permalink

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

  26. final def gridRowToMap(row: N): Double

    Permalink

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

  27. final def gridToMap(col: N, row: N): (Double, Double)

    Permalink

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

  28. def hashCode(): Int

    Permalink
    Definition Classes
    GridExtent → AnyRef → Any
  29. def isGridExtentAligned(): Boolean

    Permalink

    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.

  30. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  31. final def mapToGrid(p: Point): (N, N)

    Permalink

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

  32. final def mapToGrid(mapCoord: (Double, Double)): (N, N)

    Permalink

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

  33. final def mapToGrid(x: Double, y: Double): (N, N)

    Permalink

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

  34. final def mapXToGrid(x: Double): N

    Permalink

    Convert map coordinate x to grid coordinate column.

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

    Permalink

    Convert map coordinate x to grid coordinate column.

  36. final def mapYToGrid(y: Double): N

    Permalink

    Convert map coordinate y to grid coordinate row.

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

    Permalink

    Convert map coordinate y to grid coordinate row.

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

    Permalink
    Definition Classes
    AnyRef
  39. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  40. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  41. val rows: N

    Permalink
    Definition Classes
    GridExtentGrid
  42. def size: N

    Permalink
    Definition Classes
    Grid
  43. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  44. def toGridType[M](implicit arg0: Integral[M]): GridExtent[M]

    Permalink
  45. def toRasterExtent(): RasterExtent

    Permalink

    Creates a RasterExtent out of this GridExtent.

    Creates a RasterExtent out of this 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.

  46. def toString(): String

    Permalink
    Definition Classes
    GridExtent → AnyRef → Any
  47. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. def withDimensions(targetCols: N, targetRows: N): GridExtent[N]

    Permalink

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

  51. def withResolution(cellSize: CellSize): GridExtent[N]

    Permalink

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

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

    See withResolution(cellSize) for more details.

  52. def withResolution(targetCellWidth: Double, targetCellHeight: Double): GridExtent[N]

    Permalink

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

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

    This method can construct a GridExtent where the number of columns and rows do not align closely with an integer boundary. The caller is responsible for verifying that the provided cell sizes are appropriate for the intended use case.

    See https://github.com/locationtech/geotrellis/issues/3261 for details and an example. If you need a specific number of columns and rows, see java.lang.Object) withDimensions(targetCols, targetRows)

Inherited from Grid[N]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped