Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deal with layers consisting of multiple input rasters? #50

Open
smari opened this issue Aug 3, 2020 · 3 comments
Open

How to deal with layers consisting of multiple input rasters? #50

smari opened this issue Aug 3, 2020 · 3 comments

Comments

@smari
Copy link

smari commented Aug 3, 2020

Hello!

This is a pretty great package, but I seem not to be able to put multiple input rasters into the same RasterLayer. This would be useful for cases such as loading input tiles from satellite imagery of the entire Earth without first stitching them all together into one jumbo file (with associated memory requirements). Before I go ahead and add such functionality, I wanted to check if I'm missing some obvious way of doing this? It does seem like I could just give multiple layers the same name, but that seems like a dirty hack (and I haven't checked how the views treat that case).

What's the correct approach? Or do I just have to write my own?

Thanks!

@yellowcap
Copy link
Member

Hi Smari
This is a good use case, and its true that the package does not support this out of the box at the moment. Creating multiple layers would be possible, but very inefficient. The lookup on the view for the tiles is based on layer ID's and so creating multiple layers won't help much. So you could create multiple separate layers and add a lot of layers url endpoints to your visualization map (one per "region" so to speak). But that will be very inefficient and will trigger a lot of requests when browsing.

The raster package can handle pretty big files, so the jumbo file approach might work. But as you mentioned, this requires quite a large server and might be impossible at a global scale, depending on the resolution of your images.

If you want to contribute I would propose to make changes in the RasterLayerParser class

class RasterLayerParser(object):

It is used here to create the tiles:

def create_tiles(rasterlayer_id, zoom, extract_metadata=False):

An "add to rasterlayer" mode instead of "completely new rasterlayer" could be added. This is not a small task though. You could also try to create another parser just for "adding tiles" to a layer, and then hook it into the admin and celery as a separate task.

@yellowcap
Copy link
Member

Maybe another relevant comment here is to remember that this package stores rasters directly in a PostGIS database. So the rasters are "in-db" not "out-of-db". This means that if you want to store a huge raster, you might need a huge database as well. So factor that in when considering the ingestion of global data. Storing many terrabytes of data in PostGIS is possible but has its own challenges as well.

@jonathanmiller2
Copy link

jonathanmiller2 commented Aug 18, 2021

I need this feature as well. I'm working with MODIS data, which is on a sinusoidal grid like so. This projection is very common in environmental science, as NASA uses it for their data products. The reprojection isn't a huge issue, but not being able to input the individual tile data as-is is a big roadblock.

Hopefully the jumbo-file approach will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants