Closed undefinedSolutions closed 3 years ago
I think this is an issue in the documentation. Please try the import like this:
import GeoTIFF, { fromUrl } from 'geotiff';
// ...
Thanks a lot! It works...
I will update the docs accordingly. Thanks for reporting this
how did you display the tiff file? could you share ur entire code for displaying tiff file in angular, thanks!
I was using AG 13.1.2 for my master-thesis, here is a example for an RGBA-COG: https://github.com/undefinedSolutions/masterarbeit-cog-openlayers/blob/master/src/app/cog/cog-ortho-lindenrain/cog-ortho-lindenrain.component.ts
Hi there thanks a lot for replying, 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 the 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 ?
Hello, unfortunately I currently have a problem importing GeoTIFF in Angular 11.
When I install GeoTIFF via npm.
npm install geotiff
app.component.ts:
I then received the following error messages:
I was able to fix this with adjustments in the package.json.
But then I get the following error message in the browser:
A workaround is to load the javascript file into angular.json. However, I would like to avoid this and implement a clean impementation. angular.json:
app.component.ts:
I hope you can help me.