On Wed, Oct 31, 2012 at 1:15 PM, Ákos Maróy <[email protected]> wrote: > Hi, > > I wonder if it is possible to put a label outside a polygon? > > that is, not inside, but outside on purpose. say, some pixels to the > right of the right edge of the polygon? > > I tried to do this by calculating the with of the polygon with some > function, and to use this value in the DisplacementX value for a label > placement. but I didn't find a way to get the width of the polygon - I > didn't find any of the functions that would have me achieve this.
Hmm... writing a function that gives you the width of the bbox of a polygon is not hard, but there are issues: * the width would be in the polygon native unit of measure, turning it into pixels might not be easy, especially if there is reprojection involved * the polygon main axis might be rotated, if so you'd probably end up with a label that is quite out of the polygon The best approach would be to implement support for SLD 1.1 label offsets, which are specified in pixels. Cheers Andrea -- == Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
