Examples of Envelope2D


Examples of com.esri.core.geometry.Envelope2D

  SpatialReference spatialReference;
  QuadTree quadTree;
  QuadTreeIterator quadTreeIter;
 
  private void buildQuadTree(){
    quadTree = new QuadTree(new Envelope2D(-180, -90, 180, 90), 8);
   
    Envelope envelope = new Envelope();
    for (int i=0;i<featureClass.features.length;i++){
      featureClass.features[i].geometry.queryEnvelope(envelope);
      quadTree.insert(i, new Envelope2D(envelope.getXMin(), envelope.getYMin(), envelope.getXMax(), envelope.getYMax()));
    }
   
    quadTreeIter = quadTree.getIterator();
  }
View Full Code Here

Examples of org.apache.sis.geometry.Envelope2D

     * Tests {@link Matrices#createTransform(Envelope, Envelope)}.
     * This method tests the example given in {@code Matrices.createTransform()} javadoc.
     */
    @Test
    public void testCreateTransformFromEnvelopes() {
        final Envelope srcEnvelope = new Envelope2D(null, -20, -40, 100, 200);
        final Envelope dstEnvelope = new Envelope2D(null, -10, -25, 300, 500);
        MatrixSIS matrix = Matrices.createTransform(srcEnvelope, dstEnvelope);
        assertTrue ("isAffine",   matrix.isAffine());
        assertFalse("isIdentity", matrix.isIdentity());
        assertEquals("numRow", 3, matrix.getNumRow());
        assertEquals("numCol", 3, matrix.getNumCol());
View Full Code Here

Examples of org.apache.sis.geometry.Envelope2D

     * This method tests the example given in {@code Matrices.createTransform()} javadoc.
     */
    @Test
    @DependsOnMethod({"testCreateTransformFromEnvelopes", "testCreateTransformWithLessAxes"})
    public void testCreateTransformFromEnvelopesAndAxes() {
        final Envelope srcEnvelope = new Envelope2D(null, -40, +20, 200, 100); // swapped (y,-x)
        final Envelope dstEnvelope = new Envelope2D(null, -10, -25, 300, 500);
        MatrixSIS matrix = Matrices.createTransform(
                srcEnvelope, new AxisDirection[] {NORTH, WEST},
                dstEnvelope, new AxisDirection[] {EAST, NORTH});
        assertTrue ("isAffine",   matrix.isAffine());
        assertFalse("isIdentity", matrix.isIdentity());
View Full Code Here

Examples of org.apache.sis.geometry.Envelope2D

      String urLat = request.getParameter("urLat");
      String urLon = request.getParameter("urLon");

      if (llLat != null && llLon != null && urLat != null && urLon != null) {
        try {
          Envelope2D bbox = new Envelope2D(new DirectPosition2D(
              Double.parseDouble(llLon), Double.parseDouble(llLat)),
              new DirectPosition2D(Double.parseDouble(urLon), Double.parseDouble(urLat)));

          beforeTime = System.currentTimeMillis();
          results = tree.queryByBoundingBox(bbox);
          afterTime = System.currentTimeMillis();
          // get the polygon that approximates the region
          Rectangle2D[] rects = bbox.toRectangles();
          for (int i = 0; i < rects.length; i++) {
            final Rectangle2D r = rects[i];
            String regionStr = (r.getMinY()) + "," + (r.getMinX()) + ",";
            regionStr += (r.getMaxY()) + "," + (r.getMinX()) + ",";
            regionStr += (r.getMaxY()) + "," + (r.getMaxX()) + ",";
View Full Code Here

Examples of org.geotools.geometry.Envelope2D

        if (crs != null) {
            env = new ReferencedEnvelope(west, east, south, north, crs);
        } else {
            DirectPosition2D minDp = new DirectPosition2D(west, south);
            DirectPosition2D maxDp = new DirectPosition2D(east, north);
            env = new Envelope2D(minDp, maxDp);
        }
        readGG.setValue(new GridGeometry2D(gridEnvelope, env));
        readParams[0] = readGG;

        return readParams;
View Full Code Here

Examples of org.geotools.geometry.Envelope2D

            coverage = (GridCoverage2D) geoResource.resolve(GridCoverage.class, monitor);
            CoordinateReferenceSystem targetCrs = coverage.getCoordinateReferenceSystem();
            gridGeometry = coverage.getGridGeometry();
            evaluateCoord = transform(sourceCRS, targetCrs, envelopeCenterOrig);
            p = new Point2D.Double(evaluateCoord.x, evaluateCoord.y);
            Envelope2D envelope2d = coverage.getEnvelope2D();
            if (envelope2d.contains(p)) {
                isOnGrid = true;
            }
        } else {
            hasProblem = true;
        }
View Full Code Here

Examples of org.geotools.geometry.Envelope2D

        if (crs != null) {
            env = new ReferencedEnvelope(west, east, south, north, crs);
        } else {
            DirectPosition2D minDp = new DirectPosition2D(west, south);
            DirectPosition2D maxDp = new DirectPosition2D(east, north);
            env = new Envelope2D(minDp, maxDp);
        }
        readGG.setValue(new GridGeometry2D(gridEnvelope, env));
        readParams[0] = readGG;

        return readParams;
View Full Code Here

Examples of org.geotools.geometry.Envelope2D

        if (crs != null) {
            env = new ReferencedEnvelope(west, east, south, north, crs);
        } else {
            DirectPosition2D minDp = new DirectPosition2D(west, south);
            DirectPosition2D maxDp = new DirectPosition2D(east, north);
            env = new Envelope2D(minDp, maxDp);
        }
        readGG.setValue(new GridGeometry2D(gridEnvelope, env));
        readParams[0] = readGG;

        return readParams;
View Full Code Here

Examples of org.geotools.geometry.Envelope2D

        if (crs != null) {
            env = new ReferencedEnvelope(west, east, south, north, crs);
        } else {
            DirectPosition2D minDp = new DirectPosition2D(west, south);
            DirectPosition2D maxDp = new DirectPosition2D(east, north);
            env = new Envelope2D(minDp, maxDp);
        }
        readGG.setValue(new GridGeometry2D(gridEnvelope, env));
        readParams[0] = readGG;

        return readParams;
View Full Code Here

Examples of org.geotools.geometry.Envelope2D

        double west = envelopeParams.get(WEST);
        double south = envelopeParams.get(SOUTH);
        double east = envelopeParams.get(EAST);
        double north = envelopeParams.get(NORTH);
        Envelope2D writeEnvelope = new Envelope2D(crs, west, south, east - west, north - south);
        GridCoverageFactory factory = CoverageFactoryFinder.getGridCoverageFactory(null);

        GridCoverage2D coverage2D = factory.create(name, writableRaster, writeEnvelope);
        return coverage2D;
    }
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.