[gdal-dev] gdal_translate: extracting mask band and its overviews

Emanuele Tajariol etj at geo-solutions.it
Thu Aug 31 09:55:54 PDT 2017


Hi,

I'm trying and extract the single mask band out of a geotiff file using 
gdal_translate.
The tiff file also contains overviews of mask band, and I'd like to extract them 
as well (In the end of the mail there's a fragment of the input file's 
gdalinfo.)

The command I'm using is:

gdal_translate -b mask \
   --config GDAL_TIFF_INTERNAL_MASK YES \
   -co COPY_SRC_OVERVIEWS=yes \
   -co TILED=yes  \
   -co COMPRESS=DEFLATE   \
   intput_file.tif output_mask.tif

Anyway the output file does not contain any overview at all.

I get the very same result also removing the GDAL_TIFF_INTERNAL_MASK config 
(which should not be needed anyway since the mask band is exported as a data 
band).

Am I missing any command line option or is it possibile at all?


   Thanks,
   Emanuele


====
Input file gdalinfo fragment:

[...]
Size is 19584, 19584
[...crs, origin, pixel size...]
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=YCbCr JPEG
  INTERLEAVE=PIXEL
  SOURCE_COLOR_SPACE=YCbCr
[...Corner coords...]
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
  Overviews: 9792x9792, 4896x4896, 2448x2448, 1224x1224, 612x612, 306x306
  Mask Flags: PER_DATASET 
  Overviews of mask band: 9792x9792, 4896x4896, 2448x2448, 1224x1224, 612x612, 
306x306
  Metadata:
    COLORINTERP=Red
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
  Overviews: 9792x9792, 4896x4896, 2448x2448, 1224x1224, 612x612, 306x306
  Mask Flags: PER_DATASET 
  Overviews of mask band: 9792x9792, 4896x4896, 2448x2448, 1224x1224, 612x612, 
306x306
  Metadata:
    COLORINTERP=Green
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
  Overviews: 9792x9792, 4896x4896, 2448x2448, 1224x1224, 612x612, 306x306
  Mask Flags: PER_DATASET 
  Overviews of mask band: 9792x9792, 4896x4896, 2448x2448, 1224x1224, 612x612, 
306x306
  Metadata:
    COLORINTERP=Blue
[end]

====
Output file gdalinfo fragment:

[...]
Size is 19584, 19584
[...crs, origin, pixel size...]
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=DEFLATE
  INTERLEAVE=BAND
[...Corner coords...]
Band 1 Block=256x256 Type=Byte, ColorInterp=Gray
[end]

-- 

Regards,
Emanuele Tajariol
==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V 
for more information.
==

Ing. Emanuele Tajariol
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i 
file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo 
è consentito esclusivamente al destinatario del messaggio, per le finalità 
indicate nel messaggio stesso. Qualora riceviate questo messaggio senza 
esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-
mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal 
Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, 
distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, 
costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.
 
The information in this message and/or attachments, is intended solely for the 
attention and use of the named addressee(s) and may be confidential or 
proprietary in nature or covered by the provisions of privacy act (Legislative 
Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not 
in accord with its purpose, any disclosure, reproduction, copying, 
distribution, or either dissemination, either whole or partial, is strictly 
forbidden except previous formal approval of the named addressee(s). If you 
are not the intended recipient, please contact immediately the sender by 
telephone, fax or e-mail and delete the information in this message that has 
been received in error. The sender does not give any warranty or accept 
liability as the content, accuracy or completeness of sent messages and 
accepts no responsibility  for changes made after they were sent or for other 
risks which arise as a result of e-mail transmission, viruses, etc.


More information about the gdal-dev mailing list