WIP RTR Reporting

This commit is contained in:
Frank Schubert
2024-12-06 13:45:20 +01:00
parent 3a7b356b30
commit 33d7a4e5f1
12 changed files with 604 additions and 10 deletions

View File

@@ -200,11 +200,17 @@ class Building extends mfBaseModel {
return null;
}
public function getLaeaCoordinates() {
if(!$this->gps_lat || !$this->gps_lat) {
return false;
public function getLaeaCoordinates($gps_lat = 0, $gps_long = 0) {
if(!$gps_lat || !$gps_long) {
$gps_lat = $this->gps_lat;
$gps_long = $this->gps_long;
}
if(!$gps_lat || !$gps_long) {
return false;
}
// Elipsenparameter der Erdoberfläche
$a = 6378137;
$e = 0.081819191;
@@ -221,8 +227,8 @@ class Building extends mfBaseModel {
$PI = M_PI;
// Umrechnung der Eingabekoordinaten in rad
$Lat = $this->gps_lat * $PI / 180;
$Lon = $this->gps_long * $PI / 180;
$Lat = $gps_lat * $PI / 180;
$Lon = $gps_long * $PI / 180;
// Berechnungen
$q = (1 - $e ** 2) * ((sin($Lat) / (1 - $e ** 2 * sin($Lat) ** 2)) - ((1 / (2 * $e)) * log((1 - $e * sin($Lat)) / (1 + $e * sin($Lat)))));