/** * Gets the envelope for the bin ID. * * @param binId * @param envelope */ public void queryEnvelope(long binId, Envelope envelope) { long down = binId / numCols; long over = binId % numCols; double xmin = extentMin + (over * binSize); double xmax = xmin + binSize; double ymax = extentMax - (down * binSize); double ymin = ymax - binSize; envelope.setCoords(xmin, ymin, xmax, ymax); }
/** * Gets the envelope for the bin that contains the x,y coords. * * @param x * @param y * @param envelope */ public void queryEnvelope(double x, double y, Envelope envelope) { double down = (extentMax - y) / binSize; double over = (x - extentMin) / binSize; double xmin = extentMin + (over * binSize); double xmax = xmin + binSize; double ymax = extentMax - (down * binSize); double ymin = ymax - binSize; envelope.setCoords(xmin, ymin, xmax, ymax); } }
/** * Constructs an envelope with the specified X and Y extents. * * @param xmin * The minimum x-coordinate of the envelope. * @param ymin * The minimum y-coordinate of the envelope. * @param xmax * The maximum x-coordinate of the envelope. * @param ymax * The maximum y-coordinate of the envelope. */ public Envelope(double xmin, double ymin, double xmax, double ymax) { m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D(); setCoords(xmin, ymin, xmax, ymax); }
/** * Constructs an envelope with the specified X and Y extents. * * @param xmin * The minimum x-coordinate of the envelope. * @param ymin * The minimum y-coordinate of the envelope. * @param xmax * The maximum x-coordinate of the envelope. * @param ymax * The maximum y-coordinate of the envelope. */ public Envelope(double xmin, double ymin, double xmax, double ymax) { m_description = VertexDescriptionDesignerImpl.getDefaultDescriptor2D(); setCoords(xmin, ymin, xmax, ymax); }
public Object readResolve() throws ObjectStreamException { Envelope env = null; if (descriptionBitMask == -1) return null; try { VertexDescription vd = VertexDescriptionDesignerImpl .getVertexDescription(descriptionBitMask); env = new Envelope(vd); if (attribs != null) { env.setCoords(attribs[0], attribs[1], attribs[2], attribs[3]); int index = 4; for (int i = 1, n = vd.getAttributeCount(); i < n; i++) { int semantics = vd.getSemantics(i); int comps = VertexDescription.getComponentCount(semantics); for (int ord = 0; ord < comps; ord++) { env.setInterval(semantics, ord, attribs[index++], attribs[index++]); } } } } catch (Exception ex) { throw new InvalidObjectException("Cannot read geometry from stream"); } return env; }
public Object readResolve() throws ObjectStreamException { Envelope env = null; if (descriptionBitMask == -1) return null; try { VertexDescription vd = VertexDescriptionDesignerImpl .getVertexDescription(descriptionBitMask); env = new Envelope(vd); if (attribs != null) { env.setCoords(attribs[0], attribs[1], attribs[2], attribs[3]); int index = 4; for (int i = 1, n = vd.getAttributeCount(); i < n; i++) { int semantics = vd.getSemantics(i); int comps = VertexDescription.getComponentCount(semantics); for (int ord = 0; ord < comps; ord++) { env.setInterval(semantics, ord, attribs[index++], attribs[index++]); } } } } catch (Exception ex) { throw new InvalidObjectException("Cannot read geometry from stream"); } return env; }
} else if (m_type == Geometry.GeometryType.Envelope) { Envelope envelope = new Envelope(); envelope.setCoords(x, y, x, y);
} else if (m_type == Geometry.GeometryType.Envelope) { Envelope envelope = new Envelope(); envelope.setCoords(x, y, x, y);