GeoTIFF: Unterschied zwischen den Versionen

Aus Geoinformation HSR
Wechseln zu: Navigation, Suche
K (make each HowTo/Tip a subsection)
K (General information: make cogoe.org a link)
 
(3 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 14: Zeile 14:
 
   % gdal_translate -of VRT your.tif work.vrt
 
   % gdal_translate -of VRT your.tif work.vrt
 
   % gdal_translate work.vrt fixed_your.tif
 
   % gdal_translate work.vrt fixed_your.tif
 +
 +
=== "cloud optimized" GeoTIFF ===
 +
 +
==== General information ====
 +
* http://cogeo.org
 +
* https://trac.osgeo.org/gdal/wiki/CloudOptimizedGeoTIFF
 +
* [https://fosdem.org/2018/schedule/event/geo_gdal/ FOSDEM'18 talk "GDAL Tips and Tricks - GDAL installation, Python usage, and Cloud GeoTIFFs"] by Jeremy Mayeres, 00:09:10 to 00:13:18
 +
 +
==== creation: GeoTIFF to "cloud optimized GeoTIFF ====
 +
 +
(According to above talk, 00:11:14)
 +
 +
Create internal overviews (if not already created)
 +
 +
  gdaladdo -r average in.tif 2 4 8 16
 +
 +
Then
 +
 +
  gdal_translate in.tif out.tif \
 +
    -co TILED=YES \
 +
    -co COPY_SRC_OVERVIEWS=YES \
 +
    -co COMPRESS=LZW
 +
 +
Host result on server supporting HTTP 1.1 Range Requests (Byte Serving). (Amazon S3, Google Cloud Storage, Azure all support this.)
 +
 +
http://www.cogeo.org/developers-guide.html uses <code>-co COMPRESS=DEFLATE</code> instead of <code>-co COMPRESS=LZW</code>. According to https://trac.osgeo.org/gdal/wiki/CloudOptimizedGeoTIFF#Unspecifiedpoints, either can be used.
 +
 +
==== usage ====
 +
 +
  gdalinfo /vsicurl/http://landsat-pds.s3.amazonaws.com/L8/001/003/LC80010032014272LGN00/LC80010032014272LGN00_B1.TIF
 +
 +
will only <code>HTTP GET</code> the beginning of the file (with the metadata), not the complete GeoTIFF. Some [http://www.cogeo.org/#implementations other software] supports this as well. Also fetching only up to the neede overview when viewing data "zoomed out".

Aktuelle Version vom 20. Februar 2018, 15:57 Uhr

See also:

Tipps

How to convert Tiff to GeoTIFF

See GDAL.

How to remove the nodata values from a GeoTIFF?

I find many instructions on how to add the values, but none on how to remove them. => There isn't a direct way of accomplishing this. You could extract a work.vrt file, then manually edit it and remove the line(s) with the NoDataValue tags. Then convert back to geotiff:

 % gdal_translate -of VRT your.tif work.vrt
 % gdal_translate work.vrt fixed_your.tif

"cloud optimized" GeoTIFF

General information

creation: GeoTIFF to "cloud optimized GeoTIFF

(According to above talk, 00:11:14)

Create internal overviews (if not already created)

 gdaladdo -r average in.tif 2 4 8 16

Then

 gdal_translate in.tif out.tif \
   -co TILED=YES \
   -co COPY_SRC_OVERVIEWS=YES \
   -co COMPRESS=LZW

Host result on server supporting HTTP 1.1 Range Requests (Byte Serving). (Amazon S3, Google Cloud Storage, Azure all support this.)

http://www.cogeo.org/developers-guide.html uses -co COMPRESS=DEFLATE instead of -co COMPRESS=LZW. According to https://trac.osgeo.org/gdal/wiki/CloudOptimizedGeoTIFF#Unspecifiedpoints, either can be used.

usage

 gdalinfo /vsicurl/http://landsat-pds.s3.amazonaws.com/L8/001/003/LC80010032014272LGN00/LC80010032014272LGN00_B1.TIF

will only HTTP GET the beginning of the file (with the metadata), not the complete GeoTIFF. Some other software supports this as well. Also fetching only up to the neede overview when viewing data "zoomed out".