From 71f52003d156a8f7d4a12ec390d7e5ec85b1cc62 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Wed, 22 May 2024 16:44:31 +0200 Subject: [PATCH] updated definitions of the fields Dataset.size and Dataset.geolocation --- .../eu/dnetlib/dhp/schema/oaf/Dataset.java | 7 +- .../dnetlib/dhp/schema/oaf/GeoLocation.java | 96 +++++++++++++++---- .../dhp/schema/oaf/GeoLocationBox.java | 62 ++++++++++++ .../dhp/schema/oaf/GeoLocationPoint.java | 39 ++++++++ .../dhp/schema/oaf/GeoLocationPolygon.java | 58 +++++++++++ 5 files changed, 239 insertions(+), 23 deletions(-) create mode 100644 src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocationBox.java create mode 100644 src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocationPoint.java create mode 100644 src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocationPolygon.java diff --git a/src/main/java/eu/dnetlib/dhp/schema/oaf/Dataset.java b/src/main/java/eu/dnetlib/dhp/schema/oaf/Dataset.java index 89ea3d9..dc38c0c 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/oaf/Dataset.java +++ b/src/main/java/eu/dnetlib/dhp/schema/oaf/Dataset.java @@ -9,12 +9,13 @@ import eu.dnetlib.dhp.schema.common.ModelConstants; public class Dataset extends Result implements Serializable { private static final long serialVersionUID = 916526716184645549L; + private Field storagedate; // candidate for removal private Field device; - private Field size; + private List size; private Field version; @@ -44,11 +45,11 @@ public class Dataset extends Result implements Serializable { this.device = device; } - public Field getSize() { + public List getSize() { return size; } - public void setSize(Field size) { + public void setSize(List size) { this.size = size; } diff --git a/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocation.java b/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocation.java index 1bdf256..8485ac3 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocation.java +++ b/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocation.java @@ -2,43 +2,99 @@ package eu.dnetlib.dhp.schema.oaf; import java.io.Serializable; -import java.util.Objects; - -import org.apache.commons.lang3.StringUtils; - -import com.fasterxml.jackson.annotation.JsonIgnore; +/** + * + * Atlantic Ocean + * + * -67.302 + * 31.233 + * + * + * -71.032 + * -68.211 + * 41.090 + * 42.893 + * + * + * + * 41.991 + * -71.032 + * + * + * 42.893 + * -69.622 + * + * + * 41.991 + * -68.211 + * + * + * 41.090 + * -69.622 + * + * + * 41.991 + * -71.032 + * + * + * 41.991 + * -71.032 + * + * + * + */ public class GeoLocation implements Serializable { private static final long serialVersionUID = 8096534610208458404L; - private String point; - private String box; + private String geoLocationPlace; - private String place; + private GeoLocationPoint geoLocationPoint; - public String getPoint() { - return point; + private GeoLocationBox geoLocationBox; + + private GeoLocationPolygon geoLocationPolygon; + + public GeoLocation() { } - public void setPoint(String point) { - this.point = point; + public GeoLocation(String geoLocationPlace, GeoLocationPoint geoLocationPoint, GeoLocationBox geoLocationBox, GeoLocationPolygon geoLocationPolygon) { + this.geoLocationPlace = geoLocationPlace; + this.geoLocationPoint = geoLocationPoint; + this.geoLocationBox = geoLocationBox; + this.geoLocationPolygon = geoLocationPolygon; } - public String getBox() { - return box; + public String getGeoLocationPlace() { + return geoLocationPlace; } - public void setBox(String box) { - this.box = box; + public void setGeoLocationPlace(String geoLocationPlace) { + this.geoLocationPlace = geoLocationPlace; } - public String getPlace() { - return place; + public GeoLocationPoint getGeoLocationPoint() { + return geoLocationPoint; } - public void setPlace(String place) { - this.place = place; + public void setGeoLocationPoint(GeoLocationPoint geoLocationPoint) { + this.geoLocationPoint = geoLocationPoint; } + public GeoLocationBox getGeoLocationBox() { + return geoLocationBox; + } + + public void setGeoLocationBox(GeoLocationBox geoLocationBox) { + this.geoLocationBox = geoLocationBox; + } + + public GeoLocationPolygon getGeoLocationPolygon() { + return geoLocationPolygon; + } + + public void setGeoLocationPolygon(GeoLocationPolygon geoLocationPolygon) { + this.geoLocationPolygon = geoLocationPolygon; + } } diff --git a/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocationBox.java b/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocationBox.java new file mode 100644 index 0000000..19ebea5 --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocationBox.java @@ -0,0 +1,62 @@ +package eu.dnetlib.dhp.schema.oaf; + +/** + * + * -71.032 + * -68.211 + * 41.090 + * 42.893 + * + */ +public class GeoLocationBox { + + private Double westBoundLongitude; + + private Double eastBoundLongitude; + + private Double southBoundLatitude; + + private Double northBoundLatitude; + + public GeoLocationBox() { + } + + public GeoLocationBox(Double westBoundLongitude, Double eastBoundLongitude, Double southBoundLatitude, Double northBoundLatitude) { + this.westBoundLongitude = westBoundLongitude; + this.eastBoundLongitude = eastBoundLongitude; + this.southBoundLatitude = southBoundLatitude; + this.northBoundLatitude = northBoundLatitude; + } + + public Double getWestBoundLongitude() { + return westBoundLongitude; + } + + public void setWestBoundLongitude(Double westBoundLongitude) { + this.westBoundLongitude = westBoundLongitude; + } + + public Double getEastBoundLongitude() { + return eastBoundLongitude; + } + + public void setEastBoundLongitude(Double eastBoundLongitude) { + this.eastBoundLongitude = eastBoundLongitude; + } + + public Double getSouthBoundLatitude() { + return southBoundLatitude; + } + + public void setSouthBoundLatitude(Double southBoundLatitude) { + this.southBoundLatitude = southBoundLatitude; + } + + public Double getNorthBoundLatitude() { + return northBoundLatitude; + } + + public void setNorthBoundLatitude(Double northBoundLatitude) { + this.northBoundLatitude = northBoundLatitude; + } +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocationPoint.java b/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocationPoint.java new file mode 100644 index 0000000..606a83b --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocationPoint.java @@ -0,0 +1,39 @@ +package eu.dnetlib.dhp.schema.oaf; + +/** + * + * + * -67.302 + * 31.233 + * + */ +public class GeoLocationPoint { + + private Double pointLongitude; + + private Double pointLatitude; + + public GeoLocationPoint() { + } + + public GeoLocationPoint(Double pointLongitude, Double pointLatitude) { + this.pointLongitude = pointLongitude; + this.pointLatitude = pointLatitude; + } + + public Double getPointLongitude() { + return pointLongitude; + } + + public void setPointLongitude(Double pointLongitude) { + this.pointLongitude = pointLongitude; + } + + public Double getPointLatitude() { + return pointLatitude; + } + + public void setPointLatitude(Double pointLatitude) { + this.pointLatitude = pointLatitude; + } +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocationPolygon.java b/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocationPolygon.java new file mode 100644 index 0000000..00d60de --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocationPolygon.java @@ -0,0 +1,58 @@ +package eu.dnetlib.dhp.schema.oaf; + +import java.util.List; + +/** + * + * + * 41.991 + * -71.032 + * + * + * 42.893 + * -69.622 + * + * + * 41.991 + * -68.211 + * + * + * 41.090 + * -69.622 + * + * + * 41.991 + * -71.032 + * + * + */ +public class GeoLocationPolygon { + + private List polygonPint; + + private GeoLocationPoint inPolygonPoint; + + public GeoLocationPolygon() { + } + + public GeoLocationPolygon(List polygonPint, GeoLocationPoint inPolygonPoint) { + this.polygonPint = polygonPint; + this.inPolygonPoint = inPolygonPoint; + } + + public List getPolygonPint() { + return polygonPint; + } + + public void setPolygonPint(List polygonPint) { + this.polygonPint = polygonPint; + } + + public GeoLocationPoint getInPolygonPoint() { + return inPolygonPoint; + } + + public void setInPolygonPoint(GeoLocationPoint inPolygonPoint) { + this.inPolygonPoint = inPolygonPoint; + } +}