Package org.geotools.geopkg.wps

Examples of org.geotools.geopkg.wps.GeoPackageProcessRequest$Layer


            handleScoreChild(contentChildForm, saveAllVariants));
      }
      return contentNode;
    } else if (childForm instanceof LayerForm) {
      LayerForm contentForm = (LayerForm) childForm;
      Layer contentNode = (Layer) contentForm.getMeiNode();
      contentNode.getBarLinesAndSyllablesAndGaps().clear();
      for (BasicElement contentChildForm : contentForm.getChildren()) {
        contentNode.getBarLinesAndSyllablesAndGaps().add(
            handleScoreChild(contentChildForm, saveAllVariants));
      }
      return contentNode;
    } else if (childForm instanceof ChordGroupForm) {
      ChordGroupForm contentForm = (ChordGroupForm) childForm;
      Chord contentNode = (Chord) contentForm.getMeiNode();
      contentNode.getRestoresAndArticsAndUnclears().clear();
      for (BasicElement contentChildForm : contentForm.getChildren()) {
        contentNode.getRestoresAndArticsAndUnclears().add(
            handleScoreChild(contentChildForm, saveAllVariants));
      }
      if(contentNode.getArtics().isEmpty()) {
        contentNode.unsetArtics();
      }
      return contentNode;
    } else if (childForm instanceof BeamGroupForm) {
      BeamGroupForm contentForm = (BeamGroupForm) childForm;
      Beam contentNode = (Beam) contentForm.getMeiNode();
      contentNode.getFTremsAndChordsAndDamages().clear();
      for (BasicElement contentChildForm : contentForm.getChildren()) {
        contentNode.getFTremsAndChordsAndDamages().add(
            handleScoreChild(contentChildForm, saveAllVariants));
      }
      return contentNode;
    } else if (childForm instanceof NoteForm) {
      NoteForm contentForm = (NoteForm) childForm;
      Note contentNode = (Note) contentForm.getMeiNode();
      if (contentNode.getArtics().isEmpty())
        contentNode.unsetArtics();
      return contentNode;
    } else if (childForm instanceof RestForm) {
      RestForm contentForm = (RestForm) childForm;
      Rest contentNode = (Rest) contentForm.getMeiNode();
      return contentNode;
    } else if (childForm instanceof MRestForm) {
      MRestForm contentForm = (MRestForm) childForm;
      MRest contentNode = (MRest) contentForm.getMeiNode();
      return contentNode;
    } else if (childForm instanceof SpaceForm) {
      SpaceForm contentForm = (SpaceForm) childForm;
      Space contentNode = (Space) contentForm.getMeiNode();
      return contentNode;
    } else if (childForm instanceof DynamForm) {
      DynamForm contentForm = (DynamForm) childForm;
      Dynam contentNode = (Dynam) contentForm.getMeiNode();
      for (BasicElement contentChildForm : contentForm.getChildren()) {
        contentNode.getContent().add(
            handleScoreChild(contentChildForm, saveAllVariants));
      }
      return contentNode;
    } else if (childForm instanceof TieForm) {
      TieForm contentForm = (TieForm) childForm;
View Full Code Here


   * @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$Layer

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.