Package org.geotools.data.store

Examples of org.geotools.data.store.ContentFeatureSource


        return new OracleCurvesTestSetup();
    }

    @Test
    public void testSingleArc() throws Exception {
        ContentFeatureSource fs = dataStore.getFeatureSource(tname("curves"));
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo filter = ff.equal(ff.property(aname("name")), ff.literal("Arc segment"),
                true);
        Query q = new Query(tname("curves"), filter);
        q.getHints().put(Hints.LINEARIZATION_TOLERANCE, 0.1);
        ContentFeatureCollection fc = fs.getFeatures(q);
        assertEquals(1, fc.size());
        SimpleFeature feature = DataUtilities.first(fc);
        Geometry g = (Geometry) feature.getDefaultGeometry();
        assertNotNull(g);
        assertTrue(g instanceof SingleCurvedGeometry);
View Full Code Here


        assertEquals(0.1, curved.getTolerance(), 0d);
    }

    @Test
    public void testCircularString() throws Exception {
        ContentFeatureSource fs = dataStore.getFeatureSource(tname("curves"));
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo filter = ff.equal(ff.property(aname("name")), ff.literal("Arc string"),
                true);
        ContentFeatureCollection fc = fs.getFeatures(filter);
        assertEquals(1, fc.size());
        SimpleFeature feature = DataUtilities.first(fc);
        Geometry g = (Geometry) feature.getDefaultGeometry();
        assertNotNull(g);
        assertTrue(g instanceof SingleCurvedGeometry);
View Full Code Here

        assertArrayEquals(new double[] { 10, 35, 15, 40, 20, 35, 25, 30, 30, 35 }, cp, 0d);
    }

    @Test
    public void testCompoundOpen() throws Exception {
        ContentFeatureSource fs = dataStore.getFeatureSource(tname("curves"));
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo filter = ff.equal(ff.property(aname("name")),
                ff.literal("Compound line string"), true);
        ContentFeatureCollection fc = fs.getFeatures(filter);
        assertEquals(1, fc.size());
        SimpleFeature feature = DataUtilities.first(fc);
        Geometry g = (Geometry) feature.getDefaultGeometry();
        assertNotNull(g);
        assertTrue(g instanceof CompoundCurvedGeometry<?>);
View Full Code Here

    public void testSimplifyGeography() throws Exception {
        // try to simplify geometry, but ST_Simplify is not defined for geometry
        Query query = new Query(tname("geoline"));
        query.getHints().add(new RenderingHints(Hints.GEOMETRY_SIMPLIFICATION, 2.0));
        // used to go boom here
        ContentFeatureSource fs = dataStore.getFeatureSource(tname("geoline"));
        SimpleFeatureCollection features = fs.getFeatures(query);
        // check the geometry is what we expect (but make it so that if in the future we can simplify
        // over geography, the test still passes
        SimpleFeature sf = DataUtilities.first(features);
        LineString ls = (LineString) sf.getDefaultGeometry();
        assertEquals(0d, ls.getStartPoint().getX());
View Full Code Here

        assertEquals("gttestdb.countries",typeNames[1]);
    }
   
    @Test
    public void testFeatureType() throws Exception {       
        ContentFeatureSource featureSource = store.getFeatureSource("gttestdb.counties");
        SimpleFeatureType schema = featureSource.getSchema();
        assertNotNull(schema.getDescriptor("Name"));
        assertNotNull(schema.getDescriptor("State"));
    }
View Full Code Here

        }
    }

    @Test
    public void testGetFeatureSource() throws Exception {
        ContentFeatureSource source;

        source = (ContentFeatureSource) dataStore.getFeatureSource(simpleTypeName1);
        assertNotNull(source);
        assertTrue(source instanceof WFSFeatureStore);
View Full Code Here

    @Test
    public void testAddFeaturesAutoCommit() throws Exception {
        GeometryFactory geomfac = new GeometryFactory(new PrecisionModel(10));
        FilterFactory2 filterfac = CommonFactoryFinder.getFilterFactory2();
       
        ContentFeatureSource source = (ContentFeatureSource) dataStore.getFeatureSource(simpleTypeName1);
        assertNotNull(source);
        assertTrue(source instanceof WFSFeatureStore);

        WFSFeatureStore store = (WFSFeatureStore) source;
                
View Full Code Here

    @Test
    public void testRemoveFeaturesAutoCommit() throws Exception {

        FilterFactory2 filterfac = CommonFactoryFinder.getFilterFactory2();
       
        ContentFeatureSource source = (ContentFeatureSource) dataStore.getFeatureSource(simpleTypeName1);
       
        WFSFeatureStore store = (WFSFeatureStore) source;
       
        Filter filter = filterfac.id(filterfac.featureId("poi.2"));
       
View Full Code Here

    @Test
    public void testUpdateFeaturesAutoCommit() throws Exception {

        FilterFactory2 filterfac = CommonFactoryFinder.getFilterFactory2();
       
        ContentFeatureSource source = (ContentFeatureSource) dataStore.getFeatureSource(simpleTypeName1);
       
        WFSFeatureStore store = (WFSFeatureStore) source;
       
        Filter filter = filterfac.id(filterfac.featureId("poi.2"));
       
View Full Code Here

    @Test
    public void testTransaction() throws Exception {
        GeometryFactory geomfac = new GeometryFactory(new PrecisionModel(10));
        FilterFactory2 filterfac = CommonFactoryFinder.getFilterFactory2();
       
        ContentFeatureSource source = (ContentFeatureSource) dataStore.getFeatureSource(simpleTypeName1);
        assertNotNull(source);
        assertTrue(source instanceof WFSFeatureStore);

        WFSFeatureStore store = (WFSFeatureStore) source;
                
View Full Code Here

TOP

Related Classes of org.geotools.data.store.ContentFeatureSource

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.