|
From: Jody G. <jod...@gm...> - 2009-02-05 00:31:28
|
Hey Rodrigo: Rodrigo Paes wrote: > Hi Jody, > I tried your approach and here is what happened: > > - When I call the createSchema, it creates the schema but the crs is null; > - Then I call the forceSchemaCRS and it creates the .prj properly but > the schema is set to null; > - Then when I call the command: featureStore = > (FeatureStore<SimpleFeatureType, SimpleFeature>) shapeFileDataStore > .getFeatureSource(featureType.getTypeName()); > it is not able to get the right type, throwing an exception: > We are quickly heading into bug report territory; and should watch this turn over in a debugger. As Michael pointed out we are having a problem transforming the bounds; something we should not let get in the way of changing the crs. I was startled that forcing the CRS would set the schema to null - we should explore how that went wrong next. The shapefile module maintainer is very busy; I will see if he can help on this one. In the meantime can we arrange a test case to show the problem? The part we are missing (appart from the code you provided) is making that initial feature collection (even with a single point in it). The CRS you have chosen (that produces a transform exception) is the critical part we will of not tested before. > shapeFileDataStore.createSchema(collection.getSchema()); > SimpleFeatureType schema = shapeFileDataStore.getSchema(); // > gets the created schema > shapeFileDataStore.forceSchemaCRS(crs); // this call is > setting the schema to null > shapeFileDataStore.schema = schema; // it sets the schema again If we cannot get a hold of the module maintainer; I have opened up a couple slots for hands on geotools work and I could help you debug and patch this problem. Jody |