WMSRequest
extends OGCRequest
in package
Tags
Table of Contents
Properties
- $appContext : AppContextInterface
- $params : array<string|int, mixed>
- $project : Project
- $repository : Repository
- $requestXml : null|string
- $services : lizmapServices
- $tplExceptions : string
- $forceRequest : mixed
Methods
- __construct() : mixed
- constructor.
- getForceRequest() : mixed
- getTileCache() : array<string|int, mixed>|string
- param() : mixed
- Get the value of a request parameter. If not defined, gets its default value.
- parameters() : array<string|int, mixed>
- Provide the parameters with the lizmap extra parameters for filtering the request.
- process() : object
- Process the OGC Request Checks the request parameter and performs the right method.
- setForceRequest() : mixed
- checkMaximumWidthHeight() : bool
- Check wether the height and width values are valid.
- constructUrl() : string
- Build the URL to request QGIS Server.
- getImageData() : false|string
- getMapData() : OGCResponse
- Get data from map service or from the cache.
- getMetaTileData() : mixed
- getViewTpl() : string
- getVProfileInfos() : mixed
- gfiGmlToHtml() : string
- gfiGmlToHtml : return HTML for the getFeatureInfo GML.
- gfiRasterXmlToHtml() : string
- gfiRasterXmlToHtml : return Raster HTML for the getFeatureInfo XML.
- gfiVectorXmlToHtml() : array<string|int, mixed>
- gfiVectorXmlToHtml : return Vector HTML for the getFeatureInfo XML.
- gfiXmlToHtml() : string
- gfiXmlToHtml : return HTML for the getFeatureInfo XML.
- loadXmlString() : mixed
- logRequestIfError() : mixed
- Log if the HTTP code is a 4XX or 5XX error code.
- process_getcapabilities() : OGCResponse
- Perform an OGC GetCapabilities Request.
- process_getcontext() : OGCResponse
- process_getfeatureinfo() : OGCResponse
- process_getlegendgraphic() : mixed
- process_getlegendgraphics() : OGCResponse
- process_getmap() : OGCResponse
- process_getprint() : OGCResponse
- process_getprintatlas() : OGCResponse
- process_getschemaextension() : OGCResponse
- process_getstyles() : OGCResponse
- replaceMediaPathByMediaUrl() : string
- replaceMediaPathByMediaUrl : replace all "/media/bla" in a text by the getMedia corresponding URL.
- replaceWebDavPathByMediaUrl() : string
- replaceWebDavPathByMediaUrl : replace all webdav remote url to corresponding path for getMedia endpoint.
- request() : OGCResponse
- Request QGIS Server.
- serviceException() : OGCResponse
- Provide an OGC Service Exception result.
- useCache() : mixed
- formatHttpErrorString() : string
- Generate a string to identify the target of the HTTP request.
Properties
$appContext
protected
AppContextInterface
$appContext
$params
protected
array<string|int, mixed>
$params
$project
protected
Project
$project
$repository
protected
Repository
$repository
$requestXml
protected
null|string
$requestXml
$services
protected
lizmapServices
$services
$tplExceptions
protected
string
$tplExceptions
= 'lizmap~wms_exception'
selector of a template
$forceRequest
private
mixed
$forceRequest
= false
Methods
__construct()
constructor.
public
__construct(Project $project, array<string|int, mixed> $params, lizmapServices $services[, null|string $requestXml = null ]) : mixed
Parameters
- $project : Project
-
the project
- $params : array<string|int, mixed>
-
the params array
- $services : lizmapServices
- $requestXml : null|string = null
-
the params array
getForceRequest()
public
getForceRequest() : mixed
getTileCache()
public
getTileCache(array<string|int, mixed> $params, string $profile, bool $useCache, bool $forced[, false $debug = false ]) : array<string|int, mixed>|string
Parameters
- $params : array<string|int, mixed>
- $profile : string
- $useCache : bool
- $forced : bool
- $debug : false = false
-
deprecated
Return values
array<string|int, mixed>|stringparam()
Get the value of a request parameter. If not defined, gets its default value.
public
param(string $name[, mixed $defaultValue = null ][, bool $useDefaultIfEmpty = false ]) : mixed
Parameters
- $name : string
-
the name of the request parameter
- $defaultValue : mixed = null
-
the default returned value if the parameter doesn't exists
- $useDefaultIfEmpty : bool = false
-
true: says to return the default value if the parameter value is ""
Return values
mixed —the request parameter value
parameters()
Provide the parameters with the lizmap extra parameters for filtering the request.
public
parameters() : array<string|int, mixed>
Lizmap_User, Lizmap_User_Groups, Lizmap_Override_Filter have been added to the OGC request parameters.
Return values
array<string|int, mixed> —the OGC request parameters with Lizmap extra parameters for filtering request
process()
Process the OGC Request Checks the request parameter and performs the right method.
public
process() : object
Return values
object —The request result with HTTP code, response mime-type, response data (properties $code, $mime, $data, $cached)
setForceRequest()
public
setForceRequest(mixed $forced) : mixed
Parameters
- $forced : mixed
checkMaximumWidthHeight()
Check wether the height and width values are valid.
protected
checkMaximumWidthHeight() : bool
Return values
boolconstructUrl()
Build the URL to request QGIS Server.
protected
constructUrl() : string
Return values
string —The URL to use to request QGIS Server
getImageData()
protected
getImageData(string $data, array<string|int, mixed> $params, array<string|int, mixed> $originalParams, float $xFactor, float $yFactor[, false $debug = false ]) : false|string
Parameters
- $data : string
-
string data of the original image
- $params : array<string|int, mixed>
-
array
- $originalParams : array<string|int, mixed>
-
array
- $xFactor : float
-
int
- $yFactor : float
-
int
- $debug : false = false
-
bool deprecated
Return values
false|string —content of the image
getMapData()
Get data from map service or from the cache.
protected
getMapData(Project $project, array<string|int, mixed> $params[, mixed $forced = false ]) : OGCResponse
Parameters
- $project : Project
-
the project
- $params : array<string|int, mixed>
-
array of parameters
- $forced : mixed = false
Return values
OGCResponse —normalized and filtered response
getMetaTileData()
protected
getMetaTileData(array<string|int, mixed> $params, string $metatileSize) : mixed
Parameters
- $params : array<string|int, mixed>
- $metatileSize : string
Tags
getViewTpl()
protected
getViewTpl(mixed $tplName, mixed $layerName, mixed $layerId, mixed $layerTitle[, mixed $params = array() ]) : string
Parameters
- $tplName : mixed
- $layerName : mixed
- $layerId : mixed
- $layerTitle : mixed
- $params : mixed = array()
Return values
stringgetVProfileInfos()
protected
getVProfileInfos(mixed $configLayer, mixed $repository, mixed $project) : mixed
Parameters
- $configLayer : mixed
- $repository : mixed
- $project : mixed
gfiGmlToHtml()
gfiGmlToHtml : return HTML for the getFeatureInfo GML.
protected
gfiGmlToHtml(string $gmldata, object $configLayer) : string
Parameters
- $gmldata : string
-
GML data from getFeatureInfo
- $configLayer : object
Return values
string —feature Info in HTML format
gfiRasterXmlToHtml()
gfiRasterXmlToHtml : return Raster HTML for the getFeatureInfo XML.
protected
gfiRasterXmlToHtml(string $layerId, string $layerName, string $layerTitle, SimpleXmlElement $layer) : string
Parameters
- $layerId : string
- $layerName : string
- $layerTitle : string
- $layer : SimpleXmlElement
Return values
string —Raster feature Info in HTML format
gfiVectorXmlToHtml()
gfiVectorXmlToHtml : return Vector HTML for the getFeatureInfo XML.
protected
gfiVectorXmlToHtml(string $layerId, string $layerName, string $layerTitle, SimpleXmlElement $layer, object $configLayer, array<string|int, mixed> $filterFid) : array<string|int, mixed>
Parameters
- $layerId : string
- $layerName : string
- $layerTitle : string
- $layer : SimpleXmlElement
- $configLayer : object
- $filterFid : array<string|int, mixed>
Return values
array<string|int, mixed> —Vector features Info in HTML format
gfiXmlToHtml()
gfiXmlToHtml : return HTML for the getFeatureInfo XML.
protected
gfiXmlToHtml(string $xmlData) : string
Parameters
- $xmlData : string
-
XML data from getFeatureInfo
Return values
string —feature Info in HTML format
loadXmlString()
protected
loadXmlString(mixed $xmldata, mixed $name) : mixed
Parameters
- $xmldata : mixed
- $name : mixed
logRequestIfError()
Log if the HTTP code is a 4XX or 5XX error code.
protected
logRequestIfError(int $code) : mixed
Parameters
- $code : int
-
The HTTP code of the request
process_getcapabilities()
Perform an OGC GetCapabilities Request.
protected
process_getcapabilities() : OGCResponse
Tags
Return values
OGCResponseprocess_getcontext()
protected
process_getcontext() : OGCResponse
Return values
OGCResponseprocess_getfeatureinfo()
protected
process_getfeatureinfo() : OGCResponse
Tags
Return values
OGCResponseprocess_getlegendgraphic()
protected
process_getlegendgraphic() : mixed
process_getlegendgraphics()
protected
process_getlegendgraphics() : OGCResponse
Tags
Return values
OGCResponseprocess_getmap()
protected
process_getmap() : OGCResponse
Tags
Return values
OGCResponseprocess_getprint()
protected
process_getprint() : OGCResponse
Return values
OGCResponseprocess_getprintatlas()
protected
process_getprintatlas() : OGCResponse
Return values
OGCResponseprocess_getschemaextension()
protected
process_getschemaextension() : OGCResponse
Return values
OGCResponseprocess_getstyles()
protected
process_getstyles() : OGCResponse
Tags
Return values
OGCResponsereplaceMediaPathByMediaUrl()
replaceMediaPathByMediaUrl : replace all "/media/bla" in a text by the getMedia corresponding URL.
protected
replaceMediaPathByMediaUrl(array<string|int, mixed> $matches) : string
This method is used as callback in GetFeatureInfoHtml method for the preg_replace_callback.
Parameters
- $matches : array<string|int, mixed>
-
Array containing the preg matches
Return values
string —replaced text
replaceWebDavPathByMediaUrl()
replaceWebDavPathByMediaUrl : replace all webdav remote url to corresponding path for getMedia endpoint.
protected
replaceWebDavPathByMediaUrl(string $template, string $remoteStorageUri) : string
Parameters
- $template : string
-
The string to search on
- $remoteStorageUri : string
-
The remote baseUri to replace
Return values
string —replaced text
request()
Request QGIS Server.
protected
request([bool $post = false ][, bool $stream = false ]) : OGCResponse
Parameters
- $post : bool = false
-
Force to use POST request
- $stream : bool = false
-
Get data as stream
Return values
OGCResponse —The request result with HTTP code, response mime-type and response data (properties $code, $mime, $data)
serviceException()
Provide an OGC Service Exception result.
protected
serviceException([int $code = 400 ]) : OGCResponse
Parameters
- $code : int = 400
-
The HTTP code to return
Return values
OGCResponse —The request result with HTTP code, response mime-type, response data (properties $code, $mime, $data, $cached)
useCache()
protected
useCache(mixed $configLayer, mixed $params, mixed $profile) : mixed
Parameters
- $configLayer : mixed
- $params : mixed
- $profile : mixed
formatHttpErrorString()
Generate a string to identify the target of the HTTP request.
private
formatHttpErrorString(array<string|int, mixed> $parameters, int $code) : string
Parameters
- $parameters : array<string|int, mixed>
-
The list of HTTP parameters in the query
- $code : int
-
The HTTP code of the request
Return values
string —The string to identify the HTTP request, with main OGC parameters first such as MAP, SERVICE...