Closed Anubhavx17 closed 1 year ago
The code that ChatGPT wrote is wrong in some places. There is however a nice example in the Readme, which should get you started.
Hi there, The snippet you sent is actually using different libraries and I would have to change the entire code. I have used leaflet to display the base map, and I am using geotiff library to read the TIFF file as shown in https://geotiffjs.github.io/geotiff.js/
import GeoTIFF, { fromUrl, fromUrls, fromArrayBuffer, fromBlob } from 'geotiff';
//.. const response = await fetch("assets/NDVI_Nov.tiff"); const arrayBuffer = await response.arrayBuffer(); const tiff = await fromArrayBuffer(arrayBuffer); const image = await tiff.getImage(); const data = await image.readRasters(); //..
Could you please let me know how do I add this Tiff image as a layer to LeafLet map so that I can display the TIFF image on my browser ?
@Anubhavx17
I think you could use the georaster-layer-for-leaflet project to do so. It was created by @DanielJDufour and uses geotiff.js underneath, I believe
hi @DanielJDufour , Could you tell how to display a tiff file in angular using [georaster-layer-for-leaflet], It wasn;t very clear from the example(eg 11 source code not visible) ,thank you!
this is my js code
html
I have kept both these files and tiff file in the node module folder