Re: [gdal-dev] Nodata is None, but still has blanks?

2022-01-19 Thread Even Rouault
It seems that using an environment setting is required. Attempts to 
use -co and --config  “GDAL_TIFF_INTERNAL_MASK=NO” resulted in a 
warning or error respectively:



--config GDAL_TIFF_INTERNAL_MASK NO


/Warning 6: driver GTiff does not support creation option 
GDAL_TIFF_INTERNAL_MASK/


//

/FAILURE: No target dataset specified./

cheers,

-Matt//

*From:*Even Rouault 
*Sent:* January 18, 2022 4:21 AM
*To:* Frank Warmerdam ; Matt.Wilkie 


*Cc:* gdal dev 
*Subject:* Re: [gdal-dev] Nodata is None, but still has blanks?

>  I find that if I do:

tiffcp sample-no-mask.tif,0 x0.tif

I get an "x0.tif" with just the jpeg image, and not the mask. 
That may be helpful for you (without uncompressing the jpeg image).

tiffcp doesn't use the raw interface of libtiff, hence JPEG 
decompression will occur.


tiffsplit avoids that as it does use the raw interface:

tiffsplit sample-no-mask.tif out

will generate a outaaa.tif file with the original JPEG content (the 
geotif tags will be lost however, and will have to be reinjected 
https://github.com/OSGeo/gdal/blob/master/swig/python/gdal-utils/osgeo_utils/samples/gdalcopyproj.py 
<https://imsva91-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fgithub.com%2fOSGeo%2fgdal%2fblob%2fmaster%2fswig%2fpython%2fgdal%2dutils%2fosgeo%5futils%2fsamples%2fgdalcopyproj.py=B38C0EF4-D5D9-7605-8E85-D961C3CFDB4A=c132af8ee7c9d1278d61a701569070a095ce962e-99d2fc4ea472c846533a93775fde3b12fb6fdbbe> 
for example)


Even

--

http://www.spatialys.com  
<https://imsva91-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=http%3a%2f%2fwww.spatialys.com=B38C0EF4-D5D9-7605-8E85-D961C3CFDB4A=c132af8ee7c9d1278d61a701569070a095ce962e-da8823f42eeaed576a737271c27f693b63c86c21>
My software is free, but my time generally not.


--
http://www.spatialys.com
My software is free, but my time generally not.

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Nodata is None, but still has blanks?

2022-01-19 Thread Matt.Wilkie
Tiffsplit works smoothly and easily. I appreciate adding it to my long term 
tool kit. For my current project it’s great as an exploration and learning but 
as it turns out I found a more efficient route for my current project.

The out.tif that split creates for the mask band is a 3 band RGB even though it 
looks like only the first band has any info in it. That’s not really a problem 
except that cleaning it up later adds a step (in addition to re-applying the 
georeferencing). However I discovered that I actually can use gdal_translate 
out of the box by using environment settings:

set GDAL_TIFF_INTERNAL_MASK=NO
gdal_translate sample-internal-mask.tif out.tif

…will move the internal mask to an external file,  out.tif.msk, that can then 
be manipulated (a la Gimp recipe posted earlier) or discarded as needed.

It seems that using an environment setting is required. Attempts to use -co and 
--config  “GDAL_TIFF_INTERNAL_MASK=NO” resulted in a warning or error 
respectively:

Warning 6: driver GTiff does not support creation option GDAL_TIFF_INTERNAL_MASK

FAILURE: No target dataset specified.

cheers,

-Matt

From: Even Rouault 
Sent: January 18, 2022 4:21 AM
To: Frank Warmerdam ; Matt.Wilkie 
Cc: gdal dev 
Subject: Re: [gdal-dev] Nodata is None, but still has blanks?

>  I find that if I do:
tiffcp sample-no-mask.tif,0 x0.tif

I get an "x0.tif" with just the jpeg image, and not the mask.  That may be 
helpful for you (without uncompressing the jpeg image).

