Search in sources :

Example 1 with VesselPositionEvent

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselPositionEvent 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;
}
Also used : Geometry(com.vividsolutions.jts.geom.Geometry) VesselPositionEvent(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselPositionEvent) VesselPositionEventEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselPositionEventEntity) HashSet(java.util.HashSet)

Aggregations

Geometry (com.vividsolutions.jts.geom.Geometry)1 VesselPositionEventEntity (eu.europa.ec.fisheries.ers.fa.entities.VesselPositionEventEntity)1 HashSet (java.util.HashSet)1 VesselPositionEvent (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselPositionEvent)1