Remove map projection framework and associated classes
- Deleted the `MapProjection` interface and all related implementations (`SwissGridProjection`, `SwissGridVariant`, `UtmProjection`, and `UtmResult`). - Removed supporting classes
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
package dev.coph.flightscore.backend.map;
|
||||
|
||||
public record GeodeticDatum(double semiMajorAxis, double flattening, double dx, double dy, double dz) {
|
||||
public static final GeodeticDatum WGS84 = new GeodeticDatum(6378137.0, 1 / 298.257223563, 0, 0, 0);
|
||||
public static final GeodeticDatum ETRS89 = new GeodeticDatum(6378137.0, 1 / 298.257222101, 0, 0, 0);
|
||||
public static final GeodeticDatum BESSEL_CH = new GeodeticDatum(6377397.155, 1 / 299.1528128, 674.374, 15.056, 405.346);
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package dev.coph.flightscore.backend.map;
|
||||
|
||||
public class MapDate {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package dev.coph.flightscore.backend.map.projection;
|
||||
|
||||
import dev.coph.flightscore.backend.coordinate.Coordinate;
|
||||
import dev.coph.flightscore.backend.map.GeodeticDatum;
|
||||
|
||||
public interface MapProjection<T> {
|
||||
T project(double latitude, double longitude, GeodeticDatum sourceDatum);
|
||||
|
||||
Coordinate unproject(T projectedCoordinate, GeodeticDatum sourceDatum);
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
package dev.coph.flightscore.backend.map.projection.swiss;
|
||||
|
||||
import dev.coph.flightscore.backend.coordinate.Coordinate;
|
||||
import dev.coph.flightscore.backend.map.GeodeticDatum;
|
||||
import dev.coph.flightscore.backend.map.projection.MapProjection;
|
||||
|
||||
public class SwissGridProjection implements MapProjection<SwissResult> {
|
||||
private final GeodeticDatum targetDatum = GeodeticDatum.BESSEL_CH;
|
||||
private final SwissGridVariant variant;
|
||||
|
||||
public SwissGridProjection(SwissGridVariant variant) {
|
||||
this.variant = variant;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SwissResult project(double latitude, double longitude, GeodeticDatum sourceDatum) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Coordinate unproject(SwissResult projectedCoordinate, GeodeticDatum sourceDatum) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package dev.coph.flightscore.backend.map.projection.swiss;
|
||||
|
||||
public enum SwissGridVariant {
|
||||
LV03,
|
||||
LV95;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package dev.coph.flightscore.backend.map.projection.swiss;
|
||||
|
||||
public record SwissResult(double east, double north) {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package dev.coph.flightscore.backend.map.projection.utm;
|
||||
|
||||
import dev.coph.flightscore.backend.coordinate.Coordinate;
|
||||
import dev.coph.flightscore.backend.map.GeodeticDatum;
|
||||
import dev.coph.flightscore.backend.map.projection.MapProjection;
|
||||
|
||||
public class UtmProjection implements MapProjection<UtmResult> {
|
||||
private final int zone;
|
||||
private final boolean isNorthernHemisphere;
|
||||
private final GeodeticDatum targetDatum;
|
||||
|
||||
public UtmProjection(int zone, boolean isNorthernHemisphere, GeodeticDatum targetDatum) {
|
||||
this.zone = zone;
|
||||
this.isNorthernHemisphere = isNorthernHemisphere;
|
||||
this.targetDatum = targetDatum;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UtmResult project(double latitude, double longitude, GeodeticDatum sourceDatum) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Coordinate unproject(UtmResult projectedCoordinate, GeodeticDatum sourceDatum) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private char getUtmLetterDesignator(double lat) {
|
||||
if (lat <= 84 && lat >= 72) return 'X';
|
||||
else if (lat < 72 && lat >= 64) return 'W';
|
||||
else if (lat < 64 && lat >= 56) return 'V';
|
||||
else if (lat < 56 && lat >= 48) return 'U';
|
||||
else if (lat < 48 && lat >= 40) return 'T';
|
||||
else if (lat < 40 && lat >= 32) return 'S';
|
||||
else if (lat < 32 && lat >= 24) return 'R';
|
||||
else if (lat < 24 && lat >= 16) return 'Q';
|
||||
else if (lat < 16 && lat >= 8) return 'P';
|
||||
else if (lat < 8 && lat >= 0) return 'N';
|
||||
else if (lat < 0 && lat >= -8) return 'M';
|
||||
else if (lat < -8 && lat >= -16) return 'L';
|
||||
else if (lat < -16 && lat >= -24) return 'K';
|
||||
else if (lat < -24 && lat >= -32) return 'J';
|
||||
else if (lat < -32 && lat >= -40) return 'H';
|
||||
else if (lat < -40 && lat >= -48) return 'G';
|
||||
else if (lat < -48 && lat >= -56) return 'F';
|
||||
else if (lat < -56 && lat >= -64) return 'E';
|
||||
else if (lat < -64 && lat >= -72) return 'D';
|
||||
else if (lat < -72 && lat >= -80) return 'C';
|
||||
else return 'Z';
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package dev.coph.flightscore.backend.map.projection.utm;
|
||||
|
||||
public record UtmResult(double easting, double northing, int zone, char band, String fullZone) {
|
||||
public UtmResult(double easting, double northing, int zone, char band) {
|
||||
this(easting, northing, zone, band, zone + String.valueOf(band));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user