Skip to content

Commit

Permalink
Add test suite for RFC
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika committed Mar 2, 2024
1 parent 4b75db3 commit d404d7f
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 97 deletions.
2 changes: 2 additions & 0 deletions msautotest/misc/ogrpen.map
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Test OGR feature style PEN parameters

# RUN_PARMS: ogrpen.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&layer=test&mode=map" > [RESULT_DEMIME]

MAP
EXTENT 0 -1 1 1
SIZE 200 400
Expand Down
18 changes: 18 additions & 0 deletions msautotest/sld/data/green.sld
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<StyledLayerDescriptor version='1.1.0'>
<NamedLayer>
<Name>green</Name>
<UserStyle>
<FeatureTypeStyle>
<Rule>
<LineSymbolizer>
<Stroke>
<SvgParameter name='stroke-width'>3</SvgParameter>
<SvgParameter name='stroke-opacity'>0.5</SvgParameter>
<SvgParameter name='stroke'>#00FF00</SvgParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
34 changes: 0 additions & 34 deletions msautotest/sld/data/lline.xml

This file was deleted.

5 changes: 5 additions & 0 deletions msautotest/sld/data/mixed_styles.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
WKT,STYLE,comment
"LINESTRING(0.1 0.9,0.9 0.9)","<StyledLayerDescriptor version=""1.1.0""><NamedLayer><Name>test</Name><UserStyle><FeatureTypeStyle><Rule><LineSymbolizer><Stroke><SvgParameter name=""stroke-width"">5</SvgParameter><SvgParameter name=""stroke"">#0000FF</SvgParameter></Stroke></LineSymbolizer></Rule></FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>","red SLD line"
"LINESTRING(0.1 0.8,0.9 0.8)","PEN(c:#000000)","ogr style"
"LINESTRING(0.1 0.7,0.9 0.7)","<StyledLayerDescriptor version=""1.1.0""><NamedLayer><Name>test</Name><UserStyle><FeatureTypeStyle><Rule><LineSymbolizer><Stroke><SvgParameter name=""stroke-width"">5</SvgParameter><SvgParameter name=""stroke"">#00FF00</SvgParameter></Stroke></LineSymbolizer></Rule></FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>"","green SLD line"
"LINESTRING(0.1 0.6,0.9 0.6)","STYLE WIDTH 1.5 COLOR 0 0 255 END","blue INLINE style"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added msautotest/sld/expected/sld_styleitem_file1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions msautotest/sld/expected/sld_styleitem_file_getstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld http://ogc.dmsolutions.ca/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>green</se:Name>
</NamedLayer>
</StyledLayerDescriptor>

63 changes: 0 additions & 63 deletions msautotest/sld/sld_styleitem.map

This file was deleted.

26 changes: 26 additions & 0 deletions msautotest/sld/sld_styleitem_attribute.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Test loading SLD from an attribute using STYLEITEM. See RFC 138
#
# REQUIRES: INPUT=GDAL OUTPUT=PNG SUPPORTS=WMS
#

# RUN_PARMS: sld_styleitem_attribute.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&layer=test&mode=map" > [RESULT_DEMIME]

MAP
EXTENT 0 -1 1 1
SIZE 200 400
LAYER
NAME "test"
EXTENT 0 -1 1 1
CONNECTIONTYPE OGR
CONNECTION "data/mixed_styles.csv"
DATA "mixed_styles"

TYPE LINE
STATUS ON

STYLEITEM "STYLE"
CLASS
END #CLASS
END
END
40 changes: 40 additions & 0 deletions msautotest/sld/sld_styleitem_file.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Test loading SLD files for a layer using STYLEITEM. See RFC 138
#
# REQUIRES: INPUT=GDAL OUTPUT=PNG SUPPORTS=WMS
#
# RUN_PARMS: sld_styleitem_file1.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3&REQUEST=GetMap&CRS=EPSG:4326&BBOX=42,-5,52,9&FORMAT=image/png&WIDTH=200&HEIGHT=200&LAYERS=green&STYLES=" > [RESULT_DEMIME]
# RUN_PARMS: sld_styleitem_file_getstyle.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3&REQUEST=GetStyles&LAYERS=green" > [RESULT_DEMIME]

MAP
NAME "SLD_STYLEITEM"
SHAPEPATH "./data"
SIZE 300 300
IMAGECOLOR 100 100 100
EXTENT 42 -5 52 9
FONTSET "data/fonts.lst"
PROJECTION
"init=epsg:4326"
END
WEB
IMAGEPATH "/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
METADATA
"wms_title" "Test SLD STYLEITEM"
"wms_onlineresource" "http://localhost/path/to/wms_simple?"
"wms_srs" "EPSG:4326"
"ows_schemas_location" "http://ogc.dmsolutions.ca"
"ows_enable_request" "*"
"ows_sld_enabled" "true"
END
END
LAYER
NAME "green"
DATA "hexagon"
TYPE LINE
STATUS ON
SIZEUNITS PIXELS
STYLEITEM "sld://data/green.sld"
END

END

0 comments on commit d404d7f

Please sign in to comment.