[gdal-dev] gdal_grid: taking a value from feature attribute

Frank Warmerdam warmerdam at pobox.com
Sat May 17 12:03:05 EDT 2008


Andrey Kiselev wrote:
> Folks,
> 
> I need an advise. I have added a possibility to get the value for
> interpolation from feature attribute instead of Z coordinate of geometry
> record. But there is a small problem with gdal_grid utility interface.
> The "-a" option that I would like to use to specify attribute name is
> already taken by an algorithm parameter (see
> http://www.gdal.org/gdal_grid.html manual page for details). Other GDAL
> utilities (gdal_rasterize, gdal_contour) use "-a" option to set the
> attribute name. I would like to be consistent and go with "-a" too and
> rename the "algorithm" option in something other. Let it be "-m"
> (m[ethod]).
> 
> So my question is: will it be harmless to change the gdal_grid
> interface in that way? Any objections?

Andrey,

Consistency and backward compatability are virtues.

If you are willing to do a bit of extra work I would suggest that
the argument to -a be treated as an attribute name, but if it is not
found *and* matches an algorithm name it be used as the algorithm with
a warning so folks get used to use the new algorithm flag.

Generally speaking I am loath to change commandline arguments because it
breaks scripts.  With gdal_grid you at least have the situation that the
program is very new, so it will likely not be "deeply baked" into many
scripted systems yet.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list