File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import Protobuf from 'pbf';
17
17
import shp from 'shpjs' ;
18
18
19
19
import RASTER_LAYER_GALLERY from '@/rasterlayer_gallery/raster_layer_gallery.json' ;
20
+ import { getGdal } from './gdal' ;
20
21
21
22
export const debounce = (
22
23
func : CallableFunction ,
@@ -486,8 +487,18 @@ export const loadGeoTiff = async (
486
487
fileBlob = await base64ToBlob ( file . content , mimeType ) ;
487
488
}
488
489
490
+ const geotiff = new File ( [ fileBlob ] , 'loaded.tif' ) ;
491
+ const gdal = await getGdal ( ) ;
492
+ const result = await gdal . open ( geotiff ) ;
493
+ const tifDataset = result . datasets [ 0 ] ;
494
+ const metadata = await gdal . gdalinfo ( tifDataset , [ '-stats' ] ) ;
495
+ gdal . close ( tifDataset ) ;
496
+
497
+ await saveToIndexedDB ( url , fileBlob , metadata ) ;
498
+
489
499
return {
490
500
file : fileBlob ,
501
+ metadata,
491
502
sourceUrl : url ,
492
503
} ;
493
504
} ;
You can’t perform that action at this time.
0 commit comments