Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geotrellis-user] Joining a Raster and a Vector RDD

Ken,

If you have an `RDD[MultiPolygonFeature[Map[String,Object]]]`, then you'll needs to `flatMap` over that collection, where for each feature, call `keysForGeometry(feature.geom)` on the `mapTransform` object of the target layout to generate the `key`s, then just copy the corresponding feature to the second position of the pair, `(key, feature)`.

That is:
```val features: RDD[MultiPolygonFeature[Map[String,Object]]]
val layout: LayoutDefinition
val mapTransform = layout.mapTransform

features.flatMap { feature =>
  val keys = keysForGeometry(feature.geom)
  keys.map{ key => (key, feature) }
}```

If you have follow up questions about this, our gitter is generally much more active.

Good luck!




On Wed, Jul 4, 2018 at 2:48 AM Ken <kssalanio@xxxxxxxxx> wrote:
I have these two RDDs:

  • geotiff_tiles: RDD[(String, MultibandGeoTiff)]
  • shapefile_features: RDD[MultiPolygonFeature[Map[String,Object]]]

I want to perform a join on them so I can compare which tiles intersect which features. 

I can index the geotiff_tiles by creating a RDD[(SpatialKey, MultibandTile)], but I don't know how to do the same for the shapefile_features MultiPolygonFeature RDD.

Is there some other indexing in GeoTrellis like RTrees that I can do on both?

Thank you very much!



Ken Abryl Eleazar Salanio
kssalanio@xxxxxxxxx
_______________________________________________
geotrellis-user mailing list
geotrellis-user@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/geotrellis-user


--
Ross Bernet, Project Manager, GeoTrellis
Azavea | 990 Spring Garden Street, 5th Floor, Philadelphia, PA
rbernet@xxxxxxxxxx | office: 215.701.7717  | mobile: 858.692.1872

Azavea is a B Corporation - we apply geospatial technology for civic and social impact
while advancing the state-of-the-art through research. Join us.

Back to the top