fixed bugs with coords:

argument order is now [lat, lon] everywhere

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-01-01 10:44:32 +01:00
parent 211c92b0e3
commit d9e5475962
6 changed files with 33 additions and 9 deletions
@@ -6,10 +6,10 @@ import org.json.JSONObject;
/**
* cartesian coords
* @param longitude the longitude
* @param latitude the latitude
* @param longitude the longitude
*/
public record Coords(double longitude, double latitude) {
public record Coords(double latitude,double longitude) {
/**
* get a string representing this coords in the ICAL format, see <a href="https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.1.6">iCalendar spec</a>
* @return the formatted coords
@@ -23,6 +23,11 @@ public record Coords(double longitude, double latitude) {
* @return the json object
*/
public JSONObject json() {
return new JSONObject(Map.of("lon", longitude, "lat", latitude));
return new JSONObject(Map.of("lat", latitude,"lon", longitude ));
}
@Override
public String toString() {
return "%s, %s".formatted(latitude,longitude);
}
}