[GRASS-dev] Re: [bug #5454] (grass) projection units
incorrectly pluralized
Hamish
hamish_nospam at yahoo.com
Tue Feb 6 02:03:26 EST 2007
Hamish wrote:
> > Idea:
> >
> > It would create a new epsg=code[,n] option:
> >
> > g.proj -c location=newLocation epsg=####
> >
> > It would exit with EXIT_FAILURE if the datum transform parm is ambiguous.
> >
> > Here's the cunning part:
> >
> > "epsg=####,n" would pick param 1,2,3,.. from the list.
> >
> > "epsg=####,0" would print available options to stdout and exit with an
> > EXIT_SUCCESS return code. If the EPSG code isn't found, it exits with
> > EXIT_FAILURE. The output is in CSV or a parsable format a GUI could read
> > & make into a nice GUI popup. Maybe with a header comment line for humans.
> >
> > In the GUI:
> > - user selects create new location with EPSG code $EPSG.
> >
> > - gui runs "catch `g.proj epsg=$EPSG` > /dev/null"
> >
> > - If exit code is 0, gui creates new location with:
> > "g.proj -c location=$LOCATION epsg=$EPSG"
> >
> > - If exit code is 1, gui runs:
> > "g.proj epsg=$EPSG,0" then parses the output and creates a new
> > GUI popup with radiobutton options generated from that. (see d.menu)
> > (If it fails again, EPSG code is bad)
> >
> > Once a parm is selected and [Create] is clicked, the popup runs
> > "g.proj -c location=$LOCATION epsg=$EPSG,$N"
> >
> >
> > IMO this would be many many times better than forcing a value (you
> > wouldn't even know better transform parms exist), and isn't a huge
> > amount to code.
Michael:
> I haven't thought through all the implications, but on the face of it this
> sounds like a reasonable solution. If implemented, hopefully it would be
> able to run without lockup (succeed or fail with warning) with the current
> TclTk scripts until the GUI could be re-written for this.
The whole idea is to made g.proj fully non-interactive and leave that to the
GUI.
I guess instead of epsg=####[,n] the [,n] part should go in a datumtrans=
option as it could apply to georef=,wkt=,proj4= as well.
This would print a GUI parsable list of options: (or error if bad epsg code)
g.proj epsg=#### datumtrans=0
or
g.proj epsg=#### datumtrans=list
if there is only one item on the list the GUI would automatically run
with that, "datumtrans=1" would be the default answer:
g.proj -c loc=newLoc epsg=####
If multiple options the GUI would create a dialog from the list,
then create the new location with:
g.proj -c loc=newLoc epsg=#### datumtrans=2
or
g.proj -c loc=newLoc epsg=#### datumtrans=conus # ???
Not sure if it should take text "list,conus,etc".
Probably that is unneeded pain. Aliasing "list" to "0" would be nice
but wouldn't get past parser checks for TYPE_INTEGER and
parm->options="0-100";.
Hamish
More information about the grass-dev
mailing list