[GRASS-dev] Re: gui startup bug (new locn by epsg code)

Paul Kelly paul-grass at stjohnspoint.co.uk
Wed Jan 31 05:55:10 EST 2007


On Tue, 30 Jan 2007, Glynn Clements wrote:

> Paul Kelly wrote:
>
>> How do you propose it is fixed? It is arguable IMHO that the problem is
>> not in g.proj. It will only interactively prompt if *partially complete*
>> datum information is passed to it. If the GUI passes projection
>> information that has been pre-processed so the datum part is OK, then it
>> will not interactively prompt. This was discussed in an earlier thread.
>
> Yes, and I proposed a solution: replace the call to
> GPJ_ask_datum_params() with either a call to G_fatal_error() or some
> form of error indication (e.g. "return -1"). Assuming the availability
> of a terminal to obtain missing data from the user is a bug in
> GPJ_osr_to_grass().
>
> Unless someone else proposes an alternative solution soon, I intend to
> change GPJ_osr_to_grass() to simply ignore the "interactive"
> parameter; if datum parameters are missing, you get the defaults; it
> will be up to the user to fix it afterwards. That approach has the
> advantage that it doesn't require any changes to calling programs
> (g.proj, v.in.ogr, r.in.gdal).

If it has to be done I wouldn't like to see the functionality to choose 
datum parameters from the tables in GRASS relegated to only g.setproj. I 
was thinking along the lines of adding a new "interactive" flag to g.proj. 
If this flag was specified along with -p, -j, -w or -c it would prompt as 
at present if datum information was incomplete; if used along with the -d 
flag then after reporting the datum information it would ask the user if 
he/she wished to change the parameters.

And every other place that calls GPJ_osr_to_grass() or GPJ_wkt_to_grass() 
(I'm thinking of r.in.gdal and v.in.ogr and g.proj without the 
-i/interactive flag specified) would set the interactive flag in the 
function to 0.

> It isn't ideal, but it's a lot less non-ideal than assuming that a
> terminal is available.
>
> Also, note that g.proj already silently uses the default parameters if
> you read the settings from stdin with wkt=- or proj4=-, so it isn't as
> if we currently *insist* upon full datum information being provided.

Good point; I'd forgotten about that.


>
> -- 
> Glynn Clements <glynn at gclements.plus.com>
>




More information about the grass-dev mailing list