Examples of centre()


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

    assertEquals(47.664809318453564, envA.centre().y,0.0001);
    assertEquals(0.04496600971673814, envA.getHeight(),0.0001);
    assertEquals(0.066767981533431, envA.getWidth(),0.0001);
   
    Envelope envB = regions.get(1);
    assertEquals(-122.38992691040039, envB.centre().x,0.0001);
    assertEquals(47.66931784410792, envB.centre().y,0.0001);
    assertEquals(0.04496600971673814, envB.getHeight(),0.0001);
    assertEquals(0.066767981533431, envB.getWidth(),0.0001);
  }
}
View Full Code Here

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

    assertEquals(0.04496600971673814, envA.getHeight(),0.0001);
    assertEquals(0.066767981533431, envA.getWidth(),0.0001);
   
    Envelope envB = regions.get(1);
    assertEquals(-122.38992691040039, envB.centre().x,0.0001);
    assertEquals(47.66931784410792, envB.centre().y,0.0001);
    assertEquals(0.04496600971673814, envB.getHeight(),0.0001);
    assertEquals(0.066767981533431, envB.getWidth(),0.0001);
  }
}
View Full Code Here

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

    Coordinate[] pts = new Coordinate[nPts];

    for (int i = 0; i < nPts; i++) {
      double xLen = width * Math.random();
      double yLen = hgt * Math.random();
      pts[i] = randomPtInRectangleAround(env.centre(), xLen, yLen);
    }
    return geomFact.createLineString(pts);
  }

  public static Geometry randomRectilinearWalk(Geometry g, int nPts) {
View Full Code Here

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

    boolean xory = true;
    for (int i = 0; i < nPts; i++) {
      Coordinate pt = null;
      if (i == 0) {
       pt = randomPtInRectangleAround(env.centre(), xLen, yLen);
      }
      else {
        double dist = xLen * (Math.random() - 0.5);
        double x = pts[i-1].x;
        double y = pts[i-1].y;
View Full Code Here

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

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

            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

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

        // 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

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

        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

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

    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

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

    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.