Datenimport angepasst und Abfrage Näaherungskoordinaten lokales Horizontsystem
This commit is contained in:
26
Datenbank.py
26
Datenbank.py
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
import sqlite3
|
||||
import sympy as sp
|
||||
|
||||
|
||||
class Datenbank_anlegen:
|
||||
@@ -25,4 +26,27 @@ class Datenbank_anlegen:
|
||||
""");
|
||||
con.commit()
|
||||
cursor.close()
|
||||
con.close()
|
||||
con.close()
|
||||
|
||||
class Datenbankzugriff:
|
||||
def __init__(self, pfad_datenbank):
|
||||
self.pfad_datenbank = pfad_datenbank
|
||||
|
||||
def get_koordinaten(self, koordinatenart, ausgabeart = "Vektoren"):
|
||||
con = sqlite3.connect(self.pfad_datenbank)
|
||||
cursor = con.cursor()
|
||||
if koordinatenart == "naeherung_lh":
|
||||
values = "punktnummer, naeherungx_lh, naeherungy_lh, naeherungz_lh"
|
||||
|
||||
liste_koordinaten = cursor.execute(f"""
|
||||
SELECT {values} FROM Netzpunkte;
|
||||
""").fetchall()
|
||||
cursor.close()
|
||||
con.close()
|
||||
|
||||
if ausgabeart == "Vektoren":
|
||||
liste_koordinaten_vektoren = []
|
||||
for koordinate in liste_koordinaten:
|
||||
liste_koordinaten_vektoren.append({koordinate[0]: sp.Matrix([float(koordinate[1]), float(koordinate[2]), float(koordinate[3])])})
|
||||
liste_koordinaten = liste_koordinaten_vektoren
|
||||
return liste_koordinaten
|
||||
Reference in New Issue
Block a user