use of eu.europa.ec.fisheries.ers.fa.entities.VesselPositionEventEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class AreaDtoMapper method getTransmission.
protected PositionDto getTransmission(FishingActivityEntity faEntity) {
if (faEntity == null) {
return null;
}
PositionDto positionDto = new PositionDto();
if (faEntity.getFaReportDocument() != null && faEntity.getFaReportDocument().getVesselTransportMeans() != null && CollectionUtils.isNotEmpty(faEntity.getFaReportDocument().getVesselTransportMeans()) && CollectionUtils.isNotEmpty(faEntity.getFaReportDocument().getVesselTransportMeans().iterator().next().getVesselPositionEvents())) {
VesselPositionEventEntity vesselPositionEventEntity = faEntity.getFaReportDocument().getVesselTransportMeans().iterator().next().getVesselPositionEvents().iterator().next();
positionDto.setOccurence(vesselPositionEventEntity.getObtainedOccurrenceDateTime());
;
positionDto.setGeometry(extractGeometryWkt(vesselPositionEventEntity.getLongitude(), vesselPositionEventEntity.getLatitude()));
} else if (faEntity.getFaReportDocument() != null) {
positionDto.setOccurence(faEntity.getFaReportDocument().getAcceptedDatetime());
}
return positionDto;
}
use of eu.europa.ec.fisheries.ers.fa.entities.VesselPositionEventEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class VesselTransportMeansMapper method getVesselPositionEventEntities.
protected Set<VesselPositionEventEntity> getVesselPositionEventEntities(List<VesselPositionEvent> specifiedVesselPositionEvents, VesselTransportMeansEntity vesselTransportMeansEntity) {
if (specifiedVesselPositionEvents == null || specifiedVesselPositionEvents.isEmpty()) {
return Collections.emptySet();
}
Set<VesselPositionEventEntity> vesselPositionEventEntities = new HashSet<>();
for (VesselPositionEvent vesselPositionEvent : specifiedVesselPositionEvents) {
VesselPositionEventEntity entity = VesselPositionEventMapper.INSTANCE.mapToVesselPositionEventEntity(vesselPositionEvent, vesselTransportMeansEntity);
Geometry point = GeometryUtils.createPoint(entity.getLongitude(), entity.getLatitude());
entity.setGeom(point);
vesselPositionEventEntities.add(entity);
}
return vesselPositionEventEntities;
}
Aggregations