[GRASS5] Re: proj bugs

H Bowman hamish_nospam at yahoo.com
Thu Jul 3 21:17:26 EDT 2003


> > Testing out the new New Zealand transforms:
> >
> > g.setproj Segfaults if a datum is already set. If you say "n" to the
> > "specify a map datum for this location?" question it works, and you
> > can run it again to set a new datum, but if you try and just change
> > the transform params it segfaults.
> 
> I can't seem to reproduce this. Can you post a sample of your
> PROJ_INFO, PROJ_UNITS and DEFAULT_WIND files that you had prior to
> running g.setproj?

Ok.
I think in the long term it would be good to have a robust version of
something like g.setproj. Editing low level files isn't very nice/safe
from a user's perspective. Is the problem that of messy code that is too
far gone to deal with without a total re-write, logical paradoxes with
no good solutions, or just the danger mixung datums and creating data that
doesn't know where it belongs?


Before: (note it happens with both nadgrids and towgs84)
===================================================================
GRASS:~ > g.projinfo 

-----------------------------------------------------------
PROJ_INFO file:	
name:	 Lat/Lon
datum:	 nzgd49
nadgrids:	 nzgd2kgrid0005.gsb
proj:	 ll
ellps:	 international
-----------------------------------------------------------
PROJ_UNITS file:	
unit:	 degree
units:	 degrees
meters:	 1.0
-----------------------------------------------------------
cat nz_gd49/PERMANENT/DEFAULT_WIND 
proj:       3
zone:       0
north:      42S
south:      47S
east:       178E
west:       160E
cols:       180
rows:       50
e-w resol:  0:06
n-s resol:  0:06
===================================================================


Running g.setproj again and choosing ll with no datum give me this:
-----------------------------------------------------------
PROJ_INFO file:	
name:	 Lat/Lon
proj:	 ll
ellps:	 international
-----------------------------------------------------------
PROJ_UNITS file:	
unit:	 degree
units:	 degrees
meters:	 1.0
-----------------------------------------------------------
(DEFAULT_WIND is the same)

===================================================================

Now I can run g.setproj again- ll, datum Yes, nzgd49, #2 (7 param):
-----------------------------------------------------------
PROJ_INFO file:	
name:	 Lat/Lon
datum:	 nzgd49
towgs84:	 59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993
proj:	 ll
ellps:	 international
-----------------------------------------------------------
PROJ_UNITS file:	
unit:	 degree
units:	 degrees
meters:	 1.0
-----------------------------------------------------------
(DEFAULT_WIND is the same)


===================================================================

But if I try g.setproj again:
GRASS:~/grass_data > g.setproj 


WARNING!  A projection file already exists for this location
(Filename '/home/hb/grass_data/nz_gd49/PERMANENT/PROJ_INFO')

This file contains all the parameters for the
location's projection: Lat/Lon

    Overriding this information implies that the old projection parameters
    were incorrect.  If you change the parameters, all existing data will be
    interpreted differently by the projection software.
    GRASS will not re-project your data automatically

Would you still like to change some of the parameters (y/n) [n] y


Please specify projection name
Enter 'list' for the list of available projections
Hit RETURN to cancel request
>ll
Do you want to specify a map datum for this location?(y/n) [y] 
The current datum is nzgd49
Would you want to change the datum (or the datum transformation parameters)?(y/n) [n] 
The datum information is not changed
Segmentation fault


Same segfault if I say yes to the 'change the datum' question and select 
a new transform.


Hamish




More information about the grass-dev mailing list