-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello GeoTools user,
my vision is to rotate a map including certain map symbols using an E4
application. I develop
the application using geotools 14.1 bundled within a single plugin. From
relevant articles I
deducted the following implementation for a RotateHandler:
@Execute
private void execute() {
final SwtMapPane mapPane = contribution.getMapPane();
final CoordinateReferenceSystem crs = mapPane.getMapContent()
.getViewport().getCoordinateReferenceSystem();
final AffineTransform rotateInstance = AffineTransform
.getRotateInstance(-Math.PI / 2);
final MathTransform baseToDerived = new AffineTransform2D(
rotateInstance);
final CoordinateReferenceSystem rotatedCrs = new
DefaultDerivedCRS(
"rotated", crs, baseToDerived,
crs.getCoordinateSystem());
mapPane.getMapContent().getViewport()
.setCoordinateReferenceSystem(rotatedCrs);
mapPane.redraw();
}
Indeed this implementation rotates the geometric features of my map, but
I am not completely
happy with it. My first concern is about changing the coordinate
reference system. I am not
sure if this is the right place to introduce a rotation which aims at
the view model and not at the
world model. My second concern was the observation that the map symbols
are not rotated.
The cause seems to be that the rotation of the symbol is a matter of the
style definition and not
a geometric property. The rule applied for styling the symbols defines a
graphic like this:
final Graphic signalGraphic = styleFactory.graphic(signalSymbols, null,
someSizeLiteral, filterFactory2.property(rotationName), null,
null);
The rotation is stored in a property of the feature in question and is
not subject to the applied
transformation. Somehow I need to add the additional rotation from the
RotateHandler to the
(world) rotation stored in the property. I tried something like this:
filterFactory2.add(filterFactory2.property(rotationName),
filterFactory2.function("getRotation"))
but failed to register the function following the example in
http://docs.geotools.org/latest/userguide/tutorial/function.html.
At runtime I get an "Unable to find function getRotation"
RuntimeException.
Do you have any suggestions how to register the function properly in an
E4/OSGi context, or
how to implement the rotation for the symbols in an alternative way?
Thanks for your attention
Heiko
-----BEGIN PGP SIGNATURE-----
Version: PGP Universal 3.3.2 (Build 21274)
Charset: us-ascii
wj8DBQFX5SR7qBcvlGcRkzURApH+AJ4qvek/M99wyK42dRjNMHKDlxd5fwCgwkW9
WYOTyjTgf2uKlw2j3Q9O9cg=
=W8rr
-----END PGP SIGNATURE-----
--
Diese E-Mail kann vertrauliche und/oder rechtlich geschuetzte Informationen
enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender durch
eine Antwortmail und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail ist nicht gestattet. Wir danken fuer Ihre
Kooperation.
This e-mail may contain confidential and/or privileged information. If you are
not the intended recipient or have received this e-mail in error, you are on
notice of its status. Please notify the sender immediately by reply e-mail and
delete this e-mail from your systems. Any unauthorized copying, disclosure or
distribution of the material in this e-mail is strictly prohibited. Thank you
for your cooperation.
------------------------------------------------------------------------------
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users