Adrian Custer wrote: > Martin and I discussed a bit the role of the CRS in the feature type. > This issue will only last until geotools moves to using DirectPositions > rather than JTS directly, however the issue is with us today. > Understood. > We suggest that adding a jts geometry to any featureType whose crs has > not been explicitly set through some call to .setCRS(..) or to .crs(..) > should generate a WARNING. > Just to clarify, setCRS only exists for the builder API. And the only thing it does is mark down what the current CRS is for the builder, that current CRS will be used whenever a GeometryDescriptor is created. > We suggest therefore that a user be allowed to set a CRS to null, e.g. > via a call .setCRS(null). That would allow the user to use geometries > for which they do not know the CRS but force them to set that > explicitly. Once the CRS is set to null (or to any other value), no > WARNING would be emitted. > > Does that work for you? Perhaps this is already the case. > That is a good move guys; it shows that the user is FORCING the CRS to be null. I am sure we have a static constant for a cartisian crs that would also work (say ImageCRS?) - but yes as long as the user tells us explicitly that the crs is unknown then we should be good.
(so warning rather than IllegalStateException if a Geometry is added when no CRS has been provided) > Note also I changed the Simple example your page: > http://docs.codehaus.org/display/GEOTDOC/Feature+Model+Guide > to set the CRS before adding the geometry because I figured we wanted to > encourage 'good practice' in the doc. We should add, in one of the > alternative sections, .setCRS(null) if and when such functionality > exists. > Okay I will add that now. Also added setCRS to the simple case example. Jody > --adrian > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Geotools-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-devel > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
