Examples of expandBy()


Examples of com.barrybecker4.common.geometry.Box.expandBy()

     */
    public Box getBoundingBox() {
        Box bbox = new Box(lastTile.getLocation());

        for (Location loc : keySet())  {
            bbox.expandBy(loc);
        }
        return bbox;
    }

    /**
 
View Full Code Here

Examples of com.barrybecker4.common.geometry.Box.expandBy()

               otherPoints.add(pos);
            }
        }
        assert oneNbrPoints.size() == 3// hitting this
        Box bounds = new Box(oneNbrPoints.getFirst().getLocation(), oneNbrPoints.get(1).getLocation());
        bounds.expandBy(oneNbrPoints.get(2).getLocation());

        for (GoBoardPosition otherPt : otherPoints) {
            if (!bounds.contains(otherPt.getLocation())) {
                return Eye7Type.E1112234a;
            }
View Full Code Here

Examples of com.vividsolutions.jts.geom.Envelope.expandBy()

    Coordinate midPt = new Coordinate((p.x + q.x) / 2.0, (p.y + q.y) / 2.0);
    double segRadius = p.distance(midPt);

    // compute envelope of circumcircle
    Envelope env = new Envelope(midPt);
    env.expandBy(segRadius);
    // Find all points in envelope
    List result = kdt.query(env);

    // For each point found, test if it falls strictly in the circle
    // find closest point
View Full Code Here

Examples of com.vividsolutions.jts.geom.Envelope.expandBy()

            }
        });

        Geometry geometry = (Geometry) currentFeature.getDefaultGeometry();
        Envelope envelope = geometry.getEnvelopeInternal();
        envelope.expandBy(zoomBuffer);
        ReferencedEnvelope ref = new ReferencedEnvelope(envelope, crs);
        try {
            ref = ref.transform(activeMap.getViewportModel().getCRS(), true);
        } catch (Exception e1) {
            // ignore
View Full Code Here

Examples of com.vividsolutions.jts.geom.Envelope.expandBy()

                double mratio = mwidth / mheight;
                // Adjust bounds to be less than ideal to meet spec
                if (bbratio > mratio) {
                    // Too wide, need to increase height of bb
                    double diff = ((bbwidth / mratio) - bbheight) / 2;
                    aggregateBbox.expandBy(0, diff);
                } else {
                    // Too tall, need to increase width of bb
                    double diff = ((bbheight * mratio) - bbwidth) / 2;
                    aggregateBbox.expandBy(diff, 0);
                }
View Full Code Here

Examples of com.vividsolutions.jts.geom.Envelope.expandBy()

                    double diff = ((bbwidth / mratio) - bbheight) / 2;
                    aggregateBbox.expandBy(0, diff);
                } else {
                    // Too tall, need to increase width of bb
                    double diff = ((bbheight * mratio) - bbwidth) / 2;
                    aggregateBbox.expandBy(diff, 0);
                }
               
                adjustBounds(reqSRS, aggregateBbox);
               
            } else if (mheight > 0.5) {
View Full Code Here

Examples of com.vividsolutions.jts.geom.Envelope.expandBy()

             * for display
             */
            Envelope orig_bbox = layer.getLatLonBoundingBox();

            if ((orig_bbox.getWidth() == 0) || (orig_bbox.getHeight() == 0)) {
                orig_bbox.expandBy(0.1);
            }

            ReferencedEnvelope bbox = new ReferencedEnvelope(orig_bbox, latLonCrs);

            if (!CRS.equalsIgnoreMetadata(layerCrs, latLonCrs)) {
View Full Code Here

Examples of com.vividsolutions.jts.geom.Envelope.expandBy()

            }
        }
        BufferedImage image;
        Envelope bboxOfImage = new Envelope(geom.getEnvelopeInternal());
        double expandFactor = calculateExpandFactor(bboxOfImage, srs);
        bboxOfImage.expandBy(bboxOfImage.getWidth() * expandFactor, bboxOfImage.getHeight() * expandFactor);
        Dimension imageDimenions = calculateImageSize(bboxOfImage, widthString, heightString);

        Exception error = null;
        if (background != null) {

View Full Code Here

Examples of com.vividsolutions.jts.geom.Envelope.expandBy()

    Coordinate midPt = new Coordinate((p.x + q.x) / 2.0, (p.y + q.y) / 2.0);
    double segRadius = p.distance(midPt);

    // compute envelope of circumcircle
    Envelope env = new Envelope(midPt);
    env.expandBy(segRadius);
    // Find all points in envelope
    List result = kdt.query(env);

    // For each point found, test if it falls strictly in the circle
    // find closest point
View Full Code Here

Examples of com.vividsolutions.jts.geom.Envelope.expandBy()

    }

    public Envelope bbox () {
        Envelope env = new Envelope(center());
        double meters_per_degree_lon = METERS_PER_DEGREE_LAT * Math.cos(Math.toRadians(lat));
        env.expandBy(radius / meters_per_degree_lon, radius / METERS_PER_DEGREE_LAT);
        return env;
    }

}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.