Koordinaten des stationärem GNSS werden jetzt verwendet
This commit is contained in:
39
Import.py
39
Import.py
@@ -223,4 +223,41 @@ class Import:
|
||||
con.commit()
|
||||
cursor.close()
|
||||
con.close()
|
||||
print(f"Der Import der Datei {pfad_datei} wurde erfolgreich abgeschlossen.")
|
||||
print(f"Der Import der Datei {pfad_datei} wurde erfolgreich abgeschlossen.")
|
||||
|
||||
def import_koordinaten_gnss(self, pfad_datei, liste_sapos_stationen_genauigkeiten):
|
||||
liste_zeilen = []
|
||||
dict_koordinaten = {}
|
||||
|
||||
con = sqlite3.connect(self.pfad_datenbank)
|
||||
cursor = con.cursor()
|
||||
|
||||
with (open(pfad_datei, newline="", encoding="utf-8") as csvfile):
|
||||
r = csv.reader(csvfile, delimiter = ";")
|
||||
for i, row in enumerate(r):
|
||||
row_neu = []
|
||||
for eintrag in row:
|
||||
eintrag = str(eintrag).strip()
|
||||
|
||||
eintrag = eintrag.replace("'", "")
|
||||
aufgeteilt = eintrag.split()
|
||||
for teil in aufgeteilt:
|
||||
teil = teil.split(",")
|
||||
row_neu.extend(teil)
|
||||
if row_neu[1] == 'Referenz' and row_neu[7] == '0.0000' and row_neu[8] == '0.0000' and row_neu[9] == '0.0000':
|
||||
row_neu[7] = liste_sapos_stationen_genauigkeiten[0]
|
||||
row_neu[8] = liste_sapos_stationen_genauigkeiten[1]
|
||||
row_neu[9] = liste_sapos_stationen_genauigkeiten[2]
|
||||
cursor.execute(f"""INSERT INTO Netzpunkte (punktnummer, naeherungx_us, naeherungy_us, naeherungz_us, stabw_vorinfo_x, stabw_vorinfo_y, stabw_vorinfo_z) VALUES (?, ?, ?, ?, ?, ?, ?) ON CONFLICT (punktnummer) DO UPDATE SET naeherungx_us = excluded.naeherungx_us,
|
||||
naeherungy_us = excluded.naeherungy_us,
|
||||
naeherungz_us = excluded.naeherungz_us,
|
||||
stabw_vorinfo_x = excluded.stabw_vorinfo_x,
|
||||
stabw_vorinfo_y = excluded.stabw_vorinfo_y,
|
||||
stabw_vorinfo_z = excluded.stabw_vorinfo_z""", (row_neu[0], row_neu[4], row_neu[5], row_neu[6], row_neu[7], row_neu[8], row_neu[9])
|
||||
)
|
||||
#liste_zeilen.append(row_neu)
|
||||
|
||||
|
||||
con.commit()
|
||||
con.close()
|
||||
return "Import der Koordinaten aus stationärem GNSS abgeschlossen."
|
||||
|
||||
Reference in New Issue
Block a user