Package org.geotools.data.ows

Examples of org.geotools.data.ows.CRSEnvelope


            assertFalse(topLayer.isQueryable());
            assertEquals(topLayer.getTitle(), "World Map");
            assertEquals(topLayer.getSrs().size(), 1);
            assertTrue(topLayer.getSrs().contains("CRS:84"));
           
            CRSEnvelope llbbox = topLayer.getLatLonBoundingBox();
            assertNotNull(llbbox);
            assertEquals(llbbox.getMinX(), -180, 0.0);
            assertEquals(llbbox.getMaxX(), 180, 0.0);
            assertEquals(llbbox.getMinY(), -90, 0.0);
            assertEquals(llbbox.getMaxY(), 90, 0.0);
           
            assertEquals(topLayer.getBoundingBoxes().size(), 1);
           
            CRSEnvelope bbox = (CRSEnvelope) topLayer.getBoundingBoxes().get("CRS:84");
            assertNotNull(bbox);
            assertEquals(bbox.getEPSGCode(), "CRS:84");
            assertEquals(bbox.getMinX(), -184, 0.0);
            assertEquals(bbox.getMaxX(), 180, 0.0);
            assertEquals(bbox.getMinY(), -90.0000000017335, 0.0);
            assertEquals(bbox.getMaxY(), 90, 0.0);
           
            Layer layer = (Layer) capabilities.getLayerList().get(1);
            assertEquals(layer.getParent(), topLayer);
            assertTrue(layer.isQueryable());
            assertEquals(layer.getName(), "Bathymetry");
            assertEquals(layer.getTitle(), "Bathymetry");
           
            // Added test to verify inheritance, should be same as previous llbbox
            llbbox = topLayer.getLatLonBoundingBox();
            assertNotNull(llbbox);
            assertEquals(llbbox.getMinX(), -180, 0.0);
            assertEquals(llbbox.getMaxX(), 180, 0.0);
            assertEquals(llbbox.getMinY(), -90, 0.0);
            assertEquals(llbbox.getMaxY(), 90, 0.0);
           
            bbox = (CRSEnvelope) layer.getBoundingBoxes().get("CRS:84");
            assertNotNull(bbox);
            assertEquals(bbox.getEPSGCode(), "CRS:84");
            assertEquals(bbox.getMinX(), -180, 0.0);
            assertEquals(bbox.getMaxX(), 180, 0.0);
            assertEquals(bbox.getMinY(), -90, 0.0);
            assertEquals(bbox.getMaxY(), 90, 0.0);
           
            assertEquals(capabilities.getLayerList().size(), 21);
           
            layer = (Layer) capabilities.getLayerList().get(20);
            assertEquals(layer.getParent(), topLayer);
            assertTrue(layer.isQueryable());
            assertEquals(layer.getName(), "Ocean features");
            assertEquals(layer.getTitle(), "Ocean features");
           
            // Added test to verify inheritance, should be same as previous llbbox
            llbbox = topLayer.getLatLonBoundingBox();
            assertNotNull(llbbox);
            assertEquals(llbbox.getMinX(), -180, 0.0);
            assertEquals(llbbox.getMaxX(), 180, 0.0);
            assertEquals(llbbox.getMinY(), -90, 0.0);
            assertEquals(llbbox.getMaxY(), 90, 0.0);
           
            bbox = (CRSEnvelope) layer.getBoundingBoxes().get("CRS:84");
            assertNotNull(bbox);
            assertEquals(bbox.getEPSGCode(), "CRS:84");
            assertEquals(bbox.getMinX(), -180, 0.0);
            assertEquals(bbox.getMaxX(), 179.999420166016, 0.0);
            assertEquals(bbox.getMinY(), -62.9231796264648, 0.0);
            assertEquals(bbox.getMaxY(), 68.6906585693359, 0.0);
        } catch(java.net.ConnectException ce){
            if(ce.getMessage().indexOf("timed out")>0){
                System.err.println("Unable to test - timed out: "+ce);
            } else{
                throw(ce);
View Full Code Here


            assertEquals(layers[1].getName(), "Bathymetry");
            assertEquals(layers[20].getTitle(), "Ocean features");
            assertEquals(layers[20].getName(), "Ocean features");
            assertEquals(layers[0].getBoundingBoxes().size(), 1);
           
            CRSEnvelope bbox = (CRSEnvelope) layers[1].getBoundingBoxes().get("EPSG:4326");
            assertNotNull(bbox);
        } catch(Exception e){
            if(e.getMessage().indexOf("timed out")>0){
                System.err.println("Unable to test - timed out: "+e);
            } else{
View Full Code Here

    assertFalse(topLayer.isQueryable());
    assertEquals(topLayer.getTitle(), "World Map");
    assertEquals(topLayer.getSrs().size(), 1);
    assertTrue(topLayer.getSrs().contains("CRS:84"));
   
    CRSEnvelope llbbox = topLayer.getLatLonBoundingBox();
    assertNotNull(llbbox);
    assertEquals(llbbox.getMinX(), -180, 0.0);
    assertEquals(llbbox.getMaxX(), 180, 0.0);
    assertEquals(llbbox.getMinY(), -90, 0.0);
    assertEquals(llbbox.getMaxY(), 90, 0.0);
   
    assertEquals(topLayer.getBoundingBoxes().size(), 1);
   
    CRSEnvelope bbox = (CRSEnvelope) topLayer.getBoundingBoxes().get("CRS:84");
    assertNotNull(bbox);
    assertEquals(bbox.getEPSGCode(), "CRS:84");
    assertEquals(bbox.getMinX(), -184, 0.0);
    assertEquals(bbox.getMaxX(), 180, 0.0);
    assertEquals(bbox.getMinY(), -90.0000000017335, 0.0);
    assertEquals(bbox.getMaxY(), 90, 0.0);
   
    Layer layer = (Layer) capabilities.getLayerList().get(1);
    assertEquals(layer.getParent(), topLayer);
    assertTrue(layer.isQueryable());
    assertEquals(layer.getName(), "Bathymetry");
    assertEquals(layer.getTitle(), "Bathymetry");
    assertEquals(layer.getMetadataURL().get(0).getUrl().toString(), "http://www.example.com/?");
    assertEquals(layer.getMetadataURL().get(0).getFormat(), "text/html");
    assertEquals(layer.getMetadataURL().get(0).getType(), "FGDC");
    assertEquals(layer.getStyles().get(0).getLegendURLs().get(0), "http://www.osgeo.org/sites/all/themes/osgeo/logo.png");
   
    // Added test to verify inheritance, should be same as previous llbbox
    llbbox = layer.getLatLonBoundingBox();
    assertNotNull(llbbox);
    assertEquals(llbbox.getMinX(), -180, 0.0);
    assertEquals(llbbox.getMaxX(), 180, 0.0);
    assertEquals(llbbox.getMinY(), -90, 0.0);
    assertEquals(llbbox.getMaxY(), 90, 0.0);
   
    bbox = (CRSEnvelope) layer.getBoundingBoxes().get("CRS:84");
    assertNotNull(bbox);
    assertEquals(bbox.getEPSGCode(), "CRS:84");
    assertEquals(bbox.getMinX(), -180, 0.0);
    assertEquals(bbox.getMaxX(), 180, 0.0);
    assertEquals(bbox.getMinY(), -90, 0.0);
    assertEquals(bbox.getMaxY(), 90, 0.0);
   
    assertEquals(capabilities.getLayerList().size(), 21);
   
    layer = (Layer) capabilities.getLayerList().get(20);
    assertEquals(layer.getParent(), topLayer);
    assertTrue(layer.isQueryable());
    assertEquals(layer.getName(), "Ocean features");
    assertEquals(layer.getTitle(), "Ocean features");
   
    // Added test to verify inheritance, should be same as previous llbbox
    llbbox = layer.getLatLonBoundingBox();
    assertNotNull(llbbox);
    assertEquals(llbbox.getMinX(), -180, 0.0);
    assertEquals(llbbox.getMaxX(), 180, 0.0);
    assertEquals(llbbox.getMinY(), -90, 0.0);
    assertEquals(llbbox.getMaxY(), 90, 0.0);
   
    bbox = (CRSEnvelope) layer.getBoundingBoxes().get("CRS:84");
    assertNotNull(bbox);
    assertEquals(bbox.getEPSGCode(), "CRS:84");
    assertEquals(bbox.getMinX(), -180, 0.0);
    assertEquals(bbox.getMaxX(), 179.999420166016, 0.0);
    assertEquals(bbox.getMinY(), -62.9231796264648, 0.0);
    assertEquals(bbox.getMaxY(), 68.6906585693359, 0.0);
   
  }
View Full Code Here

        out.print("Performing GetMap operation...");
        GetMapRequest request = wms.createGetMapRequest();
       
        request.addLayer(layer);
        CRSEnvelope bbox = layer.getLatLonBoundingBox();
        request.setBBox(bbox);
        request.setFormat(format);
        request.setSRS("EPSG:4326");
        request.setDimensions("100","100");
View Full Code Here

            // Added additional check to test for inherited srs
            assertTrue(layer.getSrs().contains("EPSG:4326"));
            assertTrue(layer.getSrs().contains("EPSG:26905"));
            assertTrue(layer.getSrs().contains("EPSG:26920"));
            assertEquals(layer.getBoundingBoxes().size(), 13);
            CRSEnvelope bbox = (CRSEnvelope) layer.getBoundingBoxes().get("EPSG:26905");
            assertNotNull(bbox);
            assertEquals(bbox.getEPSGCode(), "EPSG:26905");
            assertEquals(bbox.getMinX(), 552600.0, 0.0);
            assertEquals(bbox.getMinY(), 6540200.0, 0.0);
            assertEquals(bbox.getMaxX(), 670200.0, 0.0);
            assertEquals(bbox.getMaxY(), 6794800.0, 0.0);
            assertEquals(10, layer.getScaleHintMin(), 0);
            assertEquals(10000, layer.getScaleHintMax(), 0);
           
            bbox = (CRSEnvelope) layer.getBoundingBoxes().get("EPSG:26920");
            assertNotNull(bbox);
            assertEquals(bbox.getEPSGCode(), "EPSG:26920");
            assertEquals(bbox.getMinX(), 181800.0, 0.0);
            assertEquals(bbox.getMinY(), 1985200.0, 0.0);
            assertEquals(bbox.getMaxX(), 269400.0, 0.0);
            assertEquals(bbox.getMaxY(), 2048600.0, 0.0);
           
            // Changed expected value, no duplicates allowed by spec
            assertEquals(layer.getStyles().size(), 18);
            assertTrue(layer.getStyles().contains(new StyleImpl("UTMGrid")));
            assertTrue(layer.getStyles().contains(new StyleImpl("GeoGrid_Cyan")));
View Full Code Here

          layer.setLatLonBoundingBox((CRSEnvelope) value[i]
              .getValue());
        }

        if (sameName(elems[6], value[i])) {
          CRSEnvelope bbox = (CRSEnvelope) value[i].getValue();

          boundingBoxes.put(bbox.getEPSGCode(), bbox);
        }

         if (sameName(elems[7], value[i])) {
           Dimension dim = (Dimension) value[i].getValue();
           dimensions.put(dim.getName(), dim);
View Full Code Here

                }
            }
        }
    }
    public void testCRSEnvelope(){
        CRSEnvelope test = new CRSEnvelope( null, -20, -100, 20, 100 );
        test.setSRSName("EPSG:4326", false );
        CoordinateReferenceSystem crs = test.getCoordinateReferenceSystem();
        assertEquals( AxisOrder.NORTH_EAST, CRS.getAxisOrder( crs ) );
       
        test = new CRSEnvelope( null, 100, -20, 100, 20 );
        test.setSRSName("EPSG:4326", true );
        crs = test.getCoordinateReferenceSystem();
        assertEquals( AxisOrder.EAST_NORTH, CRS.getAxisOrder( crs ) );
       
    }
