Open pjcozzi opened 6 years ago
Note that the openlayers viewer users an AWS lambda tile server. Though you're more than welcome to hit that tile server until I run out of credits. Could make a similar interaction easily.
The other thing to note is https://github.com/constantinius/geotiff.js/issues/36 - this should hopefully be a pure JS library that cesium would be able to use. cc @constantinius
I was under the impression that cloud-optimized geotiffs were more for on-demand tiling using something like AWS lambda reading from a GeoTIFF stored on S3 (ideal for "serverless" but not something Cesium can do completely client side. Because of things like band data type, projection, compression, etc.. it would be really hard for Cesium to ingest the image as tiles without a server.
That being said, I would love to be wrong.
Yeah, it's still an experiment that needs to be done, but if @constantinius is successful it should open the way for cesium. We've also contemplated a cloud optimized geotiff profile for a 'web cog', see https://github.com/locationtech/geotrellis/issues/2284 - it'd be web mercator with tiles that match web tiles, and would have RGB, etc.
But yes, using COG's with on-demand tiling with geotiffs on S3 works today and would definitely be the place to start.
Sounds promising, thanks for the info.
Hi folks!
I was under the impression that cloud-optimized geotiffs were more for on-demand tiling using something like AWS lambda reading from a GeoTIFF stored on S3 (ideal for "serverless" but not something Cesium can do completely client side. Because of things like band data type, projection, compression, etc.. it would be really hard for Cesium to ingest the image as tiles without a server.
GeoTIFF.js is capable of (or will soon be) handling all data abstraction stuff (remote reading, all kinds of tiling, compression, etc). It can read the actual raster values (TypedArrays) which can then be visualized. For single band false color visualization there is a good library that works well with the parsed data.
What we are currently thinking about is a JS library that creates nice RGB views of e.g Landsat images using various techniques like contrast stretching etc.
What is missing is handling the reprojection of the images to map them on the cesium globe. OpenLayers is capable of this, maybe it is possible to extract this piece and make it commonly available.
Those are the available/missing pieces, as we see it.
Thanks for connecting @cholmes
They recently launched http://www.cogeo.org/ which does a good job of summarizing everything. Also, every is just calling them COGs now.
Eugene from Azavea gave a good talk on it at FOSS4GNA as well, not sure when/if his slides will get posted: https://2018.foss4g-na.org/session/best-practice-serving-cog-imagery-using-mapserver-cloud-sponsored-aws
I successfully implemented Google COGs on Google Maps with Geotiff.js and now I am implementing Cesium. I will be looking on this functionality and let you know of my progress.
Hi @philip-firstorder. Is there any update with your implementation. I am using Cesium for my project and it's very helpful if I can render COGs on mapviewer. Let me know if there is any updates.
Hello,
On fileorder.io you can create an account and upload COGs. Then just right-click the image and click View On Maps, you will then see your COG on Google Maps.
For Cesium I was delayed by some other developments and didn't get to implement COG on it yet.
any update on the COG support ?
Hi @abhijitgujar86 , I just created a cesium plugin TIFFImageryProvider, which support Load and render Cloud optimized GeoTIFF on Cesium.
I just created a cesium plugin TIFFImageryProvider,
Wonderful, thanks for sharing! I just tried to load a custom landsat COG on your online demo (the one used on the OpenLayers example), but it could not load, do you know why? No error in the console, just an out-of-memory error in chrome and the tab crashes.
@jo-chemla Hello, I have solved this problem, now you can add the OpenLayers example through my online demo
@jo-chemla Thank you for your suggestion, as the readme says, you can customize the band of rgb channel. (Maybe I should provide more rendering configurations in the demo) The layer tree was created with react-sortable-hoc, and you can copy the code from demo folder.
@jo-chemla I added a multi-band/ single-band rendering configuration in the demo. You can try it.
@hongfaqiu , thanks for sharing, great job!
@jo-chemla , can you please describe how you've fixed the problem with inverted colors?
@ilyaly, are you referring to the three-band rendering in TIFFImageryProvider? According to the API documentation, you can set the r
, g
, and b
options to the corresponding color band index of the TIFF image. Here's an example code snippet for your reference:
const provider = new TIFFImageryProvider({
url: 'YOURTIFF.tif',
renderOptions: {
r: { band: 4 },
g: { band: 3 },
b: { band: 2 },
}
});
Hope this helps!
Great news! I have added WebGL support to the continuous color interpolation feature, which has significantly improved rendering speed. You are welcome to try it out and experience the difference!
@hongfaqiu , thank you for your reply!
Yeah I am talking about the three-band rendering. I do understand how to configure bands order but still cant reach a desired appearance.
For reference here is how this raster is displayed in COG Explorer:
And here is how it is displayed in your demo app:
@ilyaly It seems like there is a bug, I suggest you to raise an issue in my repo, and I will fix it soon.
@hongfaqiu This is probably due to a difference in the color representation. geotiff.js has a readRGB
method, that translates to RGB colorspace.
@constantinius Thank you for your help. I have just seen your message now. As you said, the problem has been resolved and it is now working properly.
https://trac.osgeo.org/gdal/wiki/CloudOptimizedGeoTIFF
Basically a GeoTIFF with tiles that can be served without a full tile server.
A good starting place could be this OpenLayers viewer by @cholmes: https://github.com/cholmes/cog-map
Could be a great code sprint project!