Skip to main content

Samo map layers

Header

Level: Intermediate

Keywords: feature, entity, map layers, wfs, wms, wmts, tms

The result: overview of map layers

Introduction

Each map needs to have defined a set of layers for correct rendering of LIDS data. In SAMO applications standard OGC web geographical services are supported: WMS (Web Map Service), WFS(Web Feature Service), WMTS (Web Map Tile Service) and TMS (Tile Map Service) and also others.

Map layers are defined in both SAMO and LIDS metadata.

WMS

WMS is used to display maps data in raster format, however some WMS can also use SVG.

lids-map-layer-wms - configuration example
"orthofotoWms":{ // wms folder
"title": "{tr:mapLayers.ortophoto}",
"type": "lids-map-layer-wms",
"visible": false,
"optional": true,
"gatewayEntityGroup": "samo-layers-wms",
"properties" : {
"wmsParams": {
"LAYERS": "bd_orthofoto"
},
"singleTile": true
}
}

Properties

Custom propertyTypeDefault valueDescription
maxResolutionNumbernotifiesThe maximum resolution (exclusive) below which this layer will be visible. The resolution is the size of 1 pixel in map units.
minResolutionNumbernotifiesThe minimum resolution (inclusive) at which this layer will be visible. The resolution is the size of 1 pixel in map units.
opacityNumberDefault: 1 – notifiesOpacity of the layer. Defined in interval <0,1>.
queryableBooleanDefault: falseIf true, the layer can be used in queries.
singleTileBooleannotifiesOption to load map at single tile.
titleStringName of the layer. Could be used in UI components for layer managment.
urlStringURL of specific Map Service.
visibleBooleanDefault: true – notifiesVisibility of the layer. Whether layer should be displayed in the map.
wmsParamsObjectnotifiesWMS request parameters. At least a LAYERS param is required. STYLES is '' by default. VERSION is 1.3.0 by default. FORMAT is image/png by default. TRANSPARENT is true by default. WIDTH, HEIGHT, BBOX and CRS (SRS for WMS version < 1.3.0) will be set dynamically. Required.
zIndexNumberDefault: 0 – notifiesThe z-index for layer rendering. At rendering time, the layers will be ordered, first by Z-index and then by position.

TMS

lids-map-layer-tms - configuration example
"baseTMS": { // no folder
"title" : "{tr:mapLayers.baseTMS}",
"type": "lids-map-layer-tms",
"visible": false,
"optional": true,
"gatewayEntityGroup": "public-samo-layers-tms",
"properties" : {
"layerName" : "tms_ext",
"opacity" : "0.35",
"origin": [
-15000.0, 325000.0
],
"resolutions": [
56.00003023999999, 28.00001512, 14.00000756, 5.600003024, 2.800001512, 1.400000756, 0.5600003024, 0.2800001512, 0.1400000756, 0.05600003024
],
"extent": [
-15000.0, 20000.0, 325000.0, 355000.0
],
"tileSize": [
512, 512
]
}
}

Properties

Custom propertyTypeDefault valueDescription
bufferNumberDefault: 0 – notifiesUsed only when in gridded mode, this specifies the number of extra rows and columns of tiles on each side which will surround the minimum grid tiles to cover the map. By default buffer is 0.
extentArraynotifiesExtent for the grid. Defined as array consist of four elements in format [minx, miny, maxx, maxy].
layerNameStringName of the layer. It would be used in TMS requests for this layer.
maxResolutionNumbernotifiesThe maximum resolution (exclusive) below which this layer will be visible. The resolution is the size of 1 pixel in map units.
minResolutionNumbernotifiesThe minimum resolution (inclusive) at which this layer will be visible. The resolution is the size of 1 pixel in map units.
opacityNumberDefault: 1 – notifiesOpacity of the layer. Defined in interval <0,1>.
originArraynotifiesOrigin point for the grid. Defined as two-element array.
preloadNumberDefault: 0 – notifiesPreload. Load low-resolution tiles up to preload levels. By default preload is 0, which means no preloading. Example: preload="Infinity".
queryableBooleanDefault: falseIf true, the layer can be used in queries.
resolutionsArraynotifiesResolutions levels for this layer.
sourceWmsLayerStringID of source WMS layer.
tileSizeArraynotifiesSize of the tiles. Array consist of two values.
titleStringName of the layer. Could be used in UI components for layer managment.
urlStringURL of specific Map Service.
visibleBooleanDefault: true – notifiesVisibility of the layer. Whether layer should be displayed in the map.
zIndexNumberDefault: 0 – notifiesThe z-index for layer rendering. At rendering time, the layers will be ordered, first by Z-index and then by position.