tiffcp doesn't use the raw interface of libtiff, hence JPEG 
decompression will occur.

tiffsplit avoids that as it does use the raw interface:

tiffsplit sample-no-mask.tif out

will generate a outaaa.tif file with the original JPEG content (the geotif tags 
will be lost however, and will have to be reinjected 
https://github.com/OSGeo/gdal/blob/master/swig/python/gdal-utils/osgeo_utils/samples/gdalcopyproj.py<https://imsva91-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fgithub.com%2fOSGeo%2fgdal%2fblob%2fmaster%2fswig%2fpython%2fgdal%2dutils%2fosgeo%5futils%2fsamples%2fgdalcopyproj.py=B38C0EF4-D5D9-7605-8E85-D961C3CFDB4A=c132af8ee7c9d1278d61a701569070a095ce962e-99d2fc4ea472c846533a93775fde3b12fb6fdbbe>
 for example)

Even

--

http://www.spatialys.com<https://imsva91-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=http%3a%2f%2fwww.spatialys.com=B38C0EF4-D5D9-7605-8E85-D961C3CFDB4A=c132af8ee7c9d1278d61a701569070a095ce962e-da8823f42eeaed576a737271c27f693b63c86c21>

My software is free, but my time generally not.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Nodata is None, but still has blanks?

2022-01-18 Thread Jeff McKenna

Hi Matt,

Just for the record, the TIFF tools are also distributed to the MS4W 
users as well, on the web mapping side of things ha (I use them often, 
so when I find something useful I try to distribute them). 
https://ms4w.com   Cheers from the far east side.


-jeff



On 2022-01-18 12:41 p.m., matt.wil...@yukon.ca wrote:
Never mind! Paying attention to the version numbers answers the Q: Conda 
is built from libtiff 4.x while GnuWin32 libtiff is back on version 3.x.


I’ll see if I can find a contact at libtiff.org about adding a line 
about the library and tools being available via Conda as well as the 
other sources.


-Matt//

*From:*gdal-dev  *On Behalf Of 
*matt.wil...@yukon.ca

*Sent:* January 18, 2022 9:34 AM
*To:* gdal-dev@lists.osgeo.org
*Subject:* Re: [gdal-dev] Nodata is None, but still has blanks?

A little off topic for this list but people here might know: I see Tiff 
Tools for Windows binaries[0] haven’t been updated since 2006. Conda has 
Windows libtiff packages which include the tiff tools executables.[1] Is 
the conda variant actually newer than 2006 or is it just current packaging?


[0]: http://www.libtiff.org/index.html <http://www.libtiff.org/index.html>

[1]: 
https://anaconda.org/conda-forge/libtiff/4.3.0/download/win-64/libtiff-4.3.0-h0c97f57_1.tar.bz2 
<https://anaconda.org/conda-forge/libtiff/4.3.0/download/win-64/libtiff-4.3.0-h0c97f57_1.tar.bz2>


-Matt//

*From:*Matt.Wilkie
*Sent:* January 18, 2022 8:35 AM
*To:* gdal-dev@lists.osgeo.org <mailto:gdal-dev@lists.osgeo.org>
*Subject:* RE: [gdal-dev] Nodata is None, but still has blanks?

Thank you Frank and Even.

As is so often the case on this list, I now have answers, and an 
education. I have been peripherally aware of the tiff tools from 
libtiff, but not enough so that they came to mind when seeking to puzzle 
out things. I’m now updated. ;-)


-Matt//


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev



--
Jeff McKenna
GatewayGeo: Developers of MS4W, MapServer Consulting and Training
co-founder of FOSS4G
http://gatewaygeo.com/
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Nodata is None, but still has blanks?

2022-01-18 Thread Matt.Wilkie
Never mind! Paying attention to the version numbers answers the Q: Conda is 
built from libtiff 4.x while GnuWin32 libtiff is back on version 3.x.

I’ll see if I can find a contact at libtiff.org about adding a line about the 
library and tools being available via Conda as well as the other sources.

