forked from MapServer/MapServer
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expression to SLD: strip whitespace from non-string expressions (MapS…
…erver#6983) Fixes MapServer#6892 Expressions are stripped of whitespace before being used as literal values in SLD expressions. `EXPRESSION ( [FID] > 1 And [FID] <= 10 )` will now produce: ```xml <ogc:Filter><ogc:And><ogc:PropertyIsGreaterThan><ogc:PropertyName>FID</ogc:PropertyName> <ogc:Literal>1</ogc:Literal> </ogc:PropertyIsGreaterThan><ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>FID</ogc:PropertyName> <ogc:Literal>10</ogc:Literal></ogc:PropertyIsLessThanOrEqualTo></ogc:And></ogc:Filter> ``` Spaces at the end of strings in quotes are preserved: ` EXPRESSION ( [locationtype] = "primary location " )` will produce: ```xml <ogc:Filter><ogc:PropertyIsEqualTo><ogc:PropertyName>locationtype</ogc:PropertyName> <ogc:Literal>primary location </ogc:Literal> </ogc:PropertyIsEqualTo></ogc:Filter> ``` Whitespace in list expressions are also preserved. `EXPRESSION {primary location,secondary location }` will produce: ```xml <ogc:Filter><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>locationtype</ogc:PropertyName> <ogc:Literal>primary location</ogc:Literal></ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo><ogc:PropertyName>locationtype</ogc:PropertyName><ogc:Literal>secondary location </ogc:Literal></ogc:PropertyIsEqualTo> </ogc:Or></ogc:Filter><se:PointSymbolizer> ```
- Loading branch information
1 parent
b43fd4f
commit 1df4a96
Showing
11 changed files
with
137 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<NamedLayer> | ||
<se:Name>Test18</se:Name> | ||
<UserStyle> | ||
<se:FeatureTypeStyle> | ||
<se:Rule> | ||
<ogc:Filter><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>locationtype</ogc:PropertyName><ogc:Literal>primary location</ogc:Literal></ogc:PropertyIsEqualTo> | ||
<ogc:PropertyIsEqualTo><ogc:PropertyName>locationtype</ogc:PropertyName><ogc:Literal>secondary location </ogc:Literal></ogc:PropertyIsEqualTo> | ||
</ogc:Or></ogc:Filter><se:PointSymbolizer> | ||
<se:Graphic> | ||
<se:Mark> | ||
<se:WellKnownName>square</se:WellKnownName> | ||
<se:Fill> | ||
<se:SvgParameter name="fill">#dc0000</se:SvgParameter> | ||
</se:Fill> | ||
</se:Mark> | ||
<se:Size>1</se:Size> | ||
</se:Graphic> | ||
</se:PointSymbolizer> | ||
</se:Rule> | ||
</se:FeatureTypeStyle> | ||
</UserStyle> | ||
</NamedLayer> | ||
</StyledLayerDescriptor> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<NamedLayer> | ||
<se:Name>Test19</se:Name> | ||
<UserStyle> | ||
<se:FeatureTypeStyle> | ||
<se:Rule> | ||
<ogc:Filter><ogc:PropertyIsEqualTo><ogc:PropertyName>locationtype</ogc:PropertyName><ogc:Literal>primary location</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter> | ||
<se:PointSymbolizer> | ||
<se:Graphic> | ||
<se:Mark> | ||
<se:WellKnownName>square</se:WellKnownName> | ||
<se:Fill> | ||
<se:SvgParameter name="fill">#dc0000</se:SvgParameter> | ||
</se:Fill> | ||
</se:Mark> | ||
<se:Size>1</se:Size> | ||
</se:Graphic> | ||
</se:PointSymbolizer> | ||
</se:Rule> | ||
</se:FeatureTypeStyle> | ||
</UserStyle> | ||
</NamedLayer> | ||
</StyledLayerDescriptor> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<NamedLayer> | ||
<se:Name>Test20</se:Name> | ||
<UserStyle> | ||
<se:FeatureTypeStyle> | ||
<se:Rule> | ||
<ogc:Filter><ogc:PropertyIsEqualTo><ogc:PropertyName>locationtype</ogc:PropertyName><ogc:Literal>primary location </ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter> | ||
<se:PointSymbolizer> | ||
<se:Graphic> | ||
<se:Mark> | ||
<se:WellKnownName>square</se:WellKnownName> | ||
<se:Fill> | ||
<se:SvgParameter name="fill">#dc0000</se:SvgParameter> | ||
</se:Fill> | ||
</se:Mark> | ||
<se:Size>1</se:Size> | ||
</se:Graphic> | ||
</se:PointSymbolizer> | ||
</se:Rule> | ||
</se:FeatureTypeStyle> | ||
</UserStyle> | ||
</NamedLayer> | ||
</StyledLayerDescriptor> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters