On Wed, Feb 9, 2011 at 8:40 PM, Edward Mac Gillavry
<[email protected]> wrote:
> Thanks Miles for pushing me on! Unfortunately, I had given that one a try
> already...
>
> So, my observations now:
> - ^A\d+ does NOT work to pick out road number like A2, A35, A235 etc : NOT
> OK
> - ^A[0-9]+ does NOT work to pick out road numbers like A2 A35, A235: NOT OK
> - ^A\D+ DOES work to pick out any road name starting with an A and ignores
> the road numbers that start with an A: OK!
> - ^A.+ DOES work to pick out both road names AND road numbers starting with
> an A: OK!

I had a quick try with GeoServer 2.1 and using the pattern d\d+ against the
tiger:poly_landmarks layer (CFCC contains values such as D83, H21, and so on)

First try was with a plain ECQL filter (it's expression = expression,
only ECQL will
parse it so it will work only on the 2.1 series):
strMatches(CFCC, 'D\d+') = true

which returned me the expected response. Then tried with the following
SLD style:

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld
StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld";
xmlns:ogc="http://www.opengis.net/ogc";
xmlns:xlink="http://www.w3.org/1999/xlink";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <NamedLayer>
    <Name> area landmarks </Name>
    <UserStyle>


      <FeatureTypeStyle>
        <FeatureTypeName>Feature</FeatureTypeName>

        <!-- anything starting with D -->
        <Rule>
          <ogc:Filter>
            <ogc:PropertyIsEqualTo>
              <ogc:Function name="strMatches">
                <ogc:PropertyName>CFCC</ogc:PropertyName>
                <ogc:Literal>D\d+</ogc:Literal>
              </ogc:Function>
              <ogc:Literal>true</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>

          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">
                <ogc:Literal>#B4DFB4</ogc:Literal>
              </CssParameter>
              <CssParameter name="fill-opacity">
                <ogc:Literal>1.0</ogc:Literal>
              </CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">
                <ogc:Literal>#88B588</ogc:Literal>
              </CssParameter>
            </Stroke>
          </PolygonSymbolizer>
        </Rule>

      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

and again I got the expected response.
Also tried with patterns starting with H, same, it works as expected
So not sure what is going on in your specific case?
All I could tried worked as expected for me...

Cheers
Andrea

-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313
mob:    +39 333 8128928

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

<<attachment: regexp.png>>

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to