Package org.geotools.geometry.jts

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


                        Coordinate coordinate = placesMap.get(item);
                        Point pt = gF.createPoint(coordinate);
                        Geometry targetGeometry = JTS.transform(pt, transform);
                        Coordinate position = targetGeometry.getCoordinate();

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

                        bounds.translate(xTrans, yTrans);
                    } catch (Exception e1) {
View Full Code Here


            double widthMeters = mercatorREnv.getWidth();
            int widthPixels = screenSize.width;

            double metersXPixel = widthMeters / widthPixels;
            int nearestZoomLevel = getZoomLevelMetersXPixel(metersXPixel, latlongREnv.centre().y);

            // get tiles range
            double w = latlongREnv.getMinX();
            double s = latlongREnv.getMinY();
            double e = latlongREnv.getMaxX();
View Full Code Here

        // get the bounds for the unrotated map area
        final ReferencedEnvelope mapBounds = this.transformer.getBounds().toReferencedEnvelope(
                new Rectangle(this.transformer.getMapSize()), this.dpi);

        // then rotate the geometry around its center
        final Coordinate center = mapBounds.centre();
        final AffineTransform affineTransform = AffineTransform.getRotateInstance(
                this.transformer.getRotation(), center.x, center.y);
        final MathTransform mathTransform = new AffineTransform2D(affineTransform);

        try {
View Full Code Here

        DistanceUnit projUnit = DistanceUnit.fromProjection(getProjection());

        double geoWidthInInches;
        if (projUnit == DistanceUnit.DEGREES) {
            GeodeticCalculator calculator = new GeodeticCalculator(getProjection());
            final double centerY = bboxAdjustedToScreen.centre().y;
            calculator.setStartingGeographicPoint(bboxAdjustedToScreen.getMinX(), centerY);
            calculator.setDestinationGeographicPoint(bboxAdjustedToScreen.getMaxX(), centerY);
            double geoWidthInEllipsoidUnits = calculator.getOrthodromicDistance();
            DistanceUnit ellipsoidUnit = DistanceUnit.fromString(calculator.getEllipsoid().getAxisUnit().toString());
View Full Code Here

    if (unparsed.size() == 3) {
      offset[0] = Double.valueOf((String) unparsed.get(0));
      offset[1] = Double.valueOf((String) unparsed.get(1));
      offset[2] = Double.valueOf((String) unparsed.get(2));
    } else {
      Coordinate centre = bbox.centre();
      offset[0] = centre.x;
      offset[1] = centre.y;
      offset[2] = centre.z;
      if (offset[2] != Double.NaN) {
        offset[2] = 0;
View Full Code Here

    if (bounds != null) {
      bbox = new ReferencedEnvelope(bounds);
    } else {
      bbox = new ReferencedEnvelope(CRS.getEnvelope(crs));
    }
    Coordinate centre = bbox.centre();
    if (centre.x == 0 && centre.y == 0) {
      offset[0] = bbox.getMinX();
      offset[1] = bbox.getMaxX();
    } else {
      offset[0] = centre.x;
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.