Skip to content

Commit

Permalink
Merge pull request #915 from jansule/filter-namespace
Browse files Browse the repository at this point in the history
fix: remove unnecessary ogc: prefix from filter
  • Loading branch information
jansule authored Feb 12, 2024
2 parents 794ac90 + 450ee8f commit 84d1de4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion data/slds/1.0/function_filter.sld
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<FeatureTypeStyle>
<Rule>
<Name>Function Property Rule 0</Name>
<Filter>
<Filter xmlns="http://www.opengis.net/ogc">
<Function name="equalTo">
<Function name="between">
<PropertyName>testprop</PropertyName>
Expand Down
4 changes: 2 additions & 2 deletions data/slds/1.1/point_simplepoint_filter.sld
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>Small populated New Yorks</se:Name>
<ogc:Filter xmlns="http://www.opengis.net/ogc">
<Filter xmlns="http://www.opengis.net/ogc">
<And>
<PropertyIsEqualTo>
<PropertyName>NAME</PropertyName>
Expand Down Expand Up @@ -54,7 +54,7 @@
</UpperBoundary>
</PropertyIsBetween>
</And>
</ogc:Filter>
</Filter>
<se:MinScaleDenominator>10000</se:MinScaleDenominator>
<se:MaxScaleDenominator>20000</se:MaxScaleDenominator>
<se:PointSymbolizer uom="http://www.opengeospatial.org/se/units/pixel">
Expand Down
4 changes: 2 additions & 2 deletions data/slds/1.1/point_simplepoint_functionfilter.sld
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>Small populated New Yorks</se:Name>
<ogc:Filter xmlns="http://www.opengis.net/ogc">
<Filter xmlns="http://www.opengis.net/ogc">
<PropertyIsLike wildCard="*" singleChar="." escapeChar="!">
<Function name="strMatches">
<PropertyName>year</PropertyName>
<Literal>^( )??2019,.*</Literal>
</Function>
<Literal>true</Literal>
</PropertyIsLike>
</ogc:Filter>
</Filter>
<se:MinScaleDenominator>10000</se:MinScaleDenominator>
<se:MaxScaleDenominator>20000</se:MaxScaleDenominator>
<se:PointSymbolizer uom="http://www.opengeospatial.org/se/units/pixel">
Expand Down
4 changes: 2 additions & 2 deletions data/slds/1.1/point_simplepoint_nestedLogicalFilters.sld
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>Test</se:Name>
<ogc:Filter xmlns="http://www.opengis.net/ogc">
<Filter xmlns="http://www.opengis.net/ogc">
<And>
<Or>
<PropertyIsEqualTo>
Expand Down Expand Up @@ -40,7 +40,7 @@
</And>
</Or>
</And>
</ogc:Filter>
</Filter>
<se:MinScaleDenominator>10000</se:MinScaleDenominator>
<se:MaxScaleDenominator>20000</se:MaxScaleDenominator>
<se:PointSymbolizer uom="http://www.opengeospatial.org/se/units/pixel">
Expand Down
4 changes: 0 additions & 4 deletions src/SldStyleParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1174,10 +1174,6 @@ export class SldStyleParser implements StyleParser<string> {
* @returns The tagName as used by the configured sldVersion
*/
getTagName(tagName: string): string {
const ogcList = ['Filter'];
if (ogcList.includes(tagName)) {
return this.sldVersion === '1.1.0' ? `ogc:${tagName}` : tagName;
}
if (tagName === 'CssParameter') {
return this.sldVersion === '1.1.0' ? 'se:SvgParameter' : 'CssParameter';
}
Expand Down

0 comments on commit 84d1de4

Please sign in to comment.