Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#1 closed defect (fixed)

g.setproj bug: latitude_of_center and longitude_of_center ignored

Reported by: neteler Owned by: grass-dev@…
Priority: major Milestone: 6.3.0
Component: Default Version: svn-trunk
Keywords: proj Cc:
CPU: Unspecified Platform: Unspecified

Description

I discovered two issues with the Swiss. Obl. Mercator definition:

When defining it from scratch:

D   Other Projection

Please specify projection name
>somerc

Please specify datum name
>list
Number  Details
---
1       Used in whole ch1903 region
        (PROJ.4 Params towgs84=674.253,15.053,405.324)
        Default 3-Parameter Transformation (May not be optimum for older datums; use this only if no more appropriate
options are available.)

-> here the 7-param is missing which is listed (but commented) in lib/gis/datumtransform.table. Any objections to activate that?

We continue in the dialog as usual... (I custom defined the 7-param). Then:

g.proj -w
PROJCS["Swiss. Obl. Mercator",
    GEOGCS["bessel",
        DATUM["unknown",
            SPHEROID["Bessel_1841",6377397.155,299.1528128],
            TOWGS84[660.077,13.551,369.344,2.484,1.783,2.939,0.56]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Hotine_Oblique_Mercator"],
    PARAMETER["latitude_of_center",0],
    PARAMETER["longitude_of_center",0],
    PARAMETER["azimuth",90],
    PARAMETER["rectified_grid_angle",90],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",600000],
    PARAMETER["false_northing",200000],
    UNIT["meter",1]]

-> we observe that latitude_of_center and longitude_of_center are WRONG.

Comparing to http://www.epsg-registry.org/

-> [retrieve by code]
Code: 21781
       
Latitude of projection centre: 46° 57' 8.66" N
Unit of Measure: sexagesimal DMS
Sign Reversible: No
       
Longitude of projection centre: 7° 26' 22.5" E
Unit of Measure: sexagesimal DMS
Sign Reversible: No
       
Azimuth of initial line: 90°
Unit of Measure: sexagesimal DMS
Sign Reversible: No
       
Angle from Rectified to Skew Grid: 90°
Unit of Measure: sexagesimal DMS
Sign Reversible: No
       
Scale factor on initial line: 1
Unit of Measure: unity
Sign Reversible: No
       
Easting at projection centre: 600000
Unit of Measure: metre
Sign Reversible: No
       
Northing at projection centre: 200000
Unit of Measure: metre
Sign Reversible: No

BUT if I look into:

cd general/g.setproj/
grep -i somer *
main.c:     else if (G_strcasecmp(proj_out, "SOMERC") == 0) {
proj-parms.table:SOMERC:Swiss. Obl.
Mercator:KFACT=noask,1.0;LAT0=noask,46.952405556;LON0=noask,7.4395833333;X0=noask,600000.0;Y0=noask,200000.0

It seems to be there. How come that this isn't used? I am not familiar enough with the mechanism to fix that...

Markus

Change History (8)

comment:1 by neteler, 17 years ago

Owner: changed from neteler to glynn

comment:2 by martinl, 17 years ago

Owner: changed from glynn to martinl

comment:3 by pkelly, 17 years ago

Re: the commented-out 7-parameter transform

I originally put this in and the source is now at http://www.asprs.org/resources/grids/08-2001-swiss.pdf

As far as I can remember the two reasons I left it commented were:

1) The parameters given are for CH1903+ which is apparently different from CH1903 - I have no idea how much or if the differences are big enough to be relevant.

2) I didn't have any test points to verify the parameters - in particular we always need to check the sign of the 3 rotation parameters (the 4th, 5th and 6th numbers out of the 7) as the American/European conventions are different.

If somebody can verify these two points then we can uncomment the parameters.

Paul

comment:4 by martinl, 17 years ago

Owner: changed from martinl to grass-dev@…

in reply to:  3 ; comment:5 by martinl, 17 years ago

Replying to pkelly:

Re: the commented-out 7-parameter transform

I originally put this in and the source is now at http://www.asprs.org/resources/grids/08-2001-swiss.pdf

As far as I can remember the two reasons I left it commented were:

1) The parameters given are for CH1903+ which is apparently different from CH1903 - I have no idea how much or if the differences are big enough to be relevant.

2) I didn't have any test points to verify the parameters - in particular we always need to check the sign of the 3 rotation parameters (the 4th, 5th and 6th numbers out of the 7) as the American/European conventions are different.

If somebody can verify these two points then we can uncomment the parameters.

I cannot varify it (maybe someone in grass-dev/user ML), but I would vote for uncomment the parameters and close the ticket (or to postpone it for 6.4).

Martin

in reply to:  5 comment:6 by pkelly, 17 years ago

Replying to martinl:

Replying to pkelly:

Re: the commented-out 7-parameter transform

I originally put this in and the source is now at http://www.asprs.org/resources/grids/08-2001-swiss.pdf

As far as I can remember the two reasons I left it commented were:

1) The parameters given are for CH1903+ which is apparently different from CH1903 - I have no idea how much or if the differences are big enough to be relevant.

2) I didn't have any test points to verify the parameters - in particular we always need to check the sign of the 3 rotation parameters (the 4th, 5th and 6th numbers out of the 7) as the American/European conventions are different.

If somebody can verify these two points then we can uncomment the parameters.

I cannot varify it (maybe someone in grass-dev/user ML), but I would vote for uncomment the parameters and close the ticket (or to postpone it for 6.4).

Well, the original bug seems to be fixed according to Markus' comments, so no objections from me to closing the bug. I do object very strongly though to uncommenting the Swiss datum parameters without fully verifying them. People have been known to rely on and trust what GRASS does (ha ha ;)), and the onus is on us as developers not to let them down and verify stuff like this before putting it in there. I did a lot of research and double checking before I added all the datum parameters that I did, and while I can't remember the exact details of this one (was quite a while ago) it is obvious that I had some doubts or it wouldn't be commented out. So until someone does the work to verify that they are genuinely valid and work then IMO they should stay disabled.

comment:7 by neteler, 17 years ago

Resolution: fixed
Status: newclosed

Bug closed, new ticket #35 for ch1903 region datum.

comment:8 by hamish, 17 years ago

to verify perhaps send a ping out to the PROJ.4 mailing list?

Hamish

Note: See TracTickets for help on using tickets.