[Therion] Detecting errors

Max D md at foxel.org
Tue Aug 20 11:39:56 CEST 2019



> On 20. Aug 2019, at 11:21, Max D <md at foxel.org> wrote:
> 
>> 
>> On 20. Aug 2019, at 11:15, Bruce Mutton <bruce at tomo.co.nz> wrote:
>> 
>> Survex loop closure seems to be fed arbitrary station names 
> 
> Maybe be we can ask Therion to dump a mapping between svx station names and it's own names. 

We can!

1. Ensure that you generate an SQL export in your thcondig: 
    export database -format sql -output mycave.sql

2. load the data in SQLite (it comes preinstallted on MAc and most Linux boxes):
	rm -f cave.db
        sqlite3 mycave.db < /mycave.sql

3. extract the data you want:


        sqlite3 mycave.db 
.headers on
SELECT s.ID as sid, (s.NAME || '@' || su.NAME) AS station FROM STATION s LEFT OUTER JOIN SURVEY su ON s.SURVEY_ID=su.ID where s.NAME not in ('-', '.') order by sid;
.mode tabs
.output stations.tsv
SELECT s.ID as sid, (s.NAME || '@' || su.NAME) AS station FROM STATION s LEFT OUTER JOIN SURVEY su ON s.SURVEY_ID=su.ID where s.NAME not in ('-', '.') order by sid;
.quit

The file ' stations.tsv' should now contain the desired mapping. IT looks like this:

sid     station
1       1.0 at g1
2       1.1 at g1
3       1.2 at g1

If you have much deeper nested surveys the code could be extended to resolve them. For me one level is enough to know what was meant by the station name.

--max




More information about the Therion mailing list