Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 26 17:37
    pomadchin synchronize #3487
  • Nov 26 17:37
    pomadchin synchronize #3487
  • Nov 21 09:10
    jdries opened #3488
  • Nov 11 03:24
    pomadchin commented #3487
  • Nov 11 03:24
    pomadchin commented #3487
  • Nov 11 03:24
    pomadchin commented #3487
  • Nov 11 03:22
    pomadchin commented #3487
  • Nov 04 19:42
    pomadchin commented #3487
  • Nov 04 19:41
    pomadchin commented #3487
  • Nov 04 14:37
    pomadchin edited #3487
  • Nov 04 14:03
    pomadchin synchronize #3487
  • Nov 04 14:01
    pomadchin synchronize #3487
  • Nov 04 05:20
    pomadchin commented #3487
  • Nov 04 05:19
    pomadchin commented #3487
  • Nov 04 05:19
    pomadchin commented #3487
  • Nov 04 05:18
    pomadchin labeled #3487
  • Nov 04 03:36
    pomadchin synchronize #3487
  • Nov 04 03:26
    pomadchin synchronize #3487
  • Nov 04 03:00
    pomadchin synchronize #3487
  • Nov 04 02:47
    pomadchin synchronize #3487
Grigory
@pomadchin
:+1: thank you
santocp94
@santocp94