WMTS

lids-map-layer-wmts - configuration example
"baseMapAt": {
"title" : "basemap.at",
"type": "lids-map-layer-wmts",
"visible": true,
"optional": true,
"properties" : {
"crossOrigin" : "anonymous",
"layerName": "bmapgrau",
"matrixSet": "google3857",
"opacity" : "1",
"autoConfiguration": true,
"url" : "https://www.basemap.at/wmts/1.0.0/WMTSCapabilities.xml?SERVICE=WMTS"
}
}

Properties

Custom propertyTypeDefault valueDescription
autoConfigurationBooleanDefault: falseIf true, the layer configuration will be created automatically and only layerName and matrixSet properties will be used (if set).
extentArraynotifiesExtent for the tile grid. No tiles outside this extent will be requested by ol.source.Tile sources. When no origin or origins are configured, the origin will be set to the top-left corner of the extent. An array of numbers representing an extent: [minx, miny, maxx, maxy].
layerNameStringName of the layer. It will be used in WMTS request. If not set, the first layer from capabilities will be used.
matrixSetStringMatrix set. If not set, the first matrixSet corresponding to coordinate system of map view will be used.
maxResolutionNumbernotifiesThe maximum resolution (exclusive) below which this layer will be visible. The resolution is the size of 1 pixel in map units.
minResolutionNumbernotifiesThe minimum resolution (inclusive) at which this layer will be visible. The resolution is the size of 1 pixel in map units.
opacityNumberDefault: 1 – notifiesOpacity of the layer. Defined in interval <0,1>.
originArraynotifiesThe tile grid origin, i.e. where the x and y axes meet ([z, 0, 0]). Tile coordinates increase left to right and upwards. If not specified, extent or origins must be provided.
originsArrayTile grid origins, i.e. where the x and y axes meet ([z, 0, 0]), for each zoom level. If given, the array length should match the length of the resolutions array, i.e. each resolution can have a different origin. Tile coordinates increase left to right and upwards. If not specified, extent or origin must be provided.
preloadNumberDefault: 0 – notifiesPreload. Load low-resolution tiles up to preload levels. By default preload is 0, which means no preloading. Example: preload="Infinity"
projectionStringSRS identifier string.
queryableBooleanDefault: falseIf true, the layer can be used in queries.
requestEncodingStringDefault: KVPRequest encoding.
resolutionsArraynotifiesResolutions levels for this layer.
styleNameStringStyle identifier for the layer.
tileFormatStringDefault: image/jpegImage format.
tileSizeNumbernotifiesTile size.
titleStringName of the layer. Could be used in UI components for layer managment.
urlStringA URL for the service. For the RESTful request encoding, this is a URL template. For KVP encoding, it is normal URL. A {?-?} template pattern, for example subdomain{a-f}.domain.com, may be used instead of defining each one separately in the urls option.
visibleBooleanDefault: true – notifiesVisibility of the layer. Whether layer should be displayed in the map.
wmtsVersionStringDefault: 1.0.0Versoin of WMTS service.
zIndexNumberDefault: 0 – notifiesThe z-index for layer rendering. At rendering time, the layers will be ordered, first by Z-index and then by position.

WFS

lids-map-layer-wfs - configuration example
"gassLowPreasure": { // gassWaterFWFolder folder
"title" : "{tr:mapLayers.gassLowPreasure}",
"type" : "lids-map-layer-wfs",
"visible": false,
"optional": true,
"gatewayEntityGroup": "samo-layers-wfs",
"properties" : {
"outputFormat": "BGML",
"queryArray" : [
{
"featureType": "ft_g_gas_schutzrohr",
"attributes": ["at_geom", "at_gas_06"],
"filter": {
"operatorType": "PropertyIsEqualTo",
"propertyName": "at_gas_06/ca_gas_druckzone_01",
"expression": 3
}
}
]
}
}

Properties

Custom propertyTypeDefault valueDescription
archiveDateStringnotifiesThe archive date defines date for feature history.
featureNSStringFeature name space that is used in request.
featurePrefixStringFeature prefix that is used in request.
filterFunctionObjectnotifiesFunction to filter features. In this function can be accessed feature variable for each feature. The feature will be shown, if filter function returns true.
geometryNameStringGeometry name that is used in request.
hiddenIdsArrayDefault: [] – notifiesRepresentation of hidden features. Array contains its IDs.
maxResolutionNumbernotifiesThe maximum resolution (exclusive) below which this layer will be visible. The resolution is the size of 1 pixel in map units.
minResolutionNumbernotifiesThe minimum resolution (inclusive) at which this layer will be visible. The resolution is the size of 1 pixel in map units.
opacityNumberDefault: 1 – notifiesOpacity of the layer. Defined in interval <0,1>.
outputFormatStringThe output format specifies format in which the features would be send from server.
queryArrayArraynotifiesArray of Query objects. Query object has these properties: featureType describes Query feature type, attributes array of attributes required from server, graphicTagsTypes array of graphic tag types required from server and filters array of filters for this query. a detailed description below
styleMapObjectDefault: null – notifiesJSON Object to style features, see styling documentation.
styleMapResourceStringnotifiesID of JSON resource loaded by loader element in <lids-resources-manager>.
titleStringName of the layer. Could be used in UI components for layer managment.
urlStringURL of specific Map Service.
visibleBooleanDefault: true – notifiesVisibility of the layer. Whether layer should be displayed in the map.
wfsVersionStringDefault: 1.0.0Version of WebFeatureService. Default is 1.0.0.
zIndexNumberDefault: 0 – notifiesThe z-index for layer rendering. At rendering time, the layers will be ordered, first by Z-index and then by position.
Description of Query object

Every Query object has to consist of these properties:

Custom propertyTypeDescription
featureTypeStringWFS Query feature type
attributesArray < String >Array of attribute IDs required from server
graphicTagTypesArray < String >Array of graphic tag type IDs required from server
filterObjectObject representation of OGC filter
Structure of Filter object

The Filter object is possibility to set complex filtering rules for the query. Every item in Filter object should have attributes operatorType, for description of required operation, and propertyName, for description of operand which should operation use. Other required properties depands on operation type.

1. Comparison operators

The Comparison operators are used to compare the feature property propertyName with the expression value.

Comparison operators are:

  • PropertyIsEqualTo
  • PropertyIsNotEqualTo
  • PropertyIsLessThan
  • PropertyIsLessThanOrEqualTo
  • PropertyIsGreaterThan
  • PropertyIsGreaterThanOrEqualTo
Comparison operators - configuration example
"filter":{
"operatorType": Comparison operators,
"propertyName": "at_5001544",
"expression": "19000102"
}

In addiction of the standard set of comparison operators, there exist PropertyIsNull, PropertyIsBetween and PropertyIsLike operators.

  • The PropertyIsNull operator checks if propertyName is not NULL in feature.
PropertyIsNull operator - configuration example
"filter": {
"operatorType": 'PropertyIsNull',
"propertyName": "at_5001544"
}
  • The PropertyIsBetween operator checks if propertyName belongs to range specified by upperBoundary and lowerBoundary.
PropertyIsBetween operator - configuration example
"filter": {
"operatorType": 'PropertyIsBetween',
"propertyName": "at_5001523",
"upperBoundary": 105,
"lowerBoundary": 100
}
  • The PropertyIsLike operator provide string comparison with pattern matching. The pattern is definded by a combination of regular characters, the wildChar, the singleChar and the escapeChar character.

The wildChar character matches zero or more characters The singleChar character matches exactly one character and the escapeChar character is used to escape the meaning of the wildCard, singleChar and escapeChar itself.

PropertyIsLike operator - configuration example
"filter": {
"operatorType": 'PropertyIsLike',
"propertyName": "at_5001538",
"wildChar": "*",
"singleChar": "#",
"escapeChar": "!",
"pattern": "Blan### - O*"
}

2. Logical operators

The Logical operators are used to join multiple operators with the logical condition (And, Or) or to negate filter (Not).

  • Structure of And, Or operators
And | Or operators - configuration example
"filter": {
"operatorType": "And" | "Or",
"conditions": [
Comparison operators|Logical operators|"Not",
Comparison operators|Logical operators|"Not"
]
}
  • Structure of Not filter
Not operator - configuration example
"filter":{
"operatorType": "Not",
"condition": Comparison operators|Logical operators|"Not"
}