use of eu.europa.ec.fisheries.uvms.commons.geometry.model.StringWrapper in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingTripIdWithGeometryMapper method getGeometryMultiPointForAllFishingActivities.
private String getGeometryMultiPointForAllFishingActivities(List<FishingActivityEntity> fishingActivities) {
if (CollectionUtils.isEmpty(fishingActivities) || fishingActivities.get(0) == null) {
return null;
}
String GeometryWkt = null;
List<Geometry> activityGeomList = new ArrayList<>();
for (FishingActivityEntity fishingActivityEntity : fishingActivities) {
if (fishingActivityEntity.getGeom() != null) {
activityGeomList.add(fishingActivityEntity.getGeom());
}
}
if (CollectionUtils.isNotEmpty(activityGeomList)) {
Geometry geometry = GeometryUtils.createMultipoint(activityGeomList);
StringWrapper stringWrapper = GeometryMapper.INSTANCE.geometryToWkt(geometry);
if (stringWrapper != null) {
return stringWrapper.getValue();
}
}
return GeometryWkt;
}
Aggregations