Doodleverse / seg2map

Seg2Map is an interactive web map app for geospatial image segmentation using deep learning
MIT License
13 stars 2 forks source link

Add ability to load multiple rasters onto the map #4

Closed 2320sharon closed 1 year ago

2320sharon commented 1 year ago

Users are going to want to load a merged_multispectural tif for each year they download imagery for. leafmap's default method to load rasters onto the map load_raster takes about 15 seconds to load as discovered by @venuswku . There needs to be way to quickly load multiple rasters onto the map within 5 seconds or less ideally. leafmap and geemap have ways of quickly loading rasters from a STAC catalogue that should be investigated.

Some finding from research (thanks to @venuswku)

dbuscombe-usgs commented 1 year ago

It seems plausible that if we can simultaneously download imagery and generate XML files, that should speed up rendering of the image on the map?

2320sharon commented 1 year ago

It seems plausible that if we can simultaneously download imagery and generate XML files, that should speed up rendering of the image on the map?

Sounds like you're suggesting a workflow similar to this.

  1. Downloading imagery starts
  2. One set of tifs finishes downloading
  3. Those tif are turned into the merge multispectral tif
  4. That merged multispectral is loaded onto the map while the rest of the downloads finish

Does this sound like your idea?

We can provide the user the option to turn off loading of the rasters on the map as they download to prevent the possibility of crashing leafmap too. Of course, all this hinges on the capability of leafmap to be updated asynchronous by multiple threads which I don't even know if its possible.

dbuscombe-usgs commented 1 year ago

Yes, that is the idea

I'm not sure how the xml file is being generated by leafmap, but perhaps a) we dont need to use leafmap for this, i.e. we can have code run in the background that creates an xml file as soon as a merge multispectral tif is made b) if concurrency can't be reliably achieved using leafmap, we could always use a OS subprocess?

2320sharon commented 1 year ago

After experimentation with loading rasters on the map and loading jpgs on the map, we've determined the fastest way to load multiple images on the map is to convert the .tiff files to .jpg. This approach is the one currently implemented.