/** * Initialize to a null <code>Envelope</code>. */ public void init() { setToNull(); }
/** * Expands this envelope by a given distance in all directions. * Both positive and negative distances are supported. * * @param deltaX the distance to expand the envelope along the the X axis * @param deltaY the distance to expand the envelope along the the Y axis */ public void expandBy(double deltaX, double deltaY) { if (isNull()) return; minx -= deltaX; maxx += deltaX; miny -= deltaY; maxy += deltaY; // check for envelope disappearing if (minx > maxx || miny > maxy) setToNull(); }
/** * Initialize to a null <code>Envelope</code>. */ public void init() { setToNull(); }
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated modifiable */ public Object parse(InstanceComponent instance, Object value) throws Exception { Envelope e = new Envelope(); e.setToNull(); return e; }
/** * Expands this envelope by a given distance in all directions. * Both positive and negative distances are supported. * * @param deltaX the distance to expand the envelope along the the X axis * @param deltaY the distance to expand the envelope along the the Y axis */ public void expandBy(double deltaX, double deltaY) { if (isNull()) return; minx -= deltaX; maxx += deltaX; miny -= deltaY; maxy += deltaY; // check for envelope disappearing if (minx > maxx || miny > maxy) setToNull(); }
protected void writeBBox(Writer w, Node node, Envelope envHelper) throws IOException { envHelper.setToNull(); node.expand(envHelper); writeEnvelope(w, envHelper); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Envelope envelope = (Envelope) node.getChildValue(Envelope.class); if (envelope == null) { envelope = new Envelope(); envelope.setToNull(); } return envelope; }
public static void writeBucket(int index, Bucket bucket, DataOutput data, Envelope envBuff) { try { data.writeInt(index); data.write(bucket.getObjectId().getRawValue()); envBuff.setToNull(); bucket.expand(envBuff); writeBoundingBox(envBuff, data); } catch (IOException e) { throw Throwables.propagate(e); } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Envelope envelope = (Envelope) node.getChildValue(Envelope.class); if (envelope == null) { envelope = new Envelope(); envelope.setToNull(); } return envelope; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Envelope envelope = (Envelope) node.getChildValue(Envelope.class); if (envelope == null) { envelope = new Envelope(); envelope.setToNull(); } return envelope; }
/** * Returns the envelope for a geometry. * <p> * This method will return an "null" envelope ({@link Envelope#setToNull()}) * if <tt>wkb</tt> is <code>null</code>. * </p> * @param wkb The geometry. * @return The envelope of the geometry. */ public static Envelope Envelope( byte[] wkb ) { if ( wkb == null ) { Envelope e = new Envelope(); e.setToNull(); return e; } return fromWKB(wkb).getEnvelopeInternal(); }
@Override public void writeBucket(final int index, final Bucket bucket, DataOutput data, Envelope envBuff) throws IOException { writeUnsignedVarInt(index, data); data.write(bucket.getObjectId().getRawValue()); envBuff.setToNull(); bucket.expand(envBuff); writeBounds(envBuff,data); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { //do the null check if (node.getChild("null") != null) { //ignore the description as to why its null Envelope e = new Envelope(); e.setToNull(); return e; } //has to be a valid bounding box return (Envelope) node.getChildValue(0); }
/** * Manually calculates the bounds of a feature collection. * @param collection * @return */ public static Envelope bounds( FeatureCollection collection ) { Iterator i = collection.iterator(); try { Envelope bounds = new Envelope(); if ( !i.hasNext() ) { bounds.setToNull(); return bounds; } bounds.init( ( (Feature) i.next() ).getBounds() ); return bounds; } finally { collection.close( i ); } } }
public static void writeNode(Node node, DataOutput data, Envelope envBuff) { try { data.writeUTF(node.getName()); data.write(node.getObjectId().getRawValue()); data.write(node.getMetadataId().or(ObjectId.NULL).getRawValue()); int typeN = node.getType().value(); data.writeByte(typeN); envBuff.setToNull(); node.expand(envBuff); writeBoundingBox(envBuff, data); Map<String, Object> extraData = node.getExtraData(); DataStreamValueSerializerV1.INSTANCE.writeMap(extraData, data); } catch (IOException e) { throw Throwables.propagate(e); } }
final int extraDataMask; env.setToNull(); node.expand(env);
private void writeBBox(Writer w, Node node, Envelope envHelper) throws IOException { envHelper.setToNull(); node.expand(envHelper); if (envHelper.isNull()) { print(w, TextWriter.NULL_BOUNDING_BOX); return; } print(w, Double.toString(envHelper.getMinX())); print(w, ";"); print(w, Double.toString(envHelper.getMaxX())); print(w, ";"); print(w, Double.toString(envHelper.getMinY())); print(w, ";"); print(w, Double.toString(envHelper.getMaxY())); }
public void writeBucket(final int index, final Bucket bucket, DataOutput data, Envelope envBuff) throws IOException { writeUnsignedVarInt(index, data); data.write(bucket.getObjectId().getRawValue()); envBuff.setToNull(); bucket.expand(envBuff); if (envBuff.isNull()) { data.writeByte(BOUNDS_NULL_MASK); } else if (envBuff.getWidth() == 0D && envBuff.getHeight() == 0D) { data.writeByte(BOUNDS_POINT_MASK); writePointBoundingBox(envBuff.getMinX(), envBuff.getMinY(), data); } else { data.writeByte(BOUNDS_BOX2D_MASK); writeBoundingBox(envBuff.getMinX(), envBuff.getMaxX(), envBuff.getMinY(), envBuff.getMaxY(), data); } }
private void writeBuckets(Writer w, ImmutableSortedMap<Integer, Bucket> buckets) throws IOException { for (Entry<Integer, Bucket> entry : buckets.entrySet()) { Integer bucketIndex = entry.getKey(); Bucket bucket = entry.getValue(); print(w, TreeNode.BUCKET.name()); print(w, "\t"); print(w, bucketIndex.toString()); print(w, "\t"); print(w, bucket.getObjectId().toString()); print(w, "\t"); Envelope env = new Envelope(); env.setToNull(); bucket.expand(env); writeEnvelope(w, env); println(w); } }
private void writeBuckets(Writer w, ImmutableSortedMap<Integer, Bucket> buckets) throws IOException { for (Entry<Integer, Bucket> entry : buckets.entrySet()) { Integer bucketIndex = entry.getKey(); Bucket bucket = entry.getValue(); print(w, TreeNode.BUCKET.name()); print(w, "\t"); print(w, bucketIndex.toString()); print(w, "\t"); print(w, bucket.id().toString()); print(w, "\t"); Envelope env = new Envelope(); env.setToNull(); bucket.expand(env); print(w, Double.toString(env.getMinX())); print(w, ";"); print(w, Double.toString(env.getMaxX())); print(w, ";"); print(w, Double.toString(env.getMinY())); print(w, ";"); println(w, Double.toString(env.getMaxY())); } }