Opened 6 weeks ago

Last modified 12 days ago

#168 new defect

Walls: Shot data with duplicate "from" and "to" stations is handled differently by cavern vs walls

Reported by: Joe Walko Owned by: Olly Betts
Priority: minor Milestone:
Component: cavern Version:
Keywords: Walls duplicate Cc:

Description

When shot data with duplicate "from" and "to" stations is encountered, Walls creates two distinct shot vectors, and uses "loop closure" logic to calculate the coordinates.

Survex, on the other hand appears to simply average the values of the duplicate shot data, and creates a single shot vector.

Given the Walls SRV data below: Walls length for a-b is 15. Survex length for a-b is 20.

#FIX a 0 0 0
a b 10 90 0
a b 30 90 0

Walls shapefile vector export shows two distinct, but identical, a-b shot vectors, each 15m in length. Survex, otoh, indicates a 20m single shot vector in log and .3d data.

Also: It may be prudent for cavern to log a 'warning' for duplicate stations. Walls has this capability, but it's disabled by default, and most users don't bother to enable it (Options->Compilation->Look for duplicates).

Change History (3)

comment:1 by Olly Betts, 3 weeks ago

Survex has special handling for consecutive legs with the same from and to stations:

Repeated Readings

If your survey data contains multiple versions of each leg (for example, pockettopo produces such data), then provided these are adjacent to one another, Survex 1.2.17 and later will automatically average these and treat them as a single leg.

It seems this is active for Walls data (and I'd guess for Compass too). We could suppress this for Walls and Compass data (or turn it into a warning), though people may be processing data from pockettopo, etc in Walls and Compass and have such repeated legs as a result.

The current handling doesn't really seem problematic as it should give equivalent results to loop closure - if we add a dummy leg to force Survex to treat your example as 2 legs, the resultant distance between a and b after loop closure is still 20m:

$ cat trac168.srv 
#FIX     a        0        0        0
a        b        10        90        0
a a1 0 0 0
a        b        30        90        0
$ cavern trac168.srv 
Survex 1.4.24
Copyright © 1990-2026 Olly Betts

Removing trailing traverses...

Concatenating traverses...

Simplifying network...

Calculating network...

Calculating traverses...

Calculating trailing traverses...

Calculating statistics...

Survey contains 3 survey stations, joined by 3 legs.
There is 1 loop.
Total length of survey legs =   40.00m (  40.00m adjusted)
Total plan length of survey legs =   40.00m
Total vertical length of survey legs =    0.00m
Vertical range = 0.00m (from b at 0.00m to b at 0.00m)
North-South range = 0.00m (from b at 0.00m to a at 0.00m)
East-West range = 20.00m (from b at 20.00m to a at 0.00m)
CPU time used  0.00s

The only real difference is that the leg count won't include such duplicate legs (which is more correct in the case where someone is processing pockettopo data in Walls).

Walls length for a-b is 15.

Why does Walls resolve a loop closure between a 10m and a 30m leg as 15m? It seems to be treating the 10m length measurement as significantly more accurate, but I can't see the logic behind doing so.

comment:2 by Joe Walko, 13 days ago

Walls does weighted least-squares adjustment, and gives the shorter vector greater weight. I can see the logic with bearing & clino being more accurate, on average, for a shorter shot, but I doubt that's the case for the 'distance' reading.

Shot 1: L = 10, weight = 1/10
Shot 2: L = 30, weight = 1/30

(10x(1/10) + 30x(1/30)) / (1/10 + 1/30) = 2 / (4/30) = 15

This is not particularly intuitive.

I need to push, on the Walls side, to make the option to flag duplicate shots, "On" by default, instead of it getting reset to "off" each time Walls is restarted.

Separately, unrelated to duplicate shots, Walls weighted traverse approach sometimes causes me issues with long-traverses which tie into a rigid loop system. The traverse takes the brunt of the adjustment, more than I'd like in some cases.

comment:3 by Olly Betts, 12 days ago

Thinking about old-style sighting instruments and actual tape measure, it's hard to reliably read a compass or clino accurate to 0.5° (probably a bit easier for the clino than compass as gravity is more reliable than the magnetic field), but a tape is probably accurate to 1cm. If we take the accuracies as 0.5° and 1cm, then for a 1.15m leg the expected errors are the same, but for anything longer the tape is more accurate. At 10m, 0.5° is 8.7cm; at 30m, more than 26cm. I'm not sure what the numbers would be for a modern all-in-one, but probably not so different (ISTR Phil Underwood telling me the compass and clino on an early SAP version weren't quite as good as a well-read sighting instrument, but from real world use of that SAP I found you seemed to get closures at least as good as old-style instruments in practice, perhaps due to reduced instrument positioning errors; that was also well over a decade ago and the technology has probably improved since). I think it's reasonable to think that for a typical leg the distance reading is likely to be the most accurate reading.

Walls error model only allows one number per leg, so for typical legs in real survey data it's going to not trust the tape enough (as Walls is now - the alternative would be to trust the compass and clino too much instead on longer legs). This seems a real weakness in Walls loop closure.

Survex uses generalised least squares, so takes covariances into account and can effectively treat the bearing and clino as more accurate for a shorter leg while not treating the length as more accurate. The covariances mean there's also coupling between the axes - e.g. the N and E components of the compass error aren't really independent, but if I follow Walls assumes they are.

You can think of Walls as only allowing an error ellipsoid which is spherical, while Survex allows a more arbitrary shaped error ellipsoid which can be oriented to match the leg direction. For a very long leg it'll be pancake-like, moving through sphere-like at the leg length where the errors balance, and for a really short leg it'll be cucumber-like. (This is simplifying things somewhat, but the general idea is about right.)

Survex also includes a contribution for station position error (which accounts for the instrument and target not necessarily being exactly on their stations). This is the same size regardless of leg length or orientation. This means Survex also takes into account that multiple small legs incur more error due to station positioning than one long leg between the same end points.

I'm not sure what we can usefully do about your report right now - averaging distances of 10 and 30 to give 15 really seems like a bug in Walls, and not something it's sensible to try to emulate in Survex.

We could stop treating consecutive repeat legs as separate legs, but the loop closure answers would be pretty much the same. It'd probably make loop closure of such cases slower, due to more loops being created (though for simple cases they'll get removed by network simplification rules). It would make the leg count include such duplicates though. We definitely shouldn't change this if Walls is likely to also support averaging consecutive repeated legs, so I've asked about that in ​https://github.com/wallscavesurvey/walls/issues/67 .

I have also done some experimenting with warning about a leg between two stations which are already directly connected, which finds some real-world dubious cases in the CUCC dataset. It could be suppressed when a leg is flagged "duplicate" (which can be done in Walls data too because we infer the duplicate flag from #SEGMENT L). I think this check should be low overhead in Survex (we just need to check existing legs from one of the stations to see if one goes to the other, so it's a bounded overhead per leg which should be fairly small).

Note: See TracTickets for help on using tickets.