-Matt

From: gdal-dev  On Behalf Of 
matt.wil...@yukon.ca
Sent: January 18, 2022 9:34 AM
To: gdal-dev@lists.osgeo.org
Subject: Re: [gdal-dev] Nodata is None, but still has blanks?

A little off topic for this list but people here might know: I see Tiff Tools 
for Windows binaries[0] haven’t been updated since 2006. Conda has Windows 
libtiff packages which include the tiff tools executables.[1] Is the conda 
variant actually newer than 2006 or is it just current packaging?

[0]: http://www.libtiff.org/index.html
[1]: 
https://anaconda.org/conda-forge/libtiff/4.3.0/download/win-64/libtiff-4.3.0-h0c97f57_1.tar.bz2

-Matt

From: Matt.Wilkie
Sent: January 18, 2022 8:35 AM
To: gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org>
Subject: RE: [gdal-dev] Nodata is None, but still has blanks?

Thank you Frank and Even.

As is so often the case on this list, I now have answers, and an education. I 
have been peripherally aware of the tiff tools from libtiff, but not enough so 
that they came to mind when seeking to puzzle out things. I’m now updated. ;-)

-Matt
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Nodata is None, but still has blanks?

2022-01-18 Thread Matt.Wilkie
A little off topic for this list but people here might know: I see Tiff Tools 
for Windows binaries[0] haven’t been updated since 2006. Conda has Windows 
libtiff packages which include the tiff tools executables.[1] Is the conda 
variant actually newer than 2006 or is it just current packaging?

[0]: http://www.libtiff.org/index.html
[1]: 
https://anaconda.org/conda-forge/libtiff/4.3.0/download/win-64/libtiff-4.3.0-h0c97f57_1.tar.bz2


-Matt

From: Matt.Wilkie
Sent: January 18, 2022 8:35 AM
To: gdal-dev@lists.osgeo.org
Subject: RE: [gdal-dev] Nodata is None, but still has blanks?

Thank you Frank and Even.

As is so often the case on this list, I now have answers, and an education. I 
have been peripherally aware of the tiff tools from libtiff, but not enough so 
that they came to mind when seeking to puzzle out things. I’m now updated. ;-)

-Matt
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Nodata is None, but still has blanks?

2022-01-18 Thread Matt.Wilkie
Thank you Frank and Even.

As is so often the case on this list, I now have answers, and an education. I 
have been peripherally aware of the tiff tools from libtiff, but not enough so 
that they came to mind when seeking to puzzle out things. I’m now updated. ;-)

-Matt
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Nodata is None, but still has blanks?

2022-01-18 Thread Even Rouault

>  I find that if I do:

tiffcp sample-no-mask.tif,0 x0.tif

I get an "x0.tif" with just the jpeg image, and not the mask. That may 
be helpful for you (without uncompressing the jpeg image).


tiffcp doesn't use the raw interface of libtiff, hence JPEG 
decompression will occur.


tiffsplit avoids that as it does use the raw interface:

tiffsplit sample-no-mask.tif out

will generate a outaaa.tif file with the original JPEG content (the 
geotif tags will be lost however, and will have to be reinjected 
https://github.com/OSGeo/gdal/blob/master/swig/python/gdal-utils/osgeo_utils/samples/gdalcopyproj.py 
for example)


Even

--

http://www.spatialys.com
My software is free, but my time generally not.

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Nodata is None, but still has blanks?

2022-01-17 Thread Frank Warmerdam
Matt,

Tiffinfo reports the following.  Note the "Transparency Mask" subfile.

$ tiffinfo sample-no-mask.tif
...
TIFF Directory at offset 0xe2 (226)
  Image Width: 304 Image Length: 285
  Tile Width: 512 Tile Length: 512
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling: 2, 2
  Samples/Pixel: 3
  Planar Configuration: single image plane
  Reference Black/White:
 0: 0   255
 1:   128   255
 2:   128   255
  Tag 33550: 100.00,100.00,0.00
  Tag 33922:
0.00,0.00,0.00,343739.586723,1091611.850704,0.00
  Tag 34735:
1,1,0,7,1024,0,1,1,1025,0,1,1,1026,34737,21,0,2049,34737,6,21,2054,0,1,9102,3072,0,1,3578,3076,0,1,9001
  Tag 34737: NAD83 / Yukon Albers|NAD83|
  JPEG Tables: (142 bytes)
TIFF Directory at offset 0x33a (826)
  Subfile Type: transparency mask (4 = 0x4)
  Image Width: 304 Image Length: 285
  Tile Width: 512 Tile Length: 512
  Bits/Sample: 1
  Sample Format: unsigned integer
  Compression Scheme: AdobeDeflate
  Photometric Interpretation: transparency mask
  Samples/Pixel: 1
  Planar Configuration: single image plane
  Predictor: none 1 (0x1)

This is recognised by GDAL and treated as a special kind of mask as
indicated in the gdalinfo report:

$ gdalinfo sample-no-mask.tif
Driver: GTiff/GeoTIFF
Files: sample-no-mask.tif
Size is 304, 285
...
Origin = (343739.586723418149631,1091611.850704099284485)
Pixel Size = (100.000,-100.000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=YCbCr JPEG
  INTERLEAVE=PIXEL
  SOURCE_COLOR_SPACE=YCbCr
Corner Coordinates:
Upper Left  (  343739.587, 1091611.851)
Lower Left  (  343739.587, 1063111.851)
Upper Right (  374139.587, 1091611.851)
Lower Right (  374139.587, 1063111.851)
Center  (  358939.587, 1077361.851)
Band 1 Block=512x512 Type=Byte, ColorInterp=Red
  Mask Flags: PER_DATASET
Band 2 Block=512x512 Type=Byte, ColorInterp=Green
  Mask Flags: PER_DATASET
Band 3 Block=512x512 Type=Byte, ColorInterp=Blue
  Mask Flags: PER_DATASET

In QGIS's "Information" tab under properties I see:

"More Information: Mask band (exposed as alpha band)"

So QGIS is using the special mask as alpha.   I find that if I do:

tiffcp sample-no-mask.tif,0 x0.tif

I get an "x0.tif" with just the jpeg image, and not the mask.  That may be
helpful for you (without uncompressing the jpeg image).

Best regards,
Frank




On Mon, Jan 17, 2022 at 7:38 PM  wrote:

> I’m confused. The attached image has no Nodata, but when dropped into Qgis
> and ArcGIS large areas are still drawn transparently, and there is no 4th
> band for a mask or alpha. How is this happening?
>
>
>
> (I’m trying to get completely rid of all Nodata and Mask info, so as to
> start over creating one of those from blank slate).
>
>
>
> *Matt Wilkie*
>
> Geomatics Developer & Administrator
>
> Environment | Technology, Innovation and Mapping
>
> T 867-667-8133 | *Yukon.ca *
>
> *Hours: 08:30-16:30, Mon-Wed: Office, Thu: Remote, Fri: Away.*
>
>
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>


-- 
---+--
I set the clouds in motion - turn up   | Frank Warmerdam,
warmer...@pobox.com
light and sound - activate the windows | +1 650-701-7823
and watch the world go round - Rush| Geospatial Software Developer
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] Nodata is None, but still has blanks?

2022-01-17 Thread Matt.Wilkie
I'm confused. The attached image has no Nodata, but when dropped into Qgis and 
ArcGIS large areas are still drawn transparently, and there is no 4th band for 
a mask or alpha. How is this happening?

(I'm trying to get completely rid of all Nodata and Mask info, so as to start 
over creating one of those from blank slate).

Matt Wilkie
Geomatics Developer & Administrator
Environment | Technology, Innovation and Mapping
T 867-667-8133 | Yukon.ca
Hours: 08:30-16:30, Mon-Wed: Office, Thu: Remote, Fri: Away.

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev