Open Esteban82 opened 10 months ago
These two worked:
gmt grdcut @earth_day_30s_p.tif -R0/10/0/10 -Gonetile.tiff=GTiff
gmt grdcut @earth_day_30s_p.tif -R0/10/0/10 -Gonetile.png=PNG
It is not supported to upload the Gtiff file.
I even could make a map with correct annotations:
gmt grdcut @earth_day_30s_p.tif -R-60/-50/0/10 -Gonetile.png=PNG
gmt grdimage onetile.png -Baf -png test
Good. I noticed two further points:
This looks good. Do we have those gdal "tools" in GMT?
# 1. Create two tiles
gmt grdcut @earth_day_30s_p.tif -R-70/-60/0/10 -G1.tiff
gmt grdcut @earth_day_30s_p.tif -R-60/-50/0/10 -G2.tiff
# 2, Merge files
gdalbuildvrt mosaic.vrt ?.tiff
gdal_translate -of GTiff -co "TILED=YES" mosaic.vrt mosaic.tiff
# 3. Test merge file
gmt grdimage mosaic.tiff -Baf -png test
Do we have those gdal "tools" in GMT?
On Windows yes. Others, depend on how they installed GDAL.
My GDAL on macOS has them. Perhaps
Own builds are not guaranteed to have the gdal tools. But we have grdgdal that works as gdal_teanslate.
The installers have the GDAL tools we use so can easily add a few more if needed. As for building from source, we require GDAL I think.
We indicate gdal-dev not the package with the binaries.
We indicate gdal-dev not the package with the binaries.
But gdal-bin is listed in the optional packages.
Here I made a more complex test leaving some empty places to see if gdal can merge the tiles. It did it well.
Full script
# 1. Create tiling
gmt grdcut @earth_day_30s_p.tif -R-70/-60/0/10 -G1.tiff #=PNG
gmt grdcut @earth_day_30s_p.tif -R-60/-50/0/10 -G2.tiff #=PNG
gmt grdcut @earth_day_30s_p.tif -R-70/-60/-20/-10 -G5.tiff #=PNG
# 2, Merge files
gdalbuildvrt mosaic.vrt ?.tiff
gdal_translate -of GTiff -co "TILED=YES" mosaic.vrt mosaic.tiff
# 3. Test merge
gmt grdimage mosaic.tiff -Baf -png test
Testing tiling images for the server:
Paul, this failed:
gmt grdcut @earth_day_30s_p -R0/15/15/30 -Gonetile.tif=gd