QgisProject
in package
Tags
Table of Contents
Constants
- MAP_ONLY_VALUES = 2
- MAP_VALUES_AS_KEYS = 1
- MAP_VALUES_AS_VALUES = 0
Properties
- $allProj4 : array<string|int, mixed>
- $appContext : AppContextInterface
- $cachedProperties : array<string|int, mixed>
- $canvasColor : string
- $customProjectVariables : array<string|int, mixed>
- $data : array<string|int, mixed>
- $lastSaveDateTime : string
- Last saved date time in the QGIS file.
- $layers : array<string|int, array<string|int, mixed>>
- $optionTypes : mixed
- $path : string
- $qgisEmbeddedProjects : array<string|int, mixed>
- $qgisProjectVersion : int
- Version of QGIS which wrote the project.
- $relations : array<string|int, mixed>
- $relationsFields : array<string|int, mixed>
- $services : lizmapServices
- $themes : array<string|int, mixed>
- $useLayerIDs : bool
- $WMSInformation : array<string|int, mixed>
- $xml : SimpleXMLElement
Methods
- __construct() : mixed
- constructor.
- findLayersByKeyword() : array<string|int, qgisMapLayer>|array<string|int, qgisVectorLayer>
- getAbstract() : string
- Get the project abstract.
- getAllProj4() : mixed
- getCacheData() : mixed
- getCanvasColor() : mixed
- getCustomProjectVariables() : mixed
- getData() : null|mixed
- getEmbeddedQgisProject() : null|QgisProject
- getKeywordList() : array<string|int, mixed>
- List of keywords.
- getLastSaveDateTime() : string
- Last saved date time in the QGIS file.
- getLayer() : null|qgisMapLayer|qgisVectorLayer
- getLayerByKeyword() : null|qgisMapLayer|qgisVectorLayer
- getLayerDefinition() : null|MapLayerDef|VectorLayerDef
- getLayerNameByIdFromConfig() : null|string
- getPrintTemplates() : array<string|int, mixed>
- getProj4() : mixed
- getQgisProjectVersion() : mixed
- getRelationField() : mixed
- getRelations() : mixed
- getThemes() : mixed
- getTitle() : string
- Get the project title.
- getWMSInformation() : mixed
- getWMSMaxHeight() : int
- WMS Max Height.
- getWMSMaxWidth() : int
- WMS Max Width.
- getXmlLayer() : array<string|int, SimpleXMLElement>
- isUsingLayerIDs() : bool
- readAttributeLayers() : mixed
- readEditionForms() : mixed
- readEditionLayers() : mixed
- readFormControls() : array<string|int, mixed>
- readLayersLabeledFieldsConfig() : mixed
- Read the layer QGIS form configuration for the layers used in attribute tables, form filter & dataviz, and get the configuration for the fields for which to display labels instead of codes.
- readLayersOrder() : array<string|int, int>
- readLocateByLayer() : mixed
- setPropertiesAfterRead() : mixed
- xpathQuery() : array<string|int, mixed>
- Execute an xpath Query on the XML content and return the result.
- convertTypeOptions() : mixed
- convertValueOptions() : bool|float|int|string
- getEditType() : array<string|int, QgisFormControlProperties>
- getFieldConfiguration() : array<string|int, QgisFormControlProperties>
- getFieldConfigurationOptions() : mixed
- getMarkup() : string
- getValuesFromOptions() : array<string|int, mixed>
- getXml() : SimpleXMLElement
- temporary function to read xml for some methods that relies on xml data that are not yet stored in the cache.
- getXmlLayer2() : null|SimpleXMLElement
- readAllProj4() : array<string|int, mixed>
- readCanvasColor() : string
- readCustomProjectVariables() : null|array<string, string>
- readLastSaveDateTime() : string
- Read the last modified date of the QGS file.
- readLayers() : array<string|int, MapLayerDef|VectorLayerDef>
- readQgisProjectVersion() : mixed
- readRelationField() : mixed
- readRelations() : null|array<string|int, array<string|int, mixed>>
- readThemes() : null|array<string|int, array<string|int, mixed>>
- readUploadOptions() : mixed
- readUseLayerIDs() : bool
- readWebDavStorageOptions() : mixed
- update the upload options with the property 'webDAVStorageUrl'.
- readWMSInformation() : mixed
- readXmlProject() : mixed
- Read the qgis files.
- setLayerGroupData() : mixed
- Set layers' group infos.
- setLayerOpacity() : mixed
- Set layers' opacity with XML data.
- setLayerShowFeatureCount() : mixed
- Set layers' last infos.
- setShortNames() : mixed
- Set layers' shortname with XML data.
- unsetPropAfterRead() : mixed
- Set/Unset some properties after reading the config file.
Constants
MAP_ONLY_VALUES
public
mixed
MAP_ONLY_VALUES
= 2
MAP_VALUES_AS_KEYS
public
mixed
MAP_VALUES_AS_KEYS
= 1
MAP_VALUES_AS_VALUES
public
mixed
MAP_VALUES_AS_VALUES
= 0
Properties
$allProj4
protected
array<string|int, mixed>
$allProj4
= array()
authid => proj4
$appContext
protected
AppContextInterface
$appContext
$cachedProperties
protected
static array<string|int, mixed>
$cachedProperties
= array('WMSInformation', 'canvasColor', 'allProj4', 'relations', 'relationsFields', 'themes', 'useLayerIDs', 'layers', 'data', 'qgisProjectVersion', 'lastSaveDateTime', 'customProjectVariables')
List of cached properties
$canvasColor
protected
string
$canvasColor
= ''
$customProjectVariables
protected
array<string|int, mixed>
$customProjectVariables
= array()
list of custom project variables defined by user in project
$data
protected
array<string|int, mixed>
$data
= array()
QGIS project data
$lastSaveDateTime
Last saved date time in the QGIS file.
protected
string
$lastSaveDateTime
the last saved date contained in the QGS file
$layers
protected
array<string|int, array<string|int, mixed>>
$layers
= array()
list of layers. Each item is a list of layer properties
$optionTypes
protected
static mixed
$optionTypes
= array('Min' => 'f', 'Max' => 'f', 'Step' => 'i', 'Precision' => 'i', 'AllowMulti' => 'b', 'AllowNull' => 'b', 'UseCompleter' => 'b', 'DocumentViewer' => 'b', 'fieldEditable' => 'b', 'editable' => 'b', 'Editable' => 'b', 'notNull' => 'b', 'MapIdentification' => 'b', 'IsMultiline' => 'b', 'UseHtml' => 'b', 'field_iso_format' => 'b')
$path
protected
string
$path
QGIS project path
$qgisEmbeddedProjects
protected
array<string|int, mixed>
$qgisEmbeddedProjects
= array()
List of embedded projects
$qgisProjectVersion
Version of QGIS which wrote the project.
protected
int
$qgisProjectVersion
$relations
protected
array<string|int, mixed>
$relations
= array()
for each referenced layer, there is an item with referencingLayer, referencedField, referencingField keys. There is also a 'pivot' key
$relationsFields
protected
array<string|int, mixed>
$relationsFields
= array()
list of fields properties for each relation
$services
protected
lizmapServices
$services
$themes
protected
array<string|int, mixed>
$themes
= array()
list of themes
$useLayerIDs
protected
bool
$useLayerIDs
= false
$WMSInformation
protected
array<string|int, mixed>
$WMSInformation
contains WMS info
$xml
protected
SimpleXMLElement
$xml
QGIS project XML
Methods
__construct()
constructor.
public
__construct(string $file, lizmapServices $services, AppContextInterface $appContext[, mixed $data = false ]) : mixed
Parameters
- $file : string
-
the QGIS project path
- $services : lizmapServices
- $appContext : AppContextInterface
- $data : mixed = false
findLayersByKeyword()
public
findLayersByKeyword(string $key, Project $proj) : array<string|int, qgisMapLayer>|array<string|int, qgisVectorLayer>
Parameters
- $key : string
- $proj : Project
Return values
array<string|int, qgisMapLayer>|array<string|int, qgisVectorLayer>getAbstract()
Get the project abstract.
public
getAbstract() : string
Return values
string —the project abstract
getAllProj4()
public
getAllProj4() : mixed
getCacheData()
public
getCacheData() : mixed
getCanvasColor()
public
getCanvasColor() : mixed
getCustomProjectVariables()
public
getCustomProjectVariables() : mixed
getData()
public
getData(string $key) : null|mixed
Parameters
- $key : string
Return values
null|mixedgetEmbeddedQgisProject()
public
getEmbeddedQgisProject(string $layer) : null|QgisProject
Parameters
- $layer : string
Return values
null|QgisProjectgetKeywordList()
List of keywords.
public
getKeywordList() : array<string|int, mixed>
Return values
array<string|int, mixed>getLastSaveDateTime()
Last saved date time in the QGIS file.
public
getLastSaveDateTime() : string
Return values
string —the last saved date contained in the QGS file
getLayer()
public
getLayer(string $layerId, Project $proj) : null|qgisMapLayer|qgisVectorLayer
Parameters
- $layerId : string
- $proj : Project
Return values
null|qgisMapLayer|qgisVectorLayergetLayerByKeyword()
public
getLayerByKeyword(string $key, Project $proj) : null|qgisMapLayer|qgisVectorLayer
Parameters
- $key : string
- $proj : Project
Return values
null|qgisMapLayer|qgisVectorLayergetLayerDefinition()
public
getLayerDefinition(string $layerId) : null|MapLayerDef|VectorLayerDef
Parameters
- $layerId : string
Return values
null|MapLayerDef|VectorLayerDefgetLayerNameByIdFromConfig()
public
getLayerNameByIdFromConfig(string $layerId, object $layers) : null|string
Parameters
- $layerId : string
- $layers : object
Return values
null|stringgetPrintTemplates()
public
getPrintTemplates() : array<string|int, mixed>
Return values
array<string|int, mixed>getProj4()
public
getProj4(mixed $authId) : mixed
Parameters
- $authId : mixed
getQgisProjectVersion()
public
getQgisProjectVersion() : mixed
getRelationField()
public
getRelationField(mixed $relationId) : mixed
Parameters
- $relationId : mixed
getRelations()
public
getRelations() : mixed
getThemes()
public
getThemes() : mixed
getTitle()
Get the project title.
public
getTitle() : string
Return values
string —the project title
getWMSInformation()
public
getWMSInformation() : mixed
getWMSMaxHeight()
WMS Max Height.
public
getWMSMaxHeight() : int
Return values
intgetWMSMaxWidth()
WMS Max Width.
public
getWMSMaxWidth() : int
Return values
intgetXmlLayer()
public
getXmlLayer(mixed $layerId) : array<string|int, SimpleXMLElement>
Parameters
- $layerId : mixed
Tags
Return values
array<string|int, SimpleXMLElement>isUsingLayerIDs()
public
isUsingLayerIDs() : bool
Return values
boolreadAttributeLayers()
public
readAttributeLayers(object $attributeLayers) : mixed
Parameters
- $attributeLayers : object
readEditionForms()
public
readEditionForms(object $editionLayers, Project $proj) : mixed
Parameters
- $editionLayers : object
- $proj : Project
readEditionLayers()
public
readEditionLayers(object $editionLayers) : mixed
Parameters
- $editionLayers : object
readFormControls()
public
readFormControls(SimpleXMLElement $layerXml, string $layerId, Project $proj) : array<string|int, mixed>
Parameters
- $layerXml : SimpleXMLElement
- $layerId : string
- $proj : Project
Return values
array<string|int, mixed>readLayersLabeledFieldsConfig()
Read the layer QGIS form configuration for the layers used in attribute tables, form filter & dataviz, and get the configuration for the fields for which to display labels instead of codes.
public
readLayersLabeledFieldsConfig(array<string|int, mixed> $layerIds, Project $proj) : mixed
This concerns fields with ValueMap, ValueRelation & RelationReference config
Parameters
- $layerIds : array<string|int, mixed>
-
List of layer identifiers
- $proj : Project
readLayersOrder()
public
readLayersOrder(SimpleXMLElement $xml, mixed $layers) : array<string|int, int>
Parameters
- $xml : SimpleXMLElement
- $layers : mixed
Return values
array<string|int, int>readLocateByLayer()
public
readLocateByLayer(object $locateByLayer) : mixed
Parameters
- $locateByLayer : object
setPropertiesAfterRead()
public
setPropertiesAfterRead(ProjectConfig $cfg) : mixed
Parameters
- $cfg : ProjectConfig
xpathQuery()
Execute an xpath Query on the XML content and return the result.
public
xpathQuery(string $query) : array<string|int, mixed>
Parameters
- $query : string
-
The query to execute
Return values
array<string|int, mixed>convertTypeOptions()
protected
convertTypeOptions(mixed &$options) : mixed
Parameters
- $options : mixed
convertValueOptions()
protected
convertValueOptions(string $value, string $type) : bool|float|int|string
Parameters
- $value : string
-
the option value attribute content
- $type : string
-
the option type attribute content
Return values
bool|float|int|stringgetEditType()
protected
getEditType(SimpleXMLElement $layerXml) : array<string|int, QgisFormControlProperties>
Parameters
- $layerXml : SimpleXMLElement
Return values
array<string|int, QgisFormControlProperties>getFieldConfiguration()
protected
getFieldConfiguration(SimpleXMLElement $layerXml) : array<string|int, QgisFormControlProperties>
Parameters
- $layerXml : SimpleXMLElement
Return values
array<string|int, QgisFormControlProperties>getFieldConfigurationOptions()
protected
getFieldConfigurationOptions(SimpleXMLElement $options) : mixed
Parameters
- $options : SimpleXMLElement
getMarkup()
protected
getMarkup(int|string $fieldEditType, array<string|int, mixed> $editAttributes) : string
Parameters
- $fieldEditType : int|string
- $editAttributes : array<string|int, mixed>
-
attributes of widgetv2config
Return values
stringgetValuesFromOptions()
protected
getValuesFromOptions(SimpleXMLElement $optionList[, int $valuesExtraction = 0 ]) : array<string|int, mixed>
Parameters
- $optionList : SimpleXMLElement
- $valuesExtraction : int = 0
-
one of MAP_* const
Return values
array<string|int, mixed>getXml()
temporary function to read xml for some methods that relies on xml data that are not yet stored in the cache.
protected
getXml() : SimpleXMLElement
Return values
SimpleXMLElementgetXmlLayer2()
protected
getXmlLayer2(SimpleXMLElement $xml, string $layerId) : null|SimpleXMLElement
Parameters
- $xml : SimpleXMLElement
- $layerId : string
Return values
null|SimpleXMLElementreadAllProj4()
protected
readAllProj4(SimpleXMLElement $xml) : array<string|int, mixed>
Parameters
- $xml : SimpleXMLElement
Return values
array<string|int, mixed>readCanvasColor()
protected
readCanvasColor(SimpleXMLElement $xml) : string
Parameters
- $xml : SimpleXMLElement
Return values
stringreadCustomProjectVariables()
protected
readCustomProjectVariables(SimpleXMLElement $xml) : null|array<string, string>
Parameters
- $xml : SimpleXMLElement
Return values
null|array<string, string> —array of custom variable name => variable value
readLastSaveDateTime()
Read the last modified date of the QGS file.
protected
readLastSaveDateTime(string $qgs_path) : string
Parameters
- $qgs_path : string
-
the path to the QGS file
Return values
string —the last saved date contained in the QGS file
readLayers()
protected
readLayers(SimpleXMLElement $xml) : array<string|int, MapLayerDef|VectorLayerDef>
Parameters
- $xml : SimpleXMLElement
Tags
Return values
array<string|int, MapLayerDef|VectorLayerDef> —list of layers. Each item is a list of layer properties
readQgisProjectVersion()
protected
readQgisProjectVersion(SimpleXMLElement $xml) : mixed
Parameters
- $xml : SimpleXMLElement
readRelationField()
protected
readRelationField(SimpleXMLElement $relationXml) : mixed
Parameters
- $relationXml : SimpleXMLElement
readRelations()
protected
readRelations(SimpleXMLElement $xml) : null|array<string|int, array<string|int, mixed>>
Parameters
- $xml : SimpleXMLElement
Return values
null|array<string|int, array<string|int, mixed>> —list of two list: reference between relation, and fields of relations
readThemes()
protected
readThemes(SimpleXMLElement $xml) : null|array<string|int, array<string|int, mixed>>
Parameters
- $xml : SimpleXMLElement
Return values
null|array<string|int, array<string|int, mixed>>readUploadOptions()
protected
readUploadOptions(mixed $fieldEditType, mixed &$fieldEditOptions) : mixed
Parameters
- $fieldEditType : mixed
- $fieldEditOptions : mixed
readUseLayerIDs()
protected
readUseLayerIDs(SimpleXMLElement $xml) : bool
Parameters
- $xml : SimpleXMLElement
Return values
boolreadWebDavStorageOptions()
update the upload options with the property 'webDAVStorageUrl'.
protected
readWebDavStorageOptions(array<string|int, mixed> &$fieldEditOptions) : mixed
Parameters
- $fieldEditOptions : array<string|int, mixed>
readWMSInformation()
protected
readWMSInformation(mixed $qgsLoad) : mixed
Parameters
- $qgsLoad : mixed
readXmlProject()
Read the qgis files.
protected
readXmlProject(mixed $qgs_path) : mixed
Parameters
- $qgs_path : mixed
setLayerGroupData()
Set layers' group infos.
protected
setLayerGroupData(ProjectConfig $cfg) : mixed
Parameters
- $cfg : ProjectConfig
setLayerOpacity()
Set layers' opacity with XML data.
protected
setLayerOpacity(ProjectConfig $cfg) : mixed
Parameters
- $cfg : ProjectConfig
setLayerShowFeatureCount()
Set layers' last infos.
protected
setLayerShowFeatureCount(ProjectConfig $cfg) : mixed
Parameters
- $cfg : ProjectConfig
setShortNames()
Set layers' shortname with XML data.
protected
setShortNames(ProjectConfig $cfg) : mixed
Parameters
- $cfg : ProjectConfig
unsetPropAfterRead()
Set/Unset some properties after reading the config file.
protected
unsetPropAfterRead(ProjectConfig $cfg) : mixed
Parameters
- $cfg : ProjectConfig