ChaddFrasier / PIE

Planetary Image Editor. Using the idea of PIPS but exchanging the back-end server for an api that can connect to usgs applications like POW or PILOT.
0 stars 0 forks source link

GeoTIFF Exportation #314

Closed ChaddFrasier closed 3 years ago

ChaddFrasier commented 3 years ago

GDAL needs to be used with:

Ok here is a trick. 

gdal_translate -of vrt in.tif out.vrt

The VRT is a tiny ascii header with all the needed metadata. Now edit the *.tif, add graphics, save it with the same name, but don't make it bigger or smaller...  Once done:

gdal_translate out.vrt new.tif
-- this will add back the "geo" to the tiff.

Say you need to edit a PNG.
gdal_translate -of PNG -ot byte -scale in.tif (or in.cub) out.png
gdal_translate -of VRT out.png out.vrt
edit png same as before and to make a geotiff again
gdal_translate out.vrt out_geo.tif

Check out the VRT. It can be magically for virtual clips, map projections, scales, mosaics, band ordering ...

-Trent
ChaddFrasier commented 3 years ago

Got the code in. Trent needs to confirm the method