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';
1717import  shp  from  'shpjs' ; 
1818
1919import  RASTER_LAYER_GALLERY  from  '@/rasterlayer_gallery/raster_layer_gallery.json' ; 
20+ import  {  getGdal  }  from  './gdal' ; 
2021
2122export  const  debounce  =  ( 
2223  func : CallableFunction , 
@@ -486,8 +487,18 @@ export const loadGeoTiff = async (
486487    fileBlob  =  await  base64ToBlob ( file . content ,  mimeType ) ; 
487488  } 
488489
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+ 
489499  return  { 
490500    file : fileBlob , 
501+     metadata, 
491502    sourceUrl : url , 
492503  } ; 
493504} ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments