Re: [Qgis-user] Tiff with jpeg compression

2017-05-08 Thread Randal Hale
My big fear this weekend was I was doing something wrong. I used your 
example and now it's not crashing on me. I had it -co 'TILED=YES' - I 
just mistyped in the email. I need to update some notes on my end now to 
make sure I do this right from here on out.


Andreas and list - I thank you.

Randy


On 05/08/2017 09:46 AM, Neumann, Andreas wrote:


Hi Randal,

A crash is always a  bug, in my opinion, even if your file isn't 
optimized.


Note, that the correct parameter is "tiled=yes" not "tiles=yes". Not 
sure if this helps.


Fyi - here is one of my examples with gdal_warp:

gdalwarp -of GTiff -wm 500 --config GDAL_CACHEMAX 500 -multi -wo 
NUM_THREADS=2 -wo OPTIMIZE_SIZE=TRUE -srcnodata "255 255 255" 
-dstnodata '255 255 255' -t_srs 'EPSG:2056' -co 'BIGTIFF=YES' -co 
'TILED=YES' -co 'COMPRESS=JPEG' -co 'JPEG_QUALITY=85' -co 
'PHOTOMETRIC=YCBCR' -co 'SPARSE_OK=TRUE' Originaldaten/*.tif 
DOP2011_LV95.tif


the PHOTOMETRIC=YCBCR is specifically to be used for aerial images or 
satellite images.


Of course, for good performance, you also need the pyramids:

gdaladdo -r cubic --config BIGTIFF_OVERVIEW YES --config 
COMPRESS_OVERVIEW JPEG --config JPEG_QUALITY 85 --config 
PHOTOMETRIC_OVERVIEW YCBCR --config INTERLEAVE_OVERVIEW PIXEL 
DOP2016_LV95.tif 2 4 8 16 32 64 128 256


Hope this helps,

Andreas

On 2017-05-08 15:29, Randal Hale wrote:


  * QGIS: 2.18.7
  * GDAL 2.1.3

I have a tiff file. I decided to jpeg compress it for some help with 
the size.


I did: gdal_translate -co compress=jpeg -co tiles=yes oldfile.tif 
newfile_jpg.tif


When I open the file in QGIS (2.18.7) on linux it crashes immediately.

When opened on windows if the file is small it takes about a minute 
but displays. If I compress a larger tiff (compressed size is 1.1 gb) 
QGIS on windows crashes.


I checked for bugs and there seems to be a jpeg bug out there: 
https://issues.qgis.org/issues/16049


If I do this with compress=deflate,  QGIS is happy.

Anyway - file a bug report? or I'm doing the compression incorrectly?

Randy
--
-
Randal Hale
North River Geographic Systems, Inc
http://www.northrivergeographic.com
423.653.3611rjh...@northrivergeographic.com
twitter:rjhale

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org 
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user




--
-
Randal Hale
North River Geographic Systems, Inc
http://www.northrivergeographic.com
423.653.3611 rjh...@northrivergeographic.com
twitter:rjhale

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Tiff with jpeg compression

2017-05-08 Thread Neumann, Andreas
Hi Randal, 

A crash is always a  bug, in my opinion, even if your file isn't
optimized. 

Note, that the correct parameter is "tiled=yes" not "tiles=yes". Not
sure if this helps. 

Fyi - here is one of my examples with gdal_warp: 

gdalwarp -of GTiff -wm 500 --config GDAL_CACHEMAX 500 -multi -wo
NUM_THREADS=2 -wo OPTIMIZE_SIZE=TRUE -srcnodata "255 255 255" -dstnodata
'255 255 255' -t_srs 'EPSG:2056' -co 'BIGTIFF=YES' -co 'TILED=YES' -co
'COMPRESS=JPEG' -co 'JPEG_QUALITY=85' -co 'PHOTOMETRIC=YCBCR' -co
'SPARSE_OK=TRUE' Originaldaten/*.tif DOP2011_LV95.tif 

the PHOTOMETRIC=YCBCR is specifically to be used for aerial images or
satellite images. 

Of course, for good performance, you also need the pyramids: 

gdaladdo -r cubic --config BIGTIFF_OVERVIEW YES --config
COMPRESS_OVERVIEW JPEG --config JPEG_QUALITY 85 --config
PHOTOMETRIC_OVERVIEW YCBCR --config INTERLEAVE_OVERVIEW PIXEL
DOP2016_LV95.tif 2 4 8 16 32 64 128 256 

Hope this helps, 

Andreas 

On 2017-05-08 15:29, Randal Hale wrote:

> * QGIS: 2.18.7 
> * GDAL 2.1.3
> 
> I have a tiff file. I decided to jpeg compress it for some help with the 
> size. 
> 
> I did: gdal_translate -co compress=jpeg -co tiles=yes oldfile.tif 
> newfile_jpg.tif 
> 
> When I open the file in QGIS (2.18.7) on linux it crashes immediately. 
> 
> When opened on windows if the file is small it takes about a minute but 
> displays. If I compress a larger tiff (compressed size is 1.1 gb) QGIS on 
> windows crashes. 
> 
> I checked for bugs and there seems to be a jpeg bug out there: 
> https://issues.qgis.org/issues/16049 
> 
> If I do this with compress=deflate,  QGIS is happy. 
> 
> Anyway - file a bug report? or I'm doing the compression incorrectly? Randy
> 
> -- 
> -
> Randal Hale
> North River Geographic Systems, Inc
> http://www.northrivergeographic.com
> 423.653.3611 rjh...@northrivergeographic.com
> twitter:rjhale
> 
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] Tiff with jpeg compression

2017-05-08 Thread Randal Hale

 * QGIS: 2.18.7
 * GDAL 2.1.3

I have a tiff file. I decided to jpeg compress it for some help with the 
size.


I did: gdal_translate -co compress=jpeg -co tiles=yes oldfile.tif 
newfile_jpg.tif


When I open the file in QGIS (2.18.7) on linux it crashes immediately.

When opened on windows if the file is small it takes about a minute but 
displays. If I compress a larger tiff (compressed size is 1.1 gb) QGIS 
on windows crashes.


I checked for bugs and there seems to be a jpeg bug out there: 
https://issues.qgis.org/issues/16049


If I do this with compress=deflate,  QGIS is happy.

Anyway - file a bug report? or I'm doing the compression incorrectly?

Randy

--
-
Randal Hale
North River Geographic Systems, Inc
http://www.northrivergeographic.com
423.653.3611 rjh...@northrivergeographic.com
twitter:rjhale

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user