/** * {@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; }
GeoCoordinates upperRight = rawLocRef.getUpperRightPoint(); if (lowerLeft == null || upperRight == null) { return new LocationReferenceBinaryImpl(id,
/** * {@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; }
GeoCoordinates rightmost = rawLocRef.getUpperRightPoint(); int ncols = rawLocRef.getNumberOfColumns(); int nrows = rawLocRef.getNumberOfRows();