Cannot import multilinestrings in Oracle NG
-------------------------------------------

                 Key: GEOT-2332
                 URL: http://jira.codehaus.org/browse/GEOT-2332
             Project: GeoTools
          Issue Type: Bug
          Components: data jdbc-ng
    Affects Versions: 2.5.3
            Reporter: Andrea Aime
            Assignee: Andrea Aime
             Fix For: 2.5.4


The following app, trying to import a multilinestring shapefile, fails:

{code}
import java.io.File;
import java.util.HashMap;
import java.util.Map;

import org.geotools.data.DataStore;
import org.geotools.data.FeatureStore;
import org.geotools.data.oracle.OracleNGDataStoreFactory;
import org.geotools.data.shapefile.ShapefileDataStore;
import org.geotools.data.store.ReTypingFeatureCollection;
import org.geotools.feature.FeatureCollection;
import org.geotools.jdbc.JDBCDataStore;
import org.geotools.jdbc.JDBCDataStoreFactory;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;


public class OracleImporter {

        public static void main(String[] args) throws Exception {
                File f = new 
File("/home/aaime/devel/gs-1.7.x/data/release/data/shapefiles/states.shp");
                ShapefileDataStore shp = new ShapefileDataStore(f.toURL());
                
                System.out.println(shp.getSchema());
                
                Map params = new HashMap();
                params.put(JDBCDataStoreFactory.USER.key, "spatial");
                params.put(JDBCDataStoreFactory.PASSWD.key, "postgis");
                params.put(JDBCDataStoreFactory.HOST.key, "localhost");
                params.put(JDBCDataStoreFactory.SCHEMA.key, "SPATIAL");
                params.put(JDBCDataStoreFactory.DATABASE.key, "xe");
                params.put(JDBCDataStoreFactory.PORT.key, 1521);
                params.put(JDBCDataStoreFactory.DBTYPE, "Oracle");

                OracleNGDataStoreFactory fac = new OracleNGDataStoreFactory();
                JDBCDataStore ora = fac.createDataStore(params);
                
                ora.createSchema(shp.getSchema());
                String oraName = shp.getSchema().getTypeName().toUpperCase();
                FeatureStore<SimpleFeatureType, SimpleFeature> store = 
(FeatureStore) ora.getFeatureSource(oraName);
                store.addFeatures(shp.getFeatureSource().getFeatures());
        }
}
{code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to