Examples of createDataStore()


Examples of org.geotools.data.shapefile.ShapefileDataStoreFactory.createDataStore()

                if (ds == null) {
                    ShapefileDataStoreFactory dsf = new ShapefileDataStoreFactory();
                    if (dsf.canProcess(params)) {

                        try {
                            ds = (ShapefileDataStore) dsf.createDataStore(params);
                            // openIndexGenerationDialog(ds);
                            // hit it lightly to make sure it exists.
                            ds.getFeatureSource();

                        } catch (IOException e) {
View Full Code Here

Examples of org.geotools.data.shapefile.ShapefileDataStoreFactory.createDataStore()

                        } catch (IOException e) {
                            msg = e;
                            try {
                                params.remove(ShapefileDataStoreFactory.CREATE_SPATIAL_INDEX.key);
                                ds = (ShapefileDataStore) dsf.createDataStore(params);
                                // hit it lightly to make sure it exists.
                                ds.getFeatureSource();

                            } catch (Exception e2) {
                                msg = e2;
View Full Code Here

Examples of org.geotools.data.shapefile.ShapefileDirectoryFactory.createDataStore()

        Map params = new HashMap();
        params.put(ShapefileDataStoreFactory.URLP.key, tempDir.toURI().toURL());
        params.put(ShapefileDataStoreFactory.NAMESPACEP.key, "http://www.geotools.org");
        ShapefileDirectoryFactory factory = new ShapefileDirectoryFactory();
        assertTrue(factory.canProcess(params));
        DataStore store = factory.createDataStore(params);
        assertNotNull(store);
        assertEquals(2, store.getNames().size());
        store.dispose();
    }
   
View Full Code Here

Examples of org.geotools.data.shapefile.ShapefileDirectoryFactory.createDataStore()

        Map params = new HashMap();
        params.put(ShapefileDataStoreFactory.URLP.key, tempDir.toURI().toURL());
        params.put(ShapefileDataStoreFactory.NAMESPACEP.key, "http://www.geotools.org");
        ShapefileDirectoryFactory factory = new ShapefileDirectoryFactory();
        assertTrue(factory.canProcess(params));
        DataStore store = factory.createDataStore(params);
    assertNotNull(store);
    store.dispose();
    }
}
View Full Code Here

Examples of org.geotools.data.spatialite.SpatiaLiteDataStoreFactory.createDataStore()

        Map dbParams = new HashMap();
        dbParams.put(SpatiaLiteDataStoreFactory.DBTYPE.key, "spatialite");
        dbParams.put(SpatiaLiteDataStoreFactory.DATABASE.key, dbFile.getAbsolutePath());

        DataStore dataStore = dsFactory.createDataStore(dbParams);
        try {
            for (FeatureCollection fc : featureCollection.getFeatures()) {

                SimpleFeatureType featureType = (SimpleFeatureType) fc.getSchema()
                        ;
View Full Code Here

Examples of org.geotools.data.wfs.WFSDataStoreFactory.createDataStore()

                    URL url = new URL(WFS_SERVER_URL + "service=WFS&request=GetCapabilities");
                    params.put(WFSDataStoreFactory.URL.key, url);
                    params.put(WFSDataStoreFactory.TRY_GZIP.key, Boolean.TRUE);
                    //give it five seconds to respond...
                    params.put(WFSDataStoreFactory.TIMEOUT.key, Integer.valueOf(5000));
                    DataStore remoteStore = factory.createDataStore(params);
                    FeatureSource fs = remoteStore.getFeatureSource(TOPP_STATES);
                    remoteStatesAvailable = Boolean.TRUE;
                    // check a basic response can be answered correctly
                    DefaultQuery dq = new DefaultQuery(TOPP_STATES);
                    FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
View Full Code Here

Examples of org.geotools.data.wfs.WFSDataStoreFactory.createDataStore()

            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 WmsException("Could not connect to remote OWS", "RemoteOWSFailure", e);
        }
    }
View Full Code Here

Examples of org.geotools.data.wfs.WFSDataStoreFactory.createDataStore()

    }
    URL endPoint = new URL(getCapabilities);
    HashMap<String, Serializable> params = new HashMap<String, Serializable>();
    params.put(WFSDataStoreFactory.URL.key, endPoint);
    WFSDataStoreFactory dsFactory = new WFSDataStoreFactory();
    DataStore ds = dsFactory.createDataStore(params);
    return ds;
  }

  public static DataStore getDataStoreFromPostGIS(String host, int port,
      String user, String passwd, String database, String schema)
View Full Code Here

Examples of org.geotools.data.wfs.WFSDataStoreFactory.createDataStore()

        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.createDataStore()

        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
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.