Samo map layers
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.
"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 property | Type | Default value | Description |
|---|---|---|---|
| maxResolution | Number | notifies | The maximum resolution (exclusive) below which this layer will be visible. The resolution is the size of 1 pixel in map units. |
| minResolution | Number | notifies | The minimum resolution (inclusive) at which this layer will be visible. The resolution is the size of 1 pixel in map units. |
| opacity | Number | Default: 1 – notifies | Opacity of the layer. Defined in interval <0,1>. |
| queryable | Boolean | Default: false | If true, the layer can be used in queries. |
| singleTile | Boolean | notifies | Option to load map at single tile. |
| title | String | Name of the layer. Could be used in UI components for layer managment. | |
| url | String | URL of specific Map Service. | |
| visible | Boolean | Default: true – notifies | Visibility of the layer. Whether layer should be displayed in the map. |
| wmsParams | Object | notifies | WMS 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. |
| zIndex | Number | Default: 0 – notifies | The z-index for layer rendering. At rendering time, the layers will be ordered, first by Z-index and then by position. |
TMS
"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 property | Type | Default value | Description |
|---|---|---|---|
| buffer | Number | Default: 0 – notifies | Used 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. |
| extent | Array | notifies | Extent for the grid. Defined as array consist of four elements in format [minx, miny, maxx, maxy]. |
| layerName | String | Name of the layer. It would be used in TMS requests for this layer. | |
| maxResolution | Number | notifies | The maximum resolution (exclusive) below which this layer will be visible. The resolution is the size of 1 pixel in map units. |
| minResolution | Number | notifies | The minimum resolution (inclusive) at which this layer will be visible. The resolution is the size of 1 pixel in map units. |
| opacity | Number | Default: 1 – notifies | Opacity of the layer. Defined in interval <0,1>. |
| origin | Array | notifies | Origin point for the grid. Defined as two-element array. |
| preload | Number | Default: 0 – notifies | Preload. Load low-resolution tiles up to preload levels. By default preload is 0, which means no preloading. Example: preload="Infinity". |
| queryable | Boolean | Default: false | If true, the layer can be used in queries. |
| resolutions | Array | notifies | Resolutions levels for this layer. |
| sourceWmsLayer | String | ID of source WMS layer. | |
| tileSize | Array | notifies | Size of the tiles. Array consist of two values. |
| title | String | Name of the layer. Could be used in UI components for layer managment. | |
| url | String | URL of specific Map Service. | |
| visible | Boolean | Default: true – notifies | Visibility of the layer. Whether layer should be displayed in the map. |
| zIndex | Number | Default: 0 – notifies | The z-index for layer rendering. At rendering time, the layers will be ordered, first by Z-index and then by position. |
WMTS
"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 property | Type | Default value | Description |
|---|---|---|---|
| autoConfiguration | Boolean | Default: false | If true, the layer configuration will be created automatically and only layerName and matrixSet properties will be used (if set). |
| extent | Array | notifies | Extent 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]. |
| layerName | String | Name of the layer. It will be used in WMTS request. If not set, the first layer from capabilities will be used. | |
| matrixSet | String | Matrix set. If not set, the first matrixSet corresponding to coordinate system of map view will be used. | |
| maxResolution | Number | notifies | The maximum resolution (exclusive) below which this layer will be visible. The resolution is the size of 1 pixel in map units. |
| minResolution | Number | notifies | The minimum resolution (inclusive) at which this layer will be visible. The resolution is the size of 1 pixel in map units. |
| opacity | Number | Default: 1 – notifies | Opacity of the layer. Defined in interval <0,1>. |
| origin | Array | notifies | The 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. |
| origins | Array | Tile 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. | |
| preload | Number | Default: 0 – notifies | Preload. Load low-resolution tiles up to preload levels. By default preload is 0, which means no preloading. Example: preload="Infinity" |
| projection | String | SRS identifier string. | |
| queryable | Boolean | Default: false | If true, the layer can be used in queries. |
| requestEncoding | String | Default: KVP | Request encoding. |
| resolutions | Array | notifies | Resolutions levels for this layer. |
| styleName | String | Style identifier for the layer. | |
| tileFormat | String | Default: image/jpeg | Image format. |
| tileSize | Number | notifies | Tile size. |
| title | String | Name of the layer. Could be used in UI components for layer managment. | |
| url | String | A 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. | |
| visible | Boolean | Default: true – notifies | Visibility of the layer. Whether layer should be displayed in the map. |
| wmtsVersion | String | Default: 1.0.0 | Versoin of WMTS service. |
| zIndex | Number | Default: 0 – notifies | The z-index for layer rendering. At rendering time, the layers will be ordered, first by Z-index and then by position. |
WFS
"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 property | Type | Default value | Description |
|---|---|---|---|
| archiveDate | String | notifies | The archive date defines date for feature history. |
| featureNS | String | Feature name space that is used in request. | |
| featurePrefix | String | Feature prefix that is used in request. | |
| filterFunction | Object | notifies | Function to filter features. In this function can be accessed feature variable for each feature. The feature will be shown, if filter function returns true. |
| geometryName | String | Geometry name that is used in request. | |
| hiddenIds | Array | Default: [] – notifies | Representation of hidden features. Array contains its IDs. |
| maxResolution | Number | notifies | The maximum resolution (exclusive) below which this layer will be visible. The resolution is the size of 1 pixel in map units. |
| minResolution | Number | notifies | The minimum resolution (inclusive) at which this layer will be visible. The resolution is the size of 1 pixel in map units. |
| opacity | Number | Default: 1 – notifies | Opacity of the layer. Defined in interval <0,1>. |
| outputFormat | String | The output format specifies format in which the features would be send from server. | |
| queryArray | Array | notifies | Array 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 |
| styleMap | Object | Default: null – notifies | JSON Object to style features, see styling documentation. |
| styleMapResource | String | notifies | ID of JSON resource loaded by loader element in <lids-resources-manager>. |
| title | String | Name of the layer. Could be used in UI components for layer managment. | |
| url | String | URL of specific Map Service. | |
| visible | Boolean | Default: true – notifies | Visibility of the layer. Whether layer should be displayed in the map. |
| wfsVersion | String | Default: 1.0.0 | Version of WebFeatureService. Default is 1.0.0. |
| zIndex | Number | Default: 0 – notifies | The 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 property | Type | Description |
|---|---|---|
| featureType | String | WFS Query feature type |
| attributes | Array < String > | Array of attribute IDs required from server |
| graphicTagTypes | Array < String > | Array of graphic tag type IDs required from server |
| filter | Object | Object 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
"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
propertyNameis not NULL in feature.
"filter": {
"operatorType": 'PropertyIsNull',
"propertyName": "at_5001544"
}
- The PropertyIsBetween operator checks if
propertyNamebelongs to range specified byupperBoundaryandlowerBoundary.
"filter": {
"operatorType": 'PropertyIsBetween',
"propertyName": "at_5001523",
"upperBoundary": 105,
"lowerBoundary": 100
}
- The PropertyIsLike operator provide string comparison with pattern matching. The
patternis definded by a combination of regular characters, thewildChar, thesingleCharand theescapeCharcharacter.
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.
"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
"filter": {
"operatorType": "And" | "Or",
"conditions": [
Comparison operators|Logical operators|"Not",
Comparison operators|Logical operators|"Not"
]
}
- Structure of Not filter
"filter":{
"operatorType": "Not",
"condition": Comparison operators|Logical operators|"Not"
}