Skip to content

Commit

Permalink
Merge pull request #203 from KaiVolland/strmatches
Browse files Browse the repository at this point in the history
Introduces parsing of strMatches FunctionFilter
  • Loading branch information
KaiVolland committed May 21, 2019
2 parents be7cf04 + 5ce33e2 commit 00dcc44
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 52 deletions.
44 changes: 44 additions & 0 deletions data/slds/point_simplepoint_functionfilter.sld
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<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>Simple Point Filter</Name>
<UserStyle>
<Title>Simple Point Filter</Title>
<FeatureTypeStyle>
<Rule>
<Name>Small populated New Yorks</Name>
<Filter xmlns="http://www.opengis.net/ogc">
<PropertyIsLike>
<Function name="strMatches">
<PropertyName>year</PropertyName>
<Literal>^( )??2019,.*</Literal>
</Function>
<Literal>true</Literal>
</PropertyIsLike>
</Filter>
<MinScaleDenominator>10000</MinScaleDenominator>
<MaxScaleDenominator>20000</MaxScaleDenominator>
<PointSymbolizer>
<Graphic>
<Mark>
<WellKnownName>circle</WellKnownName>
<Fill>
<CssParameter name="fill">#FF0000</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#000000</CssParameter>
<CssParameter name="stroke-width">2</CssParameter>
</Stroke>
</Mark>
<Size>6</Size>
</Graphic>
</PointSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
27 changes: 27 additions & 0 deletions data/styles/point_simplepoint_functionfilter.ts
@@ -0,0 +1,27 @@
import { Style } from 'geostyler-style';

const pointSimplePoint: Style = {
'name': 'Simple Point Filter',
'rules': [{
'filter': [
'*=',
['FN_strMatches', 'year', /^( )??2019,.*/],
true
],
'name': 'Small populated New Yorks',
'scaleDenominator': {
'max': 20000,
'min': 10000
},
'symbolizers': [{
'kind': 'Mark',
'wellKnownName': 'Circle',
'color': '#FF0000',
'radius': 3,
'strokeColor': '#000000',
'strokeWidth': 2
}]
}]
};

export default pointSimplePoint;

0 comments on commit 00dcc44

Please sign in to comment.