From: Wouter S. <wou...@gm...> - 2008-07-29 16:50:54
|
Hey list, I'm building an application that reads the geometries in a shapefile, and writes them into postgis. To implement this, i've created my own featurereader (because i need create a Feature), and use this to insert the features in the postgis db. This is my code: PostgisFeatureStore pgFS = (PostgisFeatureStore) fsDao.getFeatureStore(uploadUtil.detectPostGisLayerName(file)); CustomShapeFileReader shpReader = new CustomShapeFileReader(shapefile, pgFS.getSchema()); shpReader.setParameters(kvp); shpReader.execute(); pgFS.addFeatures(shpReader); On this last line, the application throws the following error: java.lang.NoSuchFieldError: FEATURE_2D at org.geotools.data.postgis.PostgisDataStore.getGeometryAttributeIO(PostgisDataStore.java:1835) at org.geotools.data.jdbc.QueryData.<init>(QueryData.java:134) at org.geotools.data.jdbc.JDBC1DataStore.executeQuery(JDBC1DataStore.java:907) at org.geotools.data.jdbc.JDBC1DataStore.getFeatureWriter(JDBC1DataStore.java:1553) at org.geotools.data.postgis.PostgisDataStore.getFeatureWriterAppend(PostgisDataStore.java:1809) at org.geotools.data.jdbc.JDBCFeatureStore.addFeatures(JDBCFeatureStore.java:307) at be.geosolutions.main.Shape2PostGis.execute(Shape2PostGis.java:50) I know it has something to do with Hints.FEATURE_2D, but i don't know what, i don't know when or where i have to specify this hint... Some background info: i'm using gt2.4.4. The postgis geom attribute is defined in 2D, the shape can be 2D, or 3D, but the z-coordinate is being ignored... What am i doing wrong? thx! Wouter Schaubroeck |