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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user