View Full Code Here

    }

    public void testImgSample130() throws Exception {
        Layer water_bodies = find("topp:tasmania_water_bodies");
        assertNotNull("Img_Sample layer found", water_bodies);
        CRSEnvelope latLon = water_bodies.getLatLonBoundingBox();
        assertEquals("LatLonBoundingBox axis 0 name", "Geodetic longitude",
                axisName(latLon.getCoordinateReferenceSystem(), 0));
        assertEquals("LatLonBoundingBox axis 0 name", "Geodetic latitude",
                axisName(latLon.getCoordinateReferenceSystem(), 1));

        boolean globalXY = Boolean.getBoolean("org.geotools.referencing.forceXY");
       
        CRSEnvelope bounds = water_bodies.getBoundingBoxes().get("EPSG:4326");
        CoordinateReferenceSystem boundsCRS = bounds.getCoordinateReferenceSystem();
        if( globalXY ){
            // ensure WMS CRSEnvelope returned according to application globalXY setting
            assertEquals( "EPSG:4326", AxisOrder.EAST_NORTH, CRS.getAxisOrder(boundsCRS) );
        }
        else {
            assertEquals( "EPSG:4326", AxisOrder.NORTH_EAST, CRS.getAxisOrder(boundsCRS) );
        }
        if( CRS.getAxisOrder(boundsCRS) == AxisOrder.EAST_NORTH ){
            assertEquals("axis order 0 min", latLon.getMinimum(1), bounds.getMinimum(1));
            assertEquals("axis order 1 min", latLon.getMinimum(0), bounds.getMinimum(0));
            assertEquals("axis order 1 max", latLon.getMaximum(0), bounds.getMaximum(0));
            assertEquals("axis order 1 min", latLon.getMaximum(1), bounds.getMaximum(1));
        }
       
        if( CRS.getAxisOrder(boundsCRS) == AxisOrder.NORTH_EAST ){
            assertEquals("axis order 0 min", latLon.getMinimum(1), bounds.getMinimum(0));
            assertEquals("axis order 1 min", latLon.getMinimum(0), bounds.getMinimum(1));
            assertEquals("axis order 1 max", latLon.getMaximum(0), bounds.getMaximum(1));
            assertEquals("axis order 1 min", latLon.getMaximum(1), bounds.getMaximum(0));
        }

        // GETMAP
        checkGetMap(wms, water_bodies, DefaultGeographicCRS.WGS84);
        checkGetMap(wms, water_bodies, CRS.decode("CRS:84"));
View Full Code Here

        WMSCapabilities caps = wms111.getCapabilities();
        assertEquals("1.1.1", caps.getVersion());
   
        Layer water_bodies = find("topp:tasmania_water_bodies", caps);
        assertNotNull("Img_Sample layer found", water_bodies);
        CRSEnvelope latLon = water_bodies.getLatLonBoundingBox();
        assertEquals("LatLonBoundingBox axis 0 name", "Geodetic longitude",
                axisName(latLon.getCoordinateReferenceSystem(), 0));
        assertEquals("LatLonBoundingBox axis 1 name", "Geodetic latitude",
                axisName(latLon.getCoordinateReferenceSystem(), 1));
   
        CRSEnvelope bounds = water_bodies.getBoundingBoxes().get("EPSG:4326");
        CoordinateReferenceSystem boundsCRS = bounds.getCoordinateReferenceSystem();
        assertEquals( "EPSG:4326", AxisOrder.EAST_NORTH, CRS.getAxisOrder(boundsCRS) );;
   
        assertEquals("axis order 0 min", latLon.getMinimum(0), bounds.getMinimum(0));
        assertEquals("axis order 1 min", latLon.getMinimum(1), bounds.getMinimum(1));
        assertEquals("axis order 1 max", latLon.getMaximum(0), bounds.getMaximum(0));
        assertEquals("axis order 1 min", latLon.getMaximum(1), bounds.getMaximum(1));
   
        // GETMAP
        checkGetMap(wms111, water_bodies, DefaultGeographicCRS.WGS84);
        checkGetMap(wms111, water_bodies, CRS.decode("CRS:84"));
        checkGetMap(wms111, water_bodies, CRS.decode("EPSG:4326"));
View Full Code Here

     *      java.util.Map)
     */
    public Object getValue(Element element, ElementValue[] value,
        Attributes attrs, Map hints) throws SAXException,
        OperationNotSupportedException {
      CRSEnvelope bbox = new CRSEnvelope();

      for (int i = 0; i < value.length; i++) {
        if (sameName(elems[0], value[i])) {
          bbox.setMinX(((Double) value[i].getValue()).doubleValue());
        }
        if (sameName(elems[1], value[i])) {
          bbox.setMaxX(((Double) value[i].getValue()).doubleValue());
        }
        if (sameName(elems[2], value[i])) {
          bbox.setMinY(((Double) value[i].getValue()).doubleValue());
        }
        if (sameName(elems[3], value[i])) {
          bbox.setMaxY(((Double) value[i].getValue()).doubleValue());
        }
      }

      return bbox;
    }
View Full Code Here

TOP

Related Classes of org.geotools.data.ows.CRSEnvelope

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.