diff --git a/pom.xml b/pom.xml index 718e74b4e7107626f0a41b605c95f274d153c0df..3abb26e8dc5643119967911f6a6d4fbe178c598a 100644 --- a/pom.xml +++ b/pom.xml @@ -26,11 +26,11 @@ </repositories> <dependencies> - <dependency> + <!--dependency> <groupId>com.github.bjornharrtell</groupId> <artifactId>jts2geojson</artifactId> <version>0.6.0</version> - </dependency> + </dependency--> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-spatial</artifactId> @@ -148,6 +148,11 @@ <version>9.4.1211</version> <scope>provided</scope> </dependency> + <dependency> + <groupId>org.wololo</groupId> + <artifactId>jts2geojson</artifactId> + <version>0.8.0</version> + </dependency> <dependency> <groupId>javax</groupId> <artifactId>javaee-web-api</artifactId> diff --git a/src/main/java/no/nibio/vips/logic/controller/servlet/PointOfInterestController.java b/src/main/java/no/nibio/vips/logic/controller/servlet/PointOfInterestController.java index a3c079099c8d745a6b60c54235730c8dae7f165f..ba6415aae92af332ce2908a08434957db39489c2 100644 --- a/src/main/java/no/nibio/vips/logic/controller/servlet/PointOfInterestController.java +++ b/src/main/java/no/nibio/vips/logic/controller/servlet/PointOfInterestController.java @@ -20,6 +20,7 @@ package no.nibio.vips.logic.controller.servlet; import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.Point; import java.io.IOException; @@ -48,6 +49,7 @@ import no.nibio.vips.logic.util.SessionControllerGetter; import no.nibio.vips.util.ExceptionUtil; import no.nibio.vips.util.ServletUtil; import no.nibio.vips.logic.entity.WeatherForecastProvider; +import no.nibio.vips.logic.util.GISUtil; import no.nibio.vips.logic.util.Globals; import no.nibio.web.forms.FormField; import no.nibio.web.forms.FormValidation; @@ -261,11 +263,20 @@ public class PointOfInterestController extends HttpServlet { // Set values weatherStation.setName(formValidation.getFormField("name").getWebValue()); weatherStation.setActive(formValidation.getFormField("active").getWebValue() != null); + + Double altitude = 0.0; + Point p2d = formValidation.getFormField("location").getValueAsPointWGS84(); try { - weatherStation.setAltitude(formValidation.getFormField("altitude").getValueAsDouble()); + altitude = formValidation.getFormField("altitude").getValueAsDouble(); + weatherStation.setAltitude(altitude); + } catch(NullPointerException | NumberFormatException ex) {} + Coordinate coordinate = new Coordinate(p2d.getX(), p2d.getY(),altitude); + GISUtil gisUtil = new GISUtil(); + Point p3d = gisUtil.createPointWGS84(coordinate); + weatherStation.setGisGeom(p3d); weatherStation.setLongitude(formValidation.getFormField("location").getValueAsPointWGS84().getX()); weatherStation.setLatitude(formValidation.getFormField("location").getValueAsPointWGS84().getY()); weatherStation.setWeatherStationDataSourceId(em.find(WeatherStationDataSource.class, formValidation.getFormField("weatherStationDataSourceId").getValueAsInteger())); @@ -584,11 +595,18 @@ public class PointOfInterestController extends HttpServlet { { // Set values poi.setName(formValidation.getFormField("name").getWebValue()); + Double altitude = 0.0; + Point p2d = formValidation.getFormField("location").getValueAsPointWGS84(); try { - poi.setAltitude(formValidation.getFormField("altitude").getValueAsDouble()); + altitude = formValidation.getFormField("altitude").getValueAsDouble(); + poi.setAltitude(altitude); } catch(NullPointerException | NumberFormatException ex) {} + Coordinate coordinate = new Coordinate(p2d.getX(), p2d.getY(),altitude); + GISUtil gisUtil = new GISUtil(); + Point p3d = gisUtil.createPointWGS84(coordinate); + poi.setGisGeom(p3d); poi.setLongitude(formValidation.getFormField("location").getValueAsPointWGS84().getX()); poi.setLatitude(formValidation.getFormField("location").getValueAsPointWGS84().getY()); poi.setWeatherForecastProviderId(formValidation.getFormField("weatherForecastProviderId").getWebValue() != null ? diff --git a/src/main/java/no/nibio/vips/logic/controller/session/ForecastBean.java b/src/main/java/no/nibio/vips/logic/controller/session/ForecastBean.java index 92f8195034e840ead7dd1bb6515525be3433b5ff..f123ec190a94dc67f898e8dc0cddd0a7a01730e1 100644 --- a/src/main/java/no/nibio/vips/logic/controller/session/ForecastBean.java +++ b/src/main/java/no/nibio/vips/logic/controller/session/ForecastBean.java @@ -72,6 +72,7 @@ import no.nibio.vips.logic.entity.VipsLogicUser; import no.nibio.vips.logic.scheduling.model.ModelRunPreprocessor; import no.nibio.vips.logic.scheduling.model.ModelRunPreprocessorFactory; import no.nibio.vips.logic.scheduling.model.PreprocessorException; +import no.nibio.vips.logic.util.GISUtil; import no.nibio.vips.logic.util.RunModelException; import no.nibio.vips.logic.util.SessionControllerGetter; import no.nibio.vips.logic.util.SystemTime; @@ -689,6 +690,8 @@ public class ForecastBean { //Date benchmark = new Date(); List<PointOfInterest> poisWithAggregate = getPointOfInterestForecastsAggregate(organizationId, cropOrganismIds, theDate); //System.out.println(this.getClass().getName() + " DEBUG: getPointOfInterestForecastsAggregate took " + (new Date().getTime() - benchmark.getTime()) + " ms to complete."); + + GISUtil gisUtil = new GISUtil(); for(PointOfInterest poiWithAggregate:poisWithAggregate) { // If it's an inactive weather station, we don't produce a placemark @@ -728,11 +731,8 @@ public class ForecastBean { final Point point = placemark.createAndSetPoint(); List<Coordinate> coord = point.createAndSetCoordinates(); - coord.add(new Coordinate( - poiWithAggregate.getLongitude(), - poiWithAggregate.getLatitude(), - poiWithAggregate.getAltitude() != null ? poiWithAggregate.getAltitude() : 0 - )); + + coord.add(gisUtil.getKMLCoordinateFromJTSCoordinate(poiWithAggregate.getGisGeom().getCoordinate())); } //System.out.println(kml.marshal()); return kml; diff --git a/src/main/java/no/nibio/vips/logic/controller/session/PointOfInterestBean.java b/src/main/java/no/nibio/vips/logic/controller/session/PointOfInterestBean.java index e0f7246bc7eba3cf21ab3ad8dee2cebfb61926b4..3e54b8fb11406c7469ea289d848e9d686c20402e 100644 --- a/src/main/java/no/nibio/vips/logic/controller/session/PointOfInterestBean.java +++ b/src/main/java/no/nibio/vips/logic/controller/session/PointOfInterestBean.java @@ -50,6 +50,7 @@ import no.nibio.vips.logic.entity.PointOfInterestType; import no.nibio.vips.logic.entity.PointOfInterestWeatherStation; import no.nibio.vips.logic.entity.VipsLogicUser; import no.nibio.vips.logic.entity.WeatherStationDataSource; +import no.nibio.vips.logic.util.GISUtil; import no.nibio.vips.logic.util.Globals; import no.nibio.vips.logic.util.SessionControllerGetter; import no.nibio.web.forms.FormField; @@ -189,6 +190,7 @@ public class PointOfInterestBean { String description = ""; + GISUtil gisUtil = new GISUtil(); for(PointOfInterest poi:pois) { if(excludePoiId != null && excludePoiId.equals(poi.getPointOfInterestId())) @@ -229,11 +231,7 @@ public class PointOfInterestBean { final Point point = placemark.createAndSetPoint(); List<Coordinate> coord = point.createAndSetCoordinates(); - coord.add(new Coordinate( - poi.getLongitude(), - poi.getLatitude(), - poi.getAltitude() != null ? poi.getAltitude() : 0 - )); + coord.add(gisUtil.getKMLCoordinateFromJTSCoordinate(poi.getGisGeom().getCoordinate())); } return kml; } diff --git a/src/main/java/no/nibio/vips/logic/entity/Gis.java b/src/main/java/no/nibio/vips/logic/entity/Gis.java index 99a8caf115261ffb0bfd564fe1a19acc0e5ed88b..b0fef7e6ef89b658adfa0b15517f91bc5f1e4e14 100644 --- a/src/main/java/no/nibio/vips/logic/entity/Gis.java +++ b/src/main/java/no/nibio/vips/logic/entity/Gis.java @@ -20,6 +20,7 @@ package no.nibio.vips.logic.entity; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Geometry; import java.io.Serializable; import javax.persistence.Basic; @@ -79,6 +80,13 @@ public class Gis implements Serializable { } public void setGisGeom(Geometry gisGeom) { + for(Coordinate c:gisGeom.getCoordinates()) + { + if(Double.isNaN(c.z)) + { + c.setCoordinate(new Coordinate(c.x,c.y,0.0)); + } + } this.gisGeom = gisGeom; } diff --git a/src/main/java/no/nibio/vips/logic/entity/PointOfInterest.java b/src/main/java/no/nibio/vips/logic/entity/PointOfInterest.java index fb105431dd12b14ab2114cb66794a9d4178f302a..bc73ba0467aa1d2daa8a7f0c4da7a202c8a9f2b4 100644 --- a/src/main/java/no/nibio/vips/logic/entity/PointOfInterest.java +++ b/src/main/java/no/nibio/vips/logic/entity/PointOfInterest.java @@ -39,12 +39,14 @@ import javax.persistence.Transient; import javax.validation.constraints.Size; import javax.xml.bind.annotation.XmlRootElement; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.vividsolutions.jts.geom.Geometry; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.DiscriminatorType; import javax.persistence.DiscriminatorValue; import javax.persistence.FetchType; import javax.persistence.OneToMany; +import no.nibio.vips.logic.util.GISUtil; /** * @copyright 2013 <a href="http://www.nibio.no/">NIBIO</a> @@ -63,60 +65,51 @@ import javax.persistence.OneToMany; //@NamedQuery(name = "PointOfInterest.findByPointOfInterestTypeId", query = "SELECT p FROM PointOfInterest p WHERE p.pointOfInterestType = :pointOfInterestType"), @NamedQuery(name = "PointOfInterest.findByOrganizationId", query = "SELECT p FROM PointOfInterest p WHERE p.userId IN(SELECT u.userId FROM VipsLogicUser u WHERE u.organizationId=:organizationId OR u.organizationId IN (SELECT o.organizationId FROM Organization o WHERE o.parentOrganizationId = :organizationId)) ORDER BY p.name ASC"), @NamedQuery(name = "PointOfInterest.findByName", query = "SELECT p FROM PointOfInterest p WHERE p.name = :name"), - @NamedQuery(name = "PointOfInterest.findByLongitude", query = "SELECT p FROM PointOfInterest p WHERE p.longitude = :longitude"), - @NamedQuery(name = "PointOfInterest.findByLatitude", query = "SELECT p FROM PointOfInterest p WHERE p.latitude = :latitude"), - @NamedQuery(name = "PointOfInterest.findByAltitude", query = "SELECT p FROM PointOfInterest p WHERE p.altitude = :altitude"), + //@NamedQuery(name = "PointOfInterest.findByLongitude", query = "SELECT p FROM PointOfInterest p WHERE p.longitude = :longitude"), + //@NamedQuery(name = "PointOfInterest.findByLatitude", query = "SELECT p FROM PointOfInterest p WHERE p.latitude = :latitude"), + //@NamedQuery(name = "PointOfInterest.findByAltitude", query = "SELECT p FROM PointOfInterest p WHERE p.altitude = :altitude"), @NamedQuery(name = "PointOfInterest.findByUserId", query = "SELECT p FROM PointOfInterest p WHERE p.userId = :userId ORDER BY p.name ASC") }) public class PointOfInterest implements Serializable, Comparable { - @OneToMany(cascade = CascadeType.ALL, mappedBy = "pointOfInterest", fetch = FetchType.EAGER) private Set<PointOfInterestExternalResource> pointOfInterestExternalResourceSet; private static final long serialVersionUID = 1L; - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Basic(optional = false) - @Column(name = "point_of_interest_id") private Integer pointOfInterestId; @Size(max = 255) - @Column(name = "name") private String name; @Size(max = 255) - @Column(name = "time_zone") private String timeZone; // @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation - @Column(name = "longitude") private Double longitude; - @Column(name = "latitude") private Double latitude; - @Column(name = "altitude") private Double altitude; - @JoinColumn(name = "user_id", referencedColumnName = "user_id") - @ManyToOne + @JsonIgnore + private Geometry gisGeom; private VipsLogicUser userId; - @JoinColumn(name = "country_code", referencedColumnName = "country_code") - @ManyToOne private Country countryCode; - @JoinColumn(name = "weather_forecast_provider_id", referencedColumnName = "weather_forecast_provider_id") - @ManyToOne private WeatherForecastProvider weatherForecastProviderId; - @Column(name = "point_of_interest_type_id", insertable = false, updatable = false) private Integer pointOfInterestTypeId; // For attaching ad-hoc properties // e.g. Worst warning for map - @Transient private Map<String, Object> properties; + private GISUtil gisUtil; + public PointOfInterest() { + this.gisUtil = new GISUtil(); } public PointOfInterest(Integer pointOfInterestId) { this.pointOfInterestId = pointOfInterestId; } + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "point_of_interest_id") public Integer getPointOfInterestId() { return pointOfInterestId; } @@ -125,6 +118,7 @@ public class PointOfInterest implements Serializable, Comparable { this.pointOfInterestId = pointOfInterestId; } + @Column(name = "name") public String getName() { return name; } @@ -133,6 +127,7 @@ public class PointOfInterest implements Serializable, Comparable { this.name = name; } + @Column(name = "longitude") public Double getLongitude() { return longitude; } @@ -141,6 +136,7 @@ public class PointOfInterest implements Serializable, Comparable { this.longitude = longitude; } + @Column(name = "latitude") public Double getLatitude() { return latitude; } @@ -149,6 +145,7 @@ public class PointOfInterest implements Serializable, Comparable { this.latitude = latitude; } + @Column(name = "altitude") public Double getAltitude() { return altitude; } @@ -158,6 +155,8 @@ public class PointOfInterest implements Serializable, Comparable { } + @JoinColumn(name = "country_code", referencedColumnName = "country_code") + @ManyToOne public Country getCountryCode() { return countryCode; } @@ -225,6 +224,7 @@ public class PointOfInterest implements Serializable, Comparable { /** * @return the timeZone */ + @Column(name = "time_zone") public String getTimeZone() { return timeZone; } @@ -239,6 +239,7 @@ public class PointOfInterest implements Serializable, Comparable { /** * @return the properties */ + @Transient public Map<String,Object> getProperties() { if(this.properties == null) { @@ -257,6 +258,8 @@ public class PointOfInterest implements Serializable, Comparable { /** * @return the userId */ + @JoinColumn(name = "user_id", referencedColumnName = "user_id") + @ManyToOne @JsonIgnore public VipsLogicUser getUserId() { return userId; @@ -272,6 +275,8 @@ public class PointOfInterest implements Serializable, Comparable { /** * @return the weatherForecastProviderId */ + @JoinColumn(name = "weather_forecast_provider_id", referencedColumnName = "weather_forecast_provider_id") + @ManyToOne public WeatherForecastProvider getWeatherForecastProviderId() { return weatherForecastProviderId; } @@ -284,6 +289,7 @@ public class PointOfInterest implements Serializable, Comparable { } //@XmlTransient + @OneToMany(cascade = CascadeType.ALL, mappedBy = "pointOfInterest", fetch = FetchType.EAGER) public Set<PointOfInterestExternalResource> getPointOfInterestExternalResourceSet() { return pointOfInterestExternalResourceSet; } @@ -295,6 +301,7 @@ public class PointOfInterest implements Serializable, Comparable { /** * @return the pointOfInterestTypeId */ + @Column(name = "point_of_interest_type_id", insertable = false, updatable = false) public Integer getPointOfInterestTypeId() { return pointOfInterestTypeId; } @@ -306,5 +313,26 @@ public class PointOfInterest implements Serializable, Comparable { this.pointOfInterestTypeId = pointOfInterestTypeId; } + /** + * @return the gisGeom + */ + @Column(name = "gis_geom", columnDefinition = "Geometry") + public Geometry getGisGeom() { + return gisGeom; + } + + @Transient + public String getGeoJSON() + { + return this.gisUtil.getGeoJSONFromGeometry(this.getGisGeom()); + } + + /** + * @param gisGeom the gisGeom to set + */ + public void setGisGeom(Geometry gisGeom) { + this.gisGeom = gisGeom; + } + } diff --git a/src/main/java/no/nibio/vips/logic/entity/PointOfInterestWeatherStation.java b/src/main/java/no/nibio/vips/logic/entity/PointOfInterestWeatherStation.java index 1d517220171f574dc5d973d20761e64d4aa242c3..019363ce0802268859f7f0ca17bfaa3ff4fb8542 100644 --- a/src/main/java/no/nibio/vips/logic/entity/PointOfInterestWeatherStation.java +++ b/src/main/java/no/nibio/vips/logic/entity/PointOfInterestWeatherStation.java @@ -32,6 +32,7 @@ import javax.persistence.Table; import javax.validation.constraints.Size; import javax.xml.bind.annotation.XmlRootElement; import com.fasterxml.jackson.annotation.JsonIgnore; +import javax.persistence.Transient; /** * Extension of {@see PointOfInterest}, with additional info for weather stations @@ -53,22 +54,17 @@ import com.fasterxml.jackson.annotation.JsonIgnore; }) public class PointOfInterestWeatherStation extends PointOfInterest implements Serializable { @Size(max = 255) - @Column(name = "weather_station_remote_id") private String weatherStationRemoteId; - @JoinColumn(name = "weather_station_data_source_id", referencedColumnName = "weather_station_data_source_id") - @ManyToOne private WeatherStationDataSource weatherStationDataSourceId; @JsonIgnore - @JoinColumn(name = "point_of_interest_id", referencedColumnName = "point_of_interest_id", insertable = false, updatable = false) - @OneToOne(optional = false) private PointOfInterest pointOfInterest; - @Column(name="active") private Boolean active; public PointOfInterestWeatherStation() { } + @Column(name = "weather_station_remote_id") public String getWeatherStationRemoteId() { return weatherStationRemoteId; } @@ -77,6 +73,8 @@ public class PointOfInterestWeatherStation extends PointOfInterest implements Se this.weatherStationRemoteId = weatherStationRemoteId; } + @JoinColumn(name = "weather_station_data_source_id", referencedColumnName = "weather_station_data_source_id") + @ManyToOne public WeatherStationDataSource getWeatherStationDataSourceId() { return weatherStationDataSourceId; } @@ -85,6 +83,8 @@ public class PointOfInterestWeatherStation extends PointOfInterest implements Se this.weatherStationDataSourceId = weatherStationDataSourceId; } + @JoinColumn(name = "point_of_interest_id", referencedColumnName = "point_of_interest_id", insertable = false, updatable = false) + @OneToOne(optional = false) public PointOfInterest getPointOfInterest() { return pointOfInterest; } @@ -131,6 +131,7 @@ public class PointOfInterestWeatherStation extends PointOfInterest implements Se * weather data source and weather station * @return */ + @Transient public String getDataFetchUri() { String dataRequestUri = String.format(this.getWeatherStationDataSourceId().getDatafetchUriExpression(),this.getWeatherStationRemoteId()); @@ -140,6 +141,7 @@ public class PointOfInterestWeatherStation extends PointOfInterest implements Se /** * @return the active */ + @Column(name="active") public Boolean getActive() { return active; } diff --git a/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/CydiaPomonellaModelPreprocessor.java b/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/CydiaPomonellaModelPreprocessor.java index 9c2d08056f150a6524d54accd1f961518ede741d..83e2e231e391e6418de2431fe7dbc773b2c4e602 100644 --- a/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/CydiaPomonellaModelPreprocessor.java +++ b/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/CydiaPomonellaModelPreprocessor.java @@ -136,9 +136,9 @@ public class CydiaPomonellaModelPreprocessor extends ModelRunPreprocessor{ retVal.setConfigParameter("timeZone", timeZone.getID()); retVal.setConfigParameter("observations", observations); retVal.setConfigParameter("observedDateOfFirstCatch", observedDateOfFirstCatch); - retVal.setConfigParameter("latitude", configuration.getLocationPointOfInterestId().getLatitude()); - retVal.setConfigParameter("longitude", configuration.getLocationPointOfInterestId().getLongitude()); - retVal.setConfigParameter("altitude", configuration.getLocationPointOfInterestId().getAltitude()); + retVal.setConfigParameter("longitude", configuration.getLocationPointOfInterestId().getGisGeom().getCoordinate().x); + retVal.setConfigParameter("latitude", configuration.getLocationPointOfInterestId().getGisGeom().getCoordinate().y); + retVal.setConfigParameter("altitude", configuration.getLocationPointOfInterestId().getGisGeom().getCoordinate().z); return retVal; } diff --git a/src/main/java/no/nibio/vips/logic/util/GISUtil.java b/src/main/java/no/nibio/vips/logic/util/GISUtil.java index 689f0ff6436e2955c45bac45989164121930cd9a..b96fbe7ddb2b5f3c796e299c0730fde778406014 100644 --- a/src/main/java/no/nibio/vips/logic/util/GISUtil.java +++ b/src/main/java/no/nibio/vips/logic/util/GISUtil.java @@ -19,7 +19,11 @@ package no.nibio.vips.logic.util; +import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.GeometryFactory; +import com.vividsolutions.jts.geom.Point; +import com.vividsolutions.jts.geom.PrecisionModel; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -112,4 +116,35 @@ public class GISUtil { FeatureCollection json = writer.write(features); return json.toString(); } + + public String getGeoJSONFromGeometry(Geometry geometry) + { + if(geometry == null) + { + return ""; + } + List<Feature> features = new ArrayList<>(); + Map<String, Object> properties = new HashMap<>(); + GeoJSONWriter writer = new GeoJSONWriter(); + + features.add(new Feature(writer.write(geometry), properties)); + + FeatureCollection json = writer.write(features); + return json.toString(); + } + + public Point createPointWGS84(Coordinate coordinate) + { + GeometryFactory gf = new GeometryFactory(new PrecisionModel(), 4326); + return gf.createPoint(coordinate); + } + + public de.micromata.opengis.kml.v_2_2_0.Coordinate getKMLCoordinateFromJTSCoordinate(com.vividsolutions.jts.geom.Coordinate jtsCoordinate) + { + return new de.micromata.opengis.kml.v_2_2_0.Coordinate( + jtsCoordinate.x, + jtsCoordinate.y, + Double.isNaN(jtsCoordinate.z) ? 0.0 : jtsCoordinate.z + ); + } } diff --git a/src/main/java/no/nibio/vips/util/weather/YrWeatherForecastProvider.java b/src/main/java/no/nibio/vips/util/weather/YrWeatherForecastProvider.java index f1f310913637348d4afb24f9b2342c70b45aa046..f4dbd2ace7bc2e77d9936d4b1ea2d38dbdd59069 100644 --- a/src/main/java/no/nibio/vips/util/weather/YrWeatherForecastProvider.java +++ b/src/main/java/no/nibio/vips/util/weather/YrWeatherForecastProvider.java @@ -54,7 +54,7 @@ public class YrWeatherForecastProvider implements WeatherForecastProvider{ @Override public List<WeatherObservation> getWeatherForecasts(PointOfInterest location) throws ParseWeatherDataException { - return this.getWeatherForecasts(location.getLongitude(), location.getLatitude(), location.getAltitude()); + return this.getWeatherForecasts(location.getGisGeom().getCoordinate().x, location.getGisGeom().getCoordinate().y, location.getGisGeom().getCoordinate().z); } diff --git a/src/main/java/no/nibio/web/forms/FormField.java b/src/main/java/no/nibio/web/forms/FormField.java index 888ceb1a6e361ac0c747e01e64f23a683421f22d..4da5599561df0955b2fefb9c9c47adabd4926f1c 100644 --- a/src/main/java/no/nibio/web/forms/FormField.java +++ b/src/main/java/no/nibio/web/forms/FormField.java @@ -155,7 +155,6 @@ public class FormField { return gf.createPoint(coordinate); } - /** * Default state is valid */