return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.MISSING_DATA, LocationType.GEO_COORDINATES, version); return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_VERSION, LocationType.GEO_COORDINATES, version); byte[] bd = generateBinaryGeoCoordLocation(coord, 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.GEO_COORDINATES, 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; }
Offsets od = rawLocRef.getOffsets(); if (locRef == null || od == null || locRef.isEmpty()) { return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.MISSING_DATA, LocationType.LINE_LOCATION, version); return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_OFFSET, LocationType.LINE_LOCATION, version); return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_OFFSET, LocationType.LINE_LOCATION, version); byte[] bd = generateBinaryLineLocation(locRef, od, 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.GEO_COORDINATES, version);
Orientation o = rawLocRef.getOrientation(); if (startLRP == null || endLRP == null || od == null) { return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.MISSING_DATA, LocationType.POINT_ALONG_LINE, version); return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_VERSION, LocationType.POI_WITH_ACCESS_POINT, version); return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_OFFSET, LocationType.POINT_ALONG_LINE, version); s, o, 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.GEO_COORDINATES, version);
/** * {@inheritDoc} */ @Override public final LocationReference encodeData( final RawLocationReference rawLocRef, final int version) { List<? extends GeoCoordinates> cornerPoints = rawLocRef .getCornerPoints(); if (cornerPoints == null) { return new LocationReferenceXmlImpl(rawLocRef.getID(), XmlReturnCode.INVALID_DATA, LocationType.POLYGON, version); } OpenLR xmlData = OBJECT_FACTORY.createOpenLR(); String id = ""; if (rawLocRef.hasID()) { id = rawLocRef.getID(); } xmlData.setLocationID(id); XMLLocationReference xmlLoc = createXMLPolygonLocRef(cornerPoints); 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(); 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; }
return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.MISSING_DATA, LocationType.POI_WITH_ACCESS_POINT, version); return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_VERSION, LocationType.POI_WITH_ACCESS_POINT, version); return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_OFFSET, LocationType.POI_WITH_ACCESS_POINT, version); version, coord, s, o); 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.GEO_COORDINATES, version);
/** * {@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; }
/** * {@inheritDoc} */ @Override public final LocationReference encodeData( final RawLocationReference rawLocRef, final int version) { GeoCoordinates centerPoint = rawLocRef.getCenterPoint(); long radius = rawLocRef.getRadius(); if (centerPoint == null || radius < 0) { return new LocationReferenceXmlImpl(rawLocRef.getID(), XmlReturnCode.INVALID_DATA, LocationType.CIRCLE, version); } OpenLR xmlData = OBJECT_FACTORY.createOpenLR(); String id = ""; if (rawLocRef.hasID()) { id = rawLocRef.getID(); } xmlData.setLocationID(id); XMLLocationReference xmlLoc = createXMLCircleLocRef(centerPoint, radius); xmlData.setXMLLocationReference(xmlLoc); LocationReference locRefData = new LocationReferenceXmlImpl(id, xmlData, version); return locRefData; }
/** * {@inheritDoc} */ @Override public final LocationReference encodeData( final RawLocationReference rawLocRef, final int version) { GeoCoordinates lowerLeftPoint = rawLocRef.getLowerLeftPoint(); GeoCoordinates upperRightPoint = rawLocRef.getUpperRightPoint(); if (lowerLeftPoint == null || upperRightPoint == null) { return new LocationReferenceXmlImpl(rawLocRef.getID(), XmlReturnCode.INVALID_DATA, LocationType.RECTANGLE, version); } OpenLR xmlData = OBJECT_FACTORY.createOpenLR(); String id = ""; if (rawLocRef.hasID()) { id = rawLocRef.getID(); } xmlData.setLocationID(id); XMLLocationReference xmlLoc = createXMLRectangleLocRef(lowerLeftPoint, upperRightPoint); xmlData.setXMLLocationReference(xmlLoc); LocationReference locRefData = new LocationReferenceXmlImpl(id, xmlData, version); return locRefData; }
version); String id = rawLocRef.getID(); List<? extends GeoCoordinates> cornerPoints = rawLocRef .getCornerPoints(); lr = new LocationReferenceBinaryImpl(id, ba); } catch (PhysicalFormatException e) { lr = new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_BINARY_DATA, LocationType.POLYGON, version);
/** * {@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; }
version); String id = rawLocRef.getID(); GeoCoordinates lowerLeft = rawLocRef.getLowerLeftPoint(); GeoCoordinates upperRight = rawLocRef.getUpperRightPoint(); lr = new LocationReferenceBinaryImpl(id, ba); } catch (PhysicalFormatException e) { lr = new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_BINARY_DATA, LocationType.RECTANGLE, version);
/** * {@inheritDoc} */ @Override public final LocationReference encodeData( final RawLocationReference rawLocRef, final int version) { GeoCoordinates lowerLeftPoint = rawLocRef.getLowerLeftPoint(); GeoCoordinates upperRightPoint = rawLocRef.getUpperRightPoint(); int ncols = rawLocRef.getNumberOfColumns(); int nrows = rawLocRef.getNumberOfRows(); if (lowerLeftPoint == null || upperRightPoint == null) { return new LocationReferenceXmlImpl(rawLocRef.getID(), XmlReturnCode.INVALID_DATA, LocationType.GRID, version); } OpenLR xmlData = OBJECT_FACTORY.createOpenLR(); String id = ""; if (rawLocRef.hasID()) { id = rawLocRef.getID(); } xmlData.setLocationID(id); XMLLocationReference xmlLoc = createXMLGridLocRef(lowerLeftPoint, upperRightPoint, ncols, nrows); 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) { GeoCoordinates coord = rawLocRef.getGeoCoordinates(); OpenLR xmlData = OBJECT_FACTORY.createOpenLR(); String id = ""; if (rawLocRef.hasID()) { id = rawLocRef.getID(); } xmlData.setLocationID(id); XMLLocationReference xmlLoc = createXMLGeoCoordLocRef(coord); xmlData.setXMLLocationReference(xmlLoc); LocationReference locRefData = new LocationReferenceXmlImpl(id, xmlData, version); return locRefData; } }
BinaryReturnCode.MISSING_DATA, LocationType.CIRCLE, version); String id = rawLocRef.getID(); GeoCoordinates center = rawLocRef.getCenterPoint(); long radius = rawLocRef.getRadius(); lr = new LocationReferenceBinaryImpl(id, ba); } catch (PhysicalFormatException e) { lr = new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_BINARY_DATA, LocationType.CIRCLE, version);
BinaryReturnCode.MISSING_DATA, LocationType.GRID, version); String id = rawLocRef.getID(); GeoCoordinates leftmost = rawLocRef.getLowerLeftPoint(); GeoCoordinates rightmost = rawLocRef.getUpperRightPoint(); lr = new LocationReferenceBinaryImpl(id, ba); } catch (PhysicalFormatException e) { lr = new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_BINARY_DATA, LocationType.GRID, version);
LocationType lt = rawLocRef.getLocationType(); if (!checkVersion(version, lt)) { return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.INVALID_VERSION, lt, version); case UNKNOWN: default: return new LocationReferenceBinaryImpl(rawLocRef.getID(), BinaryReturnCode.UNKNOWN_LOCATION_TYPE, lt, version);
final RawLocationReference rawLocRef, final int version) { if (!checkVersion(version)) { return new LocationReferenceXmlImpl(rawLocRef.getID(), XmlReturnCode.INVALID_VERSION, rawLocRef.getLocationType(), version); case UNKNOWN: default: return new LocationReferenceXmlImpl(rawLocRef.getID(), XmlReturnCode.UNKNOWN_LOCATION_TYPE, rawLocRef.getLocationType(), version);