/** * {@inheritDoc} */ @Override public final LocationReference encodeData(final RawLocationReference rawLocRef, final int version) { LocationReferencePoint startLRP = rawLocRef.getLocationReferencePoints().get(0); LocationReferencePoint endLRP = rawLocRef.getLocationReferencePoints().get(1); Offsets od = rawLocRef.getOffsets(); SideOfRoad s = rawLocRef.getSideOfRoad(); Orientation o = rawLocRef.getOrientation(); OpenLR xmlData = OBJECT_FACTORY.createOpenLR(); String id = ""; if (rawLocRef.hasID()) { id = rawLocRef.getID(); } xmlData.setLocationID(id); XMLLocationReference xmlLoc = createXMLPointAlongLineLocRef(startLRP, endLRP, od, s, o); xmlData.setXMLLocationReference(xmlLoc); LocationReference locRefData = new LocationReferenceXmlImpl(id, xmlData, version); return locRefData; }
/** * {@inheritDoc} */ @Override public final LocationReference encodeData(final RawLocationReference rawLocRef, final int version) { LocationReferencePoint startLRP = rawLocRef.getLocationReferencePoints().get(0); LocationReferencePoint endLRP = rawLocRef.getLocationReferencePoints().get(1); Offsets od = rawLocRef.getOffsets(); GeoCoordinates coord = rawLocRef.getGeoCoordinates(); SideOfRoad s = rawLocRef.getSideOfRoad(); Orientation o = rawLocRef.getOrientation(); OpenLR xmlData = OBJECT_FACTORY.createOpenLR(); String id = ""; if (rawLocRef.hasID()) { id = rawLocRef.getID(); } xmlData.setLocationID(id); XMLLocationReference xmlLoc = createXMLPointWithAccessLocRef(startLRP, endLRP, od, coord, s, o); xmlData.setXMLLocationReference(xmlLoc); LocationReference locRefData = new LocationReferenceXmlImpl(id, xmlData, version); return locRefData; }
/** * {@inheritDoc} */ @Override public final LocationReference encodeData(final RawLocationReference rawLocRef, final int version) { List<? extends LocationReferencePoint> locRef = rawLocRef.getLocationReferencePoints(); Offsets od = rawLocRef.getOffsets(); if (locRef == null || od == null) { return new LocationReferenceXmlImpl(rawLocRef.getID(), XmlReturnCode.INVALID_DATA, LocationType.LINE_LOCATION, version); } OpenLR xmlData = OBJECT_FACTORY.createOpenLR(); String id = ""; if (rawLocRef.hasID()) { id = rawLocRef.getID(); } xmlData.setLocationID(id); XMLLocationReference xmlLoc = createXMLLineLocRef(locRef, od); xmlData.setXMLLocationReference(xmlLoc); LocationReference locRefData = new LocationReferenceXmlImpl(id, xmlData, version); return locRefData; }
LocationReferencePoint endLRP = rawLocRef.getLocationReferencePoints() .get(1); Offsets od = rawLocRef.getOffsets(); SideOfRoad s = rawLocRef.getSideOfRoad(); Orientation o = rawLocRef.getOrientation();
LocationReferencePoint endLRP = rawLocRef.getLocationReferencePoints() .get(1); Offsets od = rawLocRef.getOffsets(); GeoCoordinates coord = rawLocRef.getGeoCoordinates(); SideOfRoad s = rawLocRef.getSideOfRoad();
Offsets od = rawLocRef.getOffsets(); if (locRef == null || od == null || locRef.isEmpty()) { return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.MISSING_DATA, LocationType.LINE_LOCATION, version);