Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 21 17:19
    fosskers commented #2646
  • Feb 21 17:17
    fosskers closed #1989
  • Feb 21 17:14
    fosskers commented #2351
  • Feb 21 17:14
    fosskers closed #2341
  • Feb 21 17:11
    pomadchin commented #2646
  • Feb 21 17:10
    fosskers commented #2646
  • Feb 20 21:51
    pomadchin commented #3190
  • Feb 20 21:45
    doug-aero commented #3190
  • Feb 20 21:37
    doug-aero commented #3190
  • Feb 20 21:35
    doug-aero commented #3190
  • Feb 20 21:35
    doug-aero commented #3190
  • Feb 20 21:10
    jpolchlo commented #3190
  • Feb 20 19:53
    pomadchin commented #3190
  • Feb 20 18:42
    doug-aero commented #3190
  • Feb 20 14:53
    pomadchin commented #3190
  • Feb 20 14:51
    pomadchin edited #3190
  • Feb 20 14:42
    pomadchin commented #3190
  • Feb 20 14:28
    jpolchlo commented #3190
  • Feb 19 22:42
    pmacleod commented #3187
  • Feb 19 20:57

    pomadchin on master

    Fix GeoTiff Byte and UByte Cell… (compare)

Simeon H.K. Fitch
@metasim
After I finish the GT 3.x upgrade ;-)
Grigory
@pomadchin
: D
yo @kervel to make this function work you need only to have import geotrellis.spark._ in the call scope. If you have it and function still doesnt work try to use withGetBoundsMethod(rdd).getGridBounds in your code, this at least will give you a readble compile time error.
Jason T Brown
@vpipkt
My reading of this GDAL doc is that there will never be a signed Byte type. And that would mean that the first case here is always true and the second is never evaluated?
we have a bit more rich typesystem; it is wider than what GDAL Provides
also we just store data differently; we don’t have unsugned types in java (: so any byte tiff is by default in [-128; 127] ranges; and UByte allows to interpret them as [0..255] values
Grigory
@pomadchin
ha @vpipkt mb you’re right
Frank Dekervel
@kervel
@pomadchin I know where the error is coming from.. the withGetBoundsMethod Class takes the rdd as instance variable, and needs to be serializable because of this
Grigory
@pomadchin
Ah….. nd value probably can be below zero… because we don’t have ubytes
but still check it i.e. what if NoData Value=255
Frank Dekervel
@kervel
Just like the other implicit classes in the same file, which already are.
Grigory
@pomadchin
@kervel mb; do you have serialziation issues?
Frank Dekervel
@kervel
Yes. But the fix is simple
Grigory
@pomadchin
Nice! would you like to create a PR with marking this implicit class as serializable?
Frank Dekervel
@kervel
Ok.
Grigory
@pomadchin
:100:

It would be awesome if you could sign an ECA https://github.com/locationtech/geotrellis/blob/master/docs/CONTRIBUTING.rst#eclipse-contributor-agreement-eca

after that commit changes via git commit -s -m “commit message” command

Frank Dekervel
@kervel
Ok.
Jason T Brown
@vpipkt
@pomadchin i am not sure how to proceed, but my understanding is that since GDAL's type system is narrower, a GDT_Byte should always result in either UByteCellType, UByteUserDefinedNoDataCellType or UByteConstantNoDataCellType
the function as called will never return a BitCellType either because no typeSizeInBits is passed
(at least as called in this context)
Jason T Brown
@vpipkt
@pomadchin happy to keep the discussion going on this PR: locationtech/geotrellis#3150
Grigory
@pomadchin
@vpipkt can you cover it with test? so we would know that GDALRasterSource behaves the same way GeoTiffRasterSource does
Simeon H.K. Fitch
@metasim
If I have, say, an RDD[ProjectedRaster[Int]] (heterogeneous in CRS) and want to write them all out to HDFS, isn't there an "unstructured cog writer" feature in GT?
Or rather, is that the right/best option?
I don't want to reproject anything or resample it into a new grid.
Grigory
@pomadchin
@metasim nope we didn’t solve it :s
There it still a problem how would you collect metadata of multiple raster sources
Simeon H.K. Fitch
@metasim
Did you do some experimental work on it?... seem to remember some code somewhere ages ago....
Simeon H.K. Fitch
@metasim
where you were writing out debugging vrt files? or am I making that up.
Grigory
@pomadchin

@metasim we didnt resolve that; imagine the case that you have multiple RasterSources
you want to figure out how to tile them to some layout in some projection…

it would mean that you probably need to collect metadata in some CRS or reprojet it into some CRS to have some idea of the entire rasters list extent

ahhhh youre talking about persisting
and not about reading
hmmm can you describe your usecase a lil bit more?
Im jsut flygin in a different context at the moment
Simeon H.K. Fitch
@metasim
yeh, sorry. Say you want to write out a bunch of DL chips as geotiffs, organized via some arbitrary partitioning scheme. Maybe some json sidecars for metadata (or not).
BTW, progress is being made: https://circleci.com/gh/s22s/rasterframes/1757

@pomadchin

yeh, sorry. Say you want to write out a bunch of DL chips as geotiffs, organized via some arbitrary partitioning scheme. Maybe some json sidecars for metadata (or not).

Another way of looking at it (from a RasterFrames perspective) is how might I write out unstructured tiles in a form that's not, say Parquet or ORC... some form that could be slurped up by other tooing.

Not really a hard lift... just wondering if you'd gone down that path before.
Nathan Banek
@natonic77

I'm trying to render a GeoTIFF as PNG, but don't know a priori if it is single or multi band. Getting an assertion failure on color when I attempt renderPng if I don't do the following:

val gt = GeoTiffReader.readMultiband("my.tif")
gt.bandCount match {
    case 1 => gt.tile.band(0).renderPng.write("my.png")
    case i if i > 1 => gt.tile.renderPng.write("my.png")
}

I'm a GT newbie, so I'm sure overlooking something obvious, but is there not a single mechanism through the API to render an n-band GeoTIFF?

Grigory
@pomadchin
hey @natonic77 nope, because for multibands and singlebands the way you generate PNGs is different
but if you have a nice API suggestion feel free to throw ideas!
Nathan Banek
@natonic77
thanks for the quick reply @pomadchin. I can work with it, it's just awkward, but I think it may have more to do with me needing to work with the library differently. For my purposes, I probably need to get a little smarter on combining bands since I'm ultimately going to want to render a single layer image.
Grigory
@pomadchin
do you mean a singleband image?
The reason why the render function behaves differently is because renderToPng converts a multibandtile into a single banded png => it means that it needs to combine for instance 3 bands somehow to build a valid png; usually you want to visualize a 3 bands raster (rgb)
In case you have a single band raster it means that you already combined them into a valid band so you can render it
Nathan Banek
@natonic77
yes - I meant singleband, and yes combining into a single band for rendering is the goal. I sometimes receive single band tiffs (grayscale) and other times get RGB multi band tiffs. I was actually trying to use renderJpg to do this originally, but even when calling that from the multi band object it seemed to give me a strangely colored (maybe just blue and red without green) raster, so I had to fall back to renderPng which was giving an accurately colored output (albeit a much larger file). I hadn't gotten far enough with using renderJpg to see that the api mechanism was different.
tosen1990
@tosen1990
Yeah,it has a little bit change.
Grigory
@pomadchin
hey @rexuexiangbei you can use github markdown to wrap your code. Can you throw here exceptions you have?