GeoTrellis is a geographic data processing engine for high performance applications.
pomadchin on master
change all long literals to use… (compare)
pomadchin on master
update all methods to not use p… (compare)
Just an announcement: we released GeoTrellis 3.0 that depends on Spark 2.4 and has a new RasterSources API released. Also we officially have GDAL package back! https://github.com/locationtech/geotrellis/releases/tag/v3.0.0 any feedback is appreciated :tada:
It is already publish on maven central and locationtech repos
metricLayerRdd.filter(
rddKeyVal => {
val key = rddKeyVal._1
val tileExtentPolygon = key.extent(params.metadata.layout).jtsGeom
val contained = shapePolygon.contains(tileExtentPolygon)
if(tileExtentPolygon.contains(pnt.jtsGeom)) {
println(tileExtentPolygon)
println(shapePolygon)
println(contained)
System.exit(1)
}
contained
})
Exception in thread "main" java.lang.StackOverflowError
at org.locationtech.jts.geom.CoordinateArrays.dimension(CoordinateArrays.java:44)
at org.locationtech.jts.geom.impl.CoordinateArraySequence.<init>(CoordinateArraySequence.java:65)
at org.locationtech.jts.geom.impl.CoordinateArraySequenceFactory.create(CoordinateArraySequenceFactory.java:55)
at org.locationtech.jts.geom.GeometryFactory.createPoint(GeometryFactory.java:267)
at geotrellis.vector.Point$.apply(Point.scala:25)
at geotrellis.vector.reproject.Reproject$.refine$1(Reproject.scala:87)
at geotrellis.vector.reproject.Reproject$.refine$1(Reproject.scala:97)
at geotrellis.vector.reproject.Reproject$.refine$1(Reproject.scala:97)
at geotrellis.vector.reproject.Reproject$.refine$1(Reproject.scala:97)
at geotrellis.vector.reproject.Reproject$.refine$1(Reproject.scala:97)
at geotrellis.vector.reproject.Reproject$.refine$1(Reproject.scala:97)
at geotrellis.vector.reproject.Reproject$.refine$1(Reproject.scala:97)
at geotrellis.vector.reproject.Reproject$.refine$1(Reproject.scala:97)
at geotrellis.vector.reproject.Reproject$.refine$1(Reproject.scala:97)
# Continued...
def assimilate(path: String, catalog: String)(implicit sc: SparkContext): Unit = {
val scheme = ZoomedLayoutScheme(LatLng, tileSize = 256)
val (zoom, rdd) = netcdfToRDD(path, scheme)
val reprojected = rdd.reproject(WebMercator, scheme, Bilinear)
val attributeStore = new FileAttributeStore(catalog)
val writer = new FileLayerWriter(attributeStore, catalog)
writer.write(LayerId("precipitation", zoom), rdd, ZCurveKeyIndexMethod.byHour())
}
@pomadchin here are the shapePolygon and the tileExtent that is inside the polygon
metricLayerRdd.filter( rddKeyVal => {
val key = rddKeyVal._1
val tileExtentPolygon = key.extent(params.metadata.layout)
val contained = shapePolygon.contains(tileExtentPolygon)
if(tileExtentPolygon.contains(pnt.jtsGeom)) {
println(tileExtentPolygon.toGeoJson())
println(shapePolygon.toGeoJson())
println(contained)
System.exit(1)
}
contained
})
output
{"type":"Polygon","coordinates":[[[301599.466697037,4932229.096487437],[301599.466697037,4932230.096487457],[301600.46669720486,4932230.096487457],[301600.46669720486,4932229.096487437],[301599.466697037,4932229.096487437]]]}
{"type":"MultiPolygon","coordinates":[[[[301570.4514820544,4932330.550698328],[301608.4739502942,4932329.050574216],[301615.7797098104,4932283.3908159025],[301567.98736547644,4932285.527373691],[301570.4514820544,4932330.550698328]],[[301568.33936377685,4932265.41646293],[301616.3991255134,4932264.116287277],[301607.37711448024,4932221.9959483575],[301576.71921868704,4932223.2709015105],[301568.33936377685,4932265.41646293]]]]}
false