Examples of createDataStore()


Examples of org.geotools.data.postgis.PostgisDataStoreFactory.createDataStore()

          param.put("loose bbox","true");
          param.put("dbtype","postgis");
         
         
           
         THIS.ds = pgdsf.createDataStore(param);
        
          THIS.MODULE = args[1];
        
         System.out.println("start module = "+THIS.MODULE);
          
View Full Code Here

Examples of org.geotools.data.postgis.PostgisNGDataStoreFactory.createDataStore()

    }

    public synchronized JDBCDataStore getDataStore() throws IOException {
      if(datastore == null) {
            PostgisNGDataStoreFactory factory = PostgisServiceExtension2.getFactory();
            datastore = factory.createDataStore(params);
      }
        return datastore;
    }

    public String getSchemaName() {
View Full Code Here

Examples of org.geotools.data.postgis.PostgisNGDataStoreFactory.createDataStore()

        datastore=null;
        PostgisServiceExtension2 ext=new PostgisServiceExtension2();
        Map<String, Serializable> params = ext.createParams(PostgisServiceExtension2.DIALECT.toURL(url));
        PostgisNGDataStoreFactory factory = new PostgisNGDataStoreFactory();
       
        datastore=factory.createDataStore(params);
        return datastore;
    }

    public String getExtensionID() {
        return ID;
View Full Code Here

Examples of org.geotools.data.postgis.PostgisNGDataStoreFactory.createDataStore()

        // we can work with it
        assertTrue(factory.canProcess(params));
       
        // force database creation and check the store functions
        JDBCDataStore store = factory.createDataStore(params);
        assertNotNull(store);
        store.createSchema(DataUtilities.createType("test", "id:String,polygonProperty:Polygon:srid=32615"));
        store.getSchema("test");
       
        // now disconnect and drop
View Full Code Here

Examples of org.geotools.data.postgis.PostgisNGDataStoreFactory.createDataStore()

        factory.dropDatabase(params);
       
        // try to connect again, it must fail
        params.remove(PostgisNGDataStoreFactory.CREATE_DB_IF_MISSING.key);
        try {
            store = factory.createDataStore(params);
            store.getTypeNames();
            fail("This one should have failed, the database has just been dropped");
        } catch(Exception e) {
            // fine, it's what we expected
        }
View Full Code Here

Examples of org.geotools.data.sfs.SFSDataStoreFactory.createDataStore()

            /* If mock service is available then URL can be tested otherwise see
             * the next test
             */
            SFSDataStoreFactory factory = new SFSDataStoreFactory();
            SFSDataStore ods = (SFSDataStore) factory.createDataStore(createParams());

            process(ods);

        } else {
            return;
View Full Code Here

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

            return;
        }
       
        ShapefileDataStoreFactory dsfac = new ShapefileDataStoreFactory();
        File tmp = File.createTempFile(layers[0].getName() + "_" + layers[1].getName() + "_diff", ".shp"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        DataStore ds = dsfac.createDataStore(tmp.toURL());
        final SimpleFeatureType newSchema = FeatureTypes.newFeatureType(
                fromLayer.getSchema().getAttributeDescriptors().toArray(
                        new AttributeDescriptor[0]), "diff"); //$NON-NLS-1$
        ds.createSchema(newSchema);
       
View Full Code Here

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

        ShapefileDataStoreFactory factory = new ShapefileDataStoreFactory();
        Map<String, Serializable> params = new HashMap<String, Serializable>();
        params.put(ShapefileDataStoreFactory.URLP.key, file.toURI().toURL());
        params.put(ShapefileDataStoreFactory.CREATE_SPATIAL_INDEX.key, true);
       
        DataStore ds = factory.createDataStore(params);
        ds.createSchema(type);
        List<IService> service = CatalogPlugin.getDefault().getServiceFactory().createService(
                file.toURI().toURL());
        for( IService service2 : service ) {
            try {
View Full Code Here

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

        // creates the shapefile
        ShapefileDataStoreFactory dataStoreFactory = new ShapefileDataStoreFactory();
        Map<String, Serializable> params = new HashMap<String, Serializable>();
        params.put("url", URLUtils.fileToURL(file)); //$NON-NLS-1$
        params.put("create spatial index", Boolean.TRUE); //$NON-NLS-1$
        ShapefileDataStore ds = (ShapefileDataStore) dataStoreFactory.createDataStore(params);
        ds.createSchema(type);
       
        SimpleFeatureStore featureSource = (SimpleFeatureStore) ds.getFeatureSource();
        List<FeatureId> ids = featureSource.addFeatures(fc);
        return ids.size() >= 0;
View Full Code Here

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

        if( !factory.canProcess(params) ) {
            // this is tough we don't have a good error message out of the geotools factory canProcess method
            // So we will try (and fail!) to connect ...
            DataStore datastore = null;
            try {
                datastore = factory.createDataStore(params);
            }
            catch (Throwable t){
                return t.getLocalizedMessage(); // We cannot connect because of this ...
            }
            finally {
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.