1) The CRS of the bounding box or envelope of the map should trickle
down to all the layers in the map. This is done in the renderer.
The problem is in the fact that on every Feature/Geometry/FeatureSource the
method getCoordinateReferenceSystem() returns null. I looked into it and I
noticed that my shapefile
collection is missing the .prj file in which the CRS is defined. I just
hoped that it is possible to somehow
get the CRS (some helper class or something :) )
2) I don't have my code handy (it's at work), but this is fairly easy
to do, too. Something about a .transform() in the Layer class, I
think. Might involve the CRS.transform() function.
I tried to do something like:
CoordinateReferenceSystem source = CRS.decode("EPSG:900913") but it fails
with an exception.
I think I'm missing a dependency. However, if you have it coded somewhere
please do send it.
3) I'm not sure about what CRS the coordinates of the town are, but
the coordinates for Google is in EPSG:900913 (unofficial name) or
EPSG:3857 both are Spherical Mercator types, which the town
coordinates look to be. Not the same CRS, though. You might need the
WKT for the CRS to work with it. It's in the GeoTools forums, just
look for it.
Thanx for clearing that up, it was my first time dealing with CRS's :)
As a word of warning, if you are using a WMSMapLayer, there's a bug in
it that makes it so it only accepts and requests maps in the WGS84
CRS, even if the bounding box is for a different CRS. To fix this
problem, you need to get a copy of the WMSMapLayer code and alter 4
lines maybe? Like I said, the actual code is at work.
I don't even know the difference between various implementations of
MapLayer. I did not go into much detail with it - I will.
Thank you
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Coordinate-Reference-System-conversions-tp5024408p5024640.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users