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

Even Rouault even.rouault at spatialys.com
Mon Sep 7 11:54:50 PDT 2015


Le mardi 01 septembre 2015 23:00:37, Ari Jolma a écrit :
> On 01.09.2015 16:34, Even Rouault wrote:
> > 2)  Variant of 1). With some Python magic on **kwargs it can be automated
> > to redirect on 1) mem_ds = gdal.Translate('', src_ds, bands = [1,2,3],
> > format = 'MEM', progress = my_progress_method)
> > 
> > 
> > * Other binding languages.
> > 
> > 
> > - Perl: apparently possible
> 
> Yes it is. Being a non-typed high level language it is possible and IMO
> preferable to be able to give the options in a key-value list (hash)
> where the keys are well known strings and the values are understandable.
> However, the C API need not do this but it should allow it.

Would the approach I suggested for the Python bindings, i.e you would build a 
list of options with the current syntax of the utilities from the Perl key-
value list sound reasonable ?

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 }

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list