Package org.apache.sis.geometry

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


     * 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

      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

TOP

Related Classes of org.apache.sis.geometry.Envelope2D

Copyright © 2018 www.massapicom. 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.