Number format in created DBF file
---------------------------------

                 Key: GEOT-2124
                 URL: http://jira.codehaus.org/browse/GEOT-2124
             Project: GeoTools
          Issue Type: Bug
          Components: data oraclespatial
    Affects Versions: 2.4.1
            Reporter: Damien Paque
            Assignee: Andrea Aime


Hello, 

We are using the GeoTools java libraries in version 2.4.1 to export data's from 
an Oracle 10g database to shapefiles. 
For the geometric data's (SHP), everything is OK. 
But we have a problem for the alphanumerical data's (DBF): in the Oracle 
database, number format is NUMBER(8,0) and it becomes a DOUBLE in the DBF file. 
Here is the java code we use to do it: 

File fileExport = new File(System.getProperty("user.dir") + "\\" + strShape); 

// create a new shapefile data store 
newShapefileDataStore = new ShapefileDataStore(fileExport.toURI().toURL()); 

// create the schema based on the original shapefile 
newShapefileDataStore.createSchema(features.reader().getFeatureType()); 

// grab the feature source from the new shapefile data store 
FeatureSource newFeatureSource = 
newShapefileDataStore.getFeatureSource(oraDatastore.getTypeNames()[0]); 

// downcast FeatureSource to specific implementation of FeatureStore 
FeatureStore newFeatureStore = (FeatureStore)newFeatureSource; 

// add features got from the query (FeatureReader) 
newFeatureStore.addFeatures(fsBC.getFeatures());


Does anyone know how to fix this problem and where it's possible to store the 
format we want to have for the alphanumerical data's in the created DBF file. 

Thanks in advance. 

Damien.

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

        

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to