/** * {@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) { 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; } }
/** * {@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; }
/** * {@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; }
/** * {@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; }