[GRASS-dev] Create new location from EPSG code backport problem

Hamish hamish_nospam at yahoo.com
Thu Apr 26 04:44:07 EDT 2007


Hamish wrote:
> > > I'm trying to backport Michael's fancy new EPSG code search tool
> > > and location creator for the 6.2 branch, to have in the upcoming
> > > 6.2.2 release.
..
> I will simplify. I was backporting most of epsg_option.tcl.in,
> including parts of the new location generation code. I will change
> tack to only backport the EPSG code search tool, as originally
> discussed. I will leave all the improved location generation code to
> the 6.3 branch.

ok, here is the latest attempt:
  http://bambi.otago.ac.nz/hamish/grass/gui/epsg_option.tcl.in

this is primarily epsg_option.tcl.in Rev 1.15 (last before deletion) with
the old grass-xterm-wrapper make_location_epsg.sh xterm code for making
new locations instead of the new epsgOpt::create_loc replacement.


besides that file, you also need to patch lib/init/gis_set.tcl as follows:
Index: gis_set.tcl
===================================================================
RCS file: /home/grass/grassrepository/grass6/lib/init/gis_set.tcl,v
retrieving revision 1.30.2.4
diff -u -r1.30.2.4 gis_set.tcl
--- gis_set.tcl 19 Oct 2006 11:17:57 -0000      1.30.2.4
+++ gis_set.tcl 26 Apr 2007 08:18:27 -0000
@@ -506,7 +506,7 @@
        -text [G_msg "EPSG codes"] \
        -width 20 \
        -relief raised \
-       -command {epsgLocCom}
+       -command {epsgOpt::epsgLocCom}
 
     button .frame0.frameNMS.seventh.button \
        -text [G_msg "Projection values"] \



This seems to work for me, if it tests ok for others I'll put it in
the 6.2 branch. Only issue I found is that if you give it a bogus
EPSG code like "999999" it fails to make a new location but doesn't
tell you that as the xterm flashes by.


Also, a lingering [harmless] exit bug in proc epsgOpt::def_loc:

DialogGen .wrnDlg [G_msg "WARNING: restart GRASS please"] warning \
    [G_msg "WARNING: Please restart GRASS in order find the created location in the list (closing it for you now)"] \
    0 OK; 
set env(EPSGSCRIPT) {yes};
# complains that exit needs a numeric arg, but then if you give
#  it one with [list "exit" "2"] it then complains that you gave
#  it too many args. ARgh!
puts stdout "exit";
destroy .


(comment out "destroy ." to see the complaint; prob "tput clear" in
init.sh too [x2])



Hamish

ps- I found a bug, also in 6.3cvs: if you search for an EPSG code, grab
it [fills in value in parent window], then manually highlight another
and then click Grab again, the value in the parent window doesn't update.
 




More information about the grass-dev mailing list