0

which file(s) to modify in geotools or geoserver source code to have different anchor points for directions(N,W,E,S,NW, ...) for point labels if maxDisplacement is used? If I use anchor point (1, 0.5) in geoserver sld file with maxDisplacement vendor option, all remaining directions(N,W,E,S,...) placing point text labels with anchor point define in sld, I want change anchor point for remaining directions or angles, how to achieve this, I found this file in geotools source code "...\geotools-24.1-project\geotools-24.1\modules\library\render\src\main\java\org\geotools\renderer\label\LabelCacheImpl.java", I changed RIGHT_UP_ANCHOR_CANDIDATES, RIGHT_DOWN_ANCHOR_CANDIDATES, ... in this file with no success, any suggestions?

Point_Label_AnchorPoint

Thanks in advance

mmk
  • 1
  • 2
  • 1
    needs more clarity - examples of code (since java was listed as a label) should be entered into message – Casey Harrils Apr 03 '21 at 11:01
  • geotools-24.1\modules\library\render\src\main\java\org\geotools\renderer\label\LabelCacheImpl.java related to geotools and geoserver & this https://gis.stackexchange.com/questions/390822/how-to-achieve-different-anchor-point-based-on-n-w-e-s-nw-ne-sw-se-for-po – mmk Apr 03 '21 at 11:41
  • Could you explain what you are trying to achieve? It is not normal to need to make changes to the library – Ian Turton Apr 03 '21 at 16:20
  • Please refer snapshot, https://i.stack.imgur.com/s7kTJ.png – mmk Apr 03 '21 at 17:16
  • any suggestions or update? – mmk Apr 05 '21 at 19:51
  • once you allow displacement, you pretty much give up control over the placement of the label. – Ian Turton Apr 15 '21 at 13:28
  • @IanTurton how to control point label if maxDisplacement vendor option is used? I have to change source code, if yes which file(s) to change? reply will be greatly appreciated – mmk Apr 15 '21 at 17:39

0 Answers0