I labeled a polygon along it's edge by using the boundary of an inside buffer:

label-geometry: [boundary(buffer(GEOM, -0.01))];

This works, but my problem is, that at certain zoomlevels/positions the label runs out of the polygon instead of being labeled around the corner or on the (long enough) straight line. Moving the map extend only a few pixels changes this again.

My CSS looks like this (inner black stroke is to depict the labeled boundary):

  fill: #E30613 ;
  fill-opacity: 0.2;

  font-family: "SansSerif.plain";
  font-fill: #194383;
  font-size: 20;

  label-geometry: [boundary(buffer(GEOM, -0.01))];
  stroke-geometry: [GEOM],[boundary(buffer(GEOM, -0.01))];

  label: 'Really very very very long label';
  label-follow-line: true;
  label-max-angle-delta: 180;
  label-remove-overlaps: true;
  label-conflict-resolution: true;
  label-allow-overruns: false;

  stroke: #194383, black;
  stroke-width: 2, 0.1;

Does anyone know a way to force the label to alway be on the boundary?

works doesn't work after moving the extend a little bit it works again

  • Are you testing on the latest release, 2.13.0? If not, do so. If you are and it's still happening, open a bug report with the style, request and a data dump (small, but enough to reproduce the issue) at osgeo-org.atlassian.net/projects/GEOS/summary – Andrea Aime May 9 '18 at 12:30
  • I initially used 2.12, but tried it in 2.13 now - same problem. Bug report GEOS-8759 is opened! Thanks for your advice! – Michaela May 25 '18 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.