Examples of expandBy()


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

    }

    @SuppressWarnings("unchecked")
    public void mouseClicked() {
        Envelope screenEnv = new Envelope(new Coordinate(mouseX, mouseY));
        screenEnv.expandBy(4, 4);
        Envelope env = new Envelope(toModelX(screenEnv.getMinX()), toModelX(screenEnv.getMaxX()),
                toModelY(screenEnv.getMinY()), toModelY(screenEnv.getMaxY()));

        List<Vertex> nearby = (List<Vertex>) vertexIndex.query(env);
        selector.verticesSelected(nearby);
View Full Code Here

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

        if (e == null && v == null)
            return;

        // make it a little bigger, especially needed for STOP_UNLINKED
        env.expandBy(0.02);

        // highlight relevant things
        this.clearHighlights();
        this.setHighlightedVertices(vertices);
View Full Code Here

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

        if (stopCode == null){
            return false;
        }
        Envelope envelope = new Envelope(ts.getCoordinate());
        double xscale = Math.cos(ts.getCoordinate().y * Math.PI / 180);
        envelope.expandBy(searchRadiusLat / xscale, searchRadiusLat);
        Collection<Vertex> vertices = index.getVerticesForEnvelope(envelope);
        for (Vertex v : vertices){
            if (!(v instanceof TransitStopStreetVertex)){
                continue;
            }
View Full Code Here

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

            if (gv instanceof TransitStop) {
                Coordinate c = gv.getCoordinate();
                Envelope env = new Envelope(c);
                double meters_per_degree_lon_here = 
                    METERS_PER_DEGREE_LAT * Math.cos(Math.toRadians(c.y));
                env.expandBy(distance / meters_per_degree_lon_here, 
                        distance / METERS_PER_DEGREE_LAT);
                regions.add(env);
            }
        }

View Full Code Here

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

        LinearLocation startIndex = indexedLine.getStartIndex();

        Coordinate routeStartCoordinate = startIndex.getCoordinate(routeGeometry);
        Envelope envelope = new Envelope(routeStartCoordinate);
        double distanceThreshold = DISTANCE_THRESHOLD;
        envelope.expandBy(distanceThreshold);

        BinHeap<MatchState> states = new BinHeap<MatchState>();
        List<Edge> nearbyEdges = index.query(envelope);
        while (nearbyEdges.isEmpty()) {
            envelope.expandBy(distanceThreshold);
View Full Code Here

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

        envelope.expandBy(distanceThreshold);

        BinHeap<MatchState> states = new BinHeap<MatchState>();
        List<Edge> nearbyEdges = index.query(envelope);
        while (nearbyEdges.isEmpty()) {
            envelope.expandBy(distanceThreshold);
            distanceThreshold *= 2;
            nearbyEdges = index.query(envelope);
        }

        // compute initial states
View Full Code Here

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

        double lat = pt.getY();
        double lonScale = Math.cos(Math.PI * lat / 180);
        double latExpand = distanceMeters / mPerDegreeLat;
        double lonExpand = latExpand / lonScale;
        Envelope env = pt.getEnvelopeInternal();
        env.expandBy(lonExpand, latExpand);
        return gf.toGeometry(env);
    }
   
    @Override
    public boolean filter(Individual individual) {
View Full Code Here

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

        } else {
            rInMeters = 6371.01 * 1000;
        }
        double degForOneMeter = (Math.PI / (180 * rInMeters));
        double disInDeg = degForOneMeter * distance;
        env.expandBy(disInDeg);
        Collection<Edge> edges = streetIndexService.getEdgesForEnvelope(env);

        int counter = 0;
        for (Edge edge : edges) {
            if (edge instanceof StreetEdge) {
View Full Code Here

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

                    double size = RendererUtilities.getStyle2DSize(style);
                    // take into account the meta buffer to try and clip all geometries by the same
                    // amount
                    double clipBuffer = Math.max(size / 2, metaBuffer) + 10;
                    Envelope env = new Envelope(screenSize.getMinX(), screenSize.getMaxX(), screenSize.getMinY(), screenSize.getMaxY());
                    env.expandBy(clipBuffer);
                    final GeometryClipper clipper = new GeometryClipper(env);
                    Geometry g = clipper.clip(shape.getGeometry(), false);
                    if(g == null) {
                        continue;
                    }
View Full Code Here

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

    private Rectangle2D getCurvedLabelBounds(LineStringCursor cursor, double startOrdinate,
            double endOrdinate, double bufferSize) {
        LineString cut = cursor.getSubLineString(startOrdinate, endOrdinate);
        Envelope e = cut.getEnvelopeInternal();
        e.expandBy(bufferSize);
        return new Rectangle2D.Double(e.getMinX(), e.getMinY(), e.getWidth(), e.getHeight());
    }

    private LineString decimateLineString(LineString line, double step) {
        Coordinate[] inputCoordinates = line.getCoordinates();
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.