Packages

o

geotrellis.spark.clip

ClipToGrid

object ClipToGrid

These functions perform the following transformation:

RDD[Geometry] => RDD[(SpatialKey, Geometry)]

such that each original Geometry is clipped in some way. By default, this clips them to fit inside the Extent of each SpatialKey they touch.

If you'd like more customized clipping behaviour, you can compose over the clipFeatureToExtent function below, or write your own entirely, while following its type signature. That can then be passed into the appropriate apply method below.

A variety of overloads are provided here to help you work with either Geometry or Feature. The injected

RDD[Geometry].clipToGrid: LayoutDefinition => RDD[(SpatialKey, Geometry)]

may also be preferable to you.

Note: If your custom clipping function relies on Predicates, note that its method coveredBy will always return true if your Geometry fits inside the passed-in Extent. Please avoid writing clipping functions that do non-sensical things.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ClipToGrid
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait Predicates extends Serializable

    Trait which contains methods to be used in determining the most optimal way to clip geometries and features for ClipToGrid methods.

Value Members

  1. def apply[G <: Geometry, D](rdd: RDD[Feature[G, D]], layout: LayoutDefinition, clipFeature: (Extent, Feature[G, D], Predicates) ⇒ Option[Feature[Geometry, D]]): RDD[(SpatialKey, Feature[Geometry, D])]

    Clip each geometry in the RDD to the set of SpatialKeys which intersect it, where the SpatialKeys map to the given LayoutDefinition, using the given method to clip each geometry to the extent.

  2. def apply[G <: Geometry, D](rdd: RDD[Feature[G, D]], layout: LayoutDefinition): RDD[(SpatialKey, Feature[Geometry, D])]

    Clip each geometry in the RDD to the set of SpatialKeys which intersect it, where the SpatialKeys map to the given LayoutDefinition, using the given method to clip each geometry to the extent.

  3. def apply[G <: Geometry](rdd: RDD[G], layout: LayoutDefinition, clipGeom: (Extent, G, Predicates) ⇒ Option[Geometry])(implicit d: DummyImplicit): RDD[(SpatialKey, Geometry)]

    Clip each geometry in the RDD to the set of SpatialKeys which intersect it, where the SpatialKeys map to the given LayoutDefinition, using the given method to clip each geometry to the extent.

  4. def apply[G <: Geometry](rdd: RDD[G], layout: LayoutDefinition)(implicit d: DummyImplicit): RDD[(SpatialKey, Geometry)]

    Clip each geometry in the RDD to the set of SpatialKeys which intersect it, where the SpatialKeys map to the given LayoutDefinition.

  5. def clipFeatureToExtent[G <: Geometry, D](e: Extent, feature: Feature[G, D], preds: Predicates): Option[Feature[Geometry, D]]

    Clips a feature to the given extent, that uses the given predicates to avoid doing intersections where unnecessary.