Was anyone ever able to address the problem that the forceSchemaCRS call sets the schema to null? Is the fix just to comment out that line which nulls the schema?
Thanks! Ashley jody.garnett wrote > 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 > > ------------------------------------------------------------------------------ > 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-gt2-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Problems-with-prj-while-saving-a-shapefile-tp4324581p5031384.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_jan _______________________________________________ GeoTools-GT2-Users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
