[GRASS-dev] g.proj to create a new location

Michael Barton michael.barton at asu.edu
Mon Feb 12 16:59:15 EST 2007


Actually, looking at this, maybe it is more correct to do the following...

# first run g.proj to see if there are more than the default parameters to
# choose from
set input [open "|g.proj epsg=$epsgcode epsgloc=$epsgloc datumtrans=-1"]
set dtrans [read $input]
close $input
if {$dtrans==""} {
    # I assume that $dtrans=="" if there is only one default parameter.
    # so use the default parameter.
    open "|g.proj epsg=$epsgcode epsgloc=$epsgloc datumtrans=1"
else {
    # do some kind of selection dialog here where the user
    # picks the desired datum transformation from the list in
    # dtrans and "set dtsel [integer of user datum trans selection]"
    open "|g.proj epsg=$epsgcode epsgloc=$epsgloc datumtrans=$dtsel"
}



On 2/12/07 2:49 PM, "Moritz Lennert" <moritz.lennert at ulb.ac.be> wrote:

> On Mon, February 12, 2007 19:28, Michael Barton wrote:
>> I'm continuing to follow this discussion and I don't think it will be a
>> huge
>> problem to wrap this into TclTk. The simplest way for TclTk to parse this
>> is
>> to simply have each datum transformation be a separate line in text sent
>> to
>> stdout.
>> 
>> 1:dt1 parameters
>> 2:dt2 parameters
>> 3:dt3 parameters
>> ...and so on
>> 
>> The way I'm thinking of doing this is to open a read channel from the
>> command as follows...
>> 
>> set input [open "|g.proj epsg=$epsgcode epsgloc=$epsgloc datumtrans=-1"]
>> set dtrans [read $input]
>> close $input
>> if {$dtrans==""} {
>>     # I assume that $dtrans=="" if there is only one default parameter
>>     open "|g.proj epsg=$epsgcode epsgloc=$epsgloc datumtrans=0"
> 
> 
> This means that if there is only one set of default parameters, these are
> not set explicitely in PROJ_INFO. Another option would be to make this
> 
> open "|g.proj epsg=$epsgcode epsgloc=$epsgloc datumtrans=1"
> 
> to do so.
> 
> I don't know what is better. If we want to leave the choice to the user,
> the GUI could offer it (maybe in form of a checkbox), or should this be
> only for powerusers, and GUI users live with the default=no parameters
> solution ?
> 
> Moritz
> 

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton 




More information about the grass-dev mailing list