Package org.geotools.geometry.jts

Examples of org.geotools.geometry.jts.ReferencedEnvelope.translate()


        if (latLong.getMaxY() > WORLD.getMaxY()) {
          deltay = WORLD.getMaxX() - latLong.getMaxY();
        }
      }

      latLong.translate(deltax, deltay);

      return latLong.transform(
          pixelBounds.getCoordinateReferenceSystem(), true);
    } catch (TransformException e) {
      ProjectPlugin.log("", e);
View Full Code Here


                        Coordinate centre = bounds.centre();
                        double xTrans = position.x - centre.x;
                        double yTrans = position.y - centre.y;

                        bounds.translate(xTrans, yTrans);
                    } catch (Exception e1) {
                        e1.printStackTrace();
                    }
                    map.sendCommandASync(NavigationCommandFactory.getInstance().createSetViewportBBoxCommand(bounds));
                }
View Full Code Here

    @Test
    public void testQueryWrappingMercatorSeparate() throws Exception {
        ReferencedEnvelope world = new ReferencedEnvelope(160, 180, -40, 40, WGS84);
        ReferencedEnvelope mercatorEnvelope = world.transform(MERCATOR, true);
        // move it so that it crosses the dateline
        mercatorEnvelope.translate(mercatorEnvelope.getWidth() / 2, 0);

        // get query area, we expect two separate query envelopes
        ProjectionHandler handler = ProjectionHandlerFinder.getHandler(mercatorEnvelope, WGS84, true);
        List<ReferencedEnvelope> envelopes = handler.getQueryEnvelopes();
        assertEquals(2, envelopes.size());
View Full Code Here

    public void testWrapGeometryMercator() throws Exception {
        ReferencedEnvelope world = new ReferencedEnvelope(160, 180, -40, 40, WGS84);
        ReferencedEnvelope mercatorEnvelope = world.transform(MERCATOR, true);
        // move it so that it crosses the dateline (measures are still accurate for something
        // crossing the dateline
        mercatorEnvelope.translate(mercatorEnvelope.getWidth() / 2, 0);

        // a geometry that will cross the dateline and sitting in the same area as the
        // rendering envelope
        Geometry g = new WKTReader().read("LINESTRING(170 -40, 190 40)");
View Full Code Here

                tx1.expandToInclude(180, tx1.getMinY());
                ReferencedEnvelope re2 = new ReferencedEnvelope(datelineX + EPS, maxX, minY,
                        maxY, renderingCRS);
                ReferencedEnvelope tx2 = transformEnvelope(re2, WGS84);
                if (tx2.getMinX() > 180) {
                    tx2.translate(-360, 0);
                }
                tx2.expandToInclude(-180, tx1.getMinY());
                List<ReferencedEnvelope> result = new ArrayList<ReferencedEnvelope>();
                result.add(tx1);
                result.add(tx2);
View Full Code Here

        int dx = imageOrigin.x;
        int dy = imageOrigin.y;
        DirectPosition2D newPos = new DirectPosition2D(dx, dy);
        screenToWorld.transform(newPos, newPos);

        env.translate(env.getMinimum(0) - newPos.x, env.getMaximum(1) - newPos.y);
        doSetDisplayArea(env);
        imageOrigin.setLocation(0, 0);
        redrawBaseImage = true;
    }
View Full Code Here

    public ReferencedEnvelope invert(ReferencedEnvelope renderingEnvelope) {
        Double offsetY = getExpression(1).evaluate(null, Double.class);

        if (offsetY != null) {
            ReferencedEnvelope offseted = new ReferencedEnvelope(renderingEnvelope);
            offseted.translate(0, offsetY);
            return offseted;
        } else {
            return null;
        }
    }
View Full Code Here

            int dy = imageOrigin.y;
            DirectPosition2D newPos = new DirectPosition2D(dx, dy);
            mapContent.getViewport().getScreenToWorld().transform(newPos, newPos);

            ReferencedEnvelope env = new ReferencedEnvelope(mapContent.getViewport().getBounds());
            env.translate(env.getMinimum(0) - newPos.x, env.getMaximum(1) - newPos.y);
            doSetDisplayArea(env);

            imageOrigin.setLocation(0, 0);
            baseImageMoved.set(false);
View Full Code Here

        Double offsetX = getExpression(1).evaluate(null, Double.class);
        Double offsetY = getExpression(2).evaluate(null, Double.class);

        if (offsetX != null && offsetY != null) {
            ReferencedEnvelope offseted = new ReferencedEnvelope(renderingEnvelope);
            offseted.translate(-offsetX, -offsetY);
            return offseted;
        } else {
            return null;
        }
    }
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.