hey @pomadchin I'm sorry but I'm still having some trouble with my mosaic task :( . I wrote this starting from your suggestion:

  val firstTiff = GeoTiffReader
    .readSingleband("...")
  val combinedExtent = firstExtent.expandToInclude(secondExtent)
  val re = RasterExtent(combinedExtent, firstTiff.cellSize)

  val newRaster = Raster(ArrayTile.alloc(firstTiff.cellType, re.cols, re.rows), re.extent)
  val mergedRaster = newRaster.merge(Raster(firstRaster.tile, firstExtent))

I can't understand why but the merge function with that configuration is not resolved. I tried with other two rasters read form files and the function is correctly resolved. The only difference I noticed between the created raster and the read ones is that the geotrellis.raster.DoubleUserDefinedNoDataArrayTile produces a merge while the read raster have a inner geotrellis.raster.io.geotiff.Float64GeoTiffTile. Did I mess up something with imports and packages?
Thanks in advance

Grigory
@pomadchin
hey @santocp94 what to you mean by not correctly resolved?
caoguangshun
@caoguangshun
ok @pomadchin ,i have sovled the problem referring to your test code in the github. and i add a configuration file in resource folder .as following
Grigory
@pomadchin
@caoguangshun great!
santocp94
@santocp94

hey @santocp94 what to you mean by not correctly resolved?

I tried with different configurations but an error occurred:

value merge is not a member of geotrellis.raster.Raster[geotrellis.raster.MutableArrayTile]

or

value merge is not a member of geotrellis.raster.Raster[geotrellis.raster.ArrayTile]
Grigory
@pomadchin
@santocp94 try to cast internals of the Raster to MultibandTile
if that would not work, check if withMultibandRasterMergeMethod(raster).merge works
but I bet this is due to types mismatch
MutableArrayTile is kind of a dangerous type (:
I’m surprised that it didn’t work with ArrayTile
looks like some imports hell.
santocp94
@santocp94
Looks like I can't just cast it: Exception in thread "main" java.lang.ClassCastException: class geotrellis.raster.DoubleUserDefinedNoDataArrayTile cannot be cast to class geotrellis.raster.MultibandTile
and I'm actually failing to import withMultibandRasterMergeMethod. I also tried to re-import everything from scratch but the problem persists
Grigory
@pomadchin
@santocp94 well yes, DoubleUserDefinedNoDataArrayTile can be cast to Tile
it is not a MultibandTile (:
@santocp94 what are your imports?
import geotrellis.raster._ should be able to get it into the scope
If that doesn’t happen - than or implicits are wrong or smth else is happening in your codebase
The last resort could be to use it directly from geotrellis.raster.merge.Implicits._ but I can recommend it only for test / dev purposes
Eetu Pursiainen
@epursiai
Hmm. So excluding circe from dependencies when installing Geotrellis in Databricks didn't work, as then those needed circe classes were not found at all. Since I'm not really a experienced Java/Scala dev, I'm wondering what's the easiest way to create a proper uber jar, or to shade those circe dependencies...
Grigory
@pomadchin

@epursiai just create an uber jar and shade them; check out https://github.com/sbt/sbt-assembly#shading

we usually use sbt-assembly plugin for these purposes; The example of usage in the gt build code is here https://github.com/locationtech/geotrellis/blob/master/project/Settings.scala#L559-L569

So in your case along with the circe rule you would need shapeless and cats kernel shading:

ShadeRule.rename("io.circe.**" -> s”$shadePackage.io.circe.@1").inAll
ShadeRule.rename("shapeless.**" -> s"$shadePackage.shapeless.@1").inAll,
ShadeRule.rename("cats.kernel.**" -> s"$shadePackage.cats.kernel.@1").inAll
yang162132
@yang162132
'./scripts/server --ndvi
Starting geotrellis-server-450_ndvi-example_1 ... done
Attaching to geotrellis-server-450_ndvi-example_1
ndvi-example_1 | Error: Could not find or load main class geotrellis.server.example.ndvi.NdviServer
geotrellis-server-450_ndvi-example_1 exited with code 1
' what's wrong
Grigory
@pomadchin
hey @yang162132 what are you trying to do?
what repo it is and what’s happening there
yang162132
@yang162132
Grigory
@pomadchin
oooooh I see; I think I haven’t properly updated the docker compose file
for now I think it would be more stragihtforward to:
$ sbt
$ project example
$ // run
chdsb
@chdsb
Hey,i'm beginner of geotrellis,I have some simple questions.
1.when i use "polygonalHistogramDouble" method,i always get 80 points but which should be more.
2.not only get the vaule of raster,but i also want get the Longitude and latitude of the.what should i do?Calculating from tile extent?
3.how can i choose tile level by myself,rather then calculat automaticly by tilesize in "ZoomedLayoutScheme"(for example,i want keep 256*256 resolving power,and make 0 to 19 level's tile)
Thanks
Grigory
@pomadchin

Hey @chdsb I don’t think we have polygonalHistogramDouble method anymore; we have a general polygonalSummary API with visitors passed inside that can be controlled by you

https://github.com/locationtech/geotrellis/blob/master/spark/src/main/scala/geotrellis/spark/summary/polygonal/RDDPolygonalSummary.scala

about 2. I don’t really get the question: do you want to get coordinates of a certain pixel of a tile? yes you need the tile extent and its resolution:
RasterExtent(extent, cellSize).gridToMap(col, row) // the result is a tuple of geospatial coordinates in the extent projection
Also I’m responding in terms of the GT 3.6.0
yang162132
@yang162132
Hey @pomadchin What's the difference between ValueReader and LayerReader in geotrellis
Grigory
@pomadchin
Hey @yang162132 ; value reader allows to access tiles by Key; LayerReaders allow to operate with tile collections; checkout APIs of both!
Max
@Max-AR
Has anyone sucessfully used graalvm with geotrellis?
Grigory
@pomadchin
Hey @Max I actually haven’t tried but may work; what issues do you have when using it as a runtime?
* not talking about native image
Max
@Max-AR
I haven'
t tried at the moment, I was thinking of ways to eek out more performance. In the project I am working right now I have some libs using reflection based DI that need to be removed first
If I end up getting around to it I'll post back here for sure
Grigory
@pomadchin
@Max you’re probably talking about native image - yea this one would not work; but you may try graalvm; there are articles in the wild that demonstrate some benefits of Spark + Graal
yang162132
@yang162132
klmc66666
@klmc66666
@pomadchin geotrellis is support read and write webp format?
Grigory
@pomadchin
Hey @yang162132 could you drop here the stack trace?
hello @klmc66666 only reading and only via GDAL
yang162132
@yang162132
java.util.NoSuchElementException: Either.right.get on Left
at scala.util.Either$RightProjection.get(Either.scala:640)
at geotrellis.server.example.ndvi.NdviService.$anonfun$redQueryParamDecoder$1(NdviService.scala:55)
at cats.data.Validated.map(Validated.scala:559)
at org.http4s.QueryParamDecoder
KaTeX parse error: Can't use function '$' in math mode at position 5: anon$̲7.decode(QueryP…: anon$7.decode(QueryParam.scala:205)
    at org.http4s.dsl.impl.QueryParamDecoderMatcher.$anonfun$unapply$3(Path.scala:327)
    at scala.Option.flatMap(Option.scala:271)
    at org.http4s.dsl.impl.QueryParamDecoderMatcher.unapply(Path.scala:327)
    at geotrellis.server.example.ndvi.NdviService
anonfun$routes$1.applyOrElse(NdviService.scala:75)
at geotrellis.server.example.ndvi.NdviService$$anonfun$routes$1.applyOrElse(NdviService.scala:73)
at scala.PartialFunction$Lifted.apply(PartialFunction.scala:228)
at scala.PartialFunction$Lifted.apply(PartialFunction.scala:224)
at org.http4s.HttpRoutes$.$anonfun$of$2(HttpRoutes.scala:79)
at $anonfun$combineK$1 @ org.http4s.syntax.KleisliResponseOps.$anonfun$orNotFound$1(KleisliSyntax.scala:49)
at getOrElse @ org.http4s.syntax.KleisliResponseOps.$anonfun$orNotFound$1(KleisliSyntax.scala:49)
at main$ @ geotrellis.server.example.ndvi.NdviServer$.main(NdviServer.scala:33)
@pomadchin
Grigory
@pomadchin
@yang162132 oh I see, the incorrect format of inputs
yang162132
@yang162132
Oh, the uri or json ?