I'm trying to render a symbol on map. My symbol will display on map but in the wrong location. My symbol's centre is set to my location, but I want my symbol's bottom to be the point of my location. How is it possible? See image below to explain this:

enter image description here

There is the triangle symbol, but you can see that there is a point in the middle of symbol. This dot marks my exact location. I want the lower point of the triangle to be on that point.

Please help me achieve this in Geotools.

2 Answers 2


Hi this will require set AnchorPoint to bottom of the mark.

AnchorPoint ancPoint = styleFactory.createAnchorPoint(filterFactory.literal(0.5), filterFactory.literal(0));

GeoTools (& GeoServer, and other SLD users) will always place your graphic so the centre is over the point that is being symbolized. If you want some other point on the graphic to be placed there you need to add some transparent padding to the graphic to make the point you want to use the center.

  • thanks for the answer but will you tell me please how can we add transparent padding to the graphic..? Commented Oct 17, 2016 at 5:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.