/** * There is a weird bug in geometry comparison. If a geometry envelope is not loaded it may return * false for two empty line strings or multiline strings */ private static void ensureEnvelopeLoaded(OGCGeometry geometry) { geometry.envelope(); } }
public void eval() { com.esri.core.geometry.ogc.OGCGeometry geom1; geom1 = com.esri.core.geometry.ogc.OGCGeometry .fromBinary(geom1Param.buffer.nioBuffer(geom1Param.start, geom1Param.end - geom1Param.start)); com.esri.core.geometry.ogc.OGCGeometry envelopeGeom; if (geom1.geometryType().equals("Point")) { envelopeGeom = geom1; } else { envelopeGeom = geom1.envelope(); } java.nio.ByteBuffer envelopeGeomBytes = envelopeGeom.asBinary(); int outputSize = envelopeGeomBytes.remaining(); buffer = out.buffer = buffer.reallocIfNeeded(outputSize); out.start = 0; out.end = outputSize; buffer.setBytes(0, envelopeGeomBytes); } }
@Override protected Object evaluateOGCGeometry(OGCGeometry geometry) throws HyracksDataException { return geometry.envelope(); }
/** * There is a weird bug in geometry comparison. If a geometry envelope is not loaded it may return * false for two empty line strings or multiline strings */ private static void ensureEnvelopeLoaded(OGCGeometry geometry) { geometry.envelope(); } }
/** * There is a weird bug in geometry comparison. If a geometry envelope is not loaded it may return * false for two empty line strings or multiline strings */ private static void ensureEnvelopeLoaded(OGCGeometry geometry) { geometry.envelope(); } }
@Override public Rectangle getMBR() { if (geom.isEmpty()) return null; com.esri.core.geometry.Polygon mbr = (com.esri.core.geometry.Polygon) geom.envelope().getEsriGeometry(); int pointCount = mbr.getPointCount(); double xmin = mbr.getPoint(0).getX(); double ymin = mbr.getPoint(0).getY(); double xmax = xmin, ymax = ymin; for (int i = 1; i < pointCount; i++) { com.esri.core.geometry.Point point = mbr.getPoint(i); if (point.getX() < xmin) xmin = point.getX(); if (point.getX() > xmax) xmax = point.getX(); if (point.getY() < ymin) ymin = point.getY(); if (point.getY() > ymax) ymax = point.getY(); } return new Rectangle(xmin, ymin, xmax, ymax); }