still an issue Re: *cs out EPSG:3042 and *declination auto - weird interaction

Warren Family warrenfamily at fastmail.com
Wed Oct 18 23:04:36 BST 2023


Thanks for looking into this so promptly :-).
I updated to survex 1.4.4 - thanks for indicating how :-).
It's also clearer now you explain (thanks!) that :
  - the *cs and *cs out should be defined before *declination auto;
  - the *declination auto uses the co-ordinate system of the most 
recently encountered *cs command not the *cs out command.
But I'm still having problems so there is something I still don't 
understand...

The version that should be correct is still failing for me the same way:
$ cat test_epsg3042_fail.svx
*cs OSGB:SD
*cs out EPSG:3042
*declination auto 97480 72608 225
...

Whereas the version that shouldn't work does in fact work:
$ cat test_epsg3042_succeed.svx
*cs OSGB:SD
*declination auto 97480 72608 225
*cs out EPSG:3042
...

With the v1.4.4 log I see there is a difference in the reported grid 
convergence, both between my versions, and compared to what you report:

$ cat test_epsg3042_fail.log
Survex 1.4.4
Copyright © 1990-2021 Olly Betts
test_epsg3042_fail.svx:3: info: Declination: -7.1° @ 1982-02-07 / -1.8° 
@ 2015-10-03, grid convergence: -90.8°
  *declination auto 97480 72608 225
...

versus

$ cat test_epsg3042_succeed.log
Survex 1.4.4
Copyright © 1990-2021 Olly Betts
test_epsg3042_succeed.svx:2: info: Declination: -7.1° @ 1982-02-07 / 
-1.8° @ 2015-10-03, grid convergence: 0.0°
  *declination auto 97480 72608 225

Whereas if I use *cs out UTM30N (which works either way) then I get the 
following:
$ cat test_utm3on.log
Survex 1.4.4
Copyright © 1990-2021 Olly Betts
test_utm3on.svx:3: info: Declination: -7.1° @ 1982-02-07 / -1.8° @ 
2015-10-03, grid convergence: 0.8°

I'm prepared to believe that the version that is still failing for me is 
somehow working for you.
Maybe there is a bug in the PROJ library?

Patrick





On 18/10/2023 20:32, Olly Betts wrote:
> On Wed, Oct 18, 2023 at 12:03:53PM +0100, Warren Family wrote:
>> I'm getting a weird result depending on the order of *cs out EPSG:3042 and
>> *declination auto in the survex file, for my standard test dataset for Dow
>> Cave / Providence Pot.  There is something about the interaction between
>> these two commands which I don't understand.
>>
>> I know that *declination auto should be preceded by a command defining the
>> input co-ordinate system (in this case *cs OSGB:SD) -- this problem is about
>> the interplay of *declination auto and the output co-ordinate system
>> declaration.
> The coordinates are computed in the output coordinate system, so you
> actually also need to define the *OUTPUT* coordinate system first, as
> the documentation for `*declination` in the manual indicates:
>
> | If you have specified the output coordinate system (using *cs out)
> | then you can use *declination auto (and we recommend that you do).
>
> (You do need to set an input coordinate system as well, which is used to
> interpret the coordinates specified in the `*declination auto` command.)
>
> So your "fail" version is actually the correct one, and it's a bug that
> cavern doesn't complain about the "succeed" version - currently it only
> complains if the input coordinate system isn't set.
>
> The declination values aren't computed until later because they depend
> on the survey date, but the convergence only depends on the output
> coordinate system so when I added support for that I just calculated it
> once up front (but failed to add a check that the output coordinate
> system is actually set).  We could probably delay calculating the
> convergence too (but still cache it once computed for efficiency) which
> would make both versions work.
>
>> So to summarise - if *cs out EPSG:3042 precedes *declination auto in the
>> survex file, the centreline (outside of *fix stations) is screwed up.  But
>> this co-ordinate system is quite a common one isn't it (?) since it's for
>> the European datum equivalent for WGS84, with the western European UTM zone.
>>
>> Version info:
>> os-release: Ubuntu 22.04.3 LTS (Jammy Jellyfish)
>> survex: 1.4.1
>> proj: release 8.2.1
> Your Survex release is nearly 2 years old - 1.4.5 is the latest.  You
> should be able to easily install 1.4.4 on Ubuntu from the PPA (the main
> change in 1.4.5 was a fix for a crash in aven's export dialog which
> doesn't affect Linux):
>
> https://launchpad.net/~survex-devs/+archive/ubuntu/ppa
>
> Testing with a build from git and PROJ 9.3.0, neither version gives a
> "screwed up" centre line - visually I can't tell them apart in aven,
> though `diffpos *.3d` shows stations have moved by up for ~5m.
>
> Cavern now reports the applied corrections for each `*declination auto`
> and that output is interesting:
>
> test_epsg3042_succeed.svx:2: info: Declination: -7.1° @ 1982-02-07 / -1.8° @ 2015-10-03, grid convergence: 0.0°
>
> test_epsg3042_fail.svx:3: info: Declination: -7.1° @ 1982-02-07 / -1.8° @ 2015-10-03, grid convergence: 0.8°
>
> This also suggests the "succeed" version is the one that's wrong as the
> grid convergence is unlikely to be "0.0°".
>
> I can't explain why you see screwed up coordinates from the "fail"
> version though.  A NULL coordinate system name will get passed to PROJ
> for the "succeed" case, so that's the one which I'd expect might be
> screwed up (though it seems at least with the newer PROJ I'm using that
> this just result in no correction for grid convergence).
>
> Cheers,
>      Olly




More information about the Survex mailing list