/** * Gets the lr ps. * * @return the LR ps * {@inheritDoc} */ @Override public final List<? extends LocationReferencePoint> getLRPs() { if (rawData == null || rawData.getLocationReferencePoints() == null) { return null; } return rawData.getLocationReferencePoints(); }
/** * Gets the nr of lr ps. * * @return the nr of lr ps * {@inheritDoc} */ @Override public final int getNrOfLRPs() { if (rawData == null || rawData.getLocationReferencePoints() == null) { return 0; } return rawData.getLocationReferencePoints().size(); }
/** * Checks for lr ps. * * @return true, if successful * {@inheritDoc} */ @Override public final boolean hasLRPs() { if (rawData == null || rawData.getLocationReferencePoints() == null) { return false; } return !rawData.getLocationReferencePoints().isEmpty(); }
/** * {@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; }
if (rawLocRef == null || rawLocRef.getLocationReferencePoints() == null || rawLocRef.getLocationReferencePoints().isEmpty()) { return new LocationReferenceBinaryImpl("", BinaryReturnCode.MISSING_DATA, .getLocationReferencePoints().get(0); LocationReferencePoint endLRP = rawLocRef.getLocationReferencePoints() .get(1); Offsets od = rawLocRef.getOffsets(); LocationType.POI_WITH_ACCESS_POINT, version); boolean retCode = checkOffsets(od, true, rawLocRef.getLocationReferencePoints()); if (!retCode) { return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_OFFSET, LocationType.POINT_ALONG_LINE, version);
if (rawLocRef == null || rawLocRef.getLocationReferencePoints() == null || rawLocRef.getLocationReferencePoints().isEmpty()) { return new LocationReferenceBinaryImpl("", BinaryReturnCode.MISSING_DATA, .getLocationReferencePoints().get(0); LocationReferencePoint endLRP = rawLocRef.getLocationReferencePoints() .get(1); Offsets od = rawLocRef.getOffsets(); LocationType.POI_WITH_ACCESS_POINT, version); boolean retCode = checkOffsets(od, true, rawLocRef.getLocationReferencePoints()); if (!retCode) { return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_OFFSET, LocationType.POI_WITH_ACCESS_POINT, version);
/** * {@inheritDoc} */ @Override public final LocationReference encodeData( final RawLocationReference rawLocRef, final int version) { if (rawLocRef == null) { return new LocationReferenceBinaryImpl("", BinaryReturnCode.MISSING_DATA, LocationType.CLOSED_LINE, version); } List<? extends LocationReferencePoint> locRef = rawLocRef .getLocationReferencePoints(); if (locRef == null || locRef.isEmpty()) { return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.MISSING_DATA, LocationType.CLOSED_LINE, version); } LocationReference lr = null; try { byte[] bd = generateBinaryClosedLineLocation(locRef, version); ByteArray ba = new ByteArray(bd.clone()); lr = new LocationReferenceBinaryImpl(rawLocRef.getID(), ba); } catch (PhysicalFormatException e) { lr = new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_BINARY_DATA, LocationType.CLOSED_LINE, version); } return lr; }
/** * {@inheritDoc} */ @Override public final LocationReference encodeData( final RawLocationReference rawLocRef, final int version) { List<? extends LocationReferencePoint> locRef = rawLocRef .getLocationReferencePoints(); if (locRef == null) { return new LocationReferenceXmlImpl(rawLocRef.getID(), XmlReturnCode.INVALID_DATA, LocationType.CLOSED_LINE, version); } OpenLR xmlData = OBJECT_FACTORY.createOpenLR(); String id = ""; if (rawLocRef.hasID()) { id = rawLocRef.getID(); } xmlData.setLocationID(id); XMLLocationReference xmlLoc = createXMLClosedLineLocRef(locRef); 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; }
return new LocationReferenceBinaryImpl("", BinaryReturnCode.MISSING_DATA, LocationType.LINE_LOCATION, version); List<? extends LocationReferencePoint> locRef = rawLocRef.getLocationReferencePoints(); Offsets od = rawLocRef.getOffsets(); if (locRef == null || od == null || locRef.isEmpty()) {