Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 03 18:10
    CloudNiner labeled #3312
  • Dec 03 18:10
    CloudNiner opened #3312
  • Dec 03 17:03
    CloudNiner edited #3304
  • Dec 03 17:02
    CloudNiner labeled #3311
  • Dec 03 17:02
    CloudNiner labeled #3310
  • Dec 03 17:02
    CloudNiner labeled #3309
  • Dec 03 17:02
    CloudNiner labeled #3308
  • Dec 03 17:02
    CloudNiner labeled #3307
  • Dec 03 17:02
    CloudNiner labeled #3306
  • Dec 03 17:02
    CloudNiner labeled #3305
  • Dec 03 17:02
    CloudNiner labeled #3304
  • Dec 03 17:01
    CloudNiner opened #3311
  • Dec 03 17:00
    CloudNiner unassigned #3052
  • Dec 03 16:59
    CloudNiner opened #3310
  • Dec 03 16:57
    CloudNiner commented #3306
  • Dec 03 16:54
    CloudNiner closed #1740
  • Dec 03 16:52
    CloudNiner closed #2461
  • Dec 03 16:52
    CloudNiner commented #2461
  • Dec 03 16:52
    CloudNiner opened #3309
  • Dec 03 16:50
    CloudNiner closed #2786
Grigory
@pomadchin
@iceland1906 what is the CRS of these polygons?
David Landry
@davidlandry93
Extent(210.0, 40.0, 309.8999938964844, 69.94000244140625)
Grigory
@pomadchin
@davidlandry93 210 and 309 are problematic here O:
David Landry
@davidlandry93
Extents are lat lon lat lon?
Grigory
@pomadchin
in LatLng longs are in [-180, 180] & lats are in [-90, 90] degree ranges
David Landry
@davidlandry93
Ohhhhhh
iceland1906
@iceland1906
@pomadchin EPSG:32616
Grigory
@pomadchin
@iceland1906 ha this looks like a bug(?)
Will look closer into it today
iceland1906
@iceland1906
thanks @pomadchin
Grigory
@pomadchin
what is tileExtentPolygon.contains(pnt.jtsGeom)?
in your code above
and what is the type of shapePolygon?
ah nvm I think I fugred out how to reproduce ghe behavior you had
will create a unit test for it
iceland1906
@iceland1906
@pomadchin tileExtentPolygon.contains(pnt.jtsGeom) is just a condition to only show one tile in the target polygon, for demo purpose, not related with the issue
shapePolygon is geotrellis.vector.MultiPolygon type
Ricardo Yrupailla Meza
@stg101
Hi everyone, congratulations on 3.0 !
How can I save
a geotrellis.spark.TileLayerRDD[geotrellis.layer.SpatialKey] as a single tif file
?
btw I am starting to use geotrellis, so excuse me if the question is too simple.
iceland1906
@iceland1906
@stg101 try Section "Stiching Tiles into a single GeoTiff" at this link https://geotrellis.readthedocs.io/en/latest/guide/spark.html
Ricardo Yrupailla Meza
@stg101
Thanks I'm going to try that
I got the following error
[error]  No implicit view available from geotrellis.layer.SpatialKey => geotrellis.spark.tiling.TilerKeyMethods[geotrellis.layer.SpatialKey,geotrellis.layer.SpatialKey].
[error]       rdd.collectMetadata[SpatialKey](layoutScheme)
[error]
In this line
    val (_: Int, metadata: TileLayerMetadata[SpatialKey]) =
      rdd.collectMetadata[SpatialKey](layoutScheme)
Grigory
@pomadchin
hey @stg101 yea, but it depends on what do you want: you can stitch TileLayerRDD into a single raster and persist as a tiff (but it would trigger the entire rdd reduce on a driver) or you can group it by and save by chunks
what is the type of your RDD? during the collect metadata step rdd.collectMetadata
Ricardo Yrupailla Meza
@stg101
I would like to stitch the TileLayerRDD into a single raster
The type is geotrellis.spark.TileLayerRDD[geotrellis.layer.SpatialKey]
Grigory
@pomadchin
Yea so collectMetadata works only for RDD[ProjectedExtent, T]
you already have all metadata in rdd.metadata
the only thing you need to do is to call rdd.stitch and that is it
val rdd: TileLayerRDD[SpatialKey] = ???
val raster: Raster[Tile] = rdd.stitch
GeoTiff(raster, rdd.metadata.crs).write(“path/to/output.tiff”)
Ricardo Yrupailla Meza
@stg101
Thank you so much !
Grigory
@pomadchin
hey @iceland1906 how do you get your MultiPolygon? from geoJson?
iceland1906
@iceland1906
yes
polygonType match {
      case "Polygon" =>
        val polygon = jsonString.parseGeoJson[Polygon]
        val reprojectedPolygon = polygon.reproject(CRS.fromEpsgCode(polygonEpsg), CRS.fromEpsgCode(epsgCode))
        MultiPolygon(Array(reprojectedPolygon))
      case "MultiPolygon" =>
        val multiPolygon = jsonString.parseGeoJson[MultiPolygon]
        multiPolygon.reproject(CRS.fromEpsgCode(polygonEpsg), CRS.fromEpsgCode(epsgCode))
    }
Grigory
@pomadchin
gotcha
and what gt version do you use?
2.x?
(Im trying with 3.x the same issue is present)
iceland1906
@iceland1906
my version 2.2.0
Grigory
@pomadchin
gotcha
Grigory
@pomadchin
@iceland1906 can you split manually your multipolygon into two polygons, parse them and check your function?
I think I know where is the problem but want to doublecheck the behavior
also will create an issue in a while
iceland1906
@iceland1906
sure
iceland1906
@iceland1906
@pomadchin it works if split the multipolygon into two seperate polygons
Simeon H.K. Fitch
@metasim
Unification with JTS geometry in GT 3.0 is awesome!
Only change I've had to do is delete any jtsGeom, except for on Extent, where I call toPolygon.