I'm having a harder time with parallelisation than I expected to, so I'll return to that tomorrow or possibly on Thursday after addressing https://github.com/eldang/elevation_lookups/issues/13 . So here's a very small increment of work:
Makes the SRTM subsystem give its temp files unique names and delete them at the end of a run, so that multiple instances of this project can run in parallel using the same data directory. This is probably not a particularly useful form of parallelisation, but it seems like better behaviour anyway.
Sets up both objects that need a close() method so they can be called as context managers, just because I find that syntax tidier and more pythonic.
Yeah, it's working how you've guessed. Specifically:
Step through each integer degree square covering the input file, check if a local TIFF already exists for that and if not then download one as srtm/srtm.minx.miny.tif so future runs can find it.
Make a temp file that stitches together whatever TIFFs are required, and then clips that to the extent of the input file.
Load that temp file in rasterio and use that for all the lookups.
Delete the temp file when done, but leave the source files.
I'm having a harder time with parallelisation than I expected to, so I'll return to that tomorrow or possibly on Thursday after addressing https://github.com/eldang/elevation_lookups/issues/13 . So here's a very small increment of work:
data
directory. This is probably not a particularly useful form of parallelisation, but it seems like better behaviour anyway.close()
method so they can be called as context managers, just because I find that syntax tidier and more pythonic.