Re: [Qgis-user] 16 arguments for Batch PyQGIS processing with gdalogr:cliprasterbymasklayer ?

2016-07-07 Thread Seán Lynch
Hi again just to add some more information to the
'gdalogr:cliprasterbymasklayer' puzzle:

The ones I'm not sure about are marked in bold

ALGORITHM: Clip raster by mask layer
  INPUT  (1) .. input raster
  MASK  (2) .. input shp to clip
  NO_DATA  (3) .. returning 'no_data' worked
last time but *I think this might be the issue here.*

  ALPHA_BAND  (4)  - False: If this is a
transparency band I don't think need it
  CROP_TO_CUTLINE  (5).. True means only the
ROI mask remains and gives a much smaller file size
  KEEP_RESOLUTION  (6) .. True
  RTYPE  (7) .. 0 = byte
  COMPRESS  (8) .. 0 .. don't compress
  *JPEGCOMPRESSION*  (9) - *0 not working,
selected 1*
  *ZLEVEL*  (10) - *0 not working, selected 1*
  *PREDICTOR*  (11) - *0 not working, selected
1*
  TILED  (12).. False, I don't want it tiled.
Do I? If true, 68kb. If false, 17kb.
  BIGTIFF  (13).. 2 = no
  *TFW*  (14) If true it creates a new
file.twf. I'm not sure what this does
  EXTRA  (15) .. '' worked last time
  OUTPUT   (16) .. working.

https://docs.qgis.org/2.6/en/docs/user_manual/processing_algs/gdalogr/gdal_extraction/cliprasterbymasklayer.html

Thanks,
Seán



On 7 July 2016 at 15:34, Seán Lynch  wrote:

> Dear all,
>
> It seems that with the latest release the 
> *processing.alghelp('gladogr:cliprasterbymasklayer')
> *arguments have more than doubled from 7 to 16 arguments and the documents
> 
> have not yet been updated to reflect this substantial increase in
> parameters.
>
> The previous version that I was comfortable with was :
>
> ALGORITHM: Clip raster by mask layer
>
> INPUT 
>
> MASK 
>
> NO_DATA 
>
> ALPHA_BAND 
>
> KEEP_RESOLUTION 
>
> EXTRA 
>
> OUTPUT (7)
>
> Which has now seemed to have increased to:
> ALGORITHM: Clip raster by mask layer
>   INPUT  (1)
>   MASK  (2)
>   NO_DATA  (3)
>   ALPHA_BAND  (4)
>   CROP_TO_CUTLINE  (5)
>   KEEP_RESOLUTION  (6)
>   RTYPE  (7)
>   COMPRESS  (8)
>   JPEGCOMPRESSION  (9)
>   ZLEVEL  (10)
>   PREDICTOR  (11)
>   TILED  (12)
>   BIGTIFF  (13)
>   TFW  (14)
>   EXTRA  (15)
>   OUTPUT   (16)
>
> Including:
>
> RTYPE(Output raster type)
> 0 - Byte
> 1 - Int16
> 2 - UInt16
> 3 - UInt32
> 4 - Int32
> 5 - Float32
> 6 - Float64
> COMPRESS(GeoTIFF options. Compression type:)
> 0 - NONE
> 1 - JPEG
> 2 - LZW
> 3 - PACKBITS
> 4 - DEFLATE
> BIGTIFF(Control whether the created file is a BigTIFF or a classic TIFF)
> 0 -
> 1 - YES
> 2 - NO
> 3 - IF_NEEDED
> 4 - IF_SAFER
>
>
> If I run (without the [n]):
>
> *>>> processing.runalg('gdalogr:cliprasterbymasklayer', *[1] *rstr, *[2]*
> shp, *[3] *"", *[4]* False, *[5] *True, *[6] *True, *[7]* 1, *[8]* 1, *[9]*
> 1, *[10] *1, *[11] *1, *[12] *True, *[13] *0, *[14] *True, *[15] *"", *
> [16]
>
> * rstrOutput+str(rstr))*
> that's ('gdalogr:cliprasterbymasklayer', *(1)* rstr input, *(2) *shp to
> clip, *(3)* no data = "", *(4) *alpha transparency band = false, *(5) *crop
> to cutline = true, *(6) *keep resolution = true, *(7) *RTYPE (0 is not
> allowed so I went with 1), *(8)* Compress =1 as 0 not allowed, *(9)*
> Jpegcompression = 1, *(10)*, Z level = 1, *(11)* Predictor = 1, *(12) *Tiled
> = True, *(13)* Bigtiff = 0, *(14) *'TFW' = True, *(15) *extra = "" and
> *(16)* I specify my output path)
>
> I can get an output but I can only create a binary mask.
>
> Could anyone please offer some insights on where I'm going wrong and how I
> can take advantage of this powerful function once again please?
>
> I would like to suggest too that 16 options seems like a bit much for
> clipping a raster and it makes debugging very difficult. Is there a simpler
> version that could be implemented? This is an incredibly useful function.
> It would great to see the documents updated too.
>
> Is there anyone out there who can share some information of these very
> different options please?
>
> Thank you,
> Seán Lynch
> --
> M.Sc. Coastal & Marine Environments (NUIG, 2015)
> M.Sc. GIS & Remote Sensing (UCC, 2014)
> B.A. Geography & Economics (UCC, 2011)
>



-- 
M.Sc. Coastal & Marine Environments (NUIG, 2015)
M.Sc. GIS & Remote Sensing (UCC, 2014)
B.A. Geography & Economics (UCC, 2011)
ie.linkedin.com/in/seanlynchgis
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] 16 arguments for Batch PyQGIS processing with gdalogr:cliprasterbymasklayer ?

2016-07-07 Thread Seán Lynch
Dear all,

It seems that with the latest release the
*processing.alghelp('gladogr:cliprasterbymasklayer')
*arguments have more than doubled from 7 to 16 arguments and the documents

have not yet been updated to reflect this substantial increase in
parameters.

The previous version that I was comfortable with was :

ALGORITHM: Clip raster by mask layer

INPUT 

MASK 

NO_DATA 

ALPHA_BAND 

KEEP_RESOLUTION 

EXTRA 

OUTPUT (7)

Which has now seemed to have increased to:
ALGORITHM: Clip raster by mask layer
  INPUT  (1)
  MASK  (2)
  NO_DATA  (3)
  ALPHA_BAND  (4)
  CROP_TO_CUTLINE  (5)
  KEEP_RESOLUTION  (6)
  RTYPE  (7)
  COMPRESS  (8)
  JPEGCOMPRESSION  (9)
  ZLEVEL  (10)
  PREDICTOR  (11)
  TILED  (12)
  BIGTIFF  (13)
  TFW  (14)
  EXTRA  (15)
  OUTPUT   (16)

Including:

RTYPE(Output raster type)
0 - Byte
1 - Int16
2 - UInt16
3 - UInt32
4 - Int32
5 - Float32
6 - Float64
COMPRESS(GeoTIFF options. Compression type:)
0 - NONE
1 - JPEG
2 - LZW
3 - PACKBITS
4 - DEFLATE
BIGTIFF(Control whether the created file is a BigTIFF or a classic TIFF)
0 -
1 - YES
2 - NO
3 - IF_NEEDED
4 - IF_SAFER


If I run (without the [n]):

*>>> processing.runalg('gdalogr:cliprasterbymasklayer', *[1] *rstr, *[2]*
shp, *[3] *"", *[4]* False, *[5] *True, *[6] *True, *[7]* 1, *[8]* 1, *[9]*
1, *[10] *1, *[11] *1, *[12] *True, *[13] *0, *[14] *True, *[15] *"", *[16]

* rstrOutput+str(rstr))*
that's ('gdalogr:cliprasterbymasklayer', *(1)* rstr input, *(2) *shp to
clip, *(3)* no data = "", *(4) *alpha transparency band = false, *(5) *crop
to cutline = true, *(6) *keep resolution = true, *(7) *RTYPE (0 is not
allowed so I went with 1), *(8)* Compress =1 as 0 not allowed, *(9)*
Jpegcompression = 1, *(10)*, Z level = 1, *(11)* Predictor = 1, *(12) *Tiled
= True, *(13)* Bigtiff = 0, *(14) *'TFW' = True, *(15) *extra = "" and
*(16)* I specify my output path)

I can get an output but I can only create a binary mask.

Could anyone please offer some insights on where I'm going wrong and how I
can take advantage of this powerful function once again please?

I would like to suggest too that 16 options seems like a bit much for
clipping a raster and it makes debugging very difficult. Is there a simpler
version that could be implemented? This is an incredibly useful function.
It would great to see the documents updated too.

Is there anyone out there who can share some information of these very
different options please?

Thank you,
Seán Lynch
-- 
M.Sc. Coastal & Marine Environments (NUIG, 2015)
M.Sc. GIS & Remote Sensing (UCC, 2014)
B.A. Geography & Economics (UCC, 2011)
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user