Initial commit

This commit is contained in:
torsten committed 2026-08-13 18:33:10 +02:00
commit b7d90b9afe
16245 files changed
+3396666

No files matched your search

+122
View File
@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1.1" creator="OkMap 10.11.4" xmlns="http://www.topografix.com/GPX/1/1">
<trk>
<extensions>
<line xmlns="http://www.topografix.com/GPX/gpx_style/0/2">
<color>FF0000</color>
</line>
</extensions>
<name></name>
<trkseg>
</trkseg>
</trk>
<trk>
<extensions>
<line xmlns="http://www.topografix.com/GPX/gpx_style/0/2">
<color>FF0000</color>
</line>
</extensions>
<name></name>
<trkseg>
<trkpt lat="53.0518811245" lon="8.89316441712">
<time>2019-08-26T14:38:22.200000Z</time>
</trkpt>
</trkseg>
</trk>
<trk>
<extensions>
<line xmlns="http://www.topografix.com/GPX/gpx_style/0/2">
<color>FF0000</color>
</line>
</extensions>
<name></name>
<trkseg>
<trkpt lat="53.0518811245" lon="8.89316441712">
<time>2019-08-26T14:38:22.200000Z</time>
</trkpt>
<trkpt lat="53.0545167304" lon="8.89373737492">
<time>2019-08-26T14:38:24.700000Z</time>
</trkpt>
</trkseg>
</trk>
<trk>
<extensions>
<line xmlns="http://www.topografix.com/GPX/gpx_style/0/2">
<color>FF0000</color>
</line>
</extensions>
<name></name>
<trkseg>
<trkpt lat="53.0545167304" lon="8.89373737492">
<time>2019-08-26T14:38:24.700000Z</time>
</trkpt>
<trkpt lat="53.0545167304" lon="8.89373737492">
<time>2019-08-26T14:38:24.700000Z</time>
</trkpt>
</trkseg>
</trk>
<trk>
<extensions>
<line xmlns="http://www.topografix.com/GPX/gpx_style/0/2">
<color>FF0000</color>
</line>
</extensions>
<name></name>
<trkseg>
<trkpt lat="53.0545167304" lon="8.89373737492">
<time>2019-08-26T14:38:24.700000Z</time>
</trkpt>
<trkpt lat="53.0545167304" lon="8.89373737492">
<time>2019-08-26T14:38:24.700000Z</time>
</trkpt>
</trkseg>
</trk>
<trk>
<extensions>
<line xmlns="http://www.topografix.com/GPX/gpx_style/0/2">
<color>FF0000</color>
</line>
</extensions>
<name></name>
<trkseg>
<trkpt lat="53.0545167304" lon="8.89373737492">
<time>2019-08-26T14:38:24.700000Z</time>
</trkpt>
<trkpt lat="53.0545167304" lon="8.89373737492">
<time>2019-08-26T14:38:24.700000Z</time>
</trkpt>
</trkseg>
</trk>
<trk>
<extensions>
<line xmlns="http://www.topografix.com/GPX/gpx_style/0/2">
<color>FF0000</color>
</line>
</extensions>
<name></name>
<trkseg>
<trkpt lat="53.0545167304" lon="8.89373737492">
<time>2019-08-26T14:38:24.700000Z</time>
</trkpt>
<trkpt lat="53.0545167304" lon="8.89373737492">
<time>2019-08-26T14:38:24.700000Z</time>
</trkpt>
</trkseg>
</trk>
<trk>
<extensions>
<line xmlns="http://www.topografix.com/GPX/gpx_style/0/2">
<color>FF0000</color>
</line>
</extensions>
<name></name>
<trkseg>
<trkpt lat="53.0545167304" lon="8.89373737492">
<time>2019-08-26T14:38:24.700000Z</time>
</trkpt>
<trkpt lat="53.0545167304" lon="8.89373737492">
<time>2019-08-26T14:38:24.700000Z</time>
</trkpt>
</trkseg>
</trk>
</gpx>
+20
View File
@@ -0,0 +1,20 @@
import subprocess
def run_command(command):
process = subprocess.Popen(command, shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = process.communicate()
return output.decode(), error.decode()
command = "psql lts_ets_pro -f statement3.spl > event_result.txt"
'''
output, error = run_command(command)
print(output)
if error:
print(error)'''
+33
View File
@@ -0,0 +1,33 @@
# Entscheidung welcher Participant
def quest():
while True:
try:
num = int(input('0 = alle Partisypants\nGebe paticipant an:'))
if num == 0:
return ''
else:
outfile = ' where participant_id = '
num = str(num)
outfile+= num
return outfile
except:
print("Muss ein int sein")
# Erstellt den Command
def creator(num):
if num == '2':
#event
outfile = 'SELECT * FROM ex_42.eem_event'
outfile+= quest()
outfile+= ' order by sample_time;'
return outfile
elif num == '1':
#track
outfile = 'select participant_id, sample_time, pos_lon, pos_lat, pos_z from ex_42.rec_participant_position'
outfile+= quest()
outfile+= ' order by participant_id;'
return outfile
# Erstellt die Datei
def statement(num):
with open('statement.spl','w') as datei:
datei.write(creator(num))
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+197
View File
@@ -0,0 +1,197 @@
import datetime
# wandelt die Zeit um
def timer(mydata,num):
sm_since_1970 = ''
sm_since_1970 = mydata[num][-4]
sm_since_1970 = float(sm_since_1970)
sec_since_1970 = sm_since_1970 / 1000.0
sec_since_1970 = float(sec_since_1970)
moment = datetime.datetime.fromtimestamp(sec_since_1970)
moment = str(moment)
moment = moment.replace(' ','T')
if len(moment) < 20:
moment += '.00'
else:
stripper(moment)
return moment
# entfernt die letzten 4 Zeichen
def stripper(text):
result = text[:-4]
return result
# einstellen der Farben
def extensions():
outfile = ' <trk>\n'
outfile += ' <extensions>\n'
outfile += ' <line xmlns="http://www.topografix.com/GPX/gpx_style/0/2">\n'
outfile += ' <color>FF0000</color>\n'
outfile += ' </line>\n'
outfile += ' </extensions>\n'
outfile += ' <name></name>\n'
outfile += ' <trkseg>\n'
return outfile
# erstellt Trackpunkte
def trkpt(mydata,num):
outfile = ' <trkpt lat="'
var = mydata[num][-2]
var = float(var)
var = var*180/3.14159265359
var = str(var)
outfile += var
outfile += '" lon="'
var = mydata[num][-3]
var = float(var)
var = var*180/3.14159265359
var = str(var)
outfile += var
outfile += '">\n'
outfile += ' <time>'
outfile += timer(mydata,num)
outfile += 'Z</time>\n' #Z
outfile += ' </trkpt>\n'
return outfile
# Abschluss des Tracks
def end():
outfile = ' </trkseg>\n'
outfile += ' </trk>\n'
return outfile
# Anfang der Datei
def start():
outfile = '<?xml version="1.0" encoding="UTF-8"?>\n'
outfile += '<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1.1" creator="OkMap 10.11.4" xmlns="http://www.topografix.com/GPX/1/1">\n' #<gpx version="1.1" creator="someone"
#outfile +='<gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="Wikipedia" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">\n'
return outfile
# Anfang des Informationsteils
def header(mydata):
outfile = start()
outfile += extensions()
outfile += end()
outfile += extensions()
outfile += trkpt(mydata,0)
outfile += end()
return outfile
# Hauptteil der Informationen
def converter(mydata):
outfile = ''
for num in range(len(mydata)):
num_2 = num + 1
if num_2 < len(mydata):
outfile += extensions()
outfile += trkpt(mydata,num)
outfile += trkpt(mydata,num_2)
outfile += end()
else:
pass
return outfile
# Hauptteil der event Informationen
def event_conv(mydata):
outfile = ''
for num in range(len(mydata)):
if mydata[num][-2] != '0' or mydata[num][-3] != '0':
'''
outfile += ' <extensions>\n'
outfile += ' <line xmlns="http://www.topografix.com/GPX/gpx_style/0/2">\n'
outfile += ' <color>FF0000</color>\n'
outfile += ' </line>\n'
outfile += ' </extensions>\n'
outfile += ' <name></name>\n'
'''
outfile += ' <wpt lat="'
var = mydata[num][-2]
var = float(var)
var = var*180/3.14159265359
var = str(var)
outfile += var
outfile += '" lon="'
var = mydata[num][-3]
var = float(var)
var = var*180/3.14159265359
var = str(var)
outfile += var
outfile += '">\n <time>'
outfile += timer(mydata,num)
outfile += 'Z</time>\n <name></name>\n <desc>' #Z
var = num
var = str(var)
outfile += var
outfile += " Date: "
outfile += timer(mydata,num)
outfile += '</desc>\n </wpt>\n'
outfile += ' <trk>\n'
outfile += ' <trkseg>\n'
outfile += trkpt(mydata,num)
outfile += trkpt(mydata,num)
outfile += end()
return outfile
# verzweigung für das editieren eine gpx Datei
def file_editor(datalist,e_en):
try:
with open('Salchau/mydata.gpx','r') as datei:
text = datei.read()
text = text.replace("</gpx>\n","")
if e_en == '1': # result.txt
full_file = text + converter(datalist) + '</gpx>\n'
elif e_en == '2': # event_result.txt
full_file = text + event_conv(datalist) + '</gpx>\n'
with open('Salchau/mydata.gpx','w') as datei:#Salchau/
datei.write(full_file)
except Exception as error:
print(error)
# Erstellen einer gpx Datei
def file_creator(datalist,e_en):
try:
if e_en == '1': # result.txt
full_file = header(datalist) + converter(datalist) + '</gpx>\n'
elif e_en == '2': # event_result.txt
full_file = start() + event_conv(datalist) + '</gpx>\n'
except Exception as error:
print(error)
with open('Salchau/mydata.gpx','w') as datei: #Salchau/
datei.write(full_file)
# Entscheidung der verzweigung
def file_typ(datalist,num,e_en):
if num == '1':
file_creator(datalist,e_en)
elif num == '2':
file_editor(datalist,e_en)
+148
View File
@@ -0,0 +1,148 @@
<!DOCTYPE html>
<html>
<head>
<title>Quick Start - Leaflet</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../include/leaflet/leaflet.css" />
<script src="../include/leaflet/leaflet.js"></script>
<script src="../include/leaflet/gpx/gpx.js"></script>
<script src="./js/GPXParser.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div>
<div>
<div class="contenta">
<h1>Participant Timeline</h1>
</div>
<ul class="list-unstyled">
<div class= "contenta">
<form action="Salchau/" method="POST" enctype="multipart/form-data">
<label for="fileupload">Wähle eine Datei aus:</label>
<input type="file" id="fileupload" name="fileupload">
<input type="submit" value="Datei hochladen">
</form>
<button id="clear">Clear</button>
<select name="ddParticipants" id="ddParticipants">
<option value="">Track</option>
<option value="">Waypoints</option>
<option value="">Beides</option>
</select>
</div>
</ul>
<div class="map-content">
<div class="contenta" id="map" style="height: 890px;width: 90% ;">
</div>
</div>
</div>
<script>
var mymap = L.map('map').setView([53.052797857017,8.89316441712249], 20); //52.487646, 11.610097
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 22,
maxNativeZoom: 19,
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(mymap);
//var gpx = 'mtb/OutputToolThorsten.gpx';
var gpx = 'Salchau/excon_999_BT_575_ohne_IPS_Empfang.gpx'; // excon_999_BT_575_ohne_IPS_Empfang.gpxmydata.gpx
new L.GPX(gpx, {async: true}).on('loaded', function(e) {
mymap.fitBounds(e.target.getBounds());
}).addTo(mymap);
const xmlDoc = 'Datei';
const points = xmlDoc.getElemantByTagName('trkpt');
let coordinates = [];
for (let i = 0; i < point.length; i++) {
const lat = point[i].getAttribute('lat');
const lon = point[i].getAttribute('lon');
const time = point[i].getAttribute('time')
const ele = point[i].getAttribute('ele')
coordinates.push({lat: parseFloat(lat), lon: parseFloat(lon)});
}
</script>
<div class="contenta">
<h1>Timeline</h1>
</div>
<div class="content">
<canvas id="myChart" style="height: 500px; width:100%;max-width:100%"></canvas>
</div>
<script>
/*
document.getElementById('loadGpx').addEventListener('click',function(){
const gpxfile = 'Salchau/mydata.gpx';
fetch(gpxfile)
.then(response => {
if (!response.ok){
throw new Error('ne');
}
return response.text();
})
.then(gpxText => {
const parser = new DOMParser();
const xmlDoc = 'Dtatei';
const trackpoint = xmlDoc.getElemantByTagName('wpt');
const points = [];
for (let i = 0; i< point.length; i++){
const time = point.getElemantByTagName('time')[0];
points.push({time});
}
const gpxData = points;
dokument.getElementById('output').textContent = JSON.stringify(gpxData, null, 2);
})
.catch(error =>{
console.error('',error);
});
});
*/
const xyValues = [
{x:50, y:7},
{x:60, y:8},
{x:70, y:8},
{x:80, y:9},
{x:90, y:9},
{x:100, y:9},
{x:110, y:10},
{x:120, y:11},
{x:130, y:14},
{x:140, y:14},
{x:150, y:15}
];
new Chart("myChart", {
type: "scatter",
data: {
datasets: [{
pointRadius: 4,
pointBackgroundColor: "rgb(123,0,255)",
data: xyValues
}]
},
options: {
legend: {display: true},
scales: {
xAxes: [{ticks: {min: 0, max:800}}],
yAxes: [{ticks: {min: 0, max:16}}],
}
}
});
</script>
</body>
</html>
+36
View File
@@ -0,0 +1,36 @@
try:
def sort(text):
myarray = []
# open file
with open(text,'r') as file:
text_ro = file.read()
# get rid of everything usless
text = text_ro.replace("-","").replace("+","").replace("(","").replace(" rows)","").replace(" ","").replace("||","|NULL|").replace("\n","|")
# split at every |
lines = [line.strip()for line in text.split('|') if line.strip()]
#gets rid of everything useless
rows = lines[-1]
rows = int(rows)
lines.pop()
one_row_items = len(lines)/rows
one_row_items = int(one_row_items)
del lines[:one_row_items]
# order in the correct list
for x in range(rows):
myarray.append([])
for x in range(rows):
for y in range(one_row_items):
myarray[x].append(lines[(one_row_items * x) + y])
return myarray
except Exception as error:
print(error)
+27
View File
@@ -0,0 +1,27 @@
import reader
import cmdw
import gpxcon
import comment
# nutzer kann die daten eingeben
num = str(input(' 1 = result.txt\n 2 = event_result.txt\n --> '))
num_ = str(input(' 1 = neue Datei\n 2 = Datei erweitern\n --> '))
comment.statement(num)
# Entscheidet ob eine Datei erstellt oder erweitert wird
if num == '1':
cmdw.run_command('psql lts_ets_pro -f statement.spl > result.txt') #participant_id, sample_time, pos_lon*180/3.14159265359, pos_lat*180/3.14159265359, pos_z where participant_id = 16 order by sample_time
data = reader.sort('result.txt')
gpxcon.file_typ(data,num_,num)
print(data)
elif num == '2':
cmdw.run_command('psql lts_ets_pro -f statement.spl > result.txt') # id,event_type_id,participant_id,party_id,equipment_number,sample_time,position_x,position_y,position_z
data = reader.sort('result.txt')
gpxcon.file_typ(data,num_,num)
print(data)
else:
print('1 or 2!!!')
+56
View File
@@ -0,0 +1,56 @@
* {
box-sizing: border-box;
}
/* Set Map options */
.map-content{
display:flex;
justify-content: center;
align-items: center;
width: 100%;
height: 890px;
}
/* Set Map Size */
#map {
width: 80%;
height: 100%;
}
/* center everything */
.contenta
{
color: azure;
text-align: center;
align-content: center;
}
/* Set a background color */
body {
background-color: #474e5d;
font-family: Helvetica, sans-serif;
}
/* Container around content */
.container {
padding: 10px 40px;
position: relative;
background-color: inherit;
width: 50%;
}
/* The actual content */
.content {
padding: 20px 30px;
background-color: white;
position: relative;
border-radius: 6px;
display:flex;
justify-content: center;
align-items: center;
width: 100%;
}
/* Full-width containers */
.container {
width: 100%;
padding-left: 70px;
padding-right: 25px;
}