Showing posts from August, 2016

Geoserver slice string values using SLD for label manipulation

I have an attribute column in my PostGIS polygon table and want to only show the first 2 characters of this text field on my label using SLD in Geoserver .  My goal is to place the label at the center of the polygon so here it goes in SLD xml syntax as usual very verbose and ugly. <TextSymbolizer>             <Geometry>               <ogc:Function name="centroid">                 <ogc:PropertyName>geom</ogc:PropertyName>               </ogc:Function>             </Geometry>           <Label>               <ogc:Function name="strSubstring">                   <ogc:PropertyName>short_name</ogc:PropertyName>                   <ogc:Function name="parseInt">                     <ogc:Literal>0</ogc:Literal>                   </ogc:Function>                   <ogc:Function name="parseInt">                                                   <