Skip to content

Commit

Permalink
Add STYLES and FILTER tests for MVT tiles. Update comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika committed Jan 21, 2024
1 parent 2a8ca55 commit eb6c5d2
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 35 deletions.
Binary file added msautotest/wxs/expected/wms_mvt_defaultgroup.mvt
Binary file not shown.
Binary file added msautotest/wxs/expected/wms_mvt_filtered.mvt
Binary file not shown.
Binary file added msautotest/wxs/expected/wms_mvt_group.mvt
Binary file not shown.
84 changes: 57 additions & 27 deletions msautotest/wxs/wms_mvt.map
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
# RUN_PARMS: wms_mvt_xprotobuf.mvt [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&SRS=EPSG:3857&BBOX=-7514065.628545966,5009377.085697311,-6261721.357121638,6261721.357121639&WIDTH=256&HEIGHT=256&STYLES=&LAYERS=road&FORMAT=application/x-protobuf" > [RESULT_DEVERSION]
# RUN_PARMS: wms_mvt.mvt [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&SRS=EPSG:3857&BBOX=-7514065.628545966,5009377.085697311,-6261721.357121638,6261721.357121639&WIDTH=256&HEIGHT=256&STYLES=&LAYERS=road&FORMAT=application/vnd.mapbox-vector-tile" > [RESULT_DEVERSION]

# Test access with STYLES and FILTER parameters
# RUN_PARMS: wms_mvt_filtered.mvt [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&SRS=EPSG:3857&BBOX=-7514065.628545966,5009377.085697311,-6261721.357121638,6261721.357121639&WIDTH=256&HEIGHT=256&STYLES=&LAYERS=road&FILTER=<Filter><PropertyIsEqualTo><PropertyName>F_CODE</PropertyName><Literal>67</Literal></PropertyIsEqualTo></Filter>&FORMAT=application/vnd.mapbox-vector-tile" > [RESULT_DEVERSION]
# RUN_PARMS: wms_mvt_group.mvt [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&SRS=EPSG:3857&BBOX=-7514065.628545966,5009377.085697311,-6261721.357121638,6261721.357121639&WIDTH=256&HEIGHT=256&STYLES=main&LAYERS=road2&FORMAT=application/vnd.mapbox-vector-tile" > [RESULT_DEVERSION]
# RUN_PARMS: wms_mvt_defaultgroup.mvt [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&SRS=EPSG:3857&BBOX=-7514065.628545966,5009377.085697311,-6261721.357121638,6261721.357121639&WIDTH=256&HEIGHT=256&STYLES=&LAYERS=road2&FORMAT=application/vnd.mapbox-vector-tile" > [RESULT_DEVERSION]


MAP

NAME WMS_TEST
NAME WMS_MVT_TEST
STATUS ON
SIZE 400 300
#EXTENT 2018000 -73300 3410396 647400
#UNITS METERS
EXTENT -67.5725 42 -58.9275 48.5
UNITS DD
IMAGECOLOR 255 255 255
Expand All @@ -31,38 +35,15 @@ WEB

METADATA
"ows_updatesequence" "123"
"wms_title" "Test simple wms"
"wms_title" "Test simple MVT wms"
"wms_onlineresource" "http://localhost/path/to/wms_simple?"
"wms_srs" "EPSG:42304 EPSG:42101 EPSG:4269 EPSG:4326"
"ows_schemas_location" "http://schemas.opengis.net"
"ows_keywordlist" "ogc,wms,mapserver"
"ows_service_onlineresource" "http://www.mapserver.org/"
"ows_fees" "None"
"ows_accessconstraints" "None"
"ows_addresstype" "postal"
"ows_address" "123 SomeRoad Road"
"ows_city" "Toronto"
"ows_stateorprovince" "Ontario"
"ows_postcode" "xxx-xxx"
"ows_country" "Canada"
"ows_contactelectronicmailaddress" "[email protected]"
"ows_contactvoicetelephone" "+xx-xxx-xxx-xxxx"
"ows_contactfacsimiletelephone" "+xx-xxx-xxx-xxxx"
"ows_contactperson" "Tom Kralidis"
"ows_contactorganization" "MapServer"
"ows_contactposition" "self"

"ows_rootlayer_title" "My Layers"
"ows_rootlayer_abstract" "These are my layers"
"ows_rootlayer_keywordlist" "layers,list"
"ows_layerlimit" "1"
"ows_enable_request" "*"
END
END

PROJECTION
"init=epsg:4326"
#"init=./data/epsg2:42304"
END


Expand Down Expand Up @@ -96,4 +77,53 @@ LAYER
END
END # Layer

# A road layer with WMS groups
LAYER
NAME road2
DATA road
TEMPLATE "ttt"
METADATA
"wms_title" "road2"
"wms_description" "Roads of I.P.E."
"wms_srs" "EPSG:43204 EPSG:3857"
"gml_include_items" "all"
END
TYPE LINE
STATUS ON
PROJECTION
"init=./data/epsg2:42304"
END

CLASSITEM "Name_e"
CLASSGROUP "all"

CLASS
GROUP "all"
NAME "Roads"
STYLE
SYMBOL 0
COLOR 0 0 0
END
END

CLASS
GROUP "main"
NAME "Roads"
EXPRESSION ([F_CODE] = 67)
STYLE
SYMBOL 0
COLOR 0 220 0
END
END
CLASS
GROUP "other"
NAME "Roads"
EXPRESSION ([F_CODE] != 67)
STYLE
SYMBOL 0
COLOR 220 0 0
END
END
END # Layer

END # Map File
15 changes: 7 additions & 8 deletions src/mapmvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ static void freeMvtTile(VectorTile__Tile *mvt_tile) {
}

/*
** In case any type of query filter (SLD, OGC, ...) is involved, intercept the
*msLayerWhichShapes() call.
* If there is a query filter (SLD, OGC, ...) is used, intercept the
* msLayerWhichShapes() call.
*/
int msMVTWhichShapes(layerObj *layer, rectObj rect, int isQuery) {
if (!layer->resultcache)
Expand All @@ -428,12 +428,11 @@ int msMVTWhichShapes(layerObj *layer, rectObj rect, int isQuery) {
}

/*
** Provides the next shape for the layer. Two possibilities:
** - No query filter involved (SLD, OGC, ...), go for msLayerNextShape() since
*msMVTWhichShapes() let msLayerWhichShapes() pass through.
** - A query filter is involved (SLD, OGC, ...), look for resultcache given
*the last requested index (iShape) -> TODO: may be find a better way.
**
* Provide the next shape for the layer. Two possibilities:
* - No query filter involved (SLD, OGC, ...), go for msLayerNextShape() since
* msMVTWhichShapes() let msLayerWhichShapes() pass through.
* - A query filter is involved (SLD, OGC, ...), look for resultcache given
* the last requested index (iShape) -> TODO: may be find a better way.
*/
int msMVTGetNextShape(layerObj *layer, shapeObj *shape, int *iShape) {
if (!iShape)
Expand Down

0 comments on commit eb6c5d2

Please sign in to comment.