Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSLogic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPSLogic
Merge requests
!17
Develop
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Develop
develop
into
master
Overview
0
Commits
66
Pipelines
0
Changes
14
Merged
Tor-Einar Skog
requested to merge
develop
into
master
5 years ago
Overview
0
Commits
66
Pipelines
0
Changes
14
Expand
Creating a baseline
0
0
Merge request reports
Viewing commit
78fdead0
Prev
Next
Show latest version
14 files
+
52
−
54
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
14
Search (e.g. *.vue) (Ctrl+P)
78fdead0
Apple fruit moth: Adding possibility of hiding an observation site to the public
· 78fdead0
Tor-Einar Skog
authored
6 years ago
src/main/java/no/nibio/vips/logic/modules/applefruitmoth/AppleFruitMothBean.java
+
7
−
48
Options
@@ -78,7 +78,8 @@ public class AppleFruitMothBean {
return
em
.
find
(
ObservationSite
.
class
,
observationSiteId
);
}
public
Kml
getObservationSitesKml
(
Integer
season
,
Integer
selectedObservationSiteId
,
String
serverName
)
{
public
Kml
getObservationSitesKml
(
Integer
season
,
Integer
selectedObservationSiteId
,
String
serverName
,
Boolean
onlyPubliclyAvailable
)
{
onlyPubliclyAvailable
=
onlyPubliclyAvailable
!=
null
?
onlyPubliclyAvailable
:
true
;
String
iconPath
=
Globals
.
PROTOCOL
+
"://"
+
serverName
+
"/public/images/"
;
// Initialization
final
Vec2
hotspot
=
new
Vec2
()
@@ -175,6 +176,10 @@ public class AppleFruitMothBean {
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
for
(
ObservationSite
site:
sites
)
{
if
(
onlyPubliclyAvailable
&&
!
site
.
getPubliclyAvailable
())
{
continue
;
}
Integer
warningStatus
=
0
;
String
remarks
=
"Varsel ikke oppdatert"
;
ObservationSiteSeasonCommonData
commonData
=
site
.
getCommonDataForSeason
(
season
);
@@ -222,53 +227,7 @@ public class AppleFruitMothBean {
return
kml
;
}
/*
public Kml getObservationSitePointsKml(Integer observationSiteId, String serverName) {
ObservationSite observationSite = em.find(ObservationSite.class, observationSiteId);
String iconPath = Globals.PROTOCOL + "://" + serverName + "/public/images/";
// Initialization
final Vec2 hotspot = new Vec2()
.withX(0.5)
.withXunits(Units.FRACTION)
.withY(0)
.withYunits(Units.FRACTION);
final Kml kml = KmlFactory.createKml();
final Document document = kml.createAndSetDocument()
.withName("Rognebærmøllstasjon-punkter").withDescription("Oversikt over punkter for rognebærmøllstasjonen " + observationSite.getObservationSiteName());
// Adding icons for warning statuses
document.createAndAddStyle()
.withId("observation_site_point_icon")
.createAndSetIconStyle()
.withScale(1)
.withHotSpot(hotspot)
.createAndSetIcon()
.withHref(iconPath + "dot_blue.png");
Set<ObservationSitePoint> sitePoints = observationSite.getObservationSitePointSet();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
for(ObservationSitePoint sitePoint:sitePoints)
{
final Placemark placemark = document.createAndAddPlacemark()
.withName(sitePoint.getPointName())
.withStyleUrl("#observation_site_point_icon")
.withId(sitePoint.getObservationSitePointId().toString());
final Point point = placemark.createAndSetPoint();
List<Coordinate> coord = point.createAndSetCoordinates();
coord.add(new Coordinate(
sitePoint.getGisId().getGisGeom().getCoordinate().x,
sitePoint.getGisId().getGisGeom().getCoordinate().y,
0
));
}
return kml;
}*/
public
ObservationSite
storeObservationSite
(
ObservationSite
observationSite
)
{
return
em
.
merge
(
observationSite
);
}
Loading