Package org.geotools.geopkg.wps

Examples of org.geotools.geopkg.wps.GeoPackageProcessRequest


   * @generated modifiable
   */ 
  public Object parse(ElementInstance instance, Node node, Object value)
    throws Exception {
     
      GeoPackageProcessRequest request = new GeoPackageProcessRequest();
     
      request.setName((String) node.getAttributeValue("name"));
      String attributeValue = (String) node.getAttributeValue("path");
      if(attributeValue != null && !attributeValue.isEmpty()){
             URL url = new URL(attributeValue);
              request.setPath(url);
      }
     
      String removeFile = (String) node.getAttributeValue("remove");
            if(removeFile != null && !removeFile.isEmpty()){
                    request.setRemove(Boolean.parseBoolean(removeFile));
            }else{
                request.setRemove(true);
            }
      for (Object child : node.getChildren()){
          request.addLayer((GeoPackageProcessRequest.Layer) ((Node) child).getValue());
      }
      return request;
  }
View Full Code Here


                + "</gridset>"
                + "</tiles>"
                + "</geopackage>");
        Object result = parse(GPKG.geopkgtype);
        assertTrue(result instanceof GeoPackageProcessRequest);
        GeoPackageProcessRequest request = (GeoPackageProcessRequest) result;
       
        assertNotNull(request.getRemove());
        assertTrue(request.getRemove());
        assertTrue(request.getPath().toString().equalsIgnoreCase("file://test"));
        assertEquals(2, request.getLayerCount());
       
        assertTrue(request.getLayer(0) instanceof GeoPackageProcessRequest.FeaturesLayer);
        GeoPackageProcessRequest.FeaturesLayer features = (GeoPackageProcessRequest.FeaturesLayer) request.getLayer(0);
        assertEquals("f1", features.getIdentifier());
        assertEquals("features1", features.getName());
        assertEquals("features1 description", features.getDescription());
        assertEquals("featuretypename", features.getFeatureType().getLocalPart());
        assertEquals(2, features.getPropertyNames().size());
        assertTrue(features.getPropertyNames().contains(new QName("http://www.opengis.net/gpkg", "property1", "")));
        assertTrue(features.getPropertyNames().contains(new QName("http://www.opengis.net/gpkg", "property2", "")));
        assertTrue(features.getFilter() instanceof PropertyIsEqualTo);
        PropertyIsEqualTo filter = (PropertyIsEqualTo) features.getFilter();
        assertTrue(filter.getExpression1() instanceof PropertyName);
        assertTrue(filter.getExpression2() instanceof Literal);
        assertEquals("propertyx", ((PropertyName) filter.getExpression1()).getPropertyName());
        assertEquals("999", ((Literal) filter.getExpression2()).getValue());
       
        assertTrue(request.getLayer(0) instanceof GeoPackageProcessRequest.FeaturesLayer);
        GeoPackageProcessRequest.TilesLayer tiles = (GeoPackageProcessRequest.TilesLayer) request.getLayer(1);
        assertEquals("t1", tiles.getIdentifier());
        assertEquals("tiles1", tiles.getName());
        assertEquals("tiles1 description", tiles.getDescription());
        assertEquals("EPSG:4326", tiles.getSrs().toString());
        assertEquals("png", tiles.getFormat());
View Full Code Here

TOP

Related Classes of org.geotools.geopkg.wps.GeoPackageProcessRequest

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.