[Geoserver-users] GeoServer function PointN doesn't work in YSLD

Hi Everyone!

I would like to confirm if somebody tried to use the PointN function in YSLD. For example trying to display a label on geometry vertex doesn’t work as if PointN function doesn’t return any value:

name: style
feature-styles:
- name: style
  rules:
  - name: style
    symbolizers:
    - text:
        uom: metre
        geometry: ${pointN(geometry,1)}
        label: ${geometryType(geometry)}
        placement: point
        fill-color: '#000088'
        font-family: Tahoma
        font-size: 0.5

I’ve already posted this issue at:
https://gis.stackexchange.com/questions/363382/geoserver-function-pointn-doesnt-work-in-ysld

And a ticket at:
https://osgeo-org.atlassian.net/browse/GEOS-9640

Best Regards
Daniel

There is nothing special about using YSLD here, so I am assuming the issue with with the function PointN.

Q: What geometry are you working with here? A multi-point?

Q: Why are you getting the second point, do you mean poinN(geometry,0) instead?

The function is here:

Reading the code :

  • It assumes the first geometry is a linestring, and will return null for anything else
  • it wants number between 0 … number of points (so 0 is indeed the first point)
···


Jody Garnett