-
Notifications
You must be signed in to change notification settings - Fork 5
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
mosaic all geotiffs #17
Comments
Heyyyyy neat: creating a virt-dataset then using Here's the west FL Peninsula rendered w/ nearest-neighbor downsampled by a factor of 2048: Took about 40m:
|
tylar@tylardesk:~/tmp$ qgis --noplugins --snapshot test.png --project ./testwv.qgz I'm not yet sure how to automate the creation of a QGIS project. |
Perhaps better than using QGIS for this step would be to use rasterio to modify the geotiff example. Note also that |
Just for fun let's try making a giant mosaic:
Neat! |
Example tile generation:
This is all going really surprisingly smoothly. |
creating mosaic for circe images:
Resulting file is 16GB file. A quick glance at it and it looks pretty good in QGIS, although I haven't updated my colormap to match the latest. 👍 |
Using gdal_merge seems to work as well too, although the resulting file get created at
|
Doh: my arguments weren't right last time. This is better:
Trying to optimize the output image so it isn't too big to load into ArcMap. I tried forcing the pixel depth with Tried outputing to png, but got an error:
Maybe we can lean on that old mainstay imageMagick convert:
...bah. not easily. That command ate up the full ~80GB of HDD space (but not RAM). |
More detail about the image produced by gdal_merge:
|
So although this has worked well enough so far, we need to find a way to overlap using the "max" function. |
I did some more work on this and found a few things:
|
Accomplished using gdaladdo by manually adding the following to the .vrt file: <VRTRasterBand dataType="Byte" band="1" subClass="VRTDerivedRasterBand">
<PixelFunctionType>maximu</PixelFunctionType>
<PixelFunctionLanguage>Python</PixelFunctionLanguage>
<PixelFunctionCode><![CDATA[
import numpy as np
def maximu(in_ar, out_ar, xoff, yoff, xsize, ysize, raster_xsize,
raster_ysize, buf_radius, gt, **kwargs):
np.round_(np.clip(np.max(in_ar, axis = 0),0,255),
out = out_ar)
]]>
</PixelFunctionCode> This is described here.
|
solution documented at https://gist.github.com/7yl4r/d03f9617212db5efded1f8a0d34550d3 |
I just tried running gdaladdo for the SE TX region and found that gdaladdo is RAM-limited. Also worth noting that gdaladdo seems to be single-threaded; not ideal. |
I'm now attempting to use gdalwarp.
A few wv03 images threw an "operation not permitted" error and I moved them from /images/ to /mved/. |
I just ran
1016 images. It took a few days. Final file is 140G large. I suspect the tile differences are less profound when calculated using the 'max' function. |
this is not so important now that we have GEE working to mosaic on the fly |
I think it is about time we start talking about how to mosaic all these geotiffs.
For now let's will focus on smushing all images into one and we can discuss more complex mosaics later.
user needs/wants
Firstly I want to make sure I understand what users would want given no technical limitations.
Here are my starting assumptions; I will update as we discuss further:
...is that really it?
technical considerations
solution comparison/discussion
Now I will list resources/options I have found, sorted by my preference, with pro/con (:green_heart:, :broken_heart:) lists.
The text was updated successfully, but these errors were encountered: