[gdal-dev] GSOC 2015 proposal - Integration of cpp GDAL utilities into GDAL core library

Sean Gillies sean at mapbox.com
Wed Apr 1 08:43:17 PDT 2015


On Wed, Apr 1, 2015 at 9:38 AM, Even Rouault <even.rouault at spatialys.com>
wrote:

> Le mercredi 01 avril 2015 17:24:47, Sean Gillies a écrit :
> > Hi all,
> >
> > I'm not entirely clear on the signatures of the new functions. Are we
> > considering new functions that would be called with a single string
> > argument like this?
> >
> >   ogr2ogr('-of "ESRI Shapefile" example.shp example.json')
> >
> > From my perspective this would be sort of a disaster. Instead of using
> > features of our programming languages to handle function arguments
> (good),
> > we'd be formatting strings (bad). It's much better to have this:
> >
> >   ogr2ogr('example.json', 'example.shp', of='ESRI Shapefile')
> >
> > Why? Your compiler can then catch trivial errors at compile time if
> you're
> > using a statically typed language. Your Python linter (for example) can
> > warn you about whether you're calling the function properly or not if
> > you're using a dynamic language. Not to mention that there are many
> > different ways to generate strings in programming languages. Python has
> > some fast ones and some slow ones. I'm concerned that introducing
> functions
> > with a single string argument, while a shortcut now, increases the number
> > of dumb string munging questions and cost of support over time.
>
> Sean,
>
> The latest orientation while discuting with Robert & Faza would drop the
> single string approach in favor of function arguments, with a minimal list
> of
> arguments for the required arguments, and put the others in a dedicated
> option
> structure.
>
> See:
>
> https://github.com/fazam/gdal/commit/a0979a621b0041d25a9d628430b5f1dd2c967fb5#commitcomment-10173885
>
> Even
>

Great! [?][?]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150401/9f491029/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: B97.gif
Type: image/gif
Size: 181 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150401/9f491029/attachment.gif>


More information about the gdal-dev mailing list