[gdal-dev] add -a_scale and -a_offset to gdal.TranslateOptions in Python

2019-01-04 Thread Johan de Braak
Hi,

I cannot find an equivalent for -a_scale and -a_offset translate options in
the method gdal.TranslateOptions in Python. Am I missing something or is
this something that should be added?

I know I can use the command line syntax but I would prefer keyword
arguments for these options in Python.

Best,

Johan



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] Option names in python bindings not interchangeable

2018-02-27 Thread Johan de Braak
Hi,

Why is it that in gdal.WarpOptions the output projection is called dstSRS
while in gdal.RasterizeOptions it is called outputSRS? Is there a difference
and if not, why is not the same name used?

Thanks,

Johan



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] Rasterize Inmem vector

2017-07-31 Thread Johan de Braak
Hi all,

How would I rasterize an in memory vector? I have tried this:

assert isinstance(inmemds, ogr.DataSource), 'inmemds is not a ogr
DataSource' #assert not triggered

rastoptions = gdal.RasterizeOptions(outputType=gdal.GDT_Byte,
burnValues=1, xRes=100, yRes=100)

ds = gdal.Rasterize('/vsimem/tmp_{}'.format(uuid4().hex), inmemds,
options=rastoptions)


gives:

TypeError: in method 'wrapper_GDALRasterizeDestName', argument 2 of type
'GDALDatasetShadow *'

The docstring of gdal.Rasterize says the following: 

Arguments are :
  destNameOrDestDS --- Output dataset name or object
  srcDS --- a Dataset object or a filename

So srcDS can be a Dataset, right? As I missing something?

Regards,

Johan




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Rasterize-Inmem-vector-tp5329885.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] gdal Info Options Python

2017-03-29 Thread Johan de Braak
Hi all,

Using gdal.Info in Python, I would like to have my result as a dictionary
instead of a string. I found that in gdal.InfoOptions I am able to specify
'format'. By default, this is set to 'text', however changing this to 'dict'
(or anything really) does still result in a string.

Is there a way to get the gdal.Info result as something else than a string?

Johan



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/gdal-Info-Options-Python-tp5314816.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] GDAL : Access window out of range in RasterIO and blank buffer in warp for same block extents

2017-02-27 Thread Johan de Braak
asmita wrote
> I tried to investigate the read with simple read, however I got this error
> :
> Access window out of range in RasterIO().  Requested
> (0,24104) of size 430x450 on raster of 11783x14544.
> (...)
> Anyways, the point is that how should I proceed with to get successful
> read of the intermediate file created from two or more tiffs to create a
> mosaic?

The point of the error message is that you are trying to access more pixels
than are available in your raster. What helps, in general, is to think of
what the extent of the project you are working on is, and tell gdal (using
-te or -projwin) what extent that is. If your input rasters have different
extents / projections, use gdalwarp to fix this, before continuing with
mosaic creation.



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/GDAL-Access-window-out-of-range-in-RasterIO-and-blank-buffer-in-warp-for-same-block-extents-tp5307794p5309599.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] gdal.DEMProcessingOptions

2017-01-12 Thread Johan de Braak
Running: 
opts = gdal.DEMProcessingOptions(zeroForFlat=True)
gdal.DEMProcessing('my\out\file_aspect.tif', 'my\in\dem.tif', 'aspect',
options=opts)

resuts in the error:

Too many command options 'zero_for_flat'

However, if I run it as:

opts = ['-zero_for_flat']
gdal.DEMProcessing('my\out\file_aspect.tif', 'my\in\dem.tif', 'aspect',
options=opts)

It runs fine. Any ideas what may cause this?





--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/gdal-DEMProcessingOptions-tp5303172.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] Sentinel driver

2016-12-11 Thread Johan de Braak
Hi all,

Will there be an update of the Sentinel driver that is able to deal with the
new Level 1C product format (as announced here:
https://scihub.copernicus.eu/news/News00124 ) ?

Thanks,

Johan



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Sentinel-driver-tp5299537.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] gdal.RasterizeOptions output type

2016-10-31 Thread Johan de Braak
Hi all,

I cannot seem to find the possibility to set the output type in
gdal.RasterizeOptions (like in gdal.TranslateOptions). Am I missing
something or is this not possible? 

I'm using GDAL 2.1.1

Thank you,

Johan



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/gdal-RasterizeOptions-output-type-tp5293573.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev