Hi, as anticipated in the proposal I'm working on keeping the coordinate dimension information inside the GeometryDescriptor hint. However, I'm having a question and facing a difficulty.
Tthe descriptor user map is mutable. Is this expected? I find somewhat strange, and would allow code to make the type and the coordinate sequences out of synch (you can do the same via retyping thought, it's just a matter of trying hard enough). When two descriptors are compared the contents of the user map are not taken into account. Again, is this by design? The difficulty I'm facing here is that I would like to report the proper coordinate dimension when the FEATURE_2D hint is used. In particular, if not used, I expect the following to pass: FeatureCollection fc = data.getFeatureSource(POINT3D).getFeatures(); FeatureIterator<SimpleFeature> fr = fc.features(); assertTrue(fr.hasNext()); SimpleFeature feature = fr.next(); assertEquals(3, feature.getType().getGeometryDescriptor().getUserData().get(Hints.COORDINATE_DIMENSION)); whilst if I'm using the FORCE_2D hint I would like this behavior to be the correct one: DefaultQuery q = new DefaultQuery(POINT3D); q.setHints(new Hints(Hints.FEATURE_2D, true)); FeatureCollection fc = data.getFeatureSource(POINT3D).getFeatures(q); FeatureIterator<SimpleFeature> fr = fc.features(); assertTrue(fr.hasNext()); SimpleFeature feature = fr.next(); assertEquals(2, feature.getType().getGeometryDescriptor().getUserData().get(Hints.COORDINATE_DIMENSION)); Unfortunately this does not work because it requires a retyping, and the retypers double check the two types, original and retyped, to be different, and throw an IllegalArgumentException otherwise. Due to the user map not being taken into account the difference is not spotted and I get the exception. Ideas? Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel