Examples of WFSDataStoreFactory


Examples of org.geotools.data.wfs.WFSDataStoreFactory

       
        Map m = new HashMap();
        m.put(WFSDataStoreFactory.URL.key, url);
        m.put(WFSDataStoreFactory.TIMEOUT.key, new Integer(100000));
        m.put(WFSDataStoreFactory.PROTOCOL.key, usePost);
        WFS_1_0_0_DataStore wfs = (WFS_1_0_0_DataStore) (new WFSDataStoreFactory())
                .createDataStore(m);

        final WFS100ProtocolHandler originalHandler = wfs.protocolHandler;
        wfs.protocolHandler = new WFS100ProtocolHandler(null, originalHandler.getConnectionFactory()) {
            @Override
View Full Code Here

Examples of org.geotools.data.wfs.WFSDataStoreFactory

            Map m = new HashMap();
            m.put(WFSDataStoreFactory.URL.key,url);
            m.put(WFSDataStoreFactory.TIMEOUT.key,new Integer(10000));
            m.put(WFSDataStoreFactory.PROTOCOL.key,Boolean.FALSE);

            DataStore wfs = (new WFSDataStoreFactory()).createNewDataStore(m);
            Query query = new Query(wfs.getTypeNames()[1]);
             FeatureReader<SimpleFeatureType, SimpleFeature> ft = wfs.getFeatureReader(query,Transaction.AUTO_COMMIT);
            int count = 0;
            while(ft.hasNext())
                if(ft.next()!=null)
View Full Code Here

Examples of org.geotools.data.wfs.WFSDataStoreFactory

        if (post != null) {
            m.put(WFSDataStoreFactory.PROTOCOL.key, Boolean.valueOf(post));
        }

        return new WFSDataStoreFactory().createDataStore(m);

    }
View Full Code Here

Examples of org.geotools.data.wfs.WFSDataStoreFactory

        WFS_1_0_0_DataStore ds;

        int totalFeatures;

        URL host=new URL("http://mapserver.refractions.net/cgi-bin/mapserv48?map=/home/www/mapserv/maps/victoria-wms.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities");
        WFSDataStoreFactory dsfac = new WFSDataStoreFactory();
        Map params = new HashMap();
        params.put(WFSDataStoreFactory.URL.key, host);
        params.put(WFSDataStoreFactory.TIMEOUT.key, 10000);
        params.put(WFSDataStoreFactory.BUFFER_SIZE.key, 100);
        params.put(WFSDataStoreFactory.TRY_GZIP.key, Boolean.TRUE);
        params.put(WFSDataStoreFactory.LENIENT.key, Boolean.TRUE);

        //ds=new WFSDataStore(host, null, null, null, 10000, 100, true, true);
        ds = (WFS_1_0_0_DataStore) dsfac.createDataStore(params);
        assertTrue( ds.strategy instanceof MapServerWFSStrategy );
       
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
       
        String attName = ds.getSchema(TYPE_NAME).getGeometryDescriptor().getLocalName();
View Full Code Here

Examples of org.geotools.data.wfs.WFSDataStoreFactory

            Map<String, Serializable> params;

            params = new HashMap<String, Serializable>();
            params.put(WFSDataStoreFactory.URL.key, url_100);

            wfs100 = new WFSDataStoreFactory().createDataStore(params);

            params = new HashMap<String, Serializable>();
            params.put(WFSDataStoreFactory.URL.key, url_110);
            wfs110 = new WFSDataStoreFactory().createDataStore(params);

            assertEquals("1.0.0", wfs100.getInfo().getVersion());
            assertEquals("1.1.0", wfs110.getInfo().getVersion());
        }
    }
View Full Code Here

Examples of org.geotools.data.wfs.WFSDataStoreFactory

        try{
        Map m = new HashMap();
        m.put(WFSDataStoreFactory.URL.key,server);
        m.put(WFSDataStoreFactory.TIMEOUT.key,new Integer(10000)); // not debug
        //m.put(WFSDataStoreFactory.TIMEOUT.key,new Integer(1000000)); //for debug
        return (WFS_1_0_0_DataStore)(new WFSDataStoreFactory()).createDataStore(m);

        }catch(java.net.SocketException se){
            se.printStackTrace();
            return null;
        }
View Full Code Here

Examples of org.geotools.data.wfs.WFSDataStoreFactory

        // we alter the data store, thus we cannot use the static "wfs" field, we need to create a new one
        Map<String, Serializable> params = new HashMap<String, Serializable>();
        params.put(WFSDataStoreFactory.URL.key, SERVER_URL);
        params.put(WFSDataStoreFactory.PROTOCOL.key, usePost);
        params.put("USE_PULL_PARSER", Boolean.TRUE);
        WFSDataStoreFactory dataStoreFactory = new WFSDataStoreFactory();
        WFSDataStore wfs = dataStoreFactory.createDataStore(params);
       
        final WFS_1_1_0_Protocol originalHandler = (WFS_1_1_0_Protocol) ((WFS_1_1_0_DataStore) wfs).wfs;
        originalHandler.http = new HttpProtocolWrapper(originalHandler.http) {
           
            @Override
View Full Code Here

Examples of org.geotools.data.wfs.WFSDataStoreFactory

            LOGGER.info("Creating test datastore for " + SERVER_URL);

            Map<String, Serializable> params = new HashMap<String, Serializable>();
            params.put(WFSDataStoreFactory.URL.key, SERVER_URL);
            params.put("USE_PULL_PARSER", Boolean.TRUE);
            WFSDataStoreFactory dataStoreFactory = new WFSDataStoreFactory();
            wfs = dataStoreFactory.createDataStore(params);
            LOGGER.fine("WFS datastore created");
        }
    }
View Full Code Here

Examples of org.geotools.data.wfs.WFSDataStoreFactory

            LOGGER.info("Creating test datastore for " + SERVER_URL);

            Map<String, Serializable> params = new HashMap<String, Serializable>();
            params.put(WFSDataStoreFactory.URL.key, SERVER_URL);
            params.put("USE_PULL_PARSER", Boolean.TRUE);
            WFSDataStoreFactory dataStoreFactory = new WFSDataStoreFactory();
            wfs = dataStoreFactory.createDataStore(params);
            LOGGER.fine("WFS datastore created");
        }
    }
View Full Code Here

Examples of org.geotools.data.wfs.WFSDataStoreFactory

        return layersOrGroups;
    }

    private static DataStore connectRemoteWFS(URL remoteOwsUrl) throws ServiceException {
        try {
            WFSDataStoreFactory factory = new WFSDataStoreFactory();
            Map params = new HashMap(factory.getImplementationHints());
            params.put(WFSDataStoreFactory.URL.key, remoteOwsUrl
                    + "&request=GetCapabilities&service=WFS");
            params.put(WFSDataStoreFactory.TRY_GZIP.key, Boolean.TRUE);
            return factory.createDataStore(params);
        } catch (Exception e) {
            throw new ServiceException("Could not connect to remote OWS", e, "RemoteOWSFailure");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.