Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
22 changed files:
- client-configuration/src/main/config/Client.ini
- client-configuration/src/main/i18n/getters/config.getter
- client-core/src/main/java/fr/ird/observe/client/ui/actions/main/menu/config/ShowConfigAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/Common.jcss
- client-core/src/main/java/fr/ird/observe/client/ui/content/api/ContentUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/content/api/ContentUI.jcss
- client-core/src/main/java/fr/ird/observe/client/ui/content/api/data/table/ContentTableUI.jcss
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/common/TripLonglineUI.jaxx
- + client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/common/TripMapContentBuilder.java
- + client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/common/TripMapContentBuilder.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/common/TripSeineUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/util/tripMap/TripMapContentBuilder.java
- client-core/src/main/java/fr/ird/observe/client/ui/util/tripMap/TripMapUIHandler.java
- client-core/src/main/map/style.xml → client-core/src/main/map/ll-style.xml
- + client-core/src/main/map/ps-style.xml
- dto/src/main/i18n/getters/java-enumeration.getter
- dto/src/main/java/fr/ird/observe/dto/data/TripMapPointType.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
- persistence/src/main/java/fr/ird/observe/entities/data/ll/common/TripLonglineTopiaDao.java
- persistence/src/main/java/fr/ird/observe/entities/data/ps/common/TripSeineTopiaDao.java
Changes:
| ... | ... | @@ -510,11 +510,17 @@ description = observe.config.map.layer10.description |
| 510 | 510 |
key = map.layer10.path
|
| 511 | 511 |
type = file
|
| 512 | 512 |
|
| 513 |
-[option mapStyleFile]
|
|
| 514 |
-description = observe.config.map.style.description
|
|
| 515 |
-key = map.style.path
|
|
| 513 |
+[option mapPsStyleFile]
|
|
| 514 |
+description = observe.config.map.ps.style.description
|
|
| 515 |
+key = map.ps.style.path
|
|
| 516 | 516 |
type = file
|
| 517 |
-defaultValue = ${resources.directory}/map/style.xml
|
|
| 517 |
+defaultValue = ${resources.directory}/map/ps-style.xml
|
|
| 518 |
+ |
|
| 519 |
+[option mapLlStyleFile]
|
|
| 520 |
+description = observe.config.map.ll.style.description
|
|
| 521 |
+key = map.ll.style.path
|
|
| 522 |
+type = file
|
|
| 523 |
+defaultValue = ${resources.directory}/map/ll-style.xml
|
|
| 518 | 524 |
|
| 519 | 525 |
[option navigationEditModel]
|
| 520 | 526 |
description = observe.config.ui.treeOpenNodes
|
| ... | ... | @@ -59,7 +59,8 @@ observe.config.map.layer6.description |
| 59 | 59 |
observe.config.map.layer7.description
|
| 60 | 60 |
observe.config.map.layer8.description
|
| 61 | 61 |
observe.config.map.layer9.description
|
| 62 |
-observe.config.map.style.description
|
|
| 62 |
+observe.config.map.ll.style.description
|
|
| 63 |
+observe.config.map.ps.style.description
|
|
| 63 | 64 |
observe.config.observation.activitysDetaillees
|
| 64 | 65 |
observe.config.observation.fauneAssociee
|
| 65 | 66 |
observe.config.observation.floatingObject
|
| ... | ... | @@ -215,7 +215,8 @@ public class ShowConfigAction extends MenuActionSupport { |
| 215 | 215 |
|
| 216 | 216 |
helper.addOption(ClientConfigOption.MAP_BACKGROUND_COLOR);
|
| 217 | 217 |
ClientConfig.MAP_LAYERS.forEach(helper::addOption);
|
| 218 |
- helper.addOption(ClientConfigOption.MAP_STYLE_FILE);
|
|
| 218 |
+ helper.addOption(ClientConfigOption.MAP_PS_STYLE_FILE);
|
|
| 219 |
+ helper.addOption(ClientConfigOption.MAP_LL_STYLE_FILE);
|
|
| 219 | 220 |
|
| 220 | 221 |
}
|
| 221 | 222 |
|
| ... | ... | @@ -43,9 +43,4 @@ BigTextEditor { |
| 43 | 43 |
BeanCheckBox {
|
| 44 | 44 |
i18nProperty:"";
|
| 45 | 45 |
horizontalTextPosition:{BeanCheckBox.LEFT};
|
| 46 |
-}
|
|
| 47 |
- |
|
| 48 |
-#bodyScrollPane {
|
|
| 49 |
- verticalScrollBarPolicy:{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED};
|
|
| 50 |
- horizontalScrollBarPolicy:{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER};
|
|
| 51 | 46 |
}
|
| \ No newline at end of file |
| ... | ... | @@ -125,7 +125,9 @@ public void resetEdit() { |
| 125 | 125 |
<JPanel id='contentContainer'>
|
| 126 | 126 |
|
| 127 | 127 |
<JXLayer UI='{blockLayerUI}' constraints='BorderLayout.CENTER'>
|
| 128 |
+ |
|
| 128 | 129 |
<JPanel id='body'/>
|
| 130 |
+ |
|
| 129 | 131 |
</JXLayer>
|
| 130 | 132 |
|
| 131 | 133 |
<Table id='actions' constraints='BorderLayout.SOUTH'/>
|
| ... | ... | @@ -67,7 +67,3 @@ |
| 67 | 67 |
borderPainted:false;
|
| 68 | 68 |
}
|
| 69 | 69 |
|
| 70 |
-#bodyScrollPane {
|
|
| 71 |
- verticalScrollBarPolicy:{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED};
|
|
| 72 |
- horizontalScrollBarPolicy:{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER};
|
|
| 73 |
-}
|
| ... | ... | @@ -132,4 +132,3 @@ |
| 132 | 132 |
verticalAlignment:"center";
|
| 133 | 133 |
horizontalAlignment:"center";
|
| 134 | 134 |
}
|
| 135 |
- |
| ... | ... | @@ -72,8 +72,7 @@ |
| 72 | 72 |
</BeanValidator>
|
| 73 | 73 |
|
| 74 | 74 |
<JPanel id="body" layout='{new BorderLayout()}'>
|
| 75 |
- <JScrollPane id='bodyScrollPane' constraints='BorderLayout.CENTER'>
|
|
| 76 |
- <JTabbedPane id='mainTabbedPane'>
|
|
| 75 |
+ <JTabbedPane id='mainTabbedPane' constraints='BorderLayout.CENTER'>
|
|
| 77 | 76 |
<tab id='generalTab' i18nProperty="">
|
| 78 | 77 |
<Table fill="both">
|
| 79 | 78 |
|
| ... | ... | @@ -328,7 +327,6 @@ |
| 328 | 327 |
<TripMapUI id="tripMap"/>
|
| 329 | 328 |
</tab>
|
| 330 | 329 |
</JTabbedPane>
|
| 331 |
- </JScrollPane>
|
|
| 332 | 330 |
</JPanel>
|
| 333 | 331 |
|
| 334 | 332 |
<!-- surcharge des actions (pour appliquer la css specifique) -->
|
| 1 |
+package fr.ird.observe.client.ui.content.data.ll.common;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Client core
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2019 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import com.google.auto.service.AutoService;
|
|
| 26 |
+import com.google.common.collect.ImmutableSet;
|
|
| 27 |
+import com.google.common.collect.Lists;
|
|
| 28 |
+import fr.ird.observe.client.configuration.ClientConfig;
|
|
| 29 |
+import fr.ird.observe.client.ui.util.tripMap.ObserveMapPaneLegendItem;
|
|
| 30 |
+import fr.ird.observe.dto.data.TripMapDto;
|
|
| 31 |
+import fr.ird.observe.dto.data.TripMapPoint;
|
|
| 32 |
+import fr.ird.observe.dto.data.TripMapPointType;
|
|
| 33 |
+import fr.ird.observe.spi.DtoModelClasses;
|
|
| 34 |
+import org.geotools.feature.DefaultFeatureCollection;
|
|
| 35 |
+import org.geotools.feature.simple.SimpleFeatureBuilder;
|
|
| 36 |
+import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
|
|
| 37 |
+import org.geotools.geometry.jts.JTSFactoryFinder;
|
|
| 38 |
+import org.geotools.map.FeatureLayer;
|
|
| 39 |
+import org.geotools.map.Layer;
|
|
| 40 |
+import org.geotools.referencing.CRS;
|
|
| 41 |
+import org.geotools.styling.Style;
|
|
| 42 |
+import org.locationtech.jts.geom.Coordinate;
|
|
| 43 |
+import org.locationtech.jts.geom.GeometryFactory;
|
|
| 44 |
+import org.locationtech.jts.geom.LineString;
|
|
| 45 |
+import org.locationtech.jts.geom.Polygon;
|
|
| 46 |
+import org.opengis.feature.simple.SimpleFeature;
|
|
| 47 |
+import org.opengis.feature.simple.SimpleFeatureType;
|
|
| 48 |
+import org.opengis.referencing.FactoryException;
|
|
| 49 |
+ |
|
| 50 |
+import java.io.File;
|
|
| 51 |
+import java.util.List;
|
|
| 52 |
+import java.util.stream.Collectors;
|
|
| 53 |
+ |
|
| 54 |
+import static io.ultreia.java4all.i18n.I18n.t;
|
|
| 55 |
+ |
|
| 56 |
+/**
|
|
| 57 |
+ * Created on 04/07/19.
|
|
| 58 |
+ *
|
|
| 59 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 60 |
+ * @since ?
|
|
| 61 |
+ */
|
|
| 62 |
+@AutoService(fr.ird.observe.client.ui.util.tripMap.TripMapContentBuilder.class)
|
|
| 63 |
+public class TripMapContentBuilder extends fr.ird.observe.client.ui.util.tripMap.TripMapContentBuilder {
|
|
| 64 |
+ |
|
| 65 |
+ private static final String TRIP_LONGLINE_OBS_FISHING_ZONE_LAYER_NAME = "Trip longline observation zone";
|
|
| 66 |
+ private static final String TRIP_LONGLINE_OBS_LINE_LAYER_NAME = "Trip longline observation line";
|
|
| 67 |
+ private static final String TRIP_LONGLINE_LOGBOOK_FISHING_ZONE_LAYER_NAME = "Trip longline logbook zone";
|
|
| 68 |
+ private static final String TRIP_LONGLINE_LOGBOOK_LINE_LAYER_NAME = "Trip longline logbook line";
|
|
| 69 |
+ |
|
| 70 |
+ public TripMapContentBuilder() {
|
|
| 71 |
+ super(ImmutableSet.of(
|
|
| 72 |
+ TripMapPointType.llActivityObs,
|
|
| 73 |
+ TripMapPointType.llActivityObsInHarbour,
|
|
| 74 |
+ TripMapPointType.llActivityObsWithSettingStart,
|
|
| 75 |
+ TripMapPointType.llActivityObsWithSettingEnd,
|
|
| 76 |
+ TripMapPointType.llActivityObsWithHaulingStart,
|
|
| 77 |
+ TripMapPointType.llActivityObsWithHaulingEnd,
|
|
| 78 |
+ TripMapPointType.llActivityLogbook,
|
|
| 79 |
+ TripMapPointType.llActivityLogbookInHarbour,
|
|
| 80 |
+ TripMapPointType.llActivityLogbookWithSettingStart,
|
|
| 81 |
+ TripMapPointType.llActivityLogbookWithSettingEnd,
|
|
| 82 |
+ TripMapPointType.llActivityLogbookWithHaulingStart,
|
|
| 83 |
+ TripMapPointType.llActivityLogbookWithHaulingEnd
|
|
| 84 |
+ ));
|
|
| 85 |
+ }
|
|
| 86 |
+ |
|
| 87 |
+ @Override
|
|
| 88 |
+ public boolean accept(TripMapDto tripMapDto) {
|
|
| 89 |
+ return DtoModelClasses.isLonglineId(tripMapDto.getTripId());
|
|
| 90 |
+ }
|
|
| 91 |
+ |
|
| 92 |
+ @Override
|
|
| 93 |
+ protected File getStyleFile(ClientConfig config) {
|
|
| 94 |
+ return config.getMapLlStyleFile();
|
|
| 95 |
+ }
|
|
| 96 |
+ |
|
| 97 |
+ @Override
|
|
| 98 |
+ protected void addLines(List<TripMapPoint> tripMapPoints) throws FactoryException {
|
|
| 99 |
+ |
|
| 100 |
+ addLonglineObsFishingZone(tripMapPoints);
|
|
| 101 |
+ addLonglineObsLine(tripMapPoints);
|
|
| 102 |
+ addLonglineLogbookFishingZone(tripMapPoints);
|
|
| 103 |
+ addLonglineLogbookLine(tripMapPoints);
|
|
| 104 |
+ |
|
| 105 |
+ }
|
|
| 106 |
+ |
|
| 107 |
+ @Override
|
|
| 108 |
+ protected void addPoints(List<TripMapPoint> tripMapPoints) throws FactoryException {
|
|
| 109 |
+ addPoints(tripMapPoints.stream().filter(f->f.getType().isTrip() || f.getType().isObs()).collect(Collectors.toList()), TRIP_OBS_POINTS_LAYER_NAME);
|
|
| 110 |
+ addPoints(tripMapPoints.stream().filter(f->f.getType().isTrip() || f.getType().isLogbook()).collect(Collectors.toList()), TRIP_LOGBOOK_POINTS_LAYER_NAME);
|
|
| 111 |
+ }
|
|
| 112 |
+ |
|
| 113 |
+ private void addLonglineObsFishingZone(List<TripMapPoint> tripMapPoints) throws FactoryException {
|
|
| 114 |
+ GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
|
|
| 115 |
+ |
|
| 116 |
+ SimpleFeatureTypeBuilder polygonFeatureTypeBuilder = new SimpleFeatureTypeBuilder();
|
|
| 117 |
+ polygonFeatureTypeBuilder.setName("longlineFishingZoneBuilder");
|
|
| 118 |
+ polygonFeatureTypeBuilder.setCRS(CRS.decode("EPSG:4326", true));
|
|
| 119 |
+ polygonFeatureTypeBuilder.add("zone", Polygon.class);
|
|
| 120 |
+ polygonFeatureTypeBuilder.add("label", String.class);
|
|
| 121 |
+ polygonFeatureTypeBuilder.add("type", String.class);
|
|
| 122 |
+ |
|
| 123 |
+ SimpleFeatureType polygonFeatureType = polygonFeatureTypeBuilder.buildFeatureType();
|
|
| 124 |
+ SimpleFeatureBuilder polygonBuilder = new SimpleFeatureBuilder(polygonFeatureType);
|
|
| 125 |
+ |
|
| 126 |
+ DefaultFeatureCollection polygonsFeatures = new DefaultFeatureCollection();
|
|
| 127 |
+ |
|
| 128 |
+ for (int indexPoint = 3; indexPoint < tripMapPoints.size(); indexPoint++) {
|
|
| 129 |
+ if (tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.llActivityObsWithHaulingEnd)
|
|
| 130 |
+ && tripMapPoints.get(indexPoint - 1).getType().equals(TripMapPointType.llActivityObsWithHaulingStart)
|
|
| 131 |
+ && tripMapPoints.get(indexPoint - 2).getType().equals(TripMapPointType.llActivityObsWithSettingEnd)
|
|
| 132 |
+ && tripMapPoints.get(indexPoint - 3).getType().equals(TripMapPointType.llActivityObsWithSettingStart)) {
|
|
| 133 |
+ |
|
| 134 |
+ Coordinate[] coordinates = {
|
|
| 135 |
+ new Coordinate(tripMapPoints.get(indexPoint - 3).getLongitude(), tripMapPoints.get(indexPoint - 3).getLatitude()),
|
|
| 136 |
+ new Coordinate(tripMapPoints.get(indexPoint - 2).getLongitude(), tripMapPoints.get(indexPoint - 2).getLatitude()),
|
|
| 137 |
+ new Coordinate(tripMapPoints.get(indexPoint - 1).getLongitude(), tripMapPoints.get(indexPoint - 1).getLatitude()),
|
|
| 138 |
+ new Coordinate(tripMapPoints.get(indexPoint).getLongitude(), tripMapPoints.get(indexPoint).getLatitude()),
|
|
| 139 |
+ new Coordinate(tripMapPoints.get(indexPoint - 3).getLongitude(), tripMapPoints.get(indexPoint - 3).getLatitude())
|
|
| 140 |
+ };
|
|
| 141 |
+ |
|
| 142 |
+ |
|
| 143 |
+ Polygon polygon = geometryFactory.createPolygon(coordinates);
|
|
| 144 |
+ //polygon = (Polygon) polygon.convexHull(); // permet de transformer un poliqgone croisé en polygon convex
|
|
| 145 |
+ polygonBuilder.add(polygon);
|
|
| 146 |
+ polygonBuilder.add(DATE_FORMAT.format(tripMapPoints.get(indexPoint - 3).getTime()));
|
|
| 147 |
+ polygonBuilder.add("longlineFishingZone");
|
|
| 148 |
+ SimpleFeature feature = polygonBuilder.buildFeature(null);
|
|
| 149 |
+ polygonsFeatures.add(feature);
|
|
| 150 |
+ |
|
| 151 |
+ }
|
|
| 152 |
+ }
|
|
| 153 |
+ |
|
| 154 |
+ if (!polygonsFeatures.isEmpty()) {
|
|
| 155 |
+ Style styleLines = findStyle(styledLayerDescriptor, TRIP_LONGLINE_OBS_FISHING_ZONE_LAYER_NAME, null);
|
|
| 156 |
+ Layer layerLines = new FeatureLayer(polygonsFeatures, styleLines, TRIP_LONGLINE_OBS_FISHING_ZONE_LAYER_NAME);
|
|
| 157 |
+ mapContent.addLayer(layerLines);
|
|
| 158 |
+ }
|
|
| 159 |
+ }
|
|
| 160 |
+ |
|
| 161 |
+ private void addLonglineLogbookFishingZone(List<TripMapPoint> tripMapPoints) throws FactoryException {
|
|
| 162 |
+ GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
|
|
| 163 |
+ |
|
| 164 |
+ SimpleFeatureTypeBuilder polygonFeatureTypeBuilder = new SimpleFeatureTypeBuilder();
|
|
| 165 |
+ polygonFeatureTypeBuilder.setName("longlineFishingZoneBuilder");
|
|
| 166 |
+ polygonFeatureTypeBuilder.setCRS(CRS.decode("EPSG:4326", true));
|
|
| 167 |
+ polygonFeatureTypeBuilder.add("zone", Polygon.class);
|
|
| 168 |
+ polygonFeatureTypeBuilder.add("label", String.class);
|
|
| 169 |
+ polygonFeatureTypeBuilder.add("type", String.class);
|
|
| 170 |
+ |
|
| 171 |
+ SimpleFeatureType polygonFeatureType = polygonFeatureTypeBuilder.buildFeatureType();
|
|
| 172 |
+ SimpleFeatureBuilder polygonBuilder = new SimpleFeatureBuilder(polygonFeatureType);
|
|
| 173 |
+ |
|
| 174 |
+ DefaultFeatureCollection polygonsFeatures = new DefaultFeatureCollection();
|
|
| 175 |
+ |
|
| 176 |
+ for (int indexPoint = 3; indexPoint < tripMapPoints.size(); indexPoint++) {
|
|
| 177 |
+ if (tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.llActivityLogbookWithHaulingEnd)
|
|
| 178 |
+ && tripMapPoints.get(indexPoint - 1).getType().equals(TripMapPointType.llActivityLogbookWithHaulingStart)
|
|
| 179 |
+ && tripMapPoints.get(indexPoint - 2).getType().equals(TripMapPointType.llActivityLogbookWithSettingEnd)
|
|
| 180 |
+ && tripMapPoints.get(indexPoint - 3).getType().equals(TripMapPointType.llActivityLogbookWithSettingStart)) {
|
|
| 181 |
+ |
|
| 182 |
+ Coordinate[] coordinates = {
|
|
| 183 |
+ new Coordinate(tripMapPoints.get(indexPoint - 3).getLongitude(), tripMapPoints.get(indexPoint - 3).getLatitude()),
|
|
| 184 |
+ new Coordinate(tripMapPoints.get(indexPoint - 2).getLongitude(), tripMapPoints.get(indexPoint - 2).getLatitude()),
|
|
| 185 |
+ new Coordinate(tripMapPoints.get(indexPoint - 1).getLongitude(), tripMapPoints.get(indexPoint - 1).getLatitude()),
|
|
| 186 |
+ new Coordinate(tripMapPoints.get(indexPoint).getLongitude(), tripMapPoints.get(indexPoint).getLatitude()),
|
|
| 187 |
+ new Coordinate(tripMapPoints.get(indexPoint - 3).getLongitude(), tripMapPoints.get(indexPoint - 3).getLatitude())
|
|
| 188 |
+ };
|
|
| 189 |
+ |
|
| 190 |
+ |
|
| 191 |
+ Polygon polygon = geometryFactory.createPolygon(coordinates);
|
|
| 192 |
+ //polygon = (Polygon) polygon.convexHull(); // permet de transformer un poliqgone croisé en polygon convex
|
|
| 193 |
+ polygonBuilder.add(polygon);
|
|
| 194 |
+ polygonBuilder.add(DATE_FORMAT.format(tripMapPoints.get(indexPoint - 3).getTime()));
|
|
| 195 |
+ polygonBuilder.add("longlineFishingZone");
|
|
| 196 |
+ SimpleFeature feature = polygonBuilder.buildFeature(null);
|
|
| 197 |
+ polygonsFeatures.add(feature);
|
|
| 198 |
+ |
|
| 199 |
+ }
|
|
| 200 |
+ }
|
|
| 201 |
+ |
|
| 202 |
+ if (!polygonsFeatures.isEmpty()) {
|
|
| 203 |
+ Style styleLines = findStyle(styledLayerDescriptor, TRIP_LONGLINE_LOGBOOK_FISHING_ZONE_LAYER_NAME, null);
|
|
| 204 |
+ Layer layerLines = new FeatureLayer(polygonsFeatures, styleLines, TRIP_LONGLINE_LOGBOOK_FISHING_ZONE_LAYER_NAME);
|
|
| 205 |
+ mapContent.addLayer(layerLines);
|
|
| 206 |
+ }
|
|
| 207 |
+ }
|
|
| 208 |
+ |
|
| 209 |
+ private void addLonglineObsLine(List<TripMapPoint> tripMapPoints) throws FactoryException {
|
|
| 210 |
+ GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
|
|
| 211 |
+ |
|
| 212 |
+ SimpleFeatureTypeBuilder lineFeatureTypeBuilder = new SimpleFeatureTypeBuilder();
|
|
| 213 |
+ lineFeatureTypeBuilder.setName("longlineSettingBuilder");
|
|
| 214 |
+ lineFeatureTypeBuilder.setCRS(CRS.decode("EPSG:4326", true));
|
|
| 215 |
+ lineFeatureTypeBuilder.add("line", LineString.class);
|
|
| 216 |
+ lineFeatureTypeBuilder.add("type", String.class);
|
|
| 217 |
+ |
|
| 218 |
+ SimpleFeatureType lineFeatureType = lineFeatureTypeBuilder.buildFeatureType();
|
|
| 219 |
+ SimpleFeatureBuilder lineBuilder = new SimpleFeatureBuilder(lineFeatureType);
|
|
| 220 |
+ |
|
| 221 |
+ DefaultFeatureCollection linesFeatures = new DefaultFeatureCollection();
|
|
| 222 |
+ |
|
| 223 |
+ List<Coordinate> defaultLineCoordinates = Lists.newLinkedList();
|
|
| 224 |
+ boolean found = false;
|
|
| 225 |
+ for (int indexPoint = 0; indexPoint < tripMapPoints.size(); indexPoint++) {
|
|
| 226 |
+ if (indexPoint > 1 && tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.llActivityObsWithSettingEnd)
|
|
| 227 |
+ && tripMapPoints.get(indexPoint - 1).getType().equals(TripMapPointType.llActivityObsWithSettingStart)
|
|
| 228 |
+ || tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.llActivityObsWithHaulingEnd)
|
|
| 229 |
+ && tripMapPoints.get(indexPoint - 1).getType().equals(TripMapPointType.llActivityObsWithHaulingStart)) {
|
|
| 230 |
+ |
|
| 231 |
+ found = true;
|
|
| 232 |
+ Coordinate[] coordinates = {
|
|
| 233 |
+ new Coordinate(tripMapPoints.get(indexPoint - 1).getLongitude(), tripMapPoints.get(indexPoint - 1).getLatitude()),
|
|
| 234 |
+ new Coordinate(tripMapPoints.get(indexPoint).getLongitude(), tripMapPoints.get(indexPoint).getLatitude()),
|
|
| 235 |
+ };
|
|
| 236 |
+ |
|
| 237 |
+ boolean setting = tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.llActivityObsWithSettingEnd);
|
|
| 238 |
+ LineString lineString = geometryFactory.createLineString(coordinates);
|
|
| 239 |
+ lineBuilder.add(lineString);
|
|
| 240 |
+ lineBuilder.add(setting ? "setting" : "hauling");
|
|
| 241 |
+ SimpleFeature feature = lineBuilder.buildFeature(null);
|
|
| 242 |
+ linesFeatures.add(feature);
|
|
| 243 |
+ |
|
| 244 |
+ defaultLineCoordinates.clear();
|
|
| 245 |
+ }
|
|
| 246 |
+ |
|
| 247 |
+ if (!(tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.llActivityObsWithSettingEnd)
|
|
| 248 |
+ || tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.llActivityObsWithHaulingStart))) {
|
|
| 249 |
+ |
|
| 250 |
+ defaultLineCoordinates.add(new Coordinate(tripMapPoints.get(indexPoint).getLongitude(), tripMapPoints.get(indexPoint).getLatitude()));
|
|
| 251 |
+ |
|
| 252 |
+ }
|
|
| 253 |
+ |
|
| 254 |
+ if ((tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.llActivityObsWithSettingStart)
|
|
| 255 |
+ || indexPoint == tripMapPoints.size() - 1) && defaultLineCoordinates.size() > 1) {
|
|
| 256 |
+ |
|
| 257 |
+ LineString lineString = geometryFactory.createLineString(defaultLineCoordinates.toArray(new Coordinate[0]));
|
|
| 258 |
+ lineBuilder.add(lineString);
|
|
| 259 |
+ lineBuilder.add("trip");
|
|
| 260 |
+ SimpleFeature feature = lineBuilder.buildFeature(null);
|
|
| 261 |
+ linesFeatures.add(feature);
|
|
| 262 |
+ |
|
| 263 |
+ defaultLineCoordinates.clear();
|
|
| 264 |
+ |
|
| 265 |
+ }
|
|
| 266 |
+ |
|
| 267 |
+ |
|
| 268 |
+ }
|
|
| 269 |
+ |
|
| 270 |
+ Style styleLines = findStyle(styledLayerDescriptor, TRIP_LONGLINE_OBS_LINE_LAYER_NAME, null);
|
|
| 271 |
+ if (!linesFeatures.isEmpty()) {
|
|
| 272 |
+ Layer layerLines = new FeatureLayer(linesFeatures, styleLines, TRIP_LONGLINE_OBS_LINE_LAYER_NAME);
|
|
| 273 |
+ mapContent.addLayer(layerLines);
|
|
| 274 |
+ }
|
|
| 275 |
+ |
|
| 276 |
+ if (found) {
|
|
| 277 |
+ // add line in legend
|
|
| 278 |
+ LineString line = geometryFactory.createLineString(ObserveMapPaneLegendItem.lineCoordinates());
|
|
| 279 |
+ lineBuilder.add(line);
|
|
| 280 |
+ lineBuilder.add("setting");
|
|
| 281 |
+ |
|
| 282 |
+ ObserveMapPaneLegendItem legendTripDay = new ObserveMapPaneLegendItem(
|
|
| 283 |
+ lineBuilder.buildFeature(null),
|
|
| 284 |
+ styleLines,
|
|
| 285 |
+ t("observe.content.map.legend.obs.setting"));
|
|
| 286 |
+ legendItems.add(legendTripDay);
|
|
| 287 |
+ |
|
| 288 |
+ line = geometryFactory.createLineString(ObserveMapPaneLegendItem.lineCoordinates());
|
|
| 289 |
+ lineBuilder.add(line);
|
|
| 290 |
+ lineBuilder.add("hauling");
|
|
| 291 |
+ |
|
| 292 |
+ legendTripDay = new ObserveMapPaneLegendItem(
|
|
| 293 |
+ lineBuilder.buildFeature(null),
|
|
| 294 |
+ styleLines,
|
|
| 295 |
+ t("observe.content.map.legend.obs.hauling"));
|
|
| 296 |
+ legendItems.add(legendTripDay);
|
|
| 297 |
+ }
|
|
| 298 |
+ |
|
| 299 |
+ }
|
|
| 300 |
+ |
|
| 301 |
+ private void addLonglineLogbookLine(List<TripMapPoint> tripMapPoints) throws FactoryException {
|
|
| 302 |
+ GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
|
|
| 303 |
+ |
|
| 304 |
+ SimpleFeatureTypeBuilder lineFeatureTypeBuilder = new SimpleFeatureTypeBuilder();
|
|
| 305 |
+ lineFeatureTypeBuilder.setName("longlineSettingBuilder");
|
|
| 306 |
+ lineFeatureTypeBuilder.setCRS(CRS.decode("EPSG:4326", true));
|
|
| 307 |
+ lineFeatureTypeBuilder.add("line", LineString.class);
|
|
| 308 |
+ lineFeatureTypeBuilder.add("type", String.class);
|
|
| 309 |
+ |
|
| 310 |
+ SimpleFeatureType lineFeatureType = lineFeatureTypeBuilder.buildFeatureType();
|
|
| 311 |
+ SimpleFeatureBuilder lineBuilder = new SimpleFeatureBuilder(lineFeatureType);
|
|
| 312 |
+ |
|
| 313 |
+ DefaultFeatureCollection linesFeatures = new DefaultFeatureCollection();
|
|
| 314 |
+ |
|
| 315 |
+ List<Coordinate> defaultLineCoordinates = Lists.newLinkedList();
|
|
| 316 |
+ boolean found = false;
|
|
| 317 |
+ for (int indexPoint = 0; indexPoint < tripMapPoints.size(); indexPoint++) {
|
|
| 318 |
+ if (indexPoint > 1 && tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.llActivityLogbookWithSettingEnd)
|
|
| 319 |
+ && tripMapPoints.get(indexPoint - 1).getType().equals(TripMapPointType.llActivityLogbookWithSettingStart)
|
|
| 320 |
+ || tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.llActivityLogbookWithHaulingEnd)
|
|
| 321 |
+ && tripMapPoints.get(indexPoint - 1).getType().equals(TripMapPointType.llActivityLogbookWithHaulingStart)) {
|
|
| 322 |
+ found = true;
|
|
| 323 |
+ Coordinate[] coordinates = {
|
|
| 324 |
+ new Coordinate(tripMapPoints.get(indexPoint - 1).getLongitude(), tripMapPoints.get(indexPoint - 1).getLatitude()),
|
|
| 325 |
+ new Coordinate(tripMapPoints.get(indexPoint).getLongitude(), tripMapPoints.get(indexPoint).getLatitude()),
|
|
| 326 |
+ };
|
|
| 327 |
+ |
|
| 328 |
+ boolean setting = tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.llActivityLogbookWithSettingEnd);
|
|
| 329 |
+ LineString lineString = geometryFactory.createLineString(coordinates);
|
|
| 330 |
+ lineBuilder.add(lineString);
|
|
| 331 |
+ lineBuilder.add(setting ? "setting" : "hauling");
|
|
| 332 |
+ SimpleFeature feature = lineBuilder.buildFeature(null);
|
|
| 333 |
+ linesFeatures.add(feature);
|
|
| 334 |
+ |
|
| 335 |
+ defaultLineCoordinates.clear();
|
|
| 336 |
+ }
|
|
| 337 |
+ |
|
| 338 |
+ if (!(tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.llActivityLogbookWithSettingEnd)
|
|
| 339 |
+ || tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.llActivityLogbookWithHaulingStart))) {
|
|
| 340 |
+ |
|
| 341 |
+ defaultLineCoordinates.add(new Coordinate(tripMapPoints.get(indexPoint).getLongitude(), tripMapPoints.get(indexPoint).getLatitude()));
|
|
| 342 |
+ |
|
| 343 |
+ }
|
|
| 344 |
+ |
|
| 345 |
+ if ((tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.llActivityLogbookWithSettingStart)
|
|
| 346 |
+ || indexPoint == tripMapPoints.size() - 1) && defaultLineCoordinates.size() > 1) {
|
|
| 347 |
+ |
|
| 348 |
+ LineString lineString = geometryFactory.createLineString(defaultLineCoordinates.toArray(new Coordinate[0]));
|
|
| 349 |
+ lineBuilder.add(lineString);
|
|
| 350 |
+ lineBuilder.add("trip");
|
|
| 351 |
+ SimpleFeature feature = lineBuilder.buildFeature(null);
|
|
| 352 |
+ linesFeatures.add(feature);
|
|
| 353 |
+ |
|
| 354 |
+ defaultLineCoordinates.clear();
|
|
| 355 |
+ |
|
| 356 |
+ }
|
|
| 357 |
+ |
|
| 358 |
+ |
|
| 359 |
+ }
|
|
| 360 |
+ if (found) {
|
|
| 361 |
+ Style styleLines = findStyle(styledLayerDescriptor, TRIP_LONGLINE_LOGBOOK_LINE_LAYER_NAME, null);
|
|
| 362 |
+ if (!linesFeatures.isEmpty()) {
|
|
| 363 |
+ Layer layerLines = new FeatureLayer(linesFeatures, styleLines, TRIP_LONGLINE_LOGBOOK_LINE_LAYER_NAME);
|
|
| 364 |
+ mapContent.addLayer(layerLines);
|
|
| 365 |
+ }
|
|
| 366 |
+ |
|
| 367 |
+ // add line in legend
|
|
| 368 |
+ LineString line = geometryFactory.createLineString(ObserveMapPaneLegendItem.lineCoordinates());
|
|
| 369 |
+ lineBuilder.add(line);
|
|
| 370 |
+ lineBuilder.add("setting");
|
|
| 371 |
+ |
|
| 372 |
+ ObserveMapPaneLegendItem legendTripDay = new ObserveMapPaneLegendItem(
|
|
| 373 |
+ lineBuilder.buildFeature(null),
|
|
| 374 |
+ styleLines,
|
|
| 375 |
+ t("observe.content.map.legend.logbook.setting"));
|
|
| 376 |
+ legendItems.add(legendTripDay);
|
|
| 377 |
+ |
|
| 378 |
+ line = geometryFactory.createLineString(ObserveMapPaneLegendItem.lineCoordinates());
|
|
| 379 |
+ lineBuilder.add(line);
|
|
| 380 |
+ lineBuilder.add("hauling");
|
|
| 381 |
+ |
|
| 382 |
+ legendTripDay = new ObserveMapPaneLegendItem(
|
|
| 383 |
+ lineBuilder.buildFeature(null),
|
|
| 384 |
+ styleLines,
|
|
| 385 |
+ t("observe.content.map.legend.logbook.hauling"));
|
|
| 386 |
+ legendItems.add(legendTripDay);
|
|
| 387 |
+ }
|
|
| 388 |
+ }
|
|
| 389 |
+ |
|
| 390 |
+ |
|
| 391 |
+}
|
| 1 |
+package fr.ird.observe.client.ui.content.data.ps.common;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Client core
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2019 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import com.google.auto.service.AutoService;
|
|
| 26 |
+import com.google.common.collect.ImmutableSet;
|
|
| 27 |
+import com.google.common.collect.Lists;
|
|
| 28 |
+import fr.ird.observe.client.configuration.ClientConfig;
|
|
| 29 |
+import fr.ird.observe.client.ui.util.tripMap.ObserveMapPaneLegendItem;
|
|
| 30 |
+import fr.ird.observe.dto.data.TripMapDto;
|
|
| 31 |
+import fr.ird.observe.dto.data.TripMapPoint;
|
|
| 32 |
+import fr.ird.observe.dto.data.TripMapPointType;
|
|
| 33 |
+import fr.ird.observe.spi.DtoModelClasses;
|
|
| 34 |
+import org.apache.commons.lang3.time.DateUtils;
|
|
| 35 |
+import org.geotools.feature.DefaultFeatureCollection;
|
|
| 36 |
+import org.geotools.feature.simple.SimpleFeatureBuilder;
|
|
| 37 |
+import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
|
|
| 38 |
+import org.geotools.geometry.jts.JTSFactoryFinder;
|
|
| 39 |
+import org.geotools.map.FeatureLayer;
|
|
| 40 |
+import org.geotools.map.Layer;
|
|
| 41 |
+import org.geotools.referencing.CRS;
|
|
| 42 |
+import org.geotools.styling.Style;
|
|
| 43 |
+import org.locationtech.jts.geom.Coordinate;
|
|
| 44 |
+import org.locationtech.jts.geom.GeometryFactory;
|
|
| 45 |
+import org.locationtech.jts.geom.LineString;
|
|
| 46 |
+import org.opengis.feature.simple.SimpleFeature;
|
|
| 47 |
+import org.opengis.feature.simple.SimpleFeatureType;
|
|
| 48 |
+import org.opengis.referencing.FactoryException;
|
|
| 49 |
+ |
|
| 50 |
+import java.io.File;
|
|
| 51 |
+import java.text.DateFormat;
|
|
| 52 |
+import java.util.List;
|
|
| 53 |
+ |
|
| 54 |
+import static io.ultreia.java4all.i18n.I18n.t;
|
|
| 55 |
+ |
|
| 56 |
+/**
|
|
| 57 |
+ * Created on 04/07/19.
|
|
| 58 |
+ *
|
|
| 59 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 60 |
+ * @since ?
|
|
| 61 |
+ */
|
|
| 62 |
+@AutoService(fr.ird.observe.client.ui.util.tripMap.TripMapContentBuilder.class)
|
|
| 63 |
+public class TripMapContentBuilder extends fr.ird.observe.client.ui.util.tripMap.TripMapContentBuilder {
|
|
| 64 |
+ |
|
| 65 |
+ private static final String TRIP_LINES_LAYER_NAME = "Trip seine lines";
|
|
| 66 |
+ |
|
| 67 |
+ public TripMapContentBuilder() {
|
|
| 68 |
+ super(ImmutableSet.of(
|
|
| 69 |
+ TripMapPointType.psActivityObs,
|
|
| 70 |
+ TripMapPointType.psActivityObsInHarbour,
|
|
| 71 |
+ TripMapPointType.psActivityObsWithFreeSchoolType,
|
|
| 72 |
+ TripMapPointType.psActivityObsWithObjectSchoolType
|
|
| 73 |
+ ));
|
|
| 74 |
+ }
|
|
| 75 |
+ |
|
| 76 |
+ @Override
|
|
| 77 |
+ public boolean accept(TripMapDto tripMapDto) {
|
|
| 78 |
+ return DtoModelClasses.isSeineId(tripMapDto.getTripId());
|
|
| 79 |
+ }
|
|
| 80 |
+ |
|
| 81 |
+ @Override
|
|
| 82 |
+ protected File getStyleFile(ClientConfig config) {
|
|
| 83 |
+ return config.getMapPsStyleFile();
|
|
| 84 |
+ }
|
|
| 85 |
+ |
|
| 86 |
+ @Override
|
|
| 87 |
+ protected void addPoints(List<TripMapPoint> tripMapPoints) throws FactoryException {
|
|
| 88 |
+ addPoints(tripMapPoints, TRIP_OBS_POINTS_LAYER_NAME);
|
|
| 89 |
+// addPoints(tripMapPoints, TRIP_LOGBOOK_POINTS_LAYER_NAME);
|
|
| 90 |
+ }
|
|
| 91 |
+ |
|
| 92 |
+ @Override
|
|
| 93 |
+ protected void addLines(List<TripMapPoint> tripMapPoints) throws FactoryException {
|
|
| 94 |
+ |
|
| 95 |
+ GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
|
|
| 96 |
+ |
|
| 97 |
+ SimpleFeatureTypeBuilder lineFeatureTypeBuilder = new SimpleFeatureTypeBuilder();
|
|
| 98 |
+ lineFeatureTypeBuilder.setName("lineBuilder");
|
|
| 99 |
+ lineFeatureTypeBuilder.setCRS(CRS.decode("EPSG:4326", true));
|
|
| 100 |
+ lineFeatureTypeBuilder.add("line", LineString.class);
|
|
| 101 |
+ lineFeatureTypeBuilder.add("label", String.class);
|
|
| 102 |
+ lineFeatureTypeBuilder.add("type", String.class);
|
|
| 103 |
+ |
|
| 104 |
+ SimpleFeatureType lineFeatureType = lineFeatureTypeBuilder.buildFeatureType();
|
|
| 105 |
+ SimpleFeatureBuilder lineBuilder = new SimpleFeatureBuilder(lineFeatureType);
|
|
| 106 |
+ |
|
| 107 |
+ DefaultFeatureCollection linesFeatures = new DefaultFeatureCollection();
|
|
| 108 |
+ |
|
| 109 |
+ List<Coordinate> coordinatesByDay = null;
|
|
| 110 |
+ |
|
| 111 |
+ TripMapPoint previousPoint = null;
|
|
| 112 |
+ |
|
| 113 |
+ for (TripMapPoint point : tripMapPoints) {
|
|
| 114 |
+ if (previousPoint == null) {
|
|
| 115 |
+ coordinatesByDay = Lists.newLinkedList();
|
|
| 116 |
+ } else if (!DateUtils.isSameDay(previousPoint.getTime(), point.getTime())) {
|
|
| 117 |
+ |
|
| 118 |
+ if (coordinatesByDay.size() > 1) {
|
|
| 119 |
+ LineString line = geometryFactory.createLineString(coordinatesByDay.toArray(new Coordinate[0]));
|
|
| 120 |
+ lineBuilder.add(line);
|
|
| 121 |
+ lineBuilder.add(DATE_FORMAT.format(previousPoint.getTime()));
|
|
| 122 |
+ lineBuilder.add("tripDay");
|
|
| 123 |
+ SimpleFeature feature = lineBuilder.buildFeature(null);
|
|
| 124 |
+ |
|
| 125 |
+ linesFeatures.add(feature);
|
|
| 126 |
+ }
|
|
| 127 |
+ |
|
| 128 |
+ Coordinate[] coordinates = {
|
|
| 129 |
+ new Coordinate(previousPoint.getLongitude(), previousPoint.getLatitude()),
|
|
| 130 |
+ new Coordinate(point.getLongitude(), point.getLatitude()),
|
|
| 131 |
+ };
|
|
| 132 |
+ LineString lineBetweenTwoDays = geometryFactory.createLineString(coordinates);
|
|
| 133 |
+ lineBuilder.add(lineBetweenTwoDays);
|
|
| 134 |
+ lineBuilder.add(DateFormat.getDateInstance().format(previousPoint.getTime()));
|
|
| 135 |
+ lineBuilder.add("tripBetweenTwoDays");
|
|
| 136 |
+ linesFeatures.add(lineBuilder.buildFeature(null));
|
|
| 137 |
+ |
|
| 138 |
+ coordinatesByDay = Lists.newLinkedList();
|
|
| 139 |
+ }
|
|
| 140 |
+ |
|
| 141 |
+ Coordinate coordinate = new Coordinate(point.getLongitude(), point.getLatitude());
|
|
| 142 |
+ coordinatesByDay.add(coordinate);
|
|
| 143 |
+ |
|
| 144 |
+ previousPoint = point;
|
|
| 145 |
+ }
|
|
| 146 |
+ |
|
| 147 |
+ if (coordinatesByDay != null && coordinatesByDay.size() > 1) {
|
|
| 148 |
+ LineString line = geometryFactory.createLineString(coordinatesByDay.toArray(new Coordinate[0]));
|
|
| 149 |
+ lineBuilder.add(line);
|
|
| 150 |
+ lineBuilder.add(DATE_FORMAT.format(previousPoint.getTime()));
|
|
| 151 |
+ lineBuilder.add("tripDay");
|
|
| 152 |
+ linesFeatures.add(lineBuilder.buildFeature(null));
|
|
| 153 |
+ }
|
|
| 154 |
+ |
|
| 155 |
+ Style styleLines = findStyle(styledLayerDescriptor, TRIP_LINES_LAYER_NAME, null);
|
|
| 156 |
+ |
|
| 157 |
+ if (!linesFeatures.isEmpty()) {
|
|
| 158 |
+ Layer layerLines = new FeatureLayer(linesFeatures, styleLines, TRIP_LINES_LAYER_NAME);
|
|
| 159 |
+ mapContent.addLayer(layerLines);
|
|
| 160 |
+ }
|
|
| 161 |
+ |
|
| 162 |
+ |
|
| 163 |
+ // add line in legend
|
|
| 164 |
+ LineString line = geometryFactory.createLineString(ObserveMapPaneLegendItem.lineCoordinates());
|
|
| 165 |
+ lineBuilder.add(line);
|
|
| 166 |
+ lineBuilder.add("");
|
|
| 167 |
+ lineBuilder.add("tripDay");
|
|
| 168 |
+ |
|
| 169 |
+ ObserveMapPaneLegendItem legendTripDay = new ObserveMapPaneLegendItem(
|
|
| 170 |
+ lineBuilder.buildFeature(null),
|
|
| 171 |
+ styleLines,
|
|
| 172 |
+ t("observe.content.map.legend.tripDay"));
|
|
| 173 |
+ legendItems.add(legendTripDay);
|
|
| 174 |
+ |
|
| 175 |
+ lineBuilder.add(line);
|
|
| 176 |
+ lineBuilder.add("");
|
|
| 177 |
+ lineBuilder.add("tripBetweenTwoDays");
|
|
| 178 |
+ ObserveMapPaneLegendItem legendTripBetweenTwoDays = new ObserveMapPaneLegendItem(
|
|
| 179 |
+ lineBuilder.buildFeature(null),
|
|
| 180 |
+ styleLines,
|
|
| 181 |
+ t("observe.content.map.legend.tripBetweenTwoDays"));
|
|
| 182 |
+ legendItems.add(legendTripBetweenTwoDays);
|
|
| 183 |
+ |
|
| 184 |
+ }
|
|
| 185 |
+ |
|
| 186 |
+}
|
| ... | ... | @@ -79,8 +79,7 @@ |
| 79 | 79 |
|
| 80 | 80 |
<!-- formulaire -->
|
| 81 | 81 |
<JPanel id="body" layout='{new BorderLayout()}'>
|
| 82 |
- <JScrollPane id='bodyScrollPane' constraints='BorderLayout.CENTER'>
|
|
| 83 |
- <JTabbedPane id='mainTabbedPane'>
|
|
| 82 |
+ <JTabbedPane id='mainTabbedPane' constraints='BorderLayout.CENTER'>
|
|
| 84 | 83 |
<tab id='generalTab' i18nProperty="">
|
| 85 | 84 |
<Table insets="0" fill="both" id="formGeneral">
|
| 86 | 85 |
|
| ... | ... | @@ -227,7 +226,6 @@ |
| 227 | 226 |
<TripMapUI id="tripMap"/>
|
| 228 | 227 |
</tab>
|
| 229 | 228 |
</JTabbedPane>
|
| 230 |
- </JScrollPane>
|
|
| 231 | 229 |
</JPanel>
|
| 232 | 230 |
|
| 233 | 231 |
<!-- surcharge des actions (pour appliquer la css specifique) -->
|
| ... | ... | @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.util.tripMap; |
| 10 | 10 |
* it under the terms of the GNU General Public License as
|
| 11 | 11 |
* published by the Free Software Foundation, either version 3 of the
|
| 12 | 12 |
* License, or (at your option) any later version.
|
| 13 |
- *
|
|
| 13 |
+ *
|
|
| 14 | 14 |
* This program is distributed in the hope that it will be useful,
|
| 15 | 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 16 | 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 17 | 17 |
* GNU General Public License for more details.
|
| 18 |
- *
|
|
| 18 |
+ *
|
|
| 19 | 19 |
* You should have received a copy of the GNU General Public
|
| 20 | 20 |
* License along with this program. If not, see
|
| 21 | 21 |
* <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| ... | ... | @@ -23,14 +23,14 @@ package fr.ird.observe.client.ui.util.tripMap; |
| 23 | 23 |
*/
|
| 24 | 24 |
|
| 25 | 25 |
import com.google.common.collect.ImmutableSet;
|
| 26 |
-import com.google.common.collect.Lists;
|
|
| 27 | 26 |
import com.google.common.collect.Sets;
|
| 28 | 27 |
import fr.ird.observe.client.ObserveSwingTechnicalException;
|
| 28 |
+import fr.ird.observe.client.configuration.ClientConfig;
|
|
| 29 | 29 |
import fr.ird.observe.dto.I18nEnumHelper;
|
| 30 |
+import fr.ird.observe.dto.data.TripMapDto;
|
|
| 30 | 31 |
import fr.ird.observe.dto.data.TripMapPoint;
|
| 31 | 32 |
import fr.ird.observe.dto.data.TripMapPointType;
|
| 32 | 33 |
import org.apache.commons.lang3.StringUtils;
|
| 33 |
-import org.apache.commons.lang3.time.DateUtils;
|
|
| 34 | 34 |
import org.geotools.data.FileDataStore;
|
| 35 | 35 |
import org.geotools.data.FileDataStoreFinder;
|
| 36 | 36 |
import org.geotools.data.simple.SimpleFeatureSource;
|
| ... | ... | @@ -53,463 +53,106 @@ import org.geotools.styling.StyledLayerDescriptor; |
| 53 | 53 |
import org.geotools.styling.UserLayer;
|
| 54 | 54 |
import org.locationtech.jts.geom.Coordinate;
|
| 55 | 55 |
import org.locationtech.jts.geom.GeometryFactory;
|
| 56 |
-import org.locationtech.jts.geom.LineString;
|
|
| 57 | 56 |
import org.locationtech.jts.geom.Point;
|
| 58 |
-import org.locationtech.jts.geom.Polygon;
|
|
| 59 |
-import org.opengis.feature.simple.SimpleFeature;
|
|
| 60 | 57 |
import org.opengis.feature.simple.SimpleFeatureType;
|
| 61 | 58 |
import org.opengis.referencing.FactoryException;
|
| 62 | 59 |
|
| 63 | 60 |
import java.io.File;
|
| 64 | 61 |
import java.io.FileNotFoundException;
|
| 65 | 62 |
import java.io.IOException;
|
| 66 |
-import java.text.DateFormat;
|
|
| 67 | 63 |
import java.text.SimpleDateFormat;
|
| 64 |
+import java.util.ArrayList;
|
|
| 68 | 65 |
import java.util.List;
|
| 69 | 66 |
import java.util.Optional;
|
| 67 |
+import java.util.ServiceLoader;
|
|
| 70 | 68 |
import java.util.Set;
|
| 71 | 69 |
|
| 72 |
-import static io.ultreia.java4all.i18n.I18n.t;
|
|
| 73 |
- |
|
| 74 | 70 |
/**
|
| 75 | 71 |
* @author Tony Chemit - dev@tchemit.fr
|
| 76 | 72 |
*/
|
| 77 |
-public class TripMapContentBuilder {
|
|
| 78 |
- |
|
| 79 |
- public static final String TRIP_LINES_LAYER_NAME = "Trip lines";
|
|
| 80 |
- public static final String TRIP_LONGLINE_OBS_FISHING_ZONE_LAYER_NAME = "Trip longline observation zone";
|
|
| 81 |
- public static final String TRIP_LONGLINE_OBS_LINE_LAYER_NAME = "Trip longline observation line";
|
|
| 82 |
- public static final String TRIP_LONGLINE_LOGBOOK_FISHING_ZONE_LAYER_NAME = "Trip longline logbook zone";
|
|
| 83 |
- public static final String TRIP_LONGLINE_LOGBOOK_LINE_LAYER_NAME = "Trip longline logbook line";
|
|
| 84 |
- public static final String TRIP_POINTS_LAYER_NAME = "Trip points";
|
|
| 85 |
- public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM");
|
|
| 86 |
- protected static final Set<TripMapPointType> TRIP_MAP_POINT_TYPES_IN_LEGEND = ImmutableSet.of(
|
|
| 87 |
- TripMapPointType.seineActivityObsInHarbour,
|
|
| 88 |
- TripMapPointType.seineActivityObsWithFreeSchoolType,
|
|
| 89 |
- TripMapPointType.seineActivityObsWithObjectSchoolType,
|
|
| 90 |
- TripMapPointType.longlineActivityObsInHarbour,
|
|
| 91 |
- TripMapPointType.longlineActivityObsWithSettingStart,
|
|
| 92 |
- TripMapPointType.longlineActivityObsWithSettingEnd,
|
|
| 93 |
- TripMapPointType.longlineActivityObsWithHaulingStart,
|
|
| 94 |
- TripMapPointType.longlineActivityObsWithHaulingEnd,
|
|
| 95 |
- TripMapPointType.longlineActivityObsWithStation,
|
|
| 96 |
- TripMapPointType.longlineActivityObsWithInteraction,
|
|
| 97 |
- TripMapPointType.longlineActivityLogbookInHarbour,
|
|
| 98 |
- TripMapPointType.longlineActivityLogbookWithSettingStart,
|
|
| 99 |
- TripMapPointType.longlineActivityLogbookWithSettingEnd,
|
|
| 100 |
- TripMapPointType.longlineActivityLogbookWithHaulingStart,
|
|
| 101 |
- TripMapPointType.longlineActivityLogbookWithHaulingEnd,
|
|
| 102 |
- TripMapPointType.longlineActivityLogbookWithStation,
|
|
| 103 |
- TripMapPointType.longlineActivityLogbookWithInteraction
|
|
| 104 |
- );
|
|
| 105 |
- protected final MapContent mapContent;
|
|
| 106 |
- protected final List<ObserveMapPaneLegendItem> legendItems;
|
|
| 107 |
- protected StyledLayerDescriptor styledLayerDescriptor;
|
|
| 108 |
- |
|
| 109 |
- public TripMapContentBuilder() {
|
|
| 110 |
- mapContent = new MapContent();
|
|
| 111 |
- legendItems = Lists.newArrayList();
|
|
| 112 |
- }
|
|
| 113 |
- |
|
| 114 |
- public MapContent getMapContent() {
|
|
| 115 |
- return mapContent;
|
|
| 116 |
- }
|
|
| 117 |
- |
|
| 118 |
- public List<ObserveMapPaneLegendItem> getLegendItems() {
|
|
| 119 |
- return legendItems;
|
|
| 120 |
- }
|
|
| 121 |
- |
|
| 122 |
- public void setStyledLayerDescriptor(File styleFile) throws FileNotFoundException {
|
|
| 123 |
- |
|
| 124 |
- StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory(null);
|
|
| 125 |
- |
|
| 126 |
- SLDParser stylereader = new SLDParser(styleFactory, styleFile);
|
|
| 127 |
- |
|
| 128 |
- styledLayerDescriptor = stylereader.parseSLD();
|
|
| 129 |
- }
|
|
| 130 |
- |
|
| 131 |
- public void addLayer(File layerFile) throws IOException {
|
|
| 132 |
- FileDataStore store = FileDataStoreFinder.getDataStore(layerFile);
|
|
| 133 |
- SimpleFeatureSource featureSource = store.getFeatureSource();
|
|
| 134 |
- Style style = SLD.createSimpleStyle(featureSource.getSchema());
|
|
| 135 |
- style = findStyle(styledLayerDescriptor, store.getNames().get(0).getLocalPart(), null, style);
|
|
| 136 |
- Layer layer = new FeatureLayer(featureSource, style, layerFile.getName());
|
|
| 137 |
- mapContent.addLayer(layer);
|
|
| 138 |
- }
|
|
| 139 |
- |
|
| 140 |
- public void addTripLine(List<TripMapPoint> tripMapPoints) throws FactoryException {
|
|
| 141 |
- |
|
| 142 |
- GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
|
|
| 73 |
+public abstract class TripMapContentBuilder {
|
|
| 143 | 74 |
|
| 144 |
- SimpleFeatureTypeBuilder lineFeatureTypeBuilder = new SimpleFeatureTypeBuilder();
|
|
| 145 |
- lineFeatureTypeBuilder.setName("lineBuilder");
|
|
| 146 |
- lineFeatureTypeBuilder.setCRS(CRS.decode("EPSG:4326", true));
|
|
| 147 |
- lineFeatureTypeBuilder.add("line", LineString.class);
|
|
| 148 |
- lineFeatureTypeBuilder.add("label", String.class);
|
|
| 149 |
- lineFeatureTypeBuilder.add("type", String.class);
|
|
| 75 |
+ protected static final String TRIP_OBS_POINTS_LAYER_NAME = "Trip Obs points";
|
|
| 76 |
+ protected static final String TRIP_LOGBOOK_POINTS_LAYER_NAME = "Trip Logbook points";
|
|
| 77 |
+ protected static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM");
|
|
| 150 | 78 |
|
| 151 |
- SimpleFeatureType lineFeatureType = lineFeatureTypeBuilder.buildFeatureType();
|
|
| 152 |
- SimpleFeatureBuilder lineBuilder = new SimpleFeatureBuilder(lineFeatureType);
|
|
| 153 |
- |
|
| 154 |
- DefaultFeatureCollection linesFeatures = new DefaultFeatureCollection();
|
|
| 155 |
- |
|
| 156 |
- List<Coordinate> coordinatesByDay = null;
|
|
| 79 |
+ protected MapContent mapContent;
|
|
| 80 |
+ protected final List<ObserveMapPaneLegendItem> legendItems;
|
|
| 81 |
+ protected final Set<TripMapPointType> acceptedTripPointTypes;
|
|
| 82 |
+ protected StyledLayerDescriptor styledLayerDescriptor;
|
|
| 157 | 83 |
|
| 158 |
- TripMapPoint previousPoint = null;
|
|
| 84 |
+ private static ImmutableSet<TripMapContentBuilder> PROVIDERS;
|
|
| 159 | 85 |
|
| 160 |
- for (TripMapPoint point : tripMapPoints) {
|
|
| 161 |
- if (previousPoint == null) {
|
|
| 162 |
- coordinatesByDay = Lists.newLinkedList();
|
|
| 163 |
- } else if (!DateUtils.isSameDay(previousPoint.getTime(), point.getTime())) {
|
|
| 86 |
+ public abstract boolean accept(TripMapDto tripMapDto);
|
|
| 164 | 87 |
|
| 165 |
- if (coordinatesByDay.size() > 1) {
|
|
| 166 |
- LineString line = geometryFactory.createLineString(coordinatesByDay.toArray(new Coordinate[0]));
|
|
| 167 |
- lineBuilder.add(line);
|
|
| 168 |
- lineBuilder.add(DATE_FORMAT.format(previousPoint.getTime()));
|
|
| 169 |
- lineBuilder.add("tripDay");
|
|
| 170 |
- SimpleFeature feature = lineBuilder.buildFeature(null);
|
|
| 88 |
+ protected abstract void addLines(List<TripMapPoint> tripMapPoints) throws FactoryException;
|
|
| 171 | 89 |
|
| 172 |
- linesFeatures.add(feature);
|
|
| 173 |
- }
|
|
| 90 |
+ protected abstract void addPoints(List<TripMapPoint> tripMapPoints) throws FactoryException;
|
|
| 174 | 91 |
|
| 92 |
+ protected abstract File getStyleFile(ClientConfig config);
|
|
| 175 | 93 |
|
| 176 |
- Coordinate[] coordinates = {
|
|
| 177 |
- new Coordinate(previousPoint.getLongitude(), previousPoint.getLatitude()),
|
|
| 178 |
- new Coordinate(point.getLongitude(), point.getLatitude()),
|
|
| 179 |
- };
|
|
| 180 |
- LineString lineBetweenTwoDays = geometryFactory.createLineString(coordinates);
|
|
| 181 |
- lineBuilder.add(lineBetweenTwoDays);
|
|
| 182 |
- lineBuilder.add(DateFormat.getDateInstance().format(previousPoint.getTime()));
|
|
| 183 |
- lineBuilder.add("tripBetweenTwoDays");
|
|
| 184 |
- linesFeatures.add(lineBuilder.buildFeature(null));
|
|
| 94 |
+ public static ImmutableSet<TripMapContentBuilder> providers() {
|
|
| 95 |
+ if (PROVIDERS == null) {
|
|
| 185 | 96 |
|
| 186 |
- coordinatesByDay = Lists.newLinkedList();
|
|
| 97 |
+ ImmutableSet.Builder<TripMapContentBuilder> modelsBuilder = ImmutableSet.builder();
|
|
| 98 |
+ for (TripMapContentBuilder dtoModel : ServiceLoader.load(TripMapContentBuilder.class)) {
|
|
| 99 |
+ modelsBuilder.add(dtoModel);
|
|
| 187 | 100 |
}
|
| 188 |
- |
|
| 189 |
- Coordinate coordinate = new Coordinate(point.getLongitude(), point.getLatitude());
|
|
| 190 |
- coordinatesByDay.add(coordinate);
|
|
| 191 |
- |
|
| 192 |
- previousPoint = point;
|
|
| 193 |
- }
|
|
| 194 |
- |
|
| 195 |
- if (coordinatesByDay != null && coordinatesByDay.size() > 1) {
|
|
| 196 |
- LineString line = geometryFactory.createLineString(coordinatesByDay.toArray(new Coordinate[0]));
|
|
| 197 |
- lineBuilder.add(line);
|
|
| 198 |
- lineBuilder.add(DATE_FORMAT.format(previousPoint.getTime()));
|
|
| 199 |
- lineBuilder.add("tripDay");
|
|
| 200 |
- linesFeatures.add(lineBuilder.buildFeature(null));
|
|
| 101 |
+ PROVIDERS = modelsBuilder.build();
|
|
| 201 | 102 |
}
|
| 103 |
+ return PROVIDERS;
|
|
| 104 |
+ }
|
|
| 202 | 105 |
|
| 203 |
- Style styleLines = findStyle(styledLayerDescriptor, TRIP_LINES_LAYER_NAME, null);
|
|
| 106 |
+ public static TripMapContentBuilder of(ClientConfig config, TripMapDto tripMapDto, List<TripMapPoint> tripMapPoints) throws IOException, FactoryException {
|
|
| 107 |
+ TripMapContentBuilder builder = providers().stream().filter(t -> t.accept(tripMapDto)).findFirst().orElseThrow(IllegalStateException::new);
|
|
| 108 |
+ builder.reset();
|
|
| 109 |
+ File styleFile = builder.getStyleFile(config);
|
|
| 110 |
+ builder.setStyledLayerDescriptor(styleFile);
|
|
| 204 | 111 |
|
| 205 |
- if (!linesFeatures.isEmpty()) {
|
|
| 206 |
- Layer layerLines = new FeatureLayer(linesFeatures, styleLines, TRIP_LINES_LAYER_NAME);
|
|
| 207 |
- mapContent.addLayer(layerLines);
|
|
| 112 |
+ for (File layerFile : config.getMapLayerFiles()) {
|
|
| 113 |
+ builder.addLayer(layerFile);
|
|
| 208 | 114 |
}
|
| 209 | 115 |
|
| 116 |
+ builder.addLines(tripMapPoints);
|
|
| 117 |
+ builder.addPoints(tripMapPoints);
|
|
| 210 | 118 |
|
| 211 |
- // add line in legend
|
|
| 212 |
- LineString line = geometryFactory.createLineString(ObserveMapPaneLegendItem.lineCoordinates());
|
|
| 213 |
- lineBuilder.add(line);
|
|
| 214 |
- lineBuilder.add("");
|
|
| 215 |
- lineBuilder.add("tripDay");
|
|
| 216 |
- |
|
| 217 |
- ObserveMapPaneLegendItem legendTripDay = new ObserveMapPaneLegendItem(
|
|
| 218 |
- lineBuilder.buildFeature(null),
|
|
| 219 |
- styleLines,
|
|
| 220 |
- t("observe.content.map.legend.tripDay"));
|
|
| 221 |
- legendItems.add(legendTripDay);
|
|
| 222 |
- |
|
| 223 |
- lineBuilder.add(line);
|
|
| 224 |
- lineBuilder.add("");
|
|
| 225 |
- lineBuilder.add("tripBetweenTwoDays");
|
|
| 226 |
- ObserveMapPaneLegendItem legendTripBetweenTwoDays = new ObserveMapPaneLegendItem(
|
|
| 227 |
- lineBuilder.buildFeature(null),
|
|
| 228 |
- styleLines,
|
|
| 229 |
- t("observe.content.map.legend.tripBetweenTwoDays"));
|
|
| 230 |
- legendItems.add(legendTripBetweenTwoDays);
|
|
| 231 |
- |
|
| 119 |
+ return builder;
|
|
| 232 | 120 |
}
|
| 233 | 121 |
|
| 234 |
- public void addLonglineObsFishingZone(List<TripMapPoint> tripMapPoints) throws FactoryException {
|
|
| 235 |
- GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
|
|
| 236 |
- |
|
| 237 |
- SimpleFeatureTypeBuilder polygonFeatureTypeBuilder = new SimpleFeatureTypeBuilder();
|
|
| 238 |
- polygonFeatureTypeBuilder.setName("longlineFishingZoneBuilder");
|
|
| 239 |
- polygonFeatureTypeBuilder.setCRS(CRS.decode("EPSG:4326", true));
|
|
| 240 |
- polygonFeatureTypeBuilder.add("zone", Polygon.class);
|
|
| 241 |
- polygonFeatureTypeBuilder.add("label", String.class);
|
|
| 242 |
- polygonFeatureTypeBuilder.add("type", String.class);
|
|
| 243 |
- |
|
| 244 |
- SimpleFeatureType polygonFeatureType = polygonFeatureTypeBuilder.buildFeatureType();
|
|
| 245 |
- SimpleFeatureBuilder polygonBuilder = new SimpleFeatureBuilder(polygonFeatureType);
|
|
| 246 |
- |
|
| 247 |
- DefaultFeatureCollection polygonsFeatures = new DefaultFeatureCollection();
|
|
| 248 |
- |
|
| 249 |
- for (int indexPoint = 3; indexPoint < tripMapPoints.size(); indexPoint++) {
|
|
| 250 |
- if (tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.longlineActivityObsWithHaulingEnd)
|
|
| 251 |
- && tripMapPoints.get(indexPoint - 1).getType().equals(TripMapPointType.longlineActivityObsWithHaulingStart)
|
|
| 252 |
- && tripMapPoints.get(indexPoint - 2).getType().equals(TripMapPointType.longlineActivityObsWithSettingEnd)
|
|
| 253 |
- && tripMapPoints.get(indexPoint - 3).getType().equals(TripMapPointType.longlineActivityObsWithSettingStart)) {
|
|
| 254 |
- |
|
| 255 |
- Coordinate[] coordinates = {
|
|
| 256 |
- new Coordinate(tripMapPoints.get(indexPoint - 3).getLongitude(), tripMapPoints.get(indexPoint - 3).getLatitude()),
|
|
| 257 |
- new Coordinate(tripMapPoints.get(indexPoint - 2).getLongitude(), tripMapPoints.get(indexPoint - 2).getLatitude()),
|
|
| 258 |
- new Coordinate(tripMapPoints.get(indexPoint - 1).getLongitude(), tripMapPoints.get(indexPoint - 1).getLatitude()),
|
|
| 259 |
- new Coordinate(tripMapPoints.get(indexPoint).getLongitude(), tripMapPoints.get(indexPoint).getLatitude()),
|
|
| 260 |
- new Coordinate(tripMapPoints.get(indexPoint - 3).getLongitude(), tripMapPoints.get(indexPoint - 3).getLatitude())
|
|
| 261 |
- };
|
|
| 262 |
- |
|
| 263 |
- |
|
| 264 |
- Polygon polygon = geometryFactory.createPolygon(coordinates);
|
|
| 265 |
- //polygon = (Polygon) polygon.convexHull(); // permet de transformer un poliqgone croisé en polygon convex
|
|
| 266 |
- polygonBuilder.add(polygon);
|
|
| 267 |
- polygonBuilder.add(DATE_FORMAT.format(tripMapPoints.get(indexPoint - 3).getTime()));
|
|
| 268 |
- polygonBuilder.add("longlineFishingZone");
|
|
| 269 |
- SimpleFeature feature = polygonBuilder.buildFeature(null);
|
|
| 270 |
- polygonsFeatures.add(feature);
|
|
| 271 |
- |
|
| 272 |
- }
|
|
| 273 |
- }
|
|
| 274 |
- |
|
| 275 |
- if (!polygonsFeatures.isEmpty()) {
|
|
| 276 |
- Style styleLines = findStyle(styledLayerDescriptor, TRIP_LONGLINE_OBS_FISHING_ZONE_LAYER_NAME, null);
|
|
| 277 |
- Layer layerLines = new FeatureLayer(polygonsFeatures, styleLines, TRIP_LONGLINE_OBS_FISHING_ZONE_LAYER_NAME);
|
|
| 278 |
- mapContent.addLayer(layerLines);
|
|
| 279 |
- }
|
|
| 122 |
+ private void reset() {
|
|
| 123 |
+ legendItems.clear();
|
|
| 124 |
+ mapContent=new MapContent();
|
|
| 280 | 125 |
}
|
| 281 | 126 |
|
| 282 |
- public void addLonglineLogbookFishingZone(List<TripMapPoint> tripMapPoints) throws FactoryException {
|
|
| 283 |
- GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
|
|
| 284 |
- |
|
| 285 |
- SimpleFeatureTypeBuilder polygonFeatureTypeBuilder = new SimpleFeatureTypeBuilder();
|
|
| 286 |
- polygonFeatureTypeBuilder.setName("longlineFishingZoneBuilder");
|
|
| 287 |
- polygonFeatureTypeBuilder.setCRS(CRS.decode("EPSG:4326", true));
|
|
| 288 |
- polygonFeatureTypeBuilder.add("zone", Polygon.class);
|
|
| 289 |
- polygonFeatureTypeBuilder.add("label", String.class);
|
|
| 290 |
- polygonFeatureTypeBuilder.add("type", String.class);
|
|
| 291 |
- |
|
| 292 |
- SimpleFeatureType polygonFeatureType = polygonFeatureTypeBuilder.buildFeatureType();
|
|
| 293 |
- SimpleFeatureBuilder polygonBuilder = new SimpleFeatureBuilder(polygonFeatureType);
|
|
| 294 |
- |
|
| 295 |
- DefaultFeatureCollection polygonsFeatures = new DefaultFeatureCollection();
|
|
| 296 |
- |
|
| 297 |
- for (int indexPoint = 3; indexPoint < tripMapPoints.size(); indexPoint++) {
|
|
| 298 |
- if (tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.longlineActivityLogbookWithHaulingEnd)
|
|
| 299 |
- && tripMapPoints.get(indexPoint - 1).getType().equals(TripMapPointType.longlineActivityLogbookWithHaulingStart)
|
|
| 300 |
- && tripMapPoints.get(indexPoint - 2).getType().equals(TripMapPointType.longlineActivityLogbookWithSettingEnd)
|
|
| 301 |
- && tripMapPoints.get(indexPoint - 3).getType().equals(TripMapPointType.longlineActivityLogbookWithSettingStart)) {
|
|
| 302 |
- |
|
| 303 |
- Coordinate[] coordinates = {
|
|
| 304 |
- new Coordinate(tripMapPoints.get(indexPoint - 3).getLongitude(), tripMapPoints.get(indexPoint - 3).getLatitude()),
|
|
| 305 |
- new Coordinate(tripMapPoints.get(indexPoint - 2).getLongitude(), tripMapPoints.get(indexPoint - 2).getLatitude()),
|
|
| 306 |
- new Coordinate(tripMapPoints.get(indexPoint - 1).getLongitude(), tripMapPoints.get(indexPoint - 1).getLatitude()),
|
|
| 307 |
- new Coordinate(tripMapPoints.get(indexPoint).getLongitude(), tripMapPoints.get(indexPoint).getLatitude()),
|
|
| 308 |
- new Coordinate(tripMapPoints.get(indexPoint - 3).getLongitude(), tripMapPoints.get(indexPoint - 3).getLatitude())
|
|
| 309 |
- };
|
|
| 310 |
- |
|
| 311 |
- |
|
| 312 |
- Polygon polygon = geometryFactory.createPolygon(coordinates);
|
|
| 313 |
- //polygon = (Polygon) polygon.convexHull(); // permet de transformer un poliqgone croisé en polygon convex
|
|
| 314 |
- polygonBuilder.add(polygon);
|
|
| 315 |
- polygonBuilder.add(DATE_FORMAT.format(tripMapPoints.get(indexPoint - 3).getTime()));
|
|
| 316 |
- polygonBuilder.add("longlineFishingZone");
|
|
| 317 |
- SimpleFeature feature = polygonBuilder.buildFeature(null);
|
|
| 318 |
- polygonsFeatures.add(feature);
|
|
| 319 |
- |
|
| 320 |
- }
|
|
| 321 |
- }
|
|
| 322 |
- |
|
| 323 |
- if (!polygonsFeatures.isEmpty()) {
|
|
| 324 |
- Style styleLines = findStyle(styledLayerDescriptor, TRIP_LONGLINE_LOGBOOK_FISHING_ZONE_LAYER_NAME, null);
|
|
| 325 |
- Layer layerLines = new FeatureLayer(polygonsFeatures, styleLines, TRIP_LONGLINE_LOGBOOK_FISHING_ZONE_LAYER_NAME);
|
|
| 326 |
- mapContent.addLayer(layerLines);
|
|
| 327 |
- }
|
|
| 127 |
+ protected TripMapContentBuilder(Set<TripMapPointType> acceptedTripPointTypes) {
|
|
| 128 |
+ this.legendItems = new ArrayList<>();
|
|
| 129 |
+ this.acceptedTripPointTypes = acceptedTripPointTypes;
|
|
| 328 | 130 |
}
|
| 329 | 131 |
|
| 330 |
- public void addLonglineObsLine(List<TripMapPoint> tripMapPoints) throws FactoryException {
|
|
| 331 |
- GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
|
|
| 332 |
- |
|
| 333 |
- SimpleFeatureTypeBuilder lineFeatureTypeBuilder = new SimpleFeatureTypeBuilder();
|
|
| 334 |
- lineFeatureTypeBuilder.setName("longlineSettingBuilder");
|
|
| 335 |
- lineFeatureTypeBuilder.setCRS(CRS.decode("EPSG:4326", true));
|
|
| 336 |
- lineFeatureTypeBuilder.add("line", LineString.class);
|
|
| 337 |
- lineFeatureTypeBuilder.add("type", String.class);
|
|
| 338 |
- |
|
| 339 |
- SimpleFeatureType lineFeatureType = lineFeatureTypeBuilder.buildFeatureType();
|
|
| 340 |
- SimpleFeatureBuilder lineBuilder = new SimpleFeatureBuilder(lineFeatureType);
|
|
| 341 |
- |
|
| 342 |
- DefaultFeatureCollection linesFeatures = new DefaultFeatureCollection();
|
|
| 343 |
- |
|
| 344 |
- List<Coordinate> defaultLineCoordinates = Lists.newLinkedList();
|
|
| 345 |
- boolean found = false;
|
|
| 346 |
- for (int indexPoint = 0; indexPoint < tripMapPoints.size(); indexPoint++) {
|
|
| 347 |
- if (indexPoint > 1 && tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.longlineActivityObsWithSettingEnd)
|
|
| 348 |
- && tripMapPoints.get(indexPoint - 1).getType().equals(TripMapPointType.longlineActivityObsWithSettingStart)
|
|
| 349 |
- || tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.longlineActivityObsWithHaulingEnd)
|
|
| 350 |
- && tripMapPoints.get(indexPoint - 1).getType().equals(TripMapPointType.longlineActivityObsWithHaulingStart)) {
|
|
| 351 |
- |
|
| 352 |
- found = true;
|
|
| 353 |
- Coordinate[] coordinates = {
|
|
| 354 |
- new Coordinate(tripMapPoints.get(indexPoint - 1).getLongitude(), tripMapPoints.get(indexPoint - 1).getLatitude()),
|
|
| 355 |
- new Coordinate(tripMapPoints.get(indexPoint).getLongitude(), tripMapPoints.get(indexPoint).getLatitude()),
|
|
| 356 |
- };
|
|
| 357 |
- |
|
| 358 |
- boolean setting = tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.longlineActivityObsWithSettingEnd);
|
|
| 359 |
- LineString lineString = geometryFactory.createLineString(coordinates);
|
|
| 360 |
- lineBuilder.add(lineString);
|
|
| 361 |
- lineBuilder.add(setting ? "setting" : "hauling");
|
|
| 362 |
- SimpleFeature feature = lineBuilder.buildFeature(null);
|
|
| 363 |
- linesFeatures.add(feature);
|
|
| 364 |
- |
|
| 365 |
- defaultLineCoordinates.clear();
|
|
| 366 |
- }
|
|
| 367 |
- |
|
| 368 |
- if (!(tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.longlineActivityObsWithSettingEnd)
|
|
| 369 |
- || tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.longlineActivityObsWithHaulingStart))) {
|
|
| 370 |
- |
|
| 371 |
- defaultLineCoordinates.add(new Coordinate(tripMapPoints.get(indexPoint).getLongitude(), tripMapPoints.get(indexPoint).getLatitude()));
|
|
| 372 |
- |
|
| 373 |
- }
|
|
| 374 |
- |
|
| 375 |
- if ((tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.longlineActivityObsWithSettingStart)
|
|
| 376 |
- || indexPoint == tripMapPoints.size() - 1) && defaultLineCoordinates.size() > 1) {
|
|
| 377 |
- |
|
| 378 |
- LineString lineString = geometryFactory.createLineString(defaultLineCoordinates.toArray(new Coordinate[0]));
|
|
| 379 |
- lineBuilder.add(lineString);
|
|
| 380 |
- lineBuilder.add("trip");
|
|
| 381 |
- SimpleFeature feature = lineBuilder.buildFeature(null);
|
|
| 382 |
- linesFeatures.add(feature);
|
|
| 383 |
- |
|
| 384 |
- defaultLineCoordinates.clear();
|
|
| 385 |
- |
|
| 386 |
- }
|
|
| 387 |
- |
|
| 388 |
- |
|
| 389 |
- }
|
|
| 390 |
- |
|
| 391 |
- Style styleLines = findStyle(styledLayerDescriptor, TRIP_LONGLINE_OBS_LINE_LAYER_NAME, null);
|
|
| 392 |
- if (!linesFeatures.isEmpty()) {
|
|
| 393 |
- Layer layerLines = new FeatureLayer(linesFeatures, styleLines, TRIP_LONGLINE_OBS_LINE_LAYER_NAME);
|
|
| 394 |
- mapContent.addLayer(layerLines);
|
|
| 395 |
- }
|
|
| 396 |
- |
|
| 397 |
- if (found) {
|
|
| 398 |
- // add line in legend
|
|
| 399 |
- LineString line = geometryFactory.createLineString(ObserveMapPaneLegendItem.lineCoordinates());
|
|
| 400 |
- lineBuilder.add(line);
|
|
| 401 |
- lineBuilder.add("setting");
|
|
| 402 |
- |
|
| 403 |
- ObserveMapPaneLegendItem legendTripDay = new ObserveMapPaneLegendItem(
|
|
| 404 |
- lineBuilder.buildFeature(null),
|
|
| 405 |
- styleLines,
|
|
| 406 |
- t("observe.content.map.legend.obs.setting"));
|
|
| 407 |
- legendItems.add(legendTripDay);
|
|
| 408 |
- |
|
| 409 |
- line = geometryFactory.createLineString(ObserveMapPaneLegendItem.lineCoordinates());
|
|
| 410 |
- lineBuilder.add(line);
|
|
| 411 |
- lineBuilder.add("hauling");
|
|
| 412 |
- |
|
| 413 |
- legendTripDay = new ObserveMapPaneLegendItem(
|
|
| 414 |
- lineBuilder.buildFeature(null),
|
|
| 415 |
- styleLines,
|
|
| 416 |
- t("observe.content.map.legend.obs.hauling"));
|
|
| 417 |
- legendItems.add(legendTripDay);
|
|
| 418 |
- }
|
|
| 419 |
- |
|
| 132 |
+ public MapContent getMapContent() {
|
|
| 133 |
+ return mapContent;
|
|
| 420 | 134 |
}
|
| 421 | 135 |
|
| 422 |
- public void addLonglineLogbookLine(List<TripMapPoint> tripMapPoints) throws FactoryException {
|
|
| 423 |
- GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
|
|
| 424 |
- |
|
| 425 |
- SimpleFeatureTypeBuilder lineFeatureTypeBuilder = new SimpleFeatureTypeBuilder();
|
|
| 426 |
- lineFeatureTypeBuilder.setName("longlineSettingBuilder");
|
|
| 427 |
- lineFeatureTypeBuilder.setCRS(CRS.decode("EPSG:4326", true));
|
|
| 428 |
- lineFeatureTypeBuilder.add("line", LineString.class);
|
|
| 429 |
- lineFeatureTypeBuilder.add("type", String.class);
|
|
| 430 |
- |
|
| 431 |
- SimpleFeatureType lineFeatureType = lineFeatureTypeBuilder.buildFeatureType();
|
|
| 432 |
- SimpleFeatureBuilder lineBuilder = new SimpleFeatureBuilder(lineFeatureType);
|
|
| 433 |
- |
|
| 434 |
- DefaultFeatureCollection linesFeatures = new DefaultFeatureCollection();
|
|
| 435 |
- |
|
| 436 |
- List<Coordinate> defaultLineCoordinates = Lists.newLinkedList();
|
|
| 437 |
- boolean found = false;
|
|
| 438 |
- for (int indexPoint = 0; indexPoint < tripMapPoints.size(); indexPoint++) {
|
|
| 439 |
- if (indexPoint > 1 && tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.longlineActivityLogbookWithSettingEnd)
|
|
| 440 |
- && tripMapPoints.get(indexPoint - 1).getType().equals(TripMapPointType.longlineActivityLogbookWithSettingStart)
|
|
| 441 |
- || tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.longlineActivityLogbookWithHaulingEnd)
|
|
| 442 |
- && tripMapPoints.get(indexPoint - 1).getType().equals(TripMapPointType.longlineActivityLogbookWithHaulingStart)) {
|
|
| 443 |
- found = true;
|
|
| 444 |
- Coordinate[] coordinates = {
|
|
| 445 |
- new Coordinate(tripMapPoints.get(indexPoint - 1).getLongitude(), tripMapPoints.get(indexPoint - 1).getLatitude()),
|
|
| 446 |
- new Coordinate(tripMapPoints.get(indexPoint).getLongitude(), tripMapPoints.get(indexPoint).getLatitude()),
|
|
| 447 |
- };
|
|
| 448 |
- |
|
| 449 |
- boolean setting = tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.longlineActivityLogbookWithSettingEnd);
|
|
| 450 |
- LineString lineString = geometryFactory.createLineString(coordinates);
|
|
| 451 |
- lineBuilder.add(lineString);
|
|
| 452 |
- lineBuilder.add(setting ? "setting" : "hauling");
|
|
| 453 |
- SimpleFeature feature = lineBuilder.buildFeature(null);
|
|
| 454 |
- linesFeatures.add(feature);
|
|
| 455 |
- |
|
| 456 |
- defaultLineCoordinates.clear();
|
|
| 457 |
- }
|
|
| 458 |
- |
|
| 459 |
- if (!(tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.longlineActivityLogbookWithSettingEnd)
|
|
| 460 |
- || tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.longlineActivityLogbookWithHaulingStart))) {
|
|
| 461 |
- |
|
| 462 |
- defaultLineCoordinates.add(new Coordinate(tripMapPoints.get(indexPoint).getLongitude(), tripMapPoints.get(indexPoint).getLatitude()));
|
|
| 463 |
- |
|
| 464 |
- }
|
|
| 465 |
- |
|
| 466 |
- if ((tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.longlineActivityLogbookWithSettingStart)
|
|
| 467 |
- || indexPoint == tripMapPoints.size() - 1) && defaultLineCoordinates.size() > 1) {
|
|
| 468 |
- |
|
| 469 |
- LineString lineString = geometryFactory.createLineString(defaultLineCoordinates.toArray(new Coordinate[0]));
|
|
| 470 |
- lineBuilder.add(lineString);
|
|
| 471 |
- lineBuilder.add("trip");
|
|
| 472 |
- SimpleFeature feature = lineBuilder.buildFeature(null);
|
|
| 473 |
- linesFeatures.add(feature);
|
|
| 474 |
- |
|
| 475 |
- defaultLineCoordinates.clear();
|
|
| 476 |
- |
|
| 477 |
- }
|
|
| 478 |
- |
|
| 479 |
- |
|
| 480 |
- }
|
|
| 481 |
- if (found) {
|
|
| 482 |
- Style styleLines = findStyle(styledLayerDescriptor, TRIP_LONGLINE_LOGBOOK_LINE_LAYER_NAME, null);
|
|
| 483 |
- if (!linesFeatures.isEmpty()) {
|
|
| 484 |
- Layer layerLines = new FeatureLayer(linesFeatures, styleLines, TRIP_LONGLINE_LOGBOOK_LINE_LAYER_NAME);
|
|
| 485 |
- mapContent.addLayer(layerLines);
|
|
| 486 |
- }
|
|
| 136 |
+ public List<ObserveMapPaneLegendItem> getLegendItems() {
|
|
| 137 |
+ return legendItems;
|
|
| 138 |
+ }
|
|
| 487 | 139 |
|
| 488 |
- // add line in legend
|
|
| 489 |
- LineString line = geometryFactory.createLineString(ObserveMapPaneLegendItem.lineCoordinates());
|
|
| 490 |
- lineBuilder.add(line);
|
|
| 491 |
- lineBuilder.add("setting");
|
|
| 492 |
- |
|
| 493 |
- ObserveMapPaneLegendItem legendTripDay = new ObserveMapPaneLegendItem(
|
|
| 494 |
- lineBuilder.buildFeature(null),
|
|
| 495 |
- styleLines,
|
|
| 496 |
- t("observe.content.map.legend.logbook.setting"));
|
|
| 497 |
- legendItems.add(legendTripDay);
|
|
| 498 |
- |
|
| 499 |
- line = geometryFactory.createLineString(ObserveMapPaneLegendItem.lineCoordinates());
|
|
| 500 |
- lineBuilder.add(line);
|
|
| 501 |
- lineBuilder.add("hauling");
|
|
| 502 |
- |
|
| 503 |
- legendTripDay = new ObserveMapPaneLegendItem(
|
|
| 504 |
- lineBuilder.buildFeature(null),
|
|
| 505 |
- styleLines,
|
|
| 506 |
- t("observe.content.map.legend.logbook.hauling"));
|
|
| 507 |
- legendItems.add(legendTripDay);
|
|
| 508 |
- }
|
|
| 140 |
+ public void setStyledLayerDescriptor(File styleFile) throws FileNotFoundException {
|
|
| 141 |
+ StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory(null);
|
|
| 142 |
+ SLDParser styleReader = new SLDParser(styleFactory, styleFile);
|
|
| 143 |
+ styledLayerDescriptor = styleReader.parseSLD();
|
|
| 509 | 144 |
}
|
| 510 | 145 |
|
| 146 |
+ public void addLayer(File layerFile) throws IOException {
|
|
| 147 |
+ FileDataStore store = FileDataStoreFinder.getDataStore(layerFile);
|
|
| 148 |
+ SimpleFeatureSource featureSource = store.getFeatureSource();
|
|
| 149 |
+ Style style = SLD.createSimpleStyle(featureSource.getSchema());
|
|
| 150 |
+ style = findStyle(styledLayerDescriptor, store.getNames().get(0).getLocalPart(), null, style);
|
|
| 151 |
+ Layer layer = new FeatureLayer(featureSource, style, layerFile.getName());
|
|
| 152 |
+ mapContent.addLayer(layer);
|
|
| 153 |
+ }
|
|
| 511 | 154 |
|
| 512 |
- public void addPoints(List<TripMapPoint> tripMapPoints) throws FactoryException {
|
|
| 155 |
+ public void addPoints(List<TripMapPoint> tripMapPoints, String layerName) throws FactoryException {
|
|
| 513 | 156 |
|
| 514 | 157 |
GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
|
| 515 | 158 |
|
| ... | ... | @@ -525,7 +168,7 @@ public class TripMapContentBuilder { |
| 525 | 168 |
|
| 526 | 169 |
DefaultFeatureCollection pointsFeatures = new DefaultFeatureCollection();
|
| 527 | 170 |
|
| 528 |
- Style stylePoints = findStyle(styledLayerDescriptor, TRIP_POINTS_LAYER_NAME, null);
|
|
| 171 |
+ Style stylePoints = findStyle(styledLayerDescriptor, layerName, null);
|
|
| 529 | 172 |
|
| 530 | 173 |
Set<TripMapPointType> pointTypeInLegend = Sets.newHashSet();
|
| 531 | 174 |
|
| ... | ... | @@ -541,7 +184,7 @@ public class TripMapContentBuilder { |
| 541 | 184 |
pointsFeatures.add(pointBuilder.buildFeature(null));
|
| 542 | 185 |
|
| 543 | 186 |
// add point in legend
|
| 544 |
- if (TRIP_MAP_POINT_TYPES_IN_LEGEND.contains(type) && !pointTypeInLegend.contains(type)) {
|
|
| 187 |
+ if (acceptedTripPointTypes.contains(type) && !pointTypeInLegend.contains(type)) {
|
|
| 545 | 188 |
point = geometryFactory.createPoint(ObserveMapPaneLegendItem.pointCoordinates());
|
| 546 | 189 |
pointBuilder.add(point);
|
| 547 | 190 |
pointBuilder.add("");
|
| ... | ... | @@ -558,7 +201,7 @@ public class TripMapContentBuilder { |
| 558 | 201 |
}
|
| 559 | 202 |
|
| 560 | 203 |
if (!pointsFeatures.isEmpty()) {
|
| 561 |
- Layer pointsLayer = new FeatureLayer(pointsFeatures, stylePoints, TRIP_POINTS_LAYER_NAME);
|
|
| 204 |
+ Layer pointsLayer = new FeatureLayer(pointsFeatures, stylePoints, layerName);
|
|
| 562 | 205 |
mapContent.addLayer(pointsLayer);
|
| 563 | 206 |
}
|
| 564 | 207 |
|
| ... | ... | @@ -22,17 +22,16 @@ package fr.ird.observe.client.ui.util.tripMap; |
| 22 | 22 |
* #L%
|
| 23 | 23 |
*/
|
| 24 | 24 |
|
| 25 |
-import com.google.common.collect.Lists;
|
|
| 26 | 25 |
import fr.ird.observe.client.ObserveSwingApplicationContext;
|
| 27 | 26 |
import fr.ird.observe.client.ObserveSwingTechnicalException;
|
| 28 | 27 |
import fr.ird.observe.client.configuration.ClientConfig;
|
| 29 | 28 |
import fr.ird.observe.client.ui.ObserveKeyStrokes;
|
| 29 |
+import fr.ird.observe.client.ui.ObserveMainUIModel;
|
|
| 30 | 30 |
import fr.ird.observe.client.ui.actions.tripMap.TripMapActionSupport;
|
| 31 | 31 |
import fr.ird.observe.client.ui.content.api.spi.ObserveActionMap;
|
| 32 | 32 |
import fr.ird.observe.client.ui.util.BeanCheckBox;
|
| 33 | 33 |
import fr.ird.observe.dto.data.TripMapDto;
|
| 34 | 34 |
import fr.ird.observe.dto.data.TripMapPoint;
|
| 35 |
-import fr.ird.observe.spi.DtoModelClasses;
|
|
| 36 | 35 |
import org.apache.commons.lang3.StringUtils;
|
| 37 | 36 |
import org.apache.logging.log4j.LogManager;
|
| 38 | 37 |
import org.apache.logging.log4j.Logger;
|
| ... | ... | @@ -56,7 +55,7 @@ import java.awt.event.MouseWheelEvent; |
| 56 | 55 |
import java.awt.event.MouseWheelListener;
|
| 57 | 56 |
import java.awt.geom.AffineTransform;
|
| 58 | 57 |
import java.awt.geom.Point2D;
|
| 59 |
-import java.io.File;
|
|
| 58 |
+import java.util.ArrayList;
|
|
| 60 | 59 |
import java.util.List;
|
| 61 | 60 |
import java.util.Objects;
|
| 62 | 61 |
|
| ... | ... | @@ -91,9 +90,10 @@ public class TripMapUIHandler implements UIHandler<TripMapUI> { |
| 91 | 90 |
|
| 92 | 91 |
public void doOpenMap(TripMapDto tripMapDto) {
|
| 93 | 92 |
|
| 93 |
+ ObserveMainUIModel model = ObserveSwingApplicationContext.get().getMainUI().getModel();
|
|
| 94 | 94 |
try {
|
| 95 | 95 |
flipContent();
|
| 96 |
- ObserveSwingApplicationContext.get().getMainUI().getModel().setBusy(true);
|
|
| 96 |
+ model.setBusy(true);
|
|
| 97 | 97 |
|
| 98 | 98 |
ObserveMapPane mapPane = getObserveMapPane();
|
| 99 | 99 |
|
| ... | ... | @@ -102,30 +102,9 @@ public class TripMapUIHandler implements UIHandler<TripMapUI> { |
| 102 | 102 |
mapPane.getMapContent().dispose();
|
| 103 | 103 |
}
|
| 104 | 104 |
|
| 105 |
- List<TripMapPoint> tripMapPoints = Lists.newArrayList(tripMapDto.getPoints());
|
|
| 105 |
+ List<TripMapPoint> tripMapPoints = new ArrayList<>(tripMapDto.getPoints());
|
|
| 106 | 106 |
|
| 107 |
- |
|
| 108 |
- TripMapContentBuilder mapContentBuilder = new TripMapContentBuilder();
|
|
| 109 |
- mapContentBuilder.setStyledLayerDescriptor(config.getMapStyleFile());
|
|
| 110 |
- |
|
| 111 |
- for (File layerFile : config.getMapLayerFiles()) {
|
|
| 112 |
- mapContentBuilder.addLayer(layerFile);
|
|
| 113 |
- }
|
|
| 114 |
- |
|
| 115 |
- if (DtoModelClasses.isSeineId(tripMapDto.getTripId())) {
|
|
| 116 |
- |
|
| 117 |
- mapContentBuilder.addTripLine(tripMapPoints);
|
|
| 118 |
- |
|
| 119 |
- } else if (DtoModelClasses.isLonglineId(tripMapDto.getTripId())) {
|
|
| 120 |
- |
|
| 121 |
- mapContentBuilder.addLonglineObsFishingZone(tripMapPoints);
|
|
| 122 |
- mapContentBuilder.addLonglineObsLine(tripMapPoints);
|
|
| 123 |
- mapContentBuilder.addLonglineLogbookFishingZone(tripMapPoints);
|
|
| 124 |
- mapContentBuilder.addLonglineLogbookLine(tripMapPoints);
|
|
| 125 |
- |
|
| 126 |
- }
|
|
| 127 |
- |
|
| 128 |
- mapContentBuilder.addPoints(tripMapPoints);
|
|
| 107 |
+ TripMapContentBuilder mapContentBuilder = TripMapContentBuilder.of(config, tripMapDto, tripMapPoints);
|
|
| 129 | 108 |
|
| 130 | 109 |
// set zoom
|
| 131 | 110 |
tripArea = new ReferencedEnvelope();
|
| ... | ... | @@ -140,7 +119,7 @@ public class TripMapUIHandler implements UIHandler<TripMapUI> { |
| 140 | 119 |
} catch (Exception e) {
|
| 141 | 120 |
throw new ObserveSwingTechnicalException("Unable to load trip map activity points", e);
|
| 142 | 121 |
} finally {
|
| 143 |
- ObserveSwingApplicationContext.get().getMainUI().getModel().setBusy(false);
|
|
| 122 |
+ model.setBusy(false);
|
|
| 144 | 123 |
}
|
| 145 | 124 |
|
| 146 | 125 |
}
|
| ... | ... | @@ -8,12 +8,12 @@ |
| 8 | 8 |
it under the terms of the GNU General Public License as
|
| 9 | 9 |
published by the Free Software Foundation, either version 3 of the
|
| 10 | 10 |
License, or (at your option) any later version.
|
| 11 |
-
|
|
| 11 |
+ |
|
| 12 | 12 |
This program is distributed in the hope that it will be useful,
|
| 13 | 13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 | 14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 | 15 |
GNU General Public License for more details.
|
| 16 |
-
|
|
| 16 |
+ |
|
| 17 | 17 |
You should have received a copy of the GNU General Public
|
| 18 | 18 |
License along with this program. If not, see
|
| 19 | 19 |
<http://www.gnu.org/licenses/gpl-3.0.html>.
|
| ... | ... | @@ -26,66 +26,6 @@ |
| 26 | 26 |
xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd
|
| 27 | 27 |
http://www.opengis.net/ogc http://schemas.opengis.net/filter/1.0.0/filter.xsd">
|
| 28 | 28 |
|
| 29 |
- <NamedLayer>
|
|
| 30 |
- <Name>Trip lines</Name>
|
|
| 31 |
- <UserStyle>
|
|
| 32 |
- <IsDefault>true</IsDefault>
|
|
| 33 |
- <FeatureTypeStyle>
|
|
| 34 |
- <Rule>
|
|
| 35 |
- <Name>Trip day</Name>
|
|
| 36 |
- <ogc:Filter>
|
|
| 37 |
- <ogc:PropertyIsEqualTo>
|
|
| 38 |
- <ogc:PropertyName>type</ogc:PropertyName>
|
|
| 39 |
- <ogc:Literal>tripDay</ogc:Literal>
|
|
| 40 |
- </ogc:PropertyIsEqualTo>
|
|
| 41 |
- </ogc:Filter>
|
|
| 42 |
- <LineSymbolizer>
|
|
| 43 |
- <Stroke>
|
|
| 44 |
- <CssParameter name="stroke">#ff4444</CssParameter>
|
|
| 45 |
- <CssParameter name="stroke-width">2</CssParameter>
|
|
| 46 |
- </Stroke>
|
|
| 47 |
- </LineSymbolizer>
|
|
| 48 |
- <TextSymbolizer>
|
|
| 49 |
- <Label>
|
|
| 50 |
- <ogc:PropertyName>label</ogc:PropertyName>
|
|
| 51 |
- </Label>
|
|
| 52 |
- <LabelPlacement>
|
|
| 53 |
- <LinePlacement>
|
|
| 54 |
- <PerpendicularOffset>10</PerpendicularOffset>
|
|
| 55 |
- </LinePlacement>
|
|
| 56 |
- </LabelPlacement>
|
|
| 57 |
- <Fill>
|
|
| 58 |
- <CssParameter name="fill">#000000</CssParameter>
|
|
| 59 |
- </Fill>
|
|
| 60 |
- <Font>
|
|
| 61 |
- <CssParameter name="font-size">14</CssParameter>
|
|
| 62 |
- <CssParameter name="font-style">normal</CssParameter>
|
|
| 63 |
- <CssParameter name="font-weight">bold</CssParameter>
|
|
| 64 |
- </Font>
|
|
| 65 |
- </TextSymbolizer>
|
|
| 66 |
- </Rule>
|
|
| 67 |
- </FeatureTypeStyle>
|
|
| 68 |
- <FeatureTypeStyle>
|
|
| 69 |
- <Rule>
|
|
| 70 |
- <Name>Trip between two days</Name>
|
|
| 71 |
- <ogc:Filter>
|
|
| 72 |
- <ogc:PropertyIsEqualTo>
|
|
| 73 |
- <ogc:PropertyName>type</ogc:PropertyName>
|
|
| 74 |
- <ogc:Literal>tripBetweenTwoDays</ogc:Literal>
|
|
| 75 |
- </ogc:PropertyIsEqualTo>
|
|
| 76 |
- </ogc:Filter>
|
|
| 77 |
- <LineSymbolizer>
|
|
| 78 |
- <Stroke>
|
|
| 79 |
- <CssParameter name="stroke">#ff4444</CssParameter>
|
|
| 80 |
- <CssParameter name="stroke-width">2</CssParameter>
|
|
| 81 |
- <CssParameter name="stroke-dasharray">6 4</CssParameter>
|
|
| 82 |
- </Stroke>
|
|
| 83 |
- </LineSymbolizer>
|
|
| 84 |
- </Rule>
|
|
| 85 |
- </FeatureTypeStyle>
|
|
| 86 |
- </UserStyle>
|
|
| 87 |
- </NamedLayer>
|
|
| 88 |
- |
|
| 89 | 29 |
<NamedLayer>
|
| 90 | 30 |
<Name>Trip longline observation zone</Name>
|
| 91 | 31 |
<UserStyle>
|
| ... | ... | @@ -134,7 +74,7 @@ |
| 134 | 74 |
<Name>Trip day</Name>
|
| 135 | 75 |
<PolygonSymbolizer>
|
| 136 | 76 |
<Fill>
|
| 137 |
- <CssParameter name="fill">#220080</CssParameter>
|
|
| 77 |
+ <CssParameter name="fill">#6262BF</CssParameter>
|
|
| 138 | 78 |
<CssParameter name="fill-opacity">0.5</CssParameter>
|
| 139 | 79 |
</Fill>
|
| 140 | 80 |
</PolygonSymbolizer>
|
| ... | ... | @@ -179,7 +119,7 @@ |
| 179 | 119 |
</ogc:Filter>
|
| 180 | 120 |
<LineSymbolizer>
|
| 181 | 121 |
<Stroke>
|
| 182 |
- <CssParameter name="stroke">#222222</CssParameter>
|
|
| 122 |
+ <CssParameter name="stroke">#00FF00</CssParameter>
|
|
| 183 | 123 |
<CssParameter name="stroke-width">1</CssParameter>
|
| 184 | 124 |
<CssParameter name="stroke-dasharray">5 7</CssParameter>
|
| 185 | 125 |
</Stroke>
|
| ... | ... | @@ -197,7 +137,7 @@ |
| 197 | 137 |
</ogc:Filter>
|
| 198 | 138 |
<LineSymbolizer>
|
| 199 | 139 |
<Stroke>
|
| 200 |
- <CssParameter name="stroke">#00ff00</CssParameter>
|
|
| 140 |
+ <CssParameter name="stroke">#00FF00</CssParameter>
|
|
| 201 | 141 |
<CssParameter name="stroke-width">2</CssParameter>
|
| 202 | 142 |
</Stroke>
|
| 203 | 143 |
</LineSymbolizer>
|
| ... | ... | @@ -214,7 +154,7 @@ |
| 214 | 154 |
</ogc:Filter>
|
| 215 | 155 |
<LineSymbolizer>
|
| 216 | 156 |
<Stroke>
|
| 217 |
- <CssParameter name="stroke">#ff0000</CssParameter>
|
|
| 157 |
+ <CssParameter name="stroke">#FFFF00</CssParameter>
|
|
| 218 | 158 |
<CssParameter name="stroke-width">2</CssParameter>
|
| 219 | 159 |
</Stroke>
|
| 220 | 160 |
</LineSymbolizer>
|
| ... | ... | @@ -256,7 +196,7 @@ |
| 256 | 196 |
</ogc:Filter>
|
| 257 | 197 |
<LineSymbolizer>
|
| 258 | 198 |
<Stroke>
|
| 259 |
- <CssParameter name="stroke">#00ff00</CssParameter>
|
|
| 199 |
+ <CssParameter name="stroke">#FF0000</CssParameter>
|
|
| 260 | 200 |
<CssParameter name="stroke-width">4</CssParameter>
|
| 261 | 201 |
</Stroke>
|
| 262 | 202 |
</LineSymbolizer>
|
| ... | ... | @@ -273,7 +213,7 @@ |
| 273 | 213 |
</ogc:Filter>
|
| 274 | 214 |
<LineSymbolizer>
|
| 275 | 215 |
<Stroke>
|
| 276 |
- <CssParameter name="stroke">#ff0000</CssParameter>
|
|
| 216 |
+ <CssParameter name="stroke">#00FFFF</CssParameter>
|
|
| 277 | 217 |
<CssParameter name="stroke-width">4</CssParameter>
|
| 278 | 218 |
</Stroke>
|
| 279 | 219 |
</LineSymbolizer>
|
| ... | ... | @@ -284,86 +224,32 @@ |
| 284 | 224 |
|
| 285 | 225 |
|
| 286 | 226 |
<NamedLayer>
|
| 287 |
- <Name>Trip points</Name>
|
|
| 227 |
+ <Name>Trip Obs points</Name>
|
|
| 288 | 228 |
<UserStyle>
|
| 289 | 229 |
<IsDefault>true</IsDefault>
|
| 290 |
- <FeatureTypeStyle>
|
|
| 291 |
- <Rule>
|
|
| 292 |
- <Name>Point seine activity Obs in harbour</Name>
|
|
| 293 |
- <ogc:Filter>
|
|
| 294 |
- <ogc:PropertyIsEqualTo>
|
|
| 295 |
- <ogc:PropertyName>pointType</ogc:PropertyName>
|
|
| 296 |
- <ogc:Literal>seineActivityObsInHarbour</ogc:Literal>
|
|
| 297 |
- </ogc:PropertyIsEqualTo>
|
|
| 298 |
- </ogc:Filter>
|
|
| 299 |
- <PointSymbolizer>
|
|
| 300 |
- <Graphic>
|
|
| 301 |
- <Mark>
|
|
| 302 |
- <WellKnownName>Circle</WellKnownName>
|
|
| 303 |
- <Fill>
|
|
| 304 |
- <CssParameter name="fill">#7800f6</CssParameter>
|
|
| 305 |
- </Fill>
|
|
| 306 |
- <Stroke>
|
|
| 307 |
- <CssParameter name="stroke">#000000</CssParameter>
|
|
| 308 |
- <CssParameter name="stroke-width">1</CssParameter>
|
|
| 309 |
- </Stroke>
|
|
| 310 |
- </Mark>
|
|
| 311 |
- <Size>12</Size>
|
|
| 312 |
- </Graphic>
|
|
| 313 |
- </PointSymbolizer>
|
|
| 314 |
- </Rule>
|
|
| 315 |
- </FeatureTypeStyle>
|
|
| 316 |
- |
|
| 317 | 230 |
|
| 318 | 231 |
<FeatureTypeStyle>
|
| 319 | 232 |
<Rule>
|
| 320 |
- <Name>Point seine activity Obs with free school type</Name>
|
|
| 233 |
+ <Name>Point longline activity Obs (Other)</Name>
|
|
| 321 | 234 |
<ogc:Filter>
|
| 322 | 235 |
<ogc:PropertyIsEqualTo>
|
| 323 | 236 |
<ogc:PropertyName>pointType</ogc:PropertyName>
|
| 324 |
- <ogc:Literal>seineActivityObsWithFreeSchoolType</ogc:Literal>
|
|
| 237 |
+ <ogc:Literal>llActivityObs</ogc:Literal>
|
|
| 325 | 238 |
</ogc:PropertyIsEqualTo>
|
| 326 | 239 |
</ogc:Filter>
|
| 327 | 240 |
<PointSymbolizer>
|
| 328 | 241 |
<Graphic>
|
| 329 | 242 |
<Mark>
|
| 330 |
- <WellKnownName>Triangle</WellKnownName>
|
|
| 243 |
+ <WellKnownName>ttf://Serif#U+00B7</WellKnownName>
|
|
| 331 | 244 |
<Fill>
|
| 332 |
- <CssParameter name="fill">#7800f6</CssParameter>
|
|
| 333 |
- </Fill>
|
|
| 334 |
- <Stroke>
|
|
| 335 |
- <CssParameter name="stroke">#000000</CssParameter>
|
|
| 336 |
- <CssParameter name="stroke-width">1</CssParameter>
|
|
| 337 |
- </Stroke>
|
|
| 338 |
- </Mark>
|
|
| 339 |
- <Size>16</Size>
|
|
| 340 |
- </Graphic>
|
|
| 341 |
- </PointSymbolizer>
|
|
| 342 |
- </Rule>
|
|
| 343 |
- </FeatureTypeStyle>
|
|
| 344 |
- |
|
| 345 |
- <FeatureTypeStyle>
|
|
| 346 |
- <Rule>
|
|
| 347 |
- <Name>Point seine activity Obs with object school type</Name>
|
|
| 348 |
- <ogc:Filter>
|
|
| 349 |
- <ogc:PropertyIsEqualTo>
|
|
| 350 |
- <ogc:PropertyName>pointType</ogc:PropertyName>
|
|
| 351 |
- <ogc:Literal>seineActivityObsWithObjectSchoolType</ogc:Literal>
|
|
| 352 |
- </ogc:PropertyIsEqualTo>
|
|
| 353 |
- </ogc:Filter>
|
|
| 354 |
- <PointSymbolizer>
|
|
| 355 |
- <Graphic>
|
|
| 356 |
- <Mark>
|
|
| 357 |
- <WellKnownName>X</WellKnownName>
|
|
| 358 |
- <Fill>
|
|
| 359 |
- <CssParameter name="fill">#7800f6</CssParameter>
|
|
| 245 |
+ <CssParameter name="fill">#00FF00</CssParameter>
|
|
| 360 | 246 |
</Fill>
|
| 361 | 247 |
<Stroke>
|
| 362 | 248 |
<CssParameter name="stroke">#000000</CssParameter>
|
| 363 | 249 |
<CssParameter name="stroke-width">1</CssParameter>
|
| 364 | 250 |
</Stroke>
|
| 365 | 251 |
</Mark>
|
| 366 |
- <Size>16</Size>
|
|
| 252 |
+ <Size>8</Size>
|
|
| 367 | 253 |
</Graphic>
|
| 368 | 254 |
</PointSymbolizer>
|
| 369 | 255 |
</Rule>
|
| ... | ... | @@ -375,7 +261,7 @@ |
| 375 | 261 |
<ogc:Filter>
|
| 376 | 262 |
<ogc:PropertyIsEqualTo>
|
| 377 | 263 |
<ogc:PropertyName>pointType</ogc:PropertyName>
|
| 378 |
- <ogc:Literal>longlineActivityObsWithSettingStart</ogc:Literal>
|
|
| 264 |
+ <ogc:Literal>llActivityObsWithSettingStart</ogc:Literal>
|
|
| 379 | 265 |
</ogc:PropertyIsEqualTo>
|
| 380 | 266 |
</ogc:Filter>
|
| 381 | 267 |
<PointSymbolizer>
|
| ... | ... | @@ -395,15 +281,13 @@ |
| 395 | 281 |
</PointSymbolizer>
|
| 396 | 282 |
</Rule>
|
| 397 | 283 |
</FeatureTypeStyle>
|
| 398 |
- |
|
| 399 |
- |
|
| 400 | 284 |
<FeatureTypeStyle>
|
| 401 | 285 |
<Rule>
|
| 402 | 286 |
<Name>Point longline activity Obs with setting end</Name>
|
| 403 | 287 |
<ogc:Filter>
|
| 404 | 288 |
<ogc:PropertyIsEqualTo>
|
| 405 | 289 |
<ogc:PropertyName>pointType</ogc:PropertyName>
|
| 406 |
- <ogc:Literal>longlineActivityObsWithSettingEnd</ogc:Literal>
|
|
| 290 |
+ <ogc:Literal>llActivityObsWithSettingEnd</ogc:Literal>
|
|
| 407 | 291 |
</ogc:PropertyIsEqualTo>
|
| 408 | 292 |
</ogc:Filter>
|
| 409 | 293 |
<PointSymbolizer>
|
| ... | ... | @@ -423,15 +307,13 @@ |
| 423 | 307 |
</PointSymbolizer>
|
| 424 | 308 |
</Rule>
|
| 425 | 309 |
</FeatureTypeStyle>
|
| 426 |
- |
|
| 427 |
- |
|
| 428 | 310 |
<FeatureTypeStyle>
|
| 429 | 311 |
<Rule>
|
| 430 | 312 |
<Name>Point longline activity Obs with hauling start</Name>
|
| 431 | 313 |
<ogc:Filter>
|
| 432 | 314 |
<ogc:PropertyIsEqualTo>
|
| 433 | 315 |
<ogc:PropertyName>pointType</ogc:PropertyName>
|
| 434 |
- <ogc:Literal>longlineActivityObsWithHaulingStart</ogc:Literal>
|
|
| 316 |
+ <ogc:Literal>llActivityObsWithHaulingStart</ogc:Literal>
|
|
| 435 | 317 |
</ogc:PropertyIsEqualTo>
|
| 436 | 318 |
</ogc:Filter>
|
| 437 | 319 |
<PointSymbolizer>
|
| ... | ... | @@ -451,14 +333,13 @@ |
| 451 | 333 |
</PointSymbolizer>
|
| 452 | 334 |
</Rule>
|
| 453 | 335 |
</FeatureTypeStyle>
|
| 454 |
- |
|
| 455 | 336 |
<FeatureTypeStyle>
|
| 456 | 337 |
<Rule>
|
| 457 | 338 |
<Name>Point longline activity Obs with hauling end</Name>
|
| 458 | 339 |
<ogc:Filter>
|
| 459 | 340 |
<ogc:PropertyIsEqualTo>
|
| 460 | 341 |
<ogc:PropertyName>pointType</ogc:PropertyName>
|
| 461 |
- <ogc:Literal>longlineActivityObsWithHaulingEnd</ogc:Literal>
|
|
| 342 |
+ <ogc:Literal>llActivityObsWithHaulingEnd</ogc:Literal>
|
|
| 462 | 343 |
</ogc:PropertyIsEqualTo>
|
| 463 | 344 |
</ogc:Filter>
|
| 464 | 345 |
<PointSymbolizer>
|
| ... | ... | @@ -478,29 +359,28 @@ |
| 478 | 359 |
</PointSymbolizer>
|
| 479 | 360 |
</Rule>
|
| 480 | 361 |
</FeatureTypeStyle>
|
| 481 |
- |
|
| 482 | 362 |
<FeatureTypeStyle>
|
| 483 | 363 |
<Rule>
|
| 484 | 364 |
<Name>Point longline activity Obs in harbour</Name>
|
| 485 | 365 |
<ogc:Filter>
|
| 486 | 366 |
<ogc:PropertyIsEqualTo>
|
| 487 | 367 |
<ogc:PropertyName>pointType</ogc:PropertyName>
|
| 488 |
- <ogc:Literal>longlineActivityObsInHarbour</ogc:Literal>
|
|
| 368 |
+ <ogc:Literal>llActivityObsInHarbour</ogc:Literal>
|
|
| 489 | 369 |
</ogc:PropertyIsEqualTo>
|
| 490 | 370 |
</ogc:Filter>
|
| 491 | 371 |
<PointSymbolizer>
|
| 492 | 372 |
<Graphic>
|
| 493 | 373 |
<Mark>
|
| 494 |
- <WellKnownName>Circle</WellKnownName>
|
|
| 374 |
+ <WellKnownName>Star</WellKnownName>
|
|
| 495 | 375 |
<Fill>
|
| 496 |
- <CssParameter name="fill">#7800f6</CssParameter>
|
|
| 376 |
+ <CssParameter name="fill">#00FF00</CssParameter>
|
|
| 497 | 377 |
</Fill>
|
| 498 | 378 |
<Stroke>
|
| 499 | 379 |
<CssParameter name="stroke">#000000</CssParameter>
|
| 500 | 380 |
<CssParameter name="stroke-width">1</CssParameter>
|
| 501 | 381 |
</Stroke>
|
| 502 | 382 |
</Mark>
|
| 503 |
- <Size>12</Size>
|
|
| 383 |
+ <Size>16</Size>
|
|
| 504 | 384 |
</Graphic>
|
| 505 | 385 |
</PointSymbolizer>
|
| 506 | 386 |
<TextSymbolizer>
|
| ... | ... | @@ -527,108 +407,48 @@ |
| 527 | 407 |
</Rule>
|
| 528 | 408 |
</FeatureTypeStyle>
|
| 529 | 409 |
|
| 530 |
- <FeatureTypeStyle>
|
|
| 531 |
- <Rule>
|
|
| 532 |
- <Name>Point longline activity Obs with interaction</Name>
|
|
| 533 |
- <ogc:Filter>
|
|
| 534 |
- <ogc:PropertyIsEqualTo>
|
|
| 535 |
- <ogc:PropertyName>pointType</ogc:PropertyName>
|
|
| 536 |
- <ogc:Literal>longlineActivityObsWithInteraction</ogc:Literal>
|
|
| 537 |
- </ogc:PropertyIsEqualTo>
|
|
| 538 |
- </ogc:Filter>
|
|
| 539 |
- <PointSymbolizer>
|
|
| 540 |
- <Graphic>
|
|
| 541 |
- <Mark>
|
|
| 542 |
- <WellKnownName>Circle</WellKnownName>
|
|
| 543 |
- <Fill>
|
|
| 544 |
- <CssParameter name="fill">#FFFF00</CssParameter>
|
|
| 545 |
- </Fill>
|
|
| 546 |
- <Stroke>
|
|
| 547 |
- <CssParameter name="stroke">#000000</CssParameter>
|
|
| 548 |
- <CssParameter name="stroke-width">1</CssParameter>
|
|
| 549 |
- </Stroke>
|
|
| 550 |
- </Mark>
|
|
| 551 |
- <Size>12</Size>
|
|
| 552 |
- </Graphic>
|
|
| 553 |
- </PointSymbolizer>
|
|
| 554 |
- <TextSymbolizer>
|
|
| 555 |
- <Label>
|
|
| 556 |
- <ogc:PropertyName>label</ogc:PropertyName>
|
|
| 557 |
- </Label>
|
|
| 558 |
- <Font>
|
|
| 559 |
- <CssParameter name="font-size">14</CssParameter>
|
|
| 560 |
- <CssParameter name="font-style">normal</CssParameter>
|
|
| 561 |
- <CssParameter name="font-weight">bold</CssParameter>
|
|
| 562 |
- </Font>
|
|
| 563 |
- <LabelPlacement>
|
|
| 564 |
- <PointPlacement>
|
|
| 565 |
- <Displacement>
|
|
| 566 |
- <DisplacementX>5</DisplacementX>
|
|
| 567 |
- <DisplacementY>5</DisplacementY>
|
|
| 568 |
- </Displacement>
|
|
| 569 |
- </PointPlacement>
|
|
| 570 |
- </LabelPlacement>
|
|
| 571 |
- <Fill>
|
|
| 572 |
- <CssParameter name="fill">#000000</CssParameter>
|
|
| 573 |
- </Fill>
|
|
| 574 |
- </TextSymbolizer>
|
|
| 575 |
- </Rule>
|
|
| 576 |
- </FeatureTypeStyle>
|
|
| 410 |
+ </UserStyle>
|
|
| 411 |
+ </NamedLayer>
|
|
| 412 |
+ |
|
| 413 |
+ <NamedLayer>
|
|
| 414 |
+ <Name>Trip Logbook points</Name>
|
|
| 415 |
+ <UserStyle>
|
|
| 416 |
+ <IsDefault>true</IsDefault>
|
|
| 577 | 417 |
|
| 578 | 418 |
<FeatureTypeStyle>
|
| 579 | 419 |
<Rule>
|
| 580 |
- <Name>Point longline activity Obs with station</Name>
|
|
| 420 |
+ <Name>Point longline activity Logbook (Other)</Name>
|
|
| 581 | 421 |
<ogc:Filter>
|
| 582 | 422 |
<ogc:PropertyIsEqualTo>
|
| 583 | 423 |
<ogc:PropertyName>pointType</ogc:PropertyName>
|
| 584 |
- <ogc:Literal>longlineActivityObsWithStation</ogc:Literal>
|
|
| 424 |
+ <ogc:Literal>llActivityLogbook</ogc:Literal>
|
|
| 585 | 425 |
</ogc:PropertyIsEqualTo>
|
| 586 | 426 |
</ogc:Filter>
|
| 587 | 427 |
<PointSymbolizer>
|
| 588 | 428 |
<Graphic>
|
| 589 | 429 |
<Mark>
|
| 590 |
- <WellKnownName>star</WellKnownName>
|
|
| 430 |
+ <WellKnownName>ttf://Serif#U+00B7</WellKnownName>
|
|
| 591 | 431 |
<Fill>
|
| 592 |
- <CssParameter name="fill">#FFFF00</CssParameter>
|
|
| 432 |
+ <CssParameter name="fill">#FF0000</CssParameter>
|
|
| 593 | 433 |
</Fill>
|
| 594 | 434 |
<Stroke>
|
| 595 | 435 |
<CssParameter name="stroke">#000000</CssParameter>
|
| 596 | 436 |
<CssParameter name="stroke-width">1</CssParameter>
|
| 597 | 437 |
</Stroke>
|
| 598 | 438 |
</Mark>
|
| 599 |
- <Size>16</Size>
|
|
| 439 |
+ <Size>8</Size>
|
|
| 600 | 440 |
</Graphic>
|
| 601 | 441 |
</PointSymbolizer>
|
| 602 |
- <TextSymbolizer>
|
|
| 603 |
- <Label>
|
|
| 604 |
- <ogc:PropertyName>label</ogc:PropertyName>
|
|
| 605 |
- </Label>
|
|
| 606 |
- <Font>
|
|
| 607 |
- <CssParameter name="font-size">14</CssParameter>
|
|
| 608 |
- <CssParameter name="font-style">normal</CssParameter>
|
|
| 609 |
- <CssParameter name="font-weight">bold</CssParameter>
|
|
| 610 |
- </Font>
|
|
| 611 |
- <LabelPlacement>
|
|
| 612 |
- <PointPlacement>
|
|
| 613 |
- <Displacement>
|
|
| 614 |
- <DisplacementX>5</DisplacementX>
|
|
| 615 |
- <DisplacementY>5</DisplacementY>
|
|
| 616 |
- </Displacement>
|
|
| 617 |
- </PointPlacement>
|
|
| 618 |
- </LabelPlacement>
|
|
| 619 |
- <Fill>
|
|
| 620 |
- <CssParameter name="fill">#000000</CssParameter>
|
|
| 621 |
- </Fill>
|
|
| 622 |
- </TextSymbolizer>
|
|
| 623 | 442 |
</Rule>
|
| 624 | 443 |
</FeatureTypeStyle>
|
| 444 |
+ |
|
| 625 | 445 |
<FeatureTypeStyle>
|
| 626 | 446 |
<Rule>
|
| 627 | 447 |
<Name>Point longline activity Logbook with setting start</Name>
|
| 628 | 448 |
<ogc:Filter>
|
| 629 | 449 |
<ogc:PropertyIsEqualTo>
|
| 630 | 450 |
<ogc:PropertyName>pointType</ogc:PropertyName>
|
| 631 |
- <ogc:Literal>longlineActivityLogbookWithSettingStart</ogc:Literal>
|
|
| 451 |
+ <ogc:Literal>llActivityLogbookWithSettingStart</ogc:Literal>
|
|
| 632 | 452 |
</ogc:PropertyIsEqualTo>
|
| 633 | 453 |
</ogc:Filter>
|
| 634 | 454 |
<PointSymbolizer>
|
| ... | ... | @@ -649,14 +469,13 @@ |
| 649 | 469 |
</Rule>
|
| 650 | 470 |
</FeatureTypeStyle>
|
| 651 | 471 |
|
| 652 |
- |
|
| 653 | 472 |
<FeatureTypeStyle>
|
| 654 | 473 |
<Rule>
|
| 655 | 474 |
<Name>Point longline activity Logbook with setting end</Name>
|
| 656 | 475 |
<ogc:Filter>
|
| 657 | 476 |
<ogc:PropertyIsEqualTo>
|
| 658 | 477 |
<ogc:PropertyName>pointType</ogc:PropertyName>
|
| 659 |
- <ogc:Literal>longlineActivityLogbookWithSettingEnd</ogc:Literal>
|
|
| 478 |
+ <ogc:Literal>llActivityLogbookWithSettingEnd</ogc:Literal>
|
|
| 660 | 479 |
</ogc:PropertyIsEqualTo>
|
| 661 | 480 |
</ogc:Filter>
|
| 662 | 481 |
<PointSymbolizer>
|
| ... | ... | @@ -677,14 +496,13 @@ |
| 677 | 496 |
</Rule>
|
| 678 | 497 |
</FeatureTypeStyle>
|
| 679 | 498 |
|
| 680 |
- |
|
| 681 | 499 |
<FeatureTypeStyle>
|
| 682 | 500 |
<Rule>
|
| 683 | 501 |
<Name>Point longline activity Logbook with hauling start</Name>
|
| 684 | 502 |
<ogc:Filter>
|
| 685 | 503 |
<ogc:PropertyIsEqualTo>
|
| 686 | 504 |
<ogc:PropertyName>pointType</ogc:PropertyName>
|
| 687 |
- <ogc:Literal>longlineActivityLogbookWithHaulingStart</ogc:Literal>
|
|
| 505 |
+ <ogc:Literal>llActivityLogbookWithHaulingStart</ogc:Literal>
|
|
| 688 | 506 |
</ogc:PropertyIsEqualTo>
|
| 689 | 507 |
</ogc:Filter>
|
| 690 | 508 |
<PointSymbolizer>
|
| ... | ... | @@ -711,7 +529,7 @@ |
| 711 | 529 |
<ogc:Filter>
|
| 712 | 530 |
<ogc:PropertyIsEqualTo>
|
| 713 | 531 |
<ogc:PropertyName>pointType</ogc:PropertyName>
|
| 714 |
- <ogc:Literal>longlineActivityLogbookWithHaulingEnd</ogc:Literal>
|
|
| 532 |
+ <ogc:Literal>llActivityLogbookWithHaulingEnd</ogc:Literal>
|
|
| 715 | 533 |
</ogc:PropertyIsEqualTo>
|
| 716 | 534 |
</ogc:Filter>
|
| 717 | 535 |
<PointSymbolizer>
|
| ... | ... | @@ -738,111 +556,15 @@ |
| 738 | 556 |
<ogc:Filter>
|
| 739 | 557 |
<ogc:PropertyIsEqualTo>
|
| 740 | 558 |
<ogc:PropertyName>pointType</ogc:PropertyName>
|
| 741 |
- <ogc:Literal>longlineActivityLogbookInHarbour</ogc:Literal>
|
|
| 742 |
- </ogc:PropertyIsEqualTo>
|
|
| 743 |
- </ogc:Filter>
|
|
| 744 |
- <PointSymbolizer>
|
|
| 745 |
- <Graphic>
|
|
| 746 |
- <Mark>
|
|
| 747 |
- <WellKnownName>Circle</WellKnownName>
|
|
| 748 |
- <Fill>
|
|
| 749 |
- <CssParameter name="fill">#7800f6</CssParameter>
|
|
| 750 |
- </Fill>
|
|
| 751 |
- <Stroke>
|
|
| 752 |
- <CssParameter name="stroke">#000000</CssParameter>
|
|
| 753 |
- <CssParameter name="stroke-width">3</CssParameter>
|
|
| 754 |
- </Stroke>
|
|
| 755 |
- </Mark>
|
|
| 756 |
- <Size>12</Size>
|
|
| 757 |
- </Graphic>
|
|
| 758 |
- </PointSymbolizer>
|
|
| 759 |
- <TextSymbolizer>
|
|
| 760 |
- <Label>
|
|
| 761 |
- <ogc:PropertyName>label</ogc:PropertyName>
|
|
| 762 |
- </Label>
|
|
| 763 |
- <Font>
|
|
| 764 |
- <CssParameter name="font-size">14</CssParameter>
|
|
| 765 |
- <CssParameter name="font-style">normal</CssParameter>
|
|
| 766 |
- <CssParameter name="font-weight">bold</CssParameter>
|
|
| 767 |
- </Font>
|
|
| 768 |
- <LabelPlacement>
|
|
| 769 |
- <PointPlacement>
|
|
| 770 |
- <Displacement>
|
|
| 771 |
- <DisplacementX>5</DisplacementX>
|
|
| 772 |
- <DisplacementY>5</DisplacementY>
|
|
| 773 |
- </Displacement>
|
|
| 774 |
- </PointPlacement>
|
|
| 775 |
- </LabelPlacement>
|
|
| 776 |
- <Fill>
|
|
| 777 |
- <CssParameter name="fill">#000000</CssParameter>
|
|
| 778 |
- </Fill>
|
|
| 779 |
- </TextSymbolizer>
|
|
| 780 |
- </Rule>
|
|
| 781 |
- </FeatureTypeStyle>
|
|
| 782 |
- |
|
| 783 |
- <FeatureTypeStyle>
|
|
| 784 |
- <Rule>
|
|
| 785 |
- <Name>Point longline activity Logbook with interaction</Name>
|
|
| 786 |
- <ogc:Filter>
|
|
| 787 |
- <ogc:PropertyIsEqualTo>
|
|
| 788 |
- <ogc:PropertyName>pointType</ogc:PropertyName>
|
|
| 789 |
- <ogc:Literal>longlineActivityLogbookWithInteraction</ogc:Literal>
|
|
| 559 |
+ <ogc:Literal>llActivityLogbookInHarbour</ogc:Literal>
|
|
| 790 | 560 |
</ogc:PropertyIsEqualTo>
|
| 791 | 561 |
</ogc:Filter>
|
| 792 | 562 |
<PointSymbolizer>
|
| 793 | 563 |
<Graphic>
|
| 794 | 564 |
<Mark>
|
| 795 |
- <WellKnownName>Circle</WellKnownName>
|
|
| 565 |
+ <WellKnownName>Star</WellKnownName>
|
|
| 796 | 566 |
<Fill>
|
| 797 |
- <CssParameter name="fill">#FFFF00</CssParameter>
|
|
| 798 |
- </Fill>
|
|
| 799 |
- <Stroke>
|
|
| 800 |
- <CssParameter name="stroke">#000000</CssParameter>
|
|
| 801 |
- <CssParameter name="stroke-width">3</CssParameter>
|
|
| 802 |
- </Stroke>
|
|
| 803 |
- </Mark>
|
|
| 804 |
- <Size>12</Size>
|
|
| 805 |
- </Graphic>
|
|
| 806 |
- </PointSymbolizer>
|
|
| 807 |
- <TextSymbolizer>
|
|
| 808 |
- <Label>
|
|
| 809 |
- <ogc:PropertyName>label</ogc:PropertyName>
|
|
| 810 |
- </Label>
|
|
| 811 |
- <Font>
|
|
| 812 |
- <CssParameter name="font-size">14</CssParameter>
|
|
| 813 |
- <CssParameter name="font-style">normal</CssParameter>
|
|
| 814 |
- <CssParameter name="font-weight">bold</CssParameter>
|
|
| 815 |
- </Font>
|
|
| 816 |
- <LabelPlacement>
|
|
| 817 |
- <PointPlacement>
|
|
| 818 |
- <Displacement>
|
|
| 819 |
- <DisplacementX>5</DisplacementX>
|
|
| 820 |
- <DisplacementY>5</DisplacementY>
|
|
| 821 |
- </Displacement>
|
|
| 822 |
- </PointPlacement>
|
|
| 823 |
- </LabelPlacement>
|
|
| 824 |
- <Fill>
|
|
| 825 |
- <CssParameter name="fill">#000000</CssParameter>
|
|
| 826 |
- </Fill>
|
|
| 827 |
- </TextSymbolizer>
|
|
| 828 |
- </Rule>
|
|
| 829 |
- </FeatureTypeStyle>
|
|
| 830 |
- |
|
| 831 |
- <FeatureTypeStyle>
|
|
| 832 |
- <Rule>
|
|
| 833 |
- <Name>Point longline activity Logbook with station</Name>
|
|
| 834 |
- <ogc:Filter>
|
|
| 835 |
- <ogc:PropertyIsEqualTo>
|
|
| 836 |
- <ogc:PropertyName>pointType</ogc:PropertyName>
|
|
| 837 |
- <ogc:Literal>longlineActivityLogbookWithStation</ogc:Literal>
|
|
| 838 |
- </ogc:PropertyIsEqualTo>
|
|
| 839 |
- </ogc:Filter>
|
|
| 840 |
- <PointSymbolizer>
|
|
| 841 |
- <Graphic>
|
|
| 842 |
- <Mark>
|
|
| 843 |
- <WellKnownName>star</WellKnownName>
|
|
| 844 |
- <Fill>
|
|
| 845 |
- <CssParameter name="fill">#FFFF00</CssParameter>
|
|
| 567 |
+ <CssParameter name="fill">#FF0000</CssParameter>
|
|
| 846 | 568 |
</Fill>
|
| 847 | 569 |
<Stroke>
|
| 848 | 570 |
<CssParameter name="stroke">#000000</CssParameter>
|
| 1 |
+<!--
|
|
| 2 |
+ #%L
|
|
| 3 |
+ ObServe :: Client core
|
|
| 4 |
+ %%
|
|
| 5 |
+ Copyright (C) 2008 - 2019 IRD, Code Lutin, Ultreia.io
|
|
| 6 |
+ %%
|
|
| 7 |
+ This program is free software: you can redistribute it and/or modify
|
|
| 8 |
+ it under the terms of the GNU General Public License as
|
|
| 9 |
+ published by the Free Software Foundation, either version 3 of the
|
|
| 10 |
+ License, or (at your option) any later version.
|
|
| 11 |
+ |
|
| 12 |
+ This program is distributed in the hope that it will be useful,
|
|
| 13 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 14 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 15 |
+ GNU General Public License for more details.
|
|
| 16 |
+ |
|
| 17 |
+ You should have received a copy of the GNU General Public
|
|
| 18 |
+ License along with this program. If not, see
|
|
| 19 |
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 20 |
+ #L%
|
|
| 21 |
+ -->
|
|
| 22 |
+<StyledLayerDescriptor version="1.0.0"
|
|
| 23 |
+ xmlns="http://www.opengis.net/sld"
|
|
| 24 |
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
| 25 |
+ xmlns:ogc="http://www.opengis.net/ogc"
|
|
| 26 |
+ xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd
|
|
| 27 |
+ http://www.opengis.net/ogc http://schemas.opengis.net/filter/1.0.0/filter.xsd">
|
|
| 28 |
+ |
|
| 29 |
+ <NamedLayer>
|
|
| 30 |
+ <Name>Trip seine lines</Name>
|
|
| 31 |
+ <UserStyle>
|
|
| 32 |
+ <IsDefault>true</IsDefault>
|
|
| 33 |
+ <FeatureTypeStyle>
|
|
| 34 |
+ <Rule>
|
|
| 35 |
+ <Name>Trip day</Name>
|
|
| 36 |
+ <ogc:Filter>
|
|
| 37 |
+ <ogc:PropertyIsEqualTo>
|
|
| 38 |
+ <ogc:PropertyName>type</ogc:PropertyName>
|
|
| 39 |
+ <ogc:Literal>tripDay</ogc:Literal>
|
|
| 40 |
+ </ogc:PropertyIsEqualTo>
|
|
| 41 |
+ </ogc:Filter>
|
|
| 42 |
+ <LineSymbolizer>
|
|
| 43 |
+ <Stroke>
|
|
| 44 |
+ <CssParameter name="stroke">#00FF00</CssParameter>
|
|
| 45 |
+ <CssParameter name="stroke-width">2</CssParameter>
|
|
| 46 |
+ </Stroke>
|
|
| 47 |
+ </LineSymbolizer>
|
|
| 48 |
+ <TextSymbolizer>
|
|
| 49 |
+ <Label>
|
|
| 50 |
+ <ogc:PropertyName>label</ogc:PropertyName>
|
|
| 51 |
+ </Label>
|
|
| 52 |
+ <LabelPlacement>
|
|
| 53 |
+ <LinePlacement>
|
|
| 54 |
+ <PerpendicularOffset>10</PerpendicularOffset>
|
|
| 55 |
+ </LinePlacement>
|
|
| 56 |
+ </LabelPlacement>
|
|
| 57 |
+ <Fill>
|
|
| 58 |
+ <CssParameter name="fill">#000000</CssParameter>
|
|
| 59 |
+ </Fill>
|
|
| 60 |
+ <Font>
|
|
| 61 |
+ <CssParameter name="font-size">14</CssParameter>
|
|
| 62 |
+ <CssParameter name="font-style">normal</CssParameter>
|
|
| 63 |
+ <CssParameter name="font-weight">bold</CssParameter>
|
|
| 64 |
+ </Font>
|
|
| 65 |
+ </TextSymbolizer>
|
|
| 66 |
+ </Rule>
|
|
| 67 |
+ </FeatureTypeStyle>
|
|
| 68 |
+ <FeatureTypeStyle>
|
|
| 69 |
+ <Rule>
|
|
| 70 |
+ <Name>Trip between two days</Name>
|
|
| 71 |
+ <ogc:Filter>
|
|
| 72 |
+ <ogc:PropertyIsEqualTo>
|
|
| 73 |
+ <ogc:PropertyName>type</ogc:PropertyName>
|
|
| 74 |
+ <ogc:Literal>tripBetweenTwoDays</ogc:Literal>
|
|
| 75 |
+ </ogc:PropertyIsEqualTo>
|
|
| 76 |
+ </ogc:Filter>
|
|
| 77 |
+ <LineSymbolizer>
|
|
| 78 |
+ <Stroke>
|
|
| 79 |
+ <CssParameter name="stroke">#00FF00</CssParameter>
|
|
| 80 |
+ <CssParameter name="stroke-width">2</CssParameter>
|
|
| 81 |
+ <CssParameter name="stroke-dasharray">6 4</CssParameter>
|
|
| 82 |
+ </Stroke>
|
|
| 83 |
+ </LineSymbolizer>
|
|
| 84 |
+ </Rule>
|
|
| 85 |
+ </FeatureTypeStyle>
|
|
| 86 |
+ </UserStyle>
|
|
| 87 |
+ </NamedLayer>
|
|
| 88 |
+ |
|
| 89 |
+ <NamedLayer>
|
|
| 90 |
+ <Name>Trip Obs points</Name>
|
|
| 91 |
+ <UserStyle>
|
|
| 92 |
+ <IsDefault>true</IsDefault>
|
|
| 93 |
+ <FeatureTypeStyle>
|
|
| 94 |
+ <Rule>
|
|
| 95 |
+ <Name>Point seine activity Obs in harbour</Name>
|
|
| 96 |
+ <ogc:Filter>
|
|
| 97 |
+ <ogc:PropertyIsEqualTo>
|
|
| 98 |
+ <ogc:PropertyName>pointType</ogc:PropertyName>
|
|
| 99 |
+ <ogc:Literal>psActivityObsInHarbour</ogc:Literal>
|
|
| 100 |
+ </ogc:PropertyIsEqualTo>
|
|
| 101 |
+ </ogc:Filter>
|
|
| 102 |
+ <PointSymbolizer>
|
|
| 103 |
+ <Graphic>
|
|
| 104 |
+ <Mark>
|
|
| 105 |
+ <WellKnownName>Star</WellKnownName>
|
|
| 106 |
+ <Fill>
|
|
| 107 |
+ <CssParameter name="fill">#00FF00</CssParameter>
|
|
| 108 |
+ </Fill>
|
|
| 109 |
+ <Stroke>
|
|
| 110 |
+ <CssParameter name="stroke">#000000</CssParameter>
|
|
| 111 |
+ <CssParameter name="stroke-width">1</CssParameter>
|
|
| 112 |
+ </Stroke>
|
|
| 113 |
+ </Mark>
|
|
| 114 |
+ <Size>16</Size>
|
|
| 115 |
+ </Graphic>
|
|
| 116 |
+ </PointSymbolizer>
|
|
| 117 |
+ </Rule>
|
|
| 118 |
+ </FeatureTypeStyle>
|
|
| 119 |
+ |
|
| 120 |
+ <FeatureTypeStyle>
|
|
| 121 |
+ <Rule>
|
|
| 122 |
+ <Name>Point seine activity Obs (Other)</Name>
|
|
| 123 |
+ <ogc:Filter>
|
|
| 124 |
+ <ogc:PropertyIsEqualTo>
|
|
| 125 |
+ <ogc:PropertyName>pointType</ogc:PropertyName>
|
|
| 126 |
+ <ogc:Literal>psActivityObs</ogc:Literal>
|
|
| 127 |
+ </ogc:PropertyIsEqualTo>
|
|
| 128 |
+ </ogc:Filter>
|
|
| 129 |
+ <PointSymbolizer>
|
|
| 130 |
+ <Graphic>
|
|
| 131 |
+ <Mark>
|
|
| 132 |
+ <WellKnownName>ttf://Serif#U+00B7</WellKnownName>
|
|
| 133 |
+ <Fill>
|
|
| 134 |
+ <CssParameter name="fill">#00FF00</CssParameter>
|
|
| 135 |
+ </Fill>
|
|
| 136 |
+ <Stroke>
|
|
| 137 |
+ <CssParameter name="stroke">#000000</CssParameter>
|
|
| 138 |
+ <CssParameter name="stroke-width">1</CssParameter>
|
|
| 139 |
+ </Stroke>
|
|
| 140 |
+ </Mark>
|
|
| 141 |
+ <Size>8</Size>
|
|
| 142 |
+ </Graphic>
|
|
| 143 |
+ </PointSymbolizer>
|
|
| 144 |
+ </Rule>
|
|
| 145 |
+ </FeatureTypeStyle>
|
|
| 146 |
+ |
|
| 147 |
+ <FeatureTypeStyle>
|
|
| 148 |
+ <Rule>
|
|
| 149 |
+ <Name>Point seine activity Obs with free school type</Name>
|
|
| 150 |
+ <ogc:Filter>
|
|
| 151 |
+ <ogc:PropertyIsEqualTo>
|
|
| 152 |
+ <ogc:PropertyName>pointType</ogc:PropertyName>
|
|
| 153 |
+ <ogc:Literal>psActivityObsWithFreeSchoolType</ogc:Literal>
|
|
| 154 |
+ </ogc:PropertyIsEqualTo>
|
|
| 155 |
+ </ogc:Filter>
|
|
| 156 |
+ <PointSymbolizer>
|
|
| 157 |
+ <Graphic>
|
|
| 158 |
+ <Mark>
|
|
| 159 |
+ <WellKnownName>ttf://Serif#U+25C6</WellKnownName>
|
|
| 160 |
+ <Fill>
|
|
| 161 |
+ <CssParameter name="fill">#00FF00</CssParameter>
|
|
| 162 |
+ </Fill>
|
|
| 163 |
+ <Stroke>
|
|
| 164 |
+ <CssParameter name="stroke">#000000</CssParameter>
|
|
| 165 |
+ <CssParameter name="stroke-width">1</CssParameter>
|
|
| 166 |
+ </Stroke>
|
|
| 167 |
+ </Mark>
|
|
| 168 |
+ <Size>16</Size>
|
|
| 169 |
+ </Graphic>
|
|
| 170 |
+ </PointSymbolizer>
|
|
| 171 |
+ </Rule>
|
|
| 172 |
+ </FeatureTypeStyle>
|
|
| 173 |
+ |
|
| 174 |
+ <FeatureTypeStyle>
|
|
| 175 |
+ <Rule>
|
|
| 176 |
+ <Name>Point seine activity Obs with object school type</Name>
|
|
| 177 |
+ <ogc:Filter>
|
|
| 178 |
+ <ogc:PropertyIsEqualTo>
|
|
| 179 |
+ <ogc:PropertyName>pointType</ogc:PropertyName>
|
|
| 180 |
+ <ogc:Literal>psActivityObsWithObjectSchoolType</ogc:Literal>
|
|
| 181 |
+ </ogc:PropertyIsEqualTo>
|
|
| 182 |
+ </ogc:Filter>
|
|
| 183 |
+ <PointSymbolizer>
|
|
| 184 |
+ <Graphic>
|
|
| 185 |
+ <Mark>
|
|
| 186 |
+ <WellKnownName>ttf://Serif#U+2B1F</WellKnownName>
|
|
| 187 |
+ <Fill>
|
|
| 188 |
+ <CssParameter name="fill">#00FF00</CssParameter>
|
|
| 189 |
+ </Fill>
|
|
| 190 |
+ <Stroke>
|
|
| 191 |
+ <CssParameter name="stroke">#000000</CssParameter>
|
|
| 192 |
+ <CssParameter name="stroke-width">1</CssParameter>
|
|
| 193 |
+ </Stroke>
|
|
| 194 |
+ </Mark>
|
|
| 195 |
+ <Size>16</Size>
|
|
| 196 |
+ </Graphic>
|
|
| 197 |
+ </PointSymbolizer>
|
|
| 198 |
+ </Rule>
|
|
| 199 |
+ </FeatureTypeStyle>
|
|
| 200 |
+ |
|
| 201 |
+ </UserStyle>
|
|
| 202 |
+ </NamedLayer>
|
|
| 203 |
+ |
|
| 204 |
+ <NamedLayer>
|
|
| 205 |
+ <Name>World_EEZ_v8_2014</Name>
|
|
| 206 |
+ <UserStyle>
|
|
| 207 |
+ <FeatureTypeStyle>
|
|
| 208 |
+ <Rule>
|
|
| 209 |
+ <PolygonSymbolizer>
|
|
| 210 |
+ <Fill>
|
|
| 211 |
+ <CssParameter name="fill">#82F4F9</CssParameter>
|
|
| 212 |
+ </Fill>
|
|
| 213 |
+ <Stroke>
|
|
| 214 |
+ <CssParameter name="stroke">#000000</CssParameter>
|
|
| 215 |
+ <CssParameter name="stroke-width">1</CssParameter>
|
|
| 216 |
+ </Stroke>
|
|
| 217 |
+ </PolygonSymbolizer>
|
|
| 218 |
+ </Rule>
|
|
| 219 |
+ </FeatureTypeStyle>
|
|
| 220 |
+ </UserStyle>
|
|
| 221 |
+ </NamedLayer>
|
|
| 222 |
+ |
|
| 223 |
+ <NamedLayer>
|
|
| 224 |
+ <Name>GSHHS_l_L1</Name>
|
|
| 225 |
+ <UserStyle>
|
|
| 226 |
+ <FeatureTypeStyle>
|
|
| 227 |
+ <Rule>
|
|
| 228 |
+ <PolygonSymbolizer>
|
|
| 229 |
+ <Fill>
|
|
| 230 |
+ <CssParameter name="fill">#FBE9D7</CssParameter>
|
|
| 231 |
+ </Fill>
|
|
| 232 |
+ <Stroke>
|
|
| 233 |
+ <CssParameter name="stroke">#000000</CssParameter>
|
|
| 234 |
+ <CssParameter name="stroke-width">1</CssParameter>
|
|
| 235 |
+ </Stroke>
|
|
| 236 |
+ </PolygonSymbolizer>
|
|
| 237 |
+ </Rule>
|
|
| 238 |
+ </FeatureTypeStyle>
|
|
| 239 |
+ </UserStyle>
|
|
| 240 |
+ </NamedLayer>
|
|
| 241 |
+ |
|
| 242 |
+ <NamedLayer>
|
|
| 243 |
+ <Name>GSHHS_l_L6</Name>
|
|
| 244 |
+ <UserStyle>
|
|
| 245 |
+ <FeatureTypeStyle>
|
|
| 246 |
+ <Rule>
|
|
| 247 |
+ <PolygonSymbolizer>
|
|
| 248 |
+ <Fill>
|
|
| 249 |
+ <CssParameter name="fill">#F5F5FF</CssParameter>
|
|
| 250 |
+ </Fill>
|
|
| 251 |
+ <Stroke>
|
|
| 252 |
+ <CssParameter name="stroke">#000000</CssParameter>
|
|
| 253 |
+ <CssParameter name="stroke-width">1</CssParameter>
|
|
| 254 |
+ </Stroke>
|
|
| 255 |
+ </PolygonSymbolizer>
|
|
| 256 |
+ </Rule>
|
|
| 257 |
+ </FeatureTypeStyle>
|
|
| 258 |
+ </UserStyle>
|
|
| 259 |
+ </NamedLayer>
|
|
| 260 |
+ |
|
| 261 |
+ <NamedLayer>
|
|
| 262 |
+ <Name>GSHHS_l_L2</Name>
|
|
| 263 |
+ <UserStyle>
|
|
| 264 |
+ <FeatureTypeStyle>
|
|
| 265 |
+ <Rule>
|
|
| 266 |
+ <PolygonSymbolizer>
|
|
| 267 |
+ <Fill>
|
|
| 268 |
+ <CssParameter name="fill">#7FB7FF</CssParameter>
|
|
| 269 |
+ </Fill>
|
|
| 270 |
+ <Stroke>
|
|
| 271 |
+ <CssParameter name="stroke">#7FB7FF</CssParameter>
|
|
| 272 |
+ <CssParameter name="stroke-width">1</CssParameter>
|
|
| 273 |
+ </Stroke>
|
|
| 274 |
+ </PolygonSymbolizer>
|
|
| 275 |
+ </Rule>
|
|
| 276 |
+ </FeatureTypeStyle>
|
|
| 277 |
+ </UserStyle>
|
|
| 278 |
+ </NamedLayer>
|
|
| 279 |
+ |
|
| 280 |
+</StyledLayerDescriptor>
|
| ... | ... | @@ -12,36 +12,26 @@ observe.constant.NonTargetCatchReleaseStatus.M |
| 12 | 12 |
observe.constant.NonTargetCatchReleaseStatus.P
|
| 13 | 13 |
observe.constant.NonTargetCatchReleaseStatus.S
|
| 14 | 14 |
observe.constant.NonTargetCatchReleaseStatus.U
|
| 15 |
-observe.constant.Ownership.autreVessel
|
|
| 16 |
-observe.constant.Ownership.ceVessel
|
|
| 17 |
-observe.constant.Ownership.unknown
|
|
| 18 |
-observe.constant.SchoolType.libre
|
|
| 19 |
-observe.constant.SchoolType.objet
|
|
| 20 |
-observe.constant.SchoolType.undefined
|
|
| 21 |
-observe.constant.TripMapPointType.longlineActivityLogbook
|
|
| 22 |
-observe.constant.TripMapPointType.longlineActivityLogbookInHarbour
|
|
| 23 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithHaulingEnd
|
|
| 24 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithHaulingStart
|
|
| 25 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithInteraction
|
|
| 26 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithSettingEnd
|
|
| 27 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithSettingStart
|
|
| 28 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithStation
|
|
| 29 |
-observe.constant.TripMapPointType.longlineActivityObs
|
|
| 30 |
-observe.constant.TripMapPointType.longlineActivityObsInHarbour
|
|
| 31 |
-observe.constant.TripMapPointType.longlineActivityObsWithHaulingEnd
|
|
| 32 |
-observe.constant.TripMapPointType.longlineActivityObsWithHaulingStart
|
|
| 33 |
-observe.constant.TripMapPointType.longlineActivityObsWithInteraction
|
|
| 34 |
-observe.constant.TripMapPointType.longlineActivityObsWithSettingEnd
|
|
| 35 |
-observe.constant.TripMapPointType.longlineActivityObsWithSettingStart
|
|
| 36 |
-observe.constant.TripMapPointType.longlineActivityObsWithStation
|
|
| 37 |
-observe.constant.TripMapPointType.longlineDepartureHarbour
|
|
| 38 |
-observe.constant.TripMapPointType.longlineLandingHarbour
|
|
| 39 |
-observe.constant.TripMapPointType.seineActivityObs
|
|
| 40 |
-observe.constant.TripMapPointType.seineActivityObsInHarbour
|
|
| 41 |
-observe.constant.TripMapPointType.seineActivityObsWithFreeSchoolType
|
|
| 42 |
-observe.constant.TripMapPointType.seineActivityObsWithObjectSchoolType
|
|
| 43 |
-observe.constant.TripMapPointType.seineDepartureHarbour
|
|
| 44 |
-observe.constant.TripMapPointType.seineLandingHarbour
|
|
| 15 |
+observe.constant.TripMapPointType.llActivityLogbook
|
|
| 16 |
+observe.constant.TripMapPointType.llActivityLogbookInHarbour
|
|
| 17 |
+observe.constant.TripMapPointType.llActivityLogbookWithHaulingEnd
|
|
| 18 |
+observe.constant.TripMapPointType.llActivityLogbookWithHaulingStart
|
|
| 19 |
+observe.constant.TripMapPointType.llActivityLogbookWithSettingEnd
|
|
| 20 |
+observe.constant.TripMapPointType.llActivityLogbookWithSettingStart
|
|
| 21 |
+observe.constant.TripMapPointType.llActivityObs
|
|
| 22 |
+observe.constant.TripMapPointType.llActivityObsInHarbour
|
|
| 23 |
+observe.constant.TripMapPointType.llActivityObsWithHaulingEnd
|
|
| 24 |
+observe.constant.TripMapPointType.llActivityObsWithHaulingStart
|
|
| 25 |
+observe.constant.TripMapPointType.llActivityObsWithSettingEnd
|
|
| 26 |
+observe.constant.TripMapPointType.llActivityObsWithSettingStart
|
|
| 27 |
+observe.constant.TripMapPointType.llTripDepartureHarbour
|
|
| 28 |
+observe.constant.TripMapPointType.llTripLandingHarbour
|
|
| 29 |
+observe.constant.TripMapPointType.psActivityObs
|
|
| 30 |
+observe.constant.TripMapPointType.psActivityObsInHarbour
|
|
| 31 |
+observe.constant.TripMapPointType.psActivityObsWithFreeSchoolType
|
|
| 32 |
+observe.constant.TripMapPointType.psActivityObsWithObjectSchoolType
|
|
| 33 |
+observe.constant.TripMapPointType.psTripDepartureHarbour
|
|
| 34 |
+observe.constant.TripMapPointType.psTripLandingHarbour
|
|
| 45 | 35 |
observe.constant.TypeTransmittingBuoyOperation.pasDeBalise
|
| 46 | 36 |
observe.constant.TypeTransmittingBuoyOperation.pose
|
| 47 | 37 |
observe.constant.TypeTransmittingBuoyOperation.recuperation
|
| ... | ... | @@ -24,38 +24,74 @@ package fr.ird.observe.dto.data; |
| 24 | 24 |
|
| 25 | 25 |
/**
|
| 26 | 26 |
* <b>Attention : les noms des constantes sont utilisées dans la feuille de style de rendu. Si on change les noms ici,
|
| 27 |
- * il faut réimpacter dans le fichier style.xml</b>
|
|
| 27 |
+ * il faut réimpacter dans les fichiers ps-style.xml et ll-style.xml</b>
|
|
| 28 | 28 |
*
|
| 29 | 29 |
* @author Tony Chemit - dev@tchemit.fr
|
| 30 | 30 |
*/
|
| 31 | 31 |
public enum TripMapPointType {
|
| 32 | 32 |
|
| 33 |
- seineDepartureHarbour,
|
|
| 34 |
- seineLandingHarbour,
|
|
| 35 |
- seineActivityObs,
|
|
| 36 |
- seineActivityObsInHarbour,
|
|
| 37 |
- seineActivityObsWithFreeSchoolType,
|
|
| 38 |
- seineActivityObsWithObjectSchoolType,
|
|
| 39 |
- |
|
| 40 |
- longlineDepartureHarbour,
|
|
| 41 |
- longlineLandingHarbour,
|
|
| 42 |
- |
|
| 43 |
- longlineActivityObs,
|
|
| 44 |
- longlineActivityObsInHarbour,
|
|
| 45 |
- longlineActivityObsWithSettingStart,
|
|
| 46 |
- longlineActivityObsWithSettingEnd,
|
|
| 47 |
- longlineActivityObsWithHaulingStart,
|
|
| 48 |
- longlineActivityObsWithHaulingEnd,
|
|
| 49 |
- longlineActivityObsWithInteraction,
|
|
| 50 |
- longlineActivityObsWithStation,
|
|
| 51 |
- |
|
| 52 |
- longlineActivityLogbook,
|
|
| 53 |
- longlineActivityLogbookInHarbour,
|
|
| 54 |
- longlineActivityLogbookWithSettingStart,
|
|
| 55 |
- longlineActivityLogbookWithSettingEnd,
|
|
| 56 |
- longlineActivityLogbookWithHaulingStart,
|
|
| 57 |
- longlineActivityLogbookWithHaulingEnd,
|
|
| 58 |
- longlineActivityLogbookWithInteraction,
|
|
| 59 |
- longlineActivityLogbookWithStation
|
|
| 33 |
+ psTripDepartureHarbour,
|
|
| 34 |
+ psTripLandingHarbour,
|
|
| 60 | 35 |
|
| 36 |
+ psActivityObs,
|
|
| 37 |
+ psActivityObsInHarbour,
|
|
| 38 |
+ psActivityObsWithFreeSchoolType,
|
|
| 39 |
+ psActivityObsWithObjectSchoolType,
|
|
| 40 |
+ |
|
| 41 |
+ llTripDepartureHarbour,
|
|
| 42 |
+ llTripLandingHarbour,
|
|
| 43 |
+ |
|
| 44 |
+ llActivityObs,
|
|
| 45 |
+ llActivityObsInHarbour,
|
|
| 46 |
+ llActivityObsWithSettingStart,
|
|
| 47 |
+ llActivityObsWithSettingEnd,
|
|
| 48 |
+ llActivityObsWithHaulingStart,
|
|
| 49 |
+ llActivityObsWithHaulingEnd,
|
|
| 50 |
+ |
|
| 51 |
+ llActivityLogbook,
|
|
| 52 |
+ llActivityLogbookInHarbour,
|
|
| 53 |
+ llActivityLogbookWithSettingStart,
|
|
| 54 |
+ llActivityLogbookWithSettingEnd,
|
|
| 55 |
+ llActivityLogbookWithHaulingStart,
|
|
| 56 |
+ llActivityLogbookWithHaulingEnd;
|
|
| 57 |
+ |
|
| 58 |
+ private final boolean seine;
|
|
| 59 |
+ private final boolean longline;
|
|
| 60 |
+ private final boolean trip;
|
|
| 61 |
+ private final boolean activity;
|
|
| 62 |
+ private final boolean obs;
|
|
| 63 |
+ private final boolean logbook;
|
|
| 64 |
+ |
|
| 65 |
+ TripMapPointType() {
|
|
| 66 |
+ this.seine = name().startsWith("ps");
|
|
| 67 |
+ this.longline = name().startsWith("ll");
|
|
| 68 |
+ this.trip = name().contains("Trip");
|
|
| 69 |
+ this.activity = name().contains("Activity");
|
|
| 70 |
+ this.obs = name().contains("Obs");
|
|
| 71 |
+ this.logbook = name().contains("Logbook");
|
|
| 72 |
+ }
|
|
| 73 |
+ |
|
| 74 |
+ public boolean isSeine() {
|
|
| 75 |
+ return seine;
|
|
| 76 |
+ }
|
|
| 77 |
+ |
|
| 78 |
+ public boolean isLongline() {
|
|
| 79 |
+ return longline;
|
|
| 80 |
+ }
|
|
| 81 |
+ |
|
| 82 |
+ public boolean isTrip() {
|
|
| 83 |
+ return trip;
|
|
| 84 |
+ }
|
|
| 85 |
+ |
|
| 86 |
+ public boolean isActivity() {
|
|
| 87 |
+ return activity;
|
|
| 88 |
+ }
|
|
| 89 |
+ |
|
| 90 |
+ public boolean isObs() {
|
|
| 91 |
+ return obs;
|
|
| 92 |
+ }
|
|
| 93 |
+ |
|
| 94 |
+ public boolean isLogbook() {
|
|
| 95 |
+ return logbook;
|
|
| 96 |
+ }
|
|
| 61 | 97 |
}
|
| ... | ... | @@ -2674,7 +2674,8 @@ observe.config.map.layer6.description=File (shapefile) for layer 6 of map |
| 2674 | 2674 |
observe.config.map.layer7.description=File (shapefile) for layer 7 of map
|
| 2675 | 2675 |
observe.config.map.layer8.description=File (shapefile) for layer 8 of map
|
| 2676 | 2676 |
observe.config.map.layer9.description=File (shapefile) for layer 9 of map
|
| 2677 |
-observe.config.map.style.description=File of styles used in map
|
|
| 2677 |
+observe.config.map.ll.style.description=[Longline] File of styles used in map
|
|
| 2678 |
+observe.config.map.ps.style.description=[Seine] File of styles used in map
|
|
| 2678 | 2679 |
observe.config.observation.activitysDetaillees=Observation of detailled activities
|
| 2679 | 2680 |
observe.config.observation.fauneAssociee=Observation of non target
|
| 2680 | 2681 |
observe.config.observation.floatingObject=Observation of floating objects
|
| ... | ... | @@ -2840,38 +2841,26 @@ observe.constant.StorageStep.ROLES=Security |
| 2840 | 2841 |
observe.constant.StorageStep.ROLES.description=Apply security on database roles
|
| 2841 | 2842 |
observe.constant.StorageStep.SELECT_DATA=Data selection
|
| 2842 | 2843 |
observe.constant.StorageStep.SELECT_DATA.description=Select data to export in backup
|
| 2843 |
-observe.constant.TripMapPointType.longlineActivity=Activity
|
|
| 2844 |
-observe.constant.TripMapPointType.longlineActivityInHarbour=Au Harbour
|
|
| 2845 |
-observe.constant.TripMapPointType.longlineActivityLogbook=Logbook - Activity
|
|
| 2846 |
-observe.constant.TripMapPointType.longlineActivityLogbookInHarbour=Logbook - At Harbour
|
|
| 2847 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithHaulingEnd=Logbook - Hauling end
|
|
| 2848 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithHaulingStart=Logbook - Hauling start
|
|
| 2849 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithInteraction=Logbook - Encounter
|
|
| 2850 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithSettingEnd=Logbook - Setting end
|
|
| 2851 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithSettingStart=Logbook - Setting start
|
|
| 2852 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithStation=Logbook - Station
|
|
| 2853 |
-observe.constant.TripMapPointType.longlineActivityObs=Observation - Activity
|
|
| 2854 |
-observe.constant.TripMapPointType.longlineActivityObsInHarbour=Observation - At Harbour
|
|
| 2855 |
-observe.constant.TripMapPointType.longlineActivityObsWithHaulingEnd=Observation - Hauling end
|
|
| 2856 |
-observe.constant.TripMapPointType.longlineActivityObsWithHaulingStart=Observation - Hauling start
|
|
| 2857 |
-observe.constant.TripMapPointType.longlineActivityObsWithInteraction=Observation - Encounter
|
|
| 2858 |
-observe.constant.TripMapPointType.longlineActivityObsWithSettingEnd=Observation - Setting end
|
|
| 2859 |
-observe.constant.TripMapPointType.longlineActivityObsWithSettingStart=Observation - Setting start
|
|
| 2860 |
-observe.constant.TripMapPointType.longlineActivityObsWithStation=Observation - Station
|
|
| 2861 |
-observe.constant.TripMapPointType.longlineActivityWithHaulingEnd=Hauling end
|
|
| 2862 |
-observe.constant.TripMapPointType.longlineActivityWithHaulingStart=Hauling start
|
|
| 2863 |
-observe.constant.TripMapPointType.longlineActivityWithInteraction=Encounter
|
|
| 2864 |
-observe.constant.TripMapPointType.longlineActivityWithSettingEnd=Setting end
|
|
| 2865 |
-observe.constant.TripMapPointType.longlineActivityWithSettingStart=Setting start
|
|
| 2866 |
-observe.constant.TripMapPointType.longlineActivityWithStation=Station
|
|
| 2867 |
-observe.constant.TripMapPointType.longlineDepartureHarbour=Harbour departure
|
|
| 2868 |
-observe.constant.TripMapPointType.longlineLandingHarbour=Harbour landing
|
|
| 2869 |
-observe.constant.TripMapPointType.seineActivityObs=Activity
|
|
| 2870 |
-observe.constant.TripMapPointType.seineActivityObsInHarbour=In harbour
|
|
| 2871 |
-observe.constant.TripMapPointType.seineActivityObsWithFreeSchoolType=Free School type
|
|
| 2872 |
-observe.constant.TripMapPointType.seineActivityObsWithObjectSchoolType=Object School type
|
|
| 2873 |
-observe.constant.TripMapPointType.seineDepartureHarbour=Harbour departure
|
|
| 2874 |
-observe.constant.TripMapPointType.seineLandingHarbour=Harbour landing
|
|
| 2844 |
+observe.constant.TripMapPointType.llActivityLogbook=Logbook - Activity (Other)
|
|
| 2845 |
+observe.constant.TripMapPointType.llActivityLogbookInHarbour=Logbook - At Harbour
|
|
| 2846 |
+observe.constant.TripMapPointType.llActivityLogbookWithHaulingEnd=Logbook - Hauling end
|
|
| 2847 |
+observe.constant.TripMapPointType.llActivityLogbookWithHaulingStart=Logbook - Hauling start
|
|
| 2848 |
+observe.constant.TripMapPointType.llActivityLogbookWithSettingEnd=Logbook - Setting end
|
|
| 2849 |
+observe.constant.TripMapPointType.llActivityLogbookWithSettingStart=Logbook - Setting start
|
|
| 2850 |
+observe.constant.TripMapPointType.llActivityObs=Observation - Activity (Other)
|
|
| 2851 |
+observe.constant.TripMapPointType.llActivityObsInHarbour=Observation - At Harbour
|
|
| 2852 |
+observe.constant.TripMapPointType.llActivityObsWithHaulingEnd=Observation - Hauling end
|
|
| 2853 |
+observe.constant.TripMapPointType.llActivityObsWithHaulingStart=Observation - Hauling start
|
|
| 2854 |
+observe.constant.TripMapPointType.llActivityObsWithSettingEnd=Observation - Setting end
|
|
| 2855 |
+observe.constant.TripMapPointType.llActivityObsWithSettingStart=Observation - Setting start
|
|
| 2856 |
+observe.constant.TripMapPointType.llTripDepartureHarbour=Harbour departure
|
|
| 2857 |
+observe.constant.TripMapPointType.llTripLandingHarbour=Harbour landing
|
|
| 2858 |
+observe.constant.TripMapPointType.psActivityObs=Activity (Other)
|
|
| 2859 |
+observe.constant.TripMapPointType.psActivityObsInHarbour=In harbour
|
|
| 2860 |
+observe.constant.TripMapPointType.psActivityObsWithFreeSchoolType=Free School type
|
|
| 2861 |
+observe.constant.TripMapPointType.psActivityObsWithObjectSchoolType=Object School type
|
|
| 2862 |
+observe.constant.TripMapPointType.psTripDepartureHarbour=Harbour departure
|
|
| 2863 |
+observe.constant.TripMapPointType.psTripLandingHarbour=Harbour landing
|
|
| 2875 | 2864 |
observe.constant.TypeTransmittingBuoyOperation.pasDeBalise=No Beacon
|
| 2876 | 2865 |
observe.constant.TypeTransmittingBuoyOperation.pose=Posing
|
| 2877 | 2866 |
observe.constant.TypeTransmittingBuoyOperation.recuperation=Grab
|
| ... | ... | @@ -2674,7 +2674,8 @@ observe.config.map.layer6.description=Archivo (shapeFiles) del sexto calco del m |
| 2674 | 2674 |
observe.config.map.layer7.description=Archivo (shapeFiles) del séptimo calco del mapa
|
| 2675 | 2675 |
observe.config.map.layer8.description=Archivo (shapeFiles) del octavo calco del mapa
|
| 2676 | 2676 |
observe.config.map.layer9.description=Archivo (shapeFiles) del noveno calco del mapa
|
| 2677 |
-observe.config.map.style.description=Archivo de los estilos a aplicar sobre los calcos del mapa
|
|
| 2677 |
+observe.config.map.ll.style.description=[Longline] Archivo de los estilos a aplicar sobre los calcos del mapa \#TODO
|
|
| 2678 |
+observe.config.map.ps.style.description=[Seina] Archivo de los estilos a aplicar sobre los calcos del mapa \#TODO
|
|
| 2678 | 2679 |
observe.config.observation.activitysDetaillees=Observación de actividades detalladas
|
| 2679 | 2680 |
observe.config.observation.fauneAssociee=Observación de Fauna asociada
|
| 2680 | 2681 |
observe.config.observation.floatingObject=Observación de objetos flotantes
|
| ... | ... | @@ -2840,38 +2841,26 @@ observe.constant.StorageStep.ROLES=Seguridad |
| 2840 | 2841 |
observe.constant.StorageStep.ROLES.description=Configuración de la seguridad
|
| 2841 | 2842 |
observe.constant.StorageStep.SELECT_DATA=Selección de datos
|
| 2842 | 2843 |
observe.constant.StorageStep.SELECT_DATA.description=Seleccionar los datos a exportar en la copia de seguridad
|
| 2843 |
-observe.constant.TripMapPointType.longlineActivity=Actividad
|
|
| 2844 |
-observe.constant.TripMapPointType.longlineActivityInHarbour=En puerto
|
|
| 2845 |
-observe.constant.TripMapPointType.longlineActivityLogbook=Logbook - Actividad
|
|
| 2846 |
-observe.constant.TripMapPointType.longlineActivityLogbookInHarbour=Logbook - En el puerto
|
|
| 2847 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithHaulingEnd=Logbook - Fin de arrastre
|
|
| 2848 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithHaulingStart=Logbook - Inicio de arrastre
|
|
| 2849 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithInteraction=Logbook - Encuentro
|
|
| 2850 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithSettingEnd=Logbook - Fin de calada
|
|
| 2851 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithSettingStart=Logbook - Inicio de calada
|
|
| 2852 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithStation=Logbook - Station
|
|
| 2853 |
-observe.constant.TripMapPointType.longlineActivityObs=Observation - Actividad
|
|
| 2854 |
-observe.constant.TripMapPointType.longlineActivityObsInHarbour=Observation - En el puerto
|
|
| 2855 |
-observe.constant.TripMapPointType.longlineActivityObsWithHaulingEnd=Observation - Fin de arrastre
|
|
| 2856 |
-observe.constant.TripMapPointType.longlineActivityObsWithHaulingStart=Observation - Inicio de arrastre
|
|
| 2857 |
-observe.constant.TripMapPointType.longlineActivityObsWithInteraction=Observation - Encuentro
|
|
| 2858 |
-observe.constant.TripMapPointType.longlineActivityObsWithSettingEnd=Observation - Fin de calada
|
|
| 2859 |
-observe.constant.TripMapPointType.longlineActivityObsWithSettingStart=Observation - Inicio de calada
|
|
| 2860 |
-observe.constant.TripMapPointType.longlineActivityObsWithStation=Observation - Station
|
|
| 2861 |
-observe.constant.TripMapPointType.longlineActivityWithHaulingEnd=Fin de arrastre
|
|
| 2862 |
-observe.constant.TripMapPointType.longlineActivityWithHaulingStart=Inicio de arrastre
|
|
| 2863 |
-observe.constant.TripMapPointType.longlineActivityWithInteraction=Encuentro
|
|
| 2864 |
-observe.constant.TripMapPointType.longlineActivityWithSettingEnd=Fin de calada
|
|
| 2865 |
-observe.constant.TripMapPointType.longlineActivityWithSettingStart=Inicio de calada
|
|
| 2866 |
-observe.constant.TripMapPointType.longlineActivityWithStation=Estación Oceanográfica
|
|
| 2867 |
-observe.constant.TripMapPointType.longlineDepartureHarbour=Puerto de salida
|
|
| 2868 |
-observe.constant.TripMapPointType.longlineLandingHarbour=Puerto de llegada
|
|
| 2869 |
-observe.constant.TripMapPointType.seineActivityObs=Actividad
|
|
| 2870 |
-observe.constant.TripMapPointType.seineActivityObsInHarbour=En puerto
|
|
| 2871 |
-observe.constant.TripMapPointType.seineActivityObsWithFreeSchoolType=Banco libre
|
|
| 2872 |
-observe.constant.TripMapPointType.seineActivityObsWithObjectSchoolType=Banco a objeto
|
|
| 2873 |
-observe.constant.TripMapPointType.seineDepartureHarbour=Puerto de salida
|
|
| 2874 |
-observe.constant.TripMapPointType.seineLandingHarbour=Puerto de llegada
|
|
| 2844 |
+observe.constant.TripMapPointType.llActivityLogbook=Logbook - Actividad (Other) \#TODO
|
|
| 2845 |
+observe.constant.TripMapPointType.llActivityLogbookInHarbour=Logbook - En el puerto
|
|
| 2846 |
+observe.constant.TripMapPointType.llActivityLogbookWithHaulingEnd=Logbook - Fin de arrastre
|
|
| 2847 |
+observe.constant.TripMapPointType.llActivityLogbookWithHaulingStart=Logbook - Inicio de arrastre
|
|
| 2848 |
+observe.constant.TripMapPointType.llActivityLogbookWithSettingEnd=Logbook - Fin de calada
|
|
| 2849 |
+observe.constant.TripMapPointType.llActivityLogbookWithSettingStart=Logbook - Inicio de calada
|
|
| 2850 |
+observe.constant.TripMapPointType.llActivityObs=Observation - Actividad (Other) \#TODO
|
|
| 2851 |
+observe.constant.TripMapPointType.llActivityObsInHarbour=Observation - En el puerto
|
|
| 2852 |
+observe.constant.TripMapPointType.llActivityObsWithHaulingEnd=Observation - Fin de arrastre
|
|
| 2853 |
+observe.constant.TripMapPointType.llActivityObsWithHaulingStart=Observation - Inicio de arrastre
|
|
| 2854 |
+observe.constant.TripMapPointType.llActivityObsWithSettingEnd=Observation - Fin de calada
|
|
| 2855 |
+observe.constant.TripMapPointType.llActivityObsWithSettingStart=Observation - Inicio de calada
|
|
| 2856 |
+observe.constant.TripMapPointType.llTripDepartureHarbour=Puerto de salida
|
|
| 2857 |
+observe.constant.TripMapPointType.llTripLandingHarbour=Puerto de llegada
|
|
| 2858 |
+observe.constant.TripMapPointType.psActivityObs=Actividad (Other) \#TODO
|
|
| 2859 |
+observe.constant.TripMapPointType.psActivityObsInHarbour=En puerto
|
|
| 2860 |
+observe.constant.TripMapPointType.psActivityObsWithFreeSchoolType=Banco libre
|
|
| 2861 |
+observe.constant.TripMapPointType.psActivityObsWithObjectSchoolType=Banco a objeto
|
|
| 2862 |
+observe.constant.TripMapPointType.psTripDepartureHarbour=Puerto de salida
|
|
| 2863 |
+observe.constant.TripMapPointType.psTripLandingHarbour=Puerto de llegada
|
|
| 2875 | 2864 |
observe.constant.TypeTransmittingBuoyOperation.pasDeBalise=DCP sin baliza
|
| 2876 | 2865 |
observe.constant.TypeTransmittingBuoyOperation.pose=Colocación de nueva baliza
|
| 2877 | 2866 |
observe.constant.TypeTransmittingBuoyOperation.recuperation=Recogida de baliza sin regreso al agua
|
| ... | ... | @@ -2674,7 +2674,8 @@ observe.config.map.layer6.description=Fichier (Shape Files) du sixième calque d |
| 2674 | 2674 |
observe.config.map.layer7.description=Fichier (Shape Files) du septième calque de la carte
|
| 2675 | 2675 |
observe.config.map.layer8.description=Fichier (Shape Files) du huitième calque de la carte
|
| 2676 | 2676 |
observe.config.map.layer9.description=Fichier (Shape Files) du neuvième calque de la carte
|
| 2677 |
-observe.config.map.style.description=Fichier des style à appliquer sur les calques de la carte
|
|
| 2677 |
+observe.config.map.ll.style.description=Fichier des style (Palangre) à appliquer sur les calques de la carte
|
|
| 2678 |
+observe.config.map.ps.style.description=Fichier des style (Senne) à appliquer sur les calques de la carte
|
|
| 2678 | 2679 |
observe.config.observation.activitysDetaillees=Observation des activités détaillées
|
| 2679 | 2680 |
observe.config.observation.fauneAssociee=Observation des Faunes associées
|
| 2680 | 2681 |
observe.config.observation.floatingObject=Observation des objets flottants
|
| ... | ... | @@ -2840,38 +2841,26 @@ observe.constant.StorageStep.ROLES=Sécurité |
| 2840 | 2841 |
observe.constant.StorageStep.ROLES.description=Mise en place de la sécurité
|
| 2841 | 2842 |
observe.constant.StorageStep.SELECT_DATA=Sélection données
|
| 2842 | 2843 |
observe.constant.StorageStep.SELECT_DATA.description=Sélectionner les données à exporter dans la sauvegarde
|
| 2843 |
-observe.constant.TripMapPointType.longlineActivity=point d'activité
|
|
| 2844 |
-observe.constant.TripMapPointType.longlineActivityInHarbour=Au port
|
|
| 2845 |
-observe.constant.TripMapPointType.longlineActivityLogbook=Livre de bord - point d'activité
|
|
| 2846 |
-observe.constant.TripMapPointType.longlineActivityLogbookInHarbour=Livre de bord - Au port
|
|
| 2847 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithHaulingEnd=Livre de bord - Fin de virage
|
|
| 2848 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithHaulingStart=Livre de bord - Début de virage
|
|
| 2849 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithInteraction=Livre de bord - Rencontre
|
|
| 2850 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithSettingEnd=Livre de bord - Fin de filage
|
|
| 2851 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithSettingStart=Livre de bord - Début de filage
|
|
| 2852 |
-observe.constant.TripMapPointType.longlineActivityLogbookWithStation=Livre de bord - Station océanographique
|
|
| 2853 |
-observe.constant.TripMapPointType.longlineActivityObs=Observation - point d'activité
|
|
| 2854 |
-observe.constant.TripMapPointType.longlineActivityObsInHarbour=Observation - Au port
|
|
| 2855 |
-observe.constant.TripMapPointType.longlineActivityObsWithHaulingEnd=Observation - Fin de virage
|
|
| 2856 |
-observe.constant.TripMapPointType.longlineActivityObsWithHaulingStart=Observation - Début de virage
|
|
| 2857 |
-observe.constant.TripMapPointType.longlineActivityObsWithInteraction=Observation - Rencontre
|
|
| 2858 |
-observe.constant.TripMapPointType.longlineActivityObsWithSettingEnd=Observation - Fin de filage
|
|
| 2859 |
-observe.constant.TripMapPointType.longlineActivityObsWithSettingStart=Observation - Début de filage
|
|
| 2860 |
-observe.constant.TripMapPointType.longlineActivityObsWithStation=Observation - Station océanographique
|
|
| 2861 |
-observe.constant.TripMapPointType.longlineActivityWithHaulingEnd=Fin de virage
|
|
| 2862 |
-observe.constant.TripMapPointType.longlineActivityWithHaulingStart=Début de virage
|
|
| 2863 |
-observe.constant.TripMapPointType.longlineActivityWithInteraction=Rencontre
|
|
| 2864 |
-observe.constant.TripMapPointType.longlineActivityWithSettingEnd=Fin de filage
|
|
| 2865 |
-observe.constant.TripMapPointType.longlineActivityWithSettingStart=Début de filage
|
|
| 2866 |
-observe.constant.TripMapPointType.longlineActivityWithStation=Station océanographique
|
|
| 2867 |
-observe.constant.TripMapPointType.longlineDepartureHarbour=Port de départ
|
|
| 2868 |
-observe.constant.TripMapPointType.longlineLandingHarbour=Port d'arrivée
|
|
| 2869 |
-observe.constant.TripMapPointType.seineActivityObs=point d'activité
|
|
| 2870 |
-observe.constant.TripMapPointType.seineActivityObsInHarbour=Au port
|
|
| 2871 |
-observe.constant.TripMapPointType.seineActivityObsWithFreeSchoolType=Banc libre
|
|
| 2872 |
-observe.constant.TripMapPointType.seineActivityObsWithObjectSchoolType=Banc objet
|
|
| 2873 |
-observe.constant.TripMapPointType.seineDepartureHarbour=Port de départ
|
|
| 2874 |
-observe.constant.TripMapPointType.seineLandingHarbour=Port d'arrivée
|
|
| 2844 |
+observe.constant.TripMapPointType.llActivityLogbook=Livre de bord - Activité (autre)
|
|
| 2845 |
+observe.constant.TripMapPointType.llActivityLogbookInHarbour=Livre de bord - Au port
|
|
| 2846 |
+observe.constant.TripMapPointType.llActivityLogbookWithHaulingEnd=Livre de bord - Fin de virage
|
|
| 2847 |
+observe.constant.TripMapPointType.llActivityLogbookWithHaulingStart=Livre de bord - Début de virage
|
|
| 2848 |
+observe.constant.TripMapPointType.llActivityLogbookWithSettingEnd=Livre de bord - Fin de filage
|
|
| 2849 |
+observe.constant.TripMapPointType.llActivityLogbookWithSettingStart=Livre de bord - Début de filage
|
|
| 2850 |
+observe.constant.TripMapPointType.llActivityObs=Observation - Activité (autre)
|
|
| 2851 |
+observe.constant.TripMapPointType.llActivityObsInHarbour=Observation - Au port
|
|
| 2852 |
+observe.constant.TripMapPointType.llActivityObsWithHaulingEnd=Observation - Fin de virage
|
|
| 2853 |
+observe.constant.TripMapPointType.llActivityObsWithHaulingStart=Observation - Début de virage
|
|
| 2854 |
+observe.constant.TripMapPointType.llActivityObsWithSettingEnd=Observation - Fin de filage
|
|
| 2855 |
+observe.constant.TripMapPointType.llActivityObsWithSettingStart=Observation - Début de filage
|
|
| 2856 |
+observe.constant.TripMapPointType.llTripDepartureHarbour=Port de départ
|
|
| 2857 |
+observe.constant.TripMapPointType.llTripLandingHarbour=Port d'arrivée
|
|
| 2858 |
+observe.constant.TripMapPointType.psActivityObs=Activité (autre)
|
|
| 2859 |
+observe.constant.TripMapPointType.psActivityObsInHarbour=Au port
|
|
| 2860 |
+observe.constant.TripMapPointType.psActivityObsWithFreeSchoolType=Banc libre
|
|
| 2861 |
+observe.constant.TripMapPointType.psActivityObsWithObjectSchoolType=Banc objet
|
|
| 2862 |
+observe.constant.TripMapPointType.psTripDepartureHarbour=Port de départ
|
|
| 2863 |
+observe.constant.TripMapPointType.psTripLandingHarbour=Port d'arrivée
|
|
| 2875 | 2864 |
observe.constant.TypeTransmittingBuoyOperation.pasDeBalise=Pas de balise liée au DCP
|
| 2876 | 2865 |
observe.constant.TypeTransmittingBuoyOperation.pose=Pose d'une nouvelle balise
|
| 2877 | 2866 |
observe.constant.TypeTransmittingBuoyOperation.recuperation=Récupération d'une balise sans remise à l'eau
|
| ... | ... | @@ -10,12 +10,12 @@ package fr.ird.observe.entities.data.ll.common; |
| 10 | 10 |
* it under the terms of the GNU General Public License as
|
| 11 | 11 |
* published by the Free Software Foundation, either version 3 of the
|
| 12 | 12 |
* License, or (at your option) any later version.
|
| 13 |
- *
|
|
| 13 |
+ *
|
|
| 14 | 14 |
* This program is distributed in the hope that it will be useful,
|
| 15 | 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 16 | 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 17 | 17 |
* GNU General Public License for more details.
|
| 18 |
- *
|
|
| 18 |
+ *
|
|
| 19 | 19 |
* You should have received a copy of the GNU General Public
|
| 20 | 20 |
* License along with this program. If not, see
|
| 21 | 21 |
* <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| ... | ... | @@ -23,7 +23,6 @@ package fr.ird.observe.entities.data.ll.common; |
| 23 | 23 |
*/
|
| 24 | 24 |
|
| 25 | 25 |
import com.google.common.collect.ImmutableMap;
|
| 26 |
-import com.google.common.collect.Lists;
|
|
| 27 | 26 |
import fr.ird.observe.dto.data.TripMapConfigDto;
|
| 28 | 27 |
import fr.ird.observe.dto.data.TripMapPoint;
|
| 29 | 28 |
import fr.ird.observe.dto.data.TripMapPointType;
|
| ... | ... | @@ -40,19 +39,21 @@ import java.sql.Timestamp; |
| 40 | 39 |
import java.util.Collections;
|
| 41 | 40 |
import java.util.Date;
|
| 42 | 41 |
import java.util.LinkedHashSet;
|
| 42 |
+import java.util.LinkedList;
|
|
| 43 | 43 |
import java.util.List;
|
| 44 | 44 |
import java.util.Objects;
|
| 45 |
+import java.util.Optional;
|
|
| 45 | 46 |
import java.util.stream.Collectors;
|
| 46 | 47 |
|
| 47 | 48 |
public class TripLonglineTopiaDao extends AbstractTripLonglineTopiaDao<TripLongline> {
|
| 48 | 49 |
//FIXME-PROTECTED-ID
|
| 49 |
- public static final String ACTIVITY_OBS_INTERACTION_ID= "fr.ird.referential.ll.common.VesselActivityLongline#1239832686138#0.4";
|
|
| 50 |
+ public static final String ACTIVITY_OBS_INTERACTION_ID = "fr.ird.referential.ll.common.VesselActivityLongline#1239832686138#0.4";
|
|
| 50 | 51 |
//FIXME-PROTECTED-ID
|
| 51 |
- public static final String ACTIVITY_LOGBOOK_INTERACTION_ID= "fr.ird.referential.ll.common.VesselActivityLongline#1239832686138#0.4";
|
|
| 52 |
+ public static final String ACTIVITY_LOGBOOK_INTERACTION_ID = "fr.ird.referential.ll.common.VesselActivityLongline#1239832686138#0.4";
|
|
| 52 | 53 |
//FIXME-PROTECTED-ID
|
| 53 |
- public static final String ACTIVITY_OBS_STATION_ID= "fr.ird.referential.ll.common.VesselActivityLongline#1239832686138#0.3";
|
|
| 54 |
+ public static final String ACTIVITY_OBS_STATION_ID = "fr.ird.referential.ll.common.VesselActivityLongline#1239832686138#0.3";
|
|
| 54 | 55 |
//FIXME-PROTECTED-ID
|
| 55 |
- public static final String ACTIVITY_LOGBOOK_STATION_ID= "fr.ird.referential.ll.common.VesselActivityLongline#1239832686138#0.3";
|
|
| 56 |
+ public static final String ACTIVITY_LOGBOOK_STATION_ID = "fr.ird.referential.ll.common.VesselActivityLongline#1239832686138#0.3";
|
|
| 56 | 57 |
|
| 57 | 58 |
public LinkedHashSet<TripMapPoint> extractTripMapActivityPoints(TripMapConfigDto tripMapConfig) {
|
| 58 | 59 |
|
| ... | ... | @@ -63,18 +64,8 @@ public class TripLonglineTopiaDao extends AbstractTripLonglineTopiaDao<TripLongl |
| 63 | 64 |
|
| 64 | 65 |
LinkedHashSet<TripMapPoint> tripMapPoints = new LinkedHashSet<>();
|
| 65 | 66 |
|
| 66 |
- // add departure harbours
|
|
| 67 |
- Harbour departureHarbour = tripLongline.getDepartureHarbour();
|
|
| 68 |
- if (departureHarbour != null
|
|
| 69 |
- && departureHarbour.getLatitude() != null
|
|
| 70 |
- && departureHarbour.getLongitude() != null) {
|
|
| 71 |
- TripMapPoint departurePoint = new TripMapPoint();
|
|
| 72 |
- departurePoint.setTime(tripLongline.getStartDate());
|
|
| 73 |
- departurePoint.setLatitude(departureHarbour.getLatitude());
|
|
| 74 |
- departurePoint.setLongitude(departureHarbour.getLongitude());
|
|
| 75 |
- departurePoint.setType(TripMapPointType.longlineDepartureHarbour);
|
|
| 76 |
- tripMapPoints.add(departurePoint);
|
|
| 77 |
- }
|
|
| 67 |
+ // add departure harbour
|
|
| 68 |
+ createPoint(tripLongline.getDepartureHarbour(), tripLongline.getStartDate(), TripMapPointType.llTripDepartureHarbour).map(tripMapPoints::add);
|
|
| 78 | 69 |
|
| 79 | 70 |
if (addObservation) {
|
| 80 | 71 |
// Add Activities Observation
|
| ... | ... | @@ -89,19 +80,8 @@ public class TripLonglineTopiaDao extends AbstractTripLonglineTopiaDao<TripLongl |
| 89 | 80 |
results.forEach(tripMapPoints::addAll);
|
| 90 | 81 |
}
|
| 91 | 82 |
|
| 92 |
- // add landing harbours
|
|
| 93 |
- Harbour landingHarbour = tripLongline.getLandingHarbour();
|
|
| 94 |
- if (landingHarbour != null
|
|
| 95 |
- && landingHarbour.getLatitude() != null
|
|
| 96 |
- && landingHarbour.getLongitude() != null) {
|
|
| 97 |
- TripMapPoint landingPoint = new TripMapPoint();
|
|
| 98 |
- landingPoint.setTime(tripLongline.getEndDate());
|
|
| 99 |
- landingPoint.setLatitude(landingHarbour.getLatitude());
|
|
| 100 |
- landingPoint.setLongitude(landingHarbour.getLongitude());
|
|
| 101 |
- landingPoint.setType(TripMapPointType.longlineLandingHarbour);
|
|
| 102 |
- tripMapPoints.add(landingPoint);
|
|
| 103 |
- }
|
|
| 104 |
- |
|
| 83 |
+ // add landing harbour
|
|
| 84 |
+ createPoint(tripLongline.getLandingHarbour(), tripLongline.getEndDate(), TripMapPointType.llTripLandingHarbour).map(tripMapPoints::add);
|
|
| 105 | 85 |
return tripMapPoints;
|
| 106 | 86 |
}
|
| 107 | 87 |
|
| ... | ... | @@ -163,9 +143,10 @@ public class TripLonglineTopiaDao extends AbstractTripLonglineTopiaDao<TripLongl |
| 163 | 143 |
"vesselId", vesselId,
|
| 164 | 144 |
"startDate", startDate,
|
| 165 | 145 |
"endDate", endDate))
|
| 166 |
- .filter(t -> !Objects.equals(id ,t.getTopiaId()))
|
|
| 146 |
+ .filter(t -> !Objects.equals(id, t.getTopiaId()))
|
|
| 167 | 147 |
.collect(Collectors.toList());
|
| 168 | 148 |
}
|
| 149 |
+ |
|
| 169 | 150 |
private static class TripMapActivityObsPointQuery extends TopiaSqlQuery<List<TripMapPoint>> {
|
| 170 | 151 |
|
| 171 | 152 |
private static final String SQL = "SELECT" +
|
| ... | ... | @@ -207,69 +188,29 @@ public class TripLonglineTopiaDao extends AbstractTripLonglineTopiaDao<TripLongl |
| 207 | 188 |
@Override
|
| 208 | 189 |
public List<TripMapPoint> prepareResult(ResultSet resultSet) throws SQLException {
|
| 209 | 190 |
|
| 210 |
- List<TripMapPoint> result = Lists.newLinkedList();
|
|
| 191 |
+ List<TripMapPoint> result = new LinkedList<>();
|
|
| 211 | 192 |
|
| 212 | 193 |
if (resultSet.getString(5) == null) {
|
| 213 |
- |
|
| 214 |
- // activity
|
|
| 215 |
- TripMapPoint activity = new TripMapPoint();
|
|
| 216 |
- activity.setTime(resultSet.getDate(1));
|
|
| 217 |
- activity.setLatitude(resultSet.getFloat(2));
|
|
| 218 |
- activity.setLongitude(resultSet.getFloat(3));
|
|
| 219 |
- |
|
| 220 |
- String vesselActivityId = resultSet.getString(4);
|
|
| 221 |
- if (vesselActivityId == null) {
|
|
| 222 |
- activity.setType(TripMapPointType.longlineActivityObs);
|
|
| 223 |
- } else if (ACTIVITY_OBS_INTERACTION_ID.equals(vesselActivityId)) {
|
|
| 224 |
- activity.setType(TripMapPointType.longlineActivityObsWithInteraction);
|
|
| 225 |
- } else if (ACTIVITY_OBS_STATION_ID.equals(vesselActivityId)) {
|
|
| 226 |
- activity.setType(TripMapPointType.longlineActivityObsWithStation);
|
|
| 227 |
- } else {
|
|
| 228 |
- activity.setType(TripMapPointType.longlineActivityObs);
|
|
| 229 |
- }
|
|
| 230 |
- |
|
| 231 |
- result.add(activity);
|
|
| 194 |
+ // simple activity
|
|
| 195 |
+ Optional<TripMapPoint> activity = createPoint(resultSet, 1, TripMapPointType.llActivityObs);
|
|
| 196 |
+ activity.ifPresent(result::add);
|
|
| 232 | 197 |
}
|
| 233 | 198 |
|
| 234 | 199 |
// settingStart
|
| 235 |
- if (resultSet.getString(5) != null) {
|
|
| 236 |
- TripMapPoint settingStart = new TripMapPoint();
|
|
| 237 |
- settingStart.setTime(resultSet.getDate(5));
|
|
| 238 |
- settingStart.setLatitude(resultSet.getFloat(6));
|
|
| 239 |
- settingStart.setLongitude(resultSet.getFloat(7));
|
|
| 240 |
- settingStart.setType(TripMapPointType.longlineActivityObsWithSettingStart);
|
|
| 241 |
- result.add(settingStart);
|
|
| 242 |
- }
|
|
| 200 |
+ Optional<TripMapPoint> settingStart = createPoint(resultSet, 5, TripMapPointType.llActivityObsWithSettingStart);
|
|
| 201 |
+ settingStart.ifPresent(result::add);
|
|
| 243 | 202 |
|
| 244 | 203 |
// settingEnd
|
| 245 |
- if (resultSet.getString(8) != null) {
|
|
| 246 |
- TripMapPoint settingEnd = new TripMapPoint();
|
|
| 247 |
- settingEnd.setTime(resultSet.getDate(8));
|
|
| 248 |
- settingEnd.setLatitude(resultSet.getFloat(9));
|
|
| 249 |
- settingEnd.setLongitude(resultSet.getFloat(10));
|
|
| 250 |
- settingEnd.setType(TripMapPointType.longlineActivityObsWithSettingEnd);
|
|
| 251 |
- result.add(settingEnd);
|
|
| 252 |
- }
|
|
| 204 |
+ Optional<TripMapPoint> settingEnd = createPoint(resultSet, 8, TripMapPointType.llActivityObsWithSettingEnd);
|
|
| 205 |
+ settingEnd.ifPresent(result::add);
|
|
| 253 | 206 |
|
| 254 | 207 |
// haulingStart
|
| 255 |
- if (resultSet.getString(11) != null) {
|
|
| 256 |
- TripMapPoint haulingStart = new TripMapPoint();
|
|
| 257 |
- haulingStart.setTime(resultSet.getDate(11));
|
|
| 258 |
- haulingStart.setLatitude(resultSet.getFloat(12));
|
|
| 259 |
- haulingStart.setLongitude(resultSet.getFloat(13));
|
|
| 260 |
- haulingStart.setType(TripMapPointType.longlineActivityObsWithHaulingStart);
|
|
| 261 |
- result.add(haulingStart);
|
|
| 262 |
- }
|
|
| 208 |
+ Optional<TripMapPoint> haulingStart = createPoint(resultSet, 11, TripMapPointType.llActivityObsWithHaulingStart);
|
|
| 209 |
+ haulingStart.ifPresent(result::add);
|
|
| 263 | 210 |
|
| 264 | 211 |
// haulingEnd
|
| 265 |
- if (resultSet.getString(14) != null) {
|
|
| 266 |
- TripMapPoint haulingEnd = new TripMapPoint();
|
|
| 267 |
- haulingEnd.setTime(resultSet.getDate(14));
|
|
| 268 |
- haulingEnd.setLatitude(resultSet.getFloat(15));
|
|
| 269 |
- haulingEnd.setLongitude(resultSet.getFloat(16));
|
|
| 270 |
- haulingEnd.setType(TripMapPointType.longlineActivityObsWithHaulingEnd);
|
|
| 271 |
- result.add(haulingEnd);
|
|
| 272 |
- }
|
|
| 212 |
+ Optional<TripMapPoint> haulingEnd = createPoint(resultSet, 14, TripMapPointType.llActivityObsWithHaulingEnd);
|
|
| 213 |
+ haulingEnd.ifPresent(result::add);
|
|
| 273 | 214 |
|
| 274 | 215 |
return result;
|
| 275 | 216 |
}
|
| ... | ... | @@ -316,69 +257,29 @@ public class TripLonglineTopiaDao extends AbstractTripLonglineTopiaDao<TripLongl |
| 316 | 257 |
@Override
|
| 317 | 258 |
public List<TripMapPoint> prepareResult(ResultSet resultSet) throws SQLException {
|
| 318 | 259 |
|
| 319 |
- List<TripMapPoint> result = Lists.newLinkedList();
|
|
| 260 |
+ List<TripMapPoint> result = new LinkedList<>();
|
|
| 320 | 261 |
|
| 321 | 262 |
if (resultSet.getString(5) == null) {
|
| 322 |
- |
|
| 323 |
- // activity
|
|
| 324 |
- TripMapPoint activity = new TripMapPoint();
|
|
| 325 |
- activity.setTime(resultSet.getDate(1));
|
|
| 326 |
- activity.setLatitude(resultSet.getFloat(2));
|
|
| 327 |
- activity.setLongitude(resultSet.getFloat(3));
|
|
| 328 |
- |
|
| 329 |
- String vesselActivityId = resultSet.getString(4);
|
|
| 330 |
- if (vesselActivityId == null) {
|
|
| 331 |
- activity.setType(TripMapPointType.longlineActivityLogbook);
|
|
| 332 |
- } else if (ACTIVITY_LOGBOOK_INTERACTION_ID.equals(vesselActivityId)) {
|
|
| 333 |
- activity.setType(TripMapPointType.longlineActivityLogbookWithInteraction);
|
|
| 334 |
- } else if (ACTIVITY_LOGBOOK_STATION_ID.equals(vesselActivityId)) {
|
|
| 335 |
- activity.setType(TripMapPointType.longlineActivityLogbookWithStation);
|
|
| 336 |
- } else {
|
|
| 337 |
- activity.setType(TripMapPointType.longlineActivityLogbook);
|
|
| 338 |
- }
|
|
| 339 |
- |
|
| 340 |
- result.add(activity);
|
|
| 263 |
+ // simple activity
|
|
| 264 |
+ Optional<TripMapPoint> activity = createPoint(resultSet, 1, TripMapPointType.llActivityLogbook);
|
|
| 265 |
+ activity.ifPresent(result::add);
|
|
| 341 | 266 |
}
|
| 342 | 267 |
|
| 343 | 268 |
// settingStart
|
| 344 |
- if (resultSet.getString(5) != null) {
|
|
| 345 |
- TripMapPoint settingStart = new TripMapPoint();
|
|
| 346 |
- settingStart.setTime(resultSet.getDate(5));
|
|
| 347 |
- settingStart.setLatitude(resultSet.getFloat(6));
|
|
| 348 |
- settingStart.setLongitude(resultSet.getFloat(7));
|
|
| 349 |
- settingStart.setType(TripMapPointType.longlineActivityLogbookWithSettingStart);
|
|
| 350 |
- result.add(settingStart);
|
|
| 351 |
- }
|
|
| 269 |
+ Optional<TripMapPoint> settingStart = createPoint(resultSet, 5, TripMapPointType.llActivityLogbookWithSettingStart);
|
|
| 270 |
+ settingStart.ifPresent(result::add);
|
|
| 352 | 271 |
|
| 353 | 272 |
// settingEnd
|
| 354 |
- if (resultSet.getString(8) != null) {
|
|
| 355 |
- TripMapPoint settingEnd = new TripMapPoint();
|
|
| 356 |
- settingEnd.setTime(resultSet.getDate(8));
|
|
| 357 |
- settingEnd.setLatitude(resultSet.getFloat(9));
|
|
| 358 |
- settingEnd.setLongitude(resultSet.getFloat(10));
|
|
| 359 |
- settingEnd.setType(TripMapPointType.longlineActivityLogbookWithSettingEnd);
|
|
| 360 |
- result.add(settingEnd);
|
|
| 361 |
- }
|
|
| 273 |
+ Optional<TripMapPoint> settingEnd = createPoint(resultSet, 8, TripMapPointType.llActivityLogbookWithSettingEnd);
|
|
| 274 |
+ settingEnd.ifPresent(result::add);
|
|
| 362 | 275 |
|
| 363 | 276 |
// haulingStart
|
| 364 |
- if (resultSet.getString(11) != null) {
|
|
| 365 |
- TripMapPoint haulingStart = new TripMapPoint();
|
|
| 366 |
- haulingStart.setTime(resultSet.getDate(11));
|
|
| 367 |
- haulingStart.setLatitude(resultSet.getFloat(12));
|
|
| 368 |
- haulingStart.setLongitude(resultSet.getFloat(13));
|
|
| 369 |
- haulingStart.setType(TripMapPointType.longlineActivityLogbookWithHaulingStart);
|
|
| 370 |
- result.add(haulingStart);
|
|
| 371 |
- }
|
|
| 277 |
+ Optional<TripMapPoint> haulingStart = createPoint(resultSet, 11, TripMapPointType.llActivityLogbookWithHaulingStart);
|
|
| 278 |
+ haulingStart.ifPresent(result::add);
|
|
| 372 | 279 |
|
| 373 | 280 |
// haulingEnd
|
| 374 |
- if (resultSet.getString(14) != null) {
|
|
| 375 |
- TripMapPoint haulingEnd = new TripMapPoint();
|
|
| 376 |
- haulingEnd.setTime(resultSet.getDate(14));
|
|
| 377 |
- haulingEnd.setLatitude(resultSet.getFloat(15));
|
|
| 378 |
- haulingEnd.setLongitude(resultSet.getFloat(16));
|
|
| 379 |
- haulingEnd.setType(TripMapPointType.longlineActivityLogbookWithHaulingEnd);
|
|
| 380 |
- result.add(haulingEnd);
|
|
| 381 |
- }
|
|
| 281 |
+ Optional<TripMapPoint> haulingEnd = createPoint(resultSet, 14, TripMapPointType.llActivityLogbookWithHaulingEnd);
|
|
| 282 |
+ haulingEnd.ifPresent(result::add);
|
|
| 382 | 283 |
|
| 383 | 284 |
return result;
|
| 384 | 285 |
}
|
| ... | ... | @@ -421,4 +322,30 @@ public class TripLonglineTopiaDao extends AbstractTripLonglineTopiaDao<TripLongl |
| 421 | 322 |
}
|
| 422 | 323 |
|
| 423 | 324 |
}
|
| 325 |
+ |
|
| 326 |
+ private static Optional<TripMapPoint> createPoint(Harbour harbour, Date date, TripMapPointType tripMapPointType) {
|
|
| 327 |
+ TripMapPoint result = null;
|
|
| 328 |
+ if (harbour != null && harbour.getLatitude() != null && harbour.getLongitude() != null) {
|
|
| 329 |
+ result = new TripMapPoint();
|
|
| 330 |
+ result.setTime(date);
|
|
| 331 |
+ result.setLatitude(harbour.getLatitude());
|
|
| 332 |
+ result.setLongitude(harbour.getLongitude());
|
|
| 333 |
+ result.setType(tripMapPointType);
|
|
| 334 |
+ }
|
|
| 335 |
+ return Optional.ofNullable(result);
|
|
| 336 |
+ }
|
|
| 337 |
+ |
|
| 338 |
+ private static Optional<TripMapPoint> createPoint(ResultSet resultSet, int dateColumnIndex, TripMapPointType tripMapPointType) throws SQLException {
|
|
| 339 |
+ |
|
| 340 |
+ TripMapPoint result = null;
|
|
| 341 |
+ if (resultSet.getString(dateColumnIndex) != null) {
|
|
| 342 |
+ result = new TripMapPoint();
|
|
| 343 |
+ result.setTime(resultSet.getDate(dateColumnIndex));
|
|
| 344 |
+ result.setLatitude(resultSet.getFloat(dateColumnIndex + 1));
|
|
| 345 |
+ result.setLongitude(resultSet.getFloat(dateColumnIndex + 2));
|
|
| 346 |
+ result.setType(tripMapPointType);
|
|
| 347 |
+ }
|
|
| 348 |
+ return Optional.ofNullable(result);
|
|
| 349 |
+ }
|
|
| 350 |
+ |
|
| 424 | 351 |
}
|
| ... | ... | @@ -40,6 +40,7 @@ import java.util.Date; |
| 40 | 40 |
import java.util.LinkedHashSet;
|
| 41 | 41 |
import java.util.List;
|
| 42 | 42 |
import java.util.Objects;
|
| 43 |
+import java.util.Optional;
|
|
| 43 | 44 |
import java.util.stream.Collectors;
|
| 44 | 45 |
|
| 45 | 46 |
/**
|
| ... | ... | @@ -58,31 +59,15 @@ public class TripSeineTopiaDao extends AbstractTripSeineTopiaDao<TripSeine> { |
| 58 | 59 |
|
| 59 | 60 |
LinkedHashSet<TripMapPoint> tripMapPoints = new LinkedHashSet<>();
|
| 60 | 61 |
|
| 61 |
- // add departure harbours
|
|
| 62 |
- Harbour departureHarbour = tripSeine.getDepartureHarbour();
|
|
| 63 |
- if (departureHarbour != null && departureHarbour.getLatitude() != null && departureHarbour.getLongitude() != null) {
|
|
| 64 |
- TripMapPoint departurePoint = new TripMapPoint();
|
|
| 65 |
- departurePoint.setTime(tripSeine.getStartDate());
|
|
| 66 |
- departurePoint.setLatitude(departureHarbour.getLatitude());
|
|
| 67 |
- departurePoint.setLongitude(departureHarbour.getLongitude());
|
|
| 68 |
- departurePoint.setType(TripMapPointType.seineDepartureHarbour);
|
|
| 69 |
- tripMapPoints.add(departurePoint);
|
|
| 70 |
- }
|
|
| 62 |
+ // add departure harbour
|
|
| 63 |
+ createPoint(tripSeine.getDepartureHarbour(), tripSeine.getStartDate(), TripMapPointType.psTripDepartureHarbour).map(tripMapPoints::add);
|
|
| 71 | 64 |
|
| 72 | 65 |
// Add Activities
|
| 73 | 66 |
TripMapActivityPointQuery tripMapActivityPointQuery = new TripMapActivityPointQuery(tripId);
|
| 74 | 67 |
tripMapPoints.addAll(topiaSqlSupport.findMultipleResult(tripMapActivityPointQuery));
|
| 75 | 68 |
|
| 76 |
- // add landing harbours
|
|
| 77 |
- Harbour landingHarbour = tripSeine.getLandingHarbour();
|
|
| 78 |
- if (landingHarbour != null && landingHarbour.getLatitude() != null && landingHarbour.getLongitude() != null) {
|
|
| 79 |
- TripMapPoint landingPoint = new TripMapPoint();
|
|
| 80 |
- landingPoint.setTime(tripSeine.getEndDate());
|
|
| 81 |
- landingPoint.setLatitude(landingHarbour.getLatitude());
|
|
| 82 |
- landingPoint.setLongitude(landingHarbour.getLongitude());
|
|
| 83 |
- landingPoint.setType(TripMapPointType.seineLandingHarbour);
|
|
| 84 |
- tripMapPoints.add(landingPoint);
|
|
| 85 |
- }
|
|
| 69 |
+ // add landing harbour
|
|
| 70 |
+ createPoint(tripSeine.getLandingHarbour(), tripSeine.getEndDate(), TripMapPointType.psTripLandingHarbour).map(tripMapPoints::add);
|
|
| 86 | 71 |
|
| 87 | 72 |
return tripMapPoints;
|
| 88 | 73 |
}
|
| ... | ... | @@ -142,31 +127,26 @@ public class TripSeineTopiaDao extends AbstractTripSeineTopiaDao<TripSeine> { |
| 142 | 127 |
point.setLatitude(resultSet.getFloat(3));
|
| 143 | 128 |
point.setLongitude(resultSet.getFloat(4));
|
| 144 | 129 |
if (ACTIVITY_HARBOUR_ID.equals(resultSet.getString(5))) {
|
| 145 |
- point.setType(TripMapPointType.seineActivityObsInHarbour);
|
|
| 130 |
+ point.setType(TripMapPointType.psActivityObsInHarbour);
|
|
| 146 | 131 |
} else if (resultSet.getString(6) == null) {
|
| 147 |
- point.setType(TripMapPointType.seineActivityObs);
|
|
| 132 |
+ point.setType(TripMapPointType.psActivityObs);
|
|
| 148 | 133 |
} else {
|
| 149 | 134 |
String schoolType = resultSet.getString(6);
|
| 150 | 135 |
switch (schoolType) {
|
| 151 | 136 |
case SchoolTypeHelper.SCHOOL_TYPE_FREE_ID:
|
| 152 |
- point.setType(TripMapPointType.seineActivityObsWithFreeSchoolType);
|
|
| 137 |
+ point.setType(TripMapPointType.psActivityObsWithFreeSchoolType);
|
|
| 153 | 138 |
break;
|
| 154 | 139 |
case SchoolTypeHelper.SCHOOL_TYPE_OBJECT_ID:
|
| 155 |
- point.setType(TripMapPointType.seineActivityObsWithObjectSchoolType);
|
|
| 156 |
- break;
|
|
| 157 |
- case SchoolTypeHelper.SCHOOL_TYPE_UNDEFINED_ID:
|
|
| 158 |
- point.setType(TripMapPointType.seineActivityObs);
|
|
| 140 |
+ point.setType(TripMapPointType.psActivityObsWithObjectSchoolType);
|
|
| 159 | 141 |
break;
|
| 160 | 142 |
default:
|
| 161 |
- point.setType(TripMapPointType.seineActivityObs);
|
|
| 143 |
+ point.setType(TripMapPointType.psActivityObs);
|
|
| 162 | 144 |
}
|
| 163 |
- |
|
| 164 | 145 |
}
|
| 165 |
- |
|
| 166 | 146 |
return point;
|
| 167 | 147 |
}
|
| 168 |
- }
|
|
| 169 | 148 |
|
| 149 |
+ }
|
|
| 170 | 150 |
public boolean updateEndDate(TripSeine trip) {
|
| 171 | 151 |
|
| 172 | 152 |
boolean wasUpdated = false;
|
| ... | ... | @@ -252,4 +232,16 @@ public class TripSeineTopiaDao extends AbstractTripSeineTopiaDao<TripSeine> { |
| 252 | 232 |
|
| 253 | 233 |
}
|
| 254 | 234 |
|
| 235 |
+ private static Optional<TripMapPoint> createPoint(Harbour harbour, Date date, TripMapPointType tripMapPointType) {
|
|
| 236 |
+ TripMapPoint result = null;
|
|
| 237 |
+ if (harbour != null && harbour.getLatitude() != null && harbour.getLongitude() != null) {
|
|
| 238 |
+ result = new TripMapPoint();
|
|
| 239 |
+ result.setTime(date);
|
|
| 240 |
+ result.setLatitude(harbour.getLatitude());
|
|
| 241 |
+ result.setLongitude(harbour.getLongitude());
|
|
| 242 |
+ result.setType(tripMapPointType);
|
|
| 243 |
+ }
|
|
| 244 |
+ return Optional.ofNullable(result);
|
|
| 245 |
+ }
|
|
| 246 |
+ |
|
| 255 | 247 |
}
|