Package org.opengis.feature

Examples of org.opengis.feature.FeatureFactory


    public void testGetFilterFactory() {
        assertNotNull( CommonFactoryFinder.getFilterFactory( null ));
    }
   
    public void testGetDefaultFeatureFactory() {
        FeatureFactory featureFactory = CommonFactoryFinder.getFeatureFactory( null );
        assertNotNull(featureFactory);
        assertTrue(featureFactory instanceof AbstractFeatureFactoryImpl);
    }
View Full Code Here


        assertTrue(featureFactory instanceof AbstractFeatureFactoryImpl);
    }
   
    public void testGetValidatingFeatureFactory() {
        Hints hints = new Hints(Hints.FEATURE_FACTORY, ValidatingFeatureFactoryImpl.class);
        FeatureFactory featureFactory = CommonFactoryFinder.getFeatureFactory( hints );
        assertNotNull(featureFactory);
        assertTrue(featureFactory instanceof ValidatingFeatureFactoryImpl);
    }
View Full Code Here

     *
     * @param schema the feature type
     * @return a template feature
     */
    public static Feature templateFeature(FeatureType schema) {
      FeatureFactory ff = CommonFactoryFinder.getFeatureFactory(null);
      Collection<Property> value = new ArrayList<Property>();
     
      for (PropertyDescriptor pd : schema.getDescriptors()) {
        if (pd instanceof AttributeDescriptor) {
          if (pd instanceof GeometryDescriptor) {
            value.add(new GeometryAttributeImpl (((AttributeDescriptor) pd).getDefaultValue(), (GeometryDescriptor) pd, null) );
          } else {
            value.add(new AttributeImpl (((AttributeDescriptor) pd).getDefaultValue(), (AttributeDescriptor) pd, null) );
          }
        }               
        }
     
      return ff.createFeature(value, (FeatureTypeschema, SimpleFeatureBuilder.createDefaultFeatureId());       
    }
View Full Code Here

            geometryFactory = new CurvedGeometryFactory(geometryFactory, linearizationTolerance);
        }

        // create a feature builder using the factory hinted or the one coming
        // from the datastore
        FeatureFactory ff = (FeatureFactory) hints.get(Hints.FEATURE_FACTORY);
        if(ff == null)
            ff = featureSource.getDataStore().getFeatureFactory();
        builder = new SimpleFeatureBuilder(featureType, ff);
       
        // find the primary key
View Full Code Here

    }
   
    @Test
    public void encodeInsert() throws IOException, SAXException, TransformerException, XpathException{
        WfsFactory wfsfac = WfsFactory.eINSTANCE;
        FeatureFactory ff = CommonFactoryFinder.getFeatureFactory(null);
        FeatureTypeFactory ftf = new FeatureTypeFactoryImpl();
       
        AttributeDescriptor ad = ftf.createAttributeDescriptor(XSSchema.STRING_TYPE, new NameImpl("dummyAttribute"), 0, 1, true, null);
        SimpleFeatureType ft = ftf.createSimpleFeatureType(new NameImpl("dummyFeatureType"), Collections.singletonList(ad), null, false, null, null, null);
        SimpleFeature feature = ff.createSimpleFeature(new Object[] {"dummyValue"}, ft, "dummyId");
       
        InsertElementType insert = wfsfac.createInsertElementType();
        insert.getFeature().add(feature);       
       
        Encoder encoder = new Encoder(new WFSConfiguration());
View Full Code Here

    }
   
    @Test
    public void encodeInsert() throws IOException, SAXException, TransformerException, XpathException{
        WfsFactory wfsfac = WfsFactory.eINSTANCE;
        FeatureFactory ff = CommonFactoryFinder.getFeatureFactory(null);
        FeatureTypeFactory ftf = new FeatureTypeFactoryImpl();
       
        AttributeDescriptor ad = ftf.createAttributeDescriptor(XSSchema.STRING_TYPE, new NameImpl("dummyAttribute"), 0, 1, true, null);
        SimpleFeatureType ft = ftf.createSimpleFeatureType(new NameImpl("dummyFeatureType"), Collections.singletonList(ad), null, false, null, null, null);
        SimpleFeature feature = ff.createSimpleFeature(new Object[] {"dummyValue"}, ft, "dummyId");
       
        InsertElementType insert = wfsfac.createInsertElementType();
        insert.getFeature().add(feature);       
       
        Encoder encoder = new Encoder(new WFSConfiguration());
View Full Code Here

TOP

Related Classes of org.opengis.feature.FeatureFactory

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.