Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Add helper methods to get latitude and longitude from a GeoJSONPoint (#2734)

Eric Bariauxc5e5ab0e5436
diff --git a/model/src/main/java/org/openremote/model/geo/GeoJSONPoint.java b/model/src/main/java/org/openremote/model/geo/GeoJSONPoint.java
index 6fe08d4de..25dd9b473 100644
--- a/model/src/main/java/org/openremote/model/geo/GeoJSONPoint.java
+++ b/model/src/main/java/org/openremote/model/geo/GeoJSONPoint.java
@@ -75,11 +75,27 @@ public class GeoJSONPoint extends GeoJSONGeometry {
return coordinates.x;
}
+ /**
+ * More intuitive than {@link #getX()} when working with map coordinates.
+ */
+ @JsonIgnore
+ public double getLongitude() {
+ return coordinates.x;
+ }
+
@JsonIgnore
public double getY() {
return coordinates.y;
}
+ /**
+ * More intuitive than {@link #getY()} when working with map coordinates.
+ */
+ @JsonIgnore
+ public double getLatitude() {
+ return coordinates.y;
+ }
+
@JsonIgnore
public Double getZ() {
return coordinates.getZ();