El 13/11/2012 10:46, Ákos Maróy escribió:
On 13/11/12 13:52, Orlando Irrazabal wrote:
Hi,

I am trying to cut a substring from my data for labeling polygons, i'm using the strSubstring function, 
but Geoserver doesn't render any label. 

According to documents (http://docs.geoserver.org/stable/en/user/filter/function_reference.html#string-functions), 
strSubstring syntax is:
     strSubstring(string, integer, integer)


Here is a snippet of my sld:
 	<Label>
          <ogc:Function name="strSubstring">
            <ogc:PropertyName>NOMENC_MZN</ogc:PropertyName>
            <ogc:Literal>1</ogc:Literal> 
            <ogc:Literal>10</ogc:Literal>
          </ogc:Function>          
        </Label>

Geoserver's log shows:

2012-11-06 13:47:51,554 ERROR [renderer.label] - Error adding label to the label cache
java.lang.IllegalArgumentException: Filter Function problem for function strSubstring argument #1 - expected type int

I found a similar issue, and my solution was to explicitly convert the literal numbers to ints, like this:

                                <ogc:Function name="parseInt">
                                    <ogc:Literal>0</ogc:Literal>
                                </ogc:Function>


Thanks Ákos, that's works!!!!

Orlando
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to