Kaergaard Kasper a écrit :
> I'm trying to show radar picture together with a
> background image and some catchments on a map. The
> radar picture is rotated 11 degrees compared to the
> normal north and therefor the north of the background
> image..
>
> So far I have not been able to show two GridCoverages
> with different angles on a map.
> I have tried to supply a MathTransform to my
> gridCoverage, this has no effect and I can see that in
> the DefaultMapContext the information is lost, ie. on
> information about the Envelope is considered. Therefor
> I have tried to set up different CRS for the two
> GridCoverages here is my code:
Its look like a bug. The math transform should be taken in account.
The legacy J2D-Renderer was taking the math transform in account. It is
possible
that the renderer used by JMapPane (I'm not sure which one exactly) ignores the
math transform and consider only the envelope.
If the above hypothesis is right (but I'm really not sure, since I don't know
the details of JMapPane and streaming renderer), then some possible actions are:
* Use J2D-Renderer instead, but it would force you to go back to a previous
Geotools implementation and will involve more pain when migrating back to
a more recent Geotools version. Probably not a recommanded approach.
* Get the JMapPane / Streaming renderer to use the MathTransform instead of
the Envelope (again, I'm not sure that the problem is there - just an
hypothesis. But I know that managing correctly CRS information in a
renderer is a non-trivial task. The CRS handling was more rigourous in
J2D-Renderer because this renderer was wrote by the same author than
the CRS framework).
* Wait for GO-1 implementation (the replacement of J2D-Renderer) to be ready,
but it may really take a while...
* Rotate the GridCoverage yourself before to pass it to the renderer. Once
you have created a GridCoverage with the correct MathTransform (you may
also try a DerivedCRS), try the following:
gc = Operations.resample(gc, yourDisplayCRS);
It may also be worth to try the most extensive "resample" flavor with
more arguments (including a GridGeometry). The Operations class is in
org.geotools.coverage.processing if my memory serve me right.
Martin
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users