Package org.geotools.validation

Examples of org.geotools.validation.IntegrityValidation


    //call the appropriate superclass method to add the validation to the feature/integrity lookup
    if (validation instanceof FeatureValidation) {
      FeatureValidation FV = (FeatureValidation) validation;
      super.addValidation(FV);
    } else if (validation instanceof IntegrityValidation) {
      IntegrityValidation IV = (IntegrityValidation) validation;
      super.addValidation(IV);
    }
    //ensure that a plugin is present
    if (plugin == null) {
      String errorMsg = "Validation plugin '"+validation.getName()+"' not found"; //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here


     * @throws Exception
     */
  public void runIntegrityTest(Object testName, ILayer[] layers, ValidationResults results, IProgressMonitor monitor) throws Exception {

    // get the validator from testKey
    IntegrityValidation validator = null;
    // (navigate through the featureLookup until we find an instance of the test)
    for (Iterator i = integrityLookup.keySet().iterator(); i.hasNext();) {
      ArrayList testList = (ArrayList) integrityLookup.get(i.next());
      // iterate through each item in the list
      for (Object thisTest : testList) {
        Validation test = (Validation) thisTest;
        // this is the matching validation for the given test
        if (test.getName().equals(testName)) {
          validator = (IntegrityValidation) test;
          break;
        }
      }
    }
    if (validator != null) // if we found the test
    {
      results.setValidation(validator);
          ReferencedEnvelope envelope = layers[0].getMap().getViewportModel().getBounds();
           FeatureSource<SimpleFeatureType, SimpleFeature> source;
          String nameSpace;
          String typeName;
          Map<String,FeatureSource<SimpleFeatureType, SimpleFeature>> stores = new HashMap<String,FeatureSource<SimpleFeatureType, SimpleFeature>>();
          for (int i = 0; i < layers.length; i++) {
              nameSpace = layers[i].getSchema().getName().getNamespaceURI();
              typeName = layers[i].getSchema().getName().getLocalPart();
              source = layers[i].getResource(FeatureSource.class, monitor);
              String typeRef = nameSpace.toString()+":"+typeName; //$NON-NLS-1$
              stores.put(typeRef, source);
          }
      // run the test
      validator.validate(stores, envelope, results);
    }
  }
View Full Code Here

                }
            }
           
        });
       
        final IntegrityValidation integrityValidation = getValidator(layer);
        if (integrityValidation == null) return;

        integrityValidation.validate(map, envelope, results);
       
        OpUtils.setSelection(layer[0], results);
        OpUtils.notifyUser(display, results);
       
        monitor.internalWorked(1);
View Full Code Here

TOP

Related Classes of org.geotools.validation.IntegrityValidation

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.