How to do this, from geotoo
<groldan> MartinD: can you point me to how transform a bbox into EPSG:4326? or did you already did it Chris?
<groldan> (for geoserver)
<MartinD> What is the source CS?
<MartinD> I mean, do you know the source CS by its EPSG code, or something else?
<groldan> can be any
<groldan> I should know it
<groldan> since I have to have it to configure the featuretype in geoserver
<groldan> I'm asking you cause I think you're doing it in renderer
<MartinD> (just a minute...)
<MartinD> Sorry, I was talking with Andrea about J2D-renderer...
<MartinD> The first step is to get the source CoordinateSystem.
<MartinD> If you know the EPSG code, you can use CoordinateSystemEPSGFactory.
<MartinD> If you know its WKT text instead, you can use CoordinateSystemFactory.createFromWKT(...)
<MartinD> For the target CS (EPSG:4326), you can use the GeographicCoordinateSystem.WGS84 constant.
<MartinD> (if I'm remembering right the WGS84 EPSG code)
<MartinD> Once you have the source and target CS, you can use the following:
<MartinD> CoordinateTransformation tr = coordinateTransformationFactory.createFromCoordinateSystem(sourceCS, targetCS)
<MartinD> You get the object which can be used for any amount of transformations from sourceCS to targetCS.
<groldan> great! lots of thanks
<MartinD> Since all the above step are somewhat costly, it may be wise to save the resulting CoordinateTransformation object for future reuse if you know that sourceCS and targetCS will not change.
<MartinD> Then, for the specific case of transforming a Rectangle2D or an Envelope, you can do it yourself by transforming each corner, or use the following convenience method:
<MartinD> CTSUtilities.transform(MathTransform, Envelope)
<MartinD> or
<MartinD> CTSUtilities.transform(MathTransform, Rectangle2D)
<MartinD> (in org.geotools.resources)
<aaime> Going bed, bye 
<MartinD> Note that CTSUtilities is a convenience method for internal use in Geotools; it is not target as a really public class since it is somewhat a hack, not very rigorous.
<-- aaime (~wolf@host149-73.pool80180.interbusiness.it) has left #geotools
<MartinD> (it is not as easy as it may seems to transform a rectangle using a more general transform than an AffineTransform)
How to do this, from geotoo
<groldan> MartinD: can you point me to how transform a bbox into EPSG:4326? or did you already did it Chris?
<groldan> (for geoserver)
<MartinD> What is the source CS?
<MartinD> I mean, do you know the source CS by its EPSG code, or something else?
<groldan> can be any
<groldan> I should know it
<groldan> since I have to have it to configure the featuretype in geoserver
<groldan> I'm asking you cause I think you're doing it in renderer
<MartinD> (just a minute...)
<MartinD> Sorry, I was talking with Andrea about J2D-renderer...
<MartinD> The first step is to get the source CoordinateSystem.
<MartinD> If you know the EPSG code, you can use CoordinateSystemEPSGFactory.
<MartinD> If you know its WKT text instead, you can use CoordinateSystemFactory.createFromWKT(...)
<MartinD> For the target CS (EPSG:4326), you can use the GeographicCoordinateSystem.WGS84 constant.
<MartinD> (if I'm remembering right the WGS84 EPSG code)
<MartinD> Once you have the source and target CS, you can use the following:
<MartinD> CoordinateTransformation tr = coordinateTransformationFactory.createFromCoordinateSystem(sourceCS, targetCS)
<MartinD> You get the object which can be used for any amount of transformations from sourceCS to targetCS.
<groldan> great! lots of thanks
<MartinD> Since all the above step are somewhat costly, it may be wise to save the resulting CoordinateTransformation object for future reuse if you know that sourceCS and targetCS will not change.
<MartinD> Then, for the specific case of transforming a Rectangle2D or an Envelope, you can do it yourself by transforming each corner, or use the following convenience method:
<MartinD> CTSUtilities.transform(MathTransform, Envelope)
<MartinD> or
<MartinD> CTSUtilities.transform(MathTransform, Rectangle2D)
<MartinD> (in org.geotools.resources)
<aaime> Going bed, bye
<MartinD> Note that CTSUtilities is a convenience method for internal use in Geotools; it is not target as a really public class since it is somewhat a hack, not very rigorous.
<-- aaime (~wolf@host149-73.pool80180.interbusiness.it) has left #geotools
<MartinD> (it is not as easy as it may seems to transform a rectangle using a more general transform than an AffineTransform)