[gdal-dev] Call for discussion on RFC 59 (v2): GDAL/OGR utilities as a library

Homme Zwaagstra hrz at geodata.soton.ac.uk
Wed Sep 9 01:45:57 PDT 2015


On 08/09/15 16:28, Even Rouault wrote:
>>> For example, let's say the user calls gdal.Translate("format" => "GTiff",  >>> "src_win" => [100,400,50,50] ) (this is probably not valid Perl 
syntax, >>> but hope you got it !), and you would call 
GDALTranslateOptionsNew(list) >>> where you would build list = { 
"-format", "GTiff", "-src_win", "100", >>> "400", "50", "50", NULL } >> 
 >> Geo::GDAL->Translate("format" => "GTiff", "src_win" => 
[100,400,50,50] ) >> >> would be valid. The argument system sounds 
reasonable. However, why not >> >> $dst_dataset = 
$src_dataset->Translate("format" => "GTiff", "src_win" => >> 
[100,400,50,50] ) >> >> i.e., apply the method on an object and get an 
object, as the command >> line utility conceptually does? Also, the 
command line uses "-of", which >> the method could also accept - the 
method could perhaps accept a longer >> version "--output_format" too. 
I'm just wondering, > > Well, I'd say that can be a per-binding choice 
(and that depends on utilities. > For example gdalwarp can accept 
several input datasets). My fundamental question was if my > proposal 
https://lists.osgeo.org/pipermail/gdal-dev/2015-September/042512.html > 
was OK at the C API level so as to be able to build upon it.

 From my point of view anything that makes the new API feel less like a 
wrapper
around a system call is great: passing expensive objects like datasets and
enabling progress functions is important.  Hopefully this would also mean
passing objects as cutline layers for gdalwarp and also clipsrc for ogr2ogr
(including geometry objects for the latter?).

The idea of an option structure parsed from an array of strings sounds 
nice and
easy to work with.  Is the option structure intended to be created for 
each call
to an utility, or is it envisaged it can hang around and be reused (and
modified)?  I.e. will the API include the ability to retrieve options 
already
set in the option structure, and set specific options?  If so how will 
options
that can be set multiple times like `gdal_translate -b` be set at the C 
level
(i.e. what would your python example of `options = gdal.TranslateOptions();
options.bands = [ 1, 2, 3 ]` look like in C)?

Hopefully not too many questions!

Best regards,

Homme

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150909/5a872540/attachment-0001.html>


More information about the gdal-dev mailing list