Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d04e34ed2 | ||
|
|
ac070f866e | ||
|
|
4851339008 | ||
|
|
f2d11a64e4 | ||
|
|
4c52c85efb | ||
|
|
3ef37aa696 | ||
|
|
3b0758ea5c | ||
|
|
852301a537 | ||
|
|
b3451773be | ||
|
|
72a4a8a7b7 | ||
|
|
c809c12c9f | ||
|
|
bc538524fb | ||
|
|
23f21a4c39 | ||
|
|
2b00cf9106 | ||
|
|
ad49b80b5a | ||
|
|
dbe918cfcf | ||
|
|
f692414698 | ||
|
|
75ec1c0191 | ||
|
|
ca79b96958 | ||
|
|
ce85b09e11 | ||
|
|
8e84d39165 | ||
|
|
72e91a527a | ||
|
|
b3eeb2d60c | ||
|
|
ea6fb7c870 | ||
|
|
1aee5d90d7 | ||
|
|
901d1b9441 | ||
|
|
cd4d320614 | ||
|
|
c7ff62c717 | ||
|
|
49b78e58ac | ||
|
|
1a17bb7d7c | ||
|
|
e2e062ed12 | ||
|
|
a90a45a0b9 | ||
|
|
80a563357d | ||
|
|
be3a082f93 | ||
|
|
cbe6952c9a | ||
|
|
bbb41400e5 | ||
|
|
d92744fe6b | ||
|
|
a7d7ea83f4 | ||
|
|
622a54e7b9 | ||
|
|
55b0826248 | ||
|
|
3141ccb15c | ||
|
|
3301c1395d | ||
|
|
7c46818923 | ||
|
|
b05a047a87 | ||
|
|
65b24ff13d | ||
|
|
ec175643bc | ||
|
|
08dda9ebb0 | ||
|
|
1fbfb009cf | ||
|
|
1c6eaa82be | ||
|
|
50902b8664 | ||
|
|
3490c51112 | ||
|
|
f79642c826 | ||
|
|
f59fac229e | ||
|
|
a3cf4248cf | ||
|
|
94d4ff85ab | ||
|
|
947a6ddd18 | ||
|
|
cf4cfc4636 | ||
|
|
ea796cf346 | ||
|
|
a37e46cfc9 | ||
|
|
9129ad279b | ||
|
|
a02ab6376e | ||
|
|
69da8e8e82 | ||
|
|
161505e4a1 | ||
|
|
873a2a0ec7 | ||
|
|
df07e9ffdb | ||
|
|
36f1145d81 | ||
|
|
9519dee924 | ||
|
|
0e2e8a555d | ||
|
|
bff19fd919 | ||
|
|
ff71cdf577 | ||
|
|
a7c2f6c169 | ||
|
|
2377238e8c | ||
|
|
bd82fb6745 | ||
|
|
a08679f0fa | ||
|
|
66e0ddc496 | ||
|
|
99f059b649 | ||
|
|
87a1b82ee9 | ||
|
|
7c38bc1326 | ||
|
|
36e55f268c | ||
|
|
7dd203f520 | ||
|
|
7fceab83bb | ||
|
|
ef182560a6 | ||
|
|
1b7803a33f | ||
|
|
32a4f593a8 | ||
|
|
97c7702312 | ||
|
|
972e815f1e | ||
|
|
17d56dd4dc | ||
|
|
d25ce2b893 | ||
|
|
5570519e0d | ||
|
|
7a3f223024 | ||
|
|
5e71a891d0 | ||
|
|
0f6b4224c3 | ||
|
|
d2cc8e2802 | ||
|
|
c1b771cef6 | ||
|
|
1458982089 | ||
|
|
af7a63e728 | ||
|
|
89b5e326d1 | ||
|
|
94eaa2e272 | ||
|
|
e6d7917a35 | ||
|
|
da1309f415 | ||
|
|
e566ce6015 | ||
|
|
6169664ae4 | ||
|
|
654a8f579f |
@@ -1,2 +1,21 @@
|
|||||||
*.zip
|
#Ignores gitignore
|
||||||
*/*/PythonSQL.py
|
/.gitignore
|
||||||
|
|
||||||
|
#Ignores all folders
|
||||||
|
/*
|
||||||
|
!plugins.xml
|
||||||
|
|
||||||
|
#Skip Ignores
|
||||||
|
!CenRa_AUTOMAP/
|
||||||
|
!CenRa_COPIE/
|
||||||
|
!CenRa_FLUX/
|
||||||
|
!CenRa_METABASE/
|
||||||
|
!CenRa_POSTGIS/
|
||||||
|
!CenRa_SICEN/
|
||||||
|
!CenRa_PAGERENDER/
|
||||||
|
|
||||||
|
#ReIgnore
|
||||||
|
**/__pycache__
|
||||||
|
**/test/
|
||||||
|
PythonSQL.py
|
||||||
|
StyleLayer.py
|
||||||
@@ -1 +0,0 @@
|
|||||||
# CenIsere_AutoMap
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
__copyright__ = "Copyright 2021, 3Liz"
|
|
||||||
__license__ = "GPL version 3"
|
|
||||||
__email__ = "info@3liz.org"
|
|
||||||
|
|
||||||
|
|
||||||
# noinspection PyPep8Naming
|
|
||||||
def classFactory(iface): # pylint: disable=invalid-name
|
|
||||||
_ = iface
|
|
||||||
from CenIsere_AUTOMAP.CenIsere_AutoMap import PgAutoMap
|
|
||||||
return PgAutoMap()
|
|
||||||
|
Before Width: | Height: | Size: 46 KiB |
@@ -1,48 +0,0 @@
|
|||||||
# This file contains metadata for your plugin.
|
|
||||||
|
|
||||||
# This file should be included when you package your plugin.# Mandatory items:
|
|
||||||
|
|
||||||
[general]
|
|
||||||
name=CenIsere_AutoMap
|
|
||||||
qgisMinimumVersion=3.0
|
|
||||||
description=CenIsere_AutoMap
|
|
||||||
version=1.6
|
|
||||||
author=Conservatoire d'Espaces Naturels Isère
|
|
||||||
|
|
||||||
|
|
||||||
about=Outils de création de mise en page prédéfinis pour simplifier et organiser cette étape.
|
|
||||||
|
|
||||||
repository=https://gitea.cenra-outils.org/CEN38/Plugin_QGIS
|
|
||||||
#homepage=https://plateformesig.cenra-outils.org/
|
|
||||||
tracker=https://gitea.cenra-outils.org/api/v1/repos/CEN38/Plugin_QGIS/issues
|
|
||||||
# End of mandatory metadata
|
|
||||||
|
|
||||||
# Recommended items:
|
|
||||||
|
|
||||||
hasProcessingProvider=no
|
|
||||||
# Uncomment the following line and add your changelog:
|
|
||||||
changelog=<h2>CenIsere_AutoMap:</h2></br><p><h3>07/10/2024 - Version 1.6: </h3> - Option de bibliotheque de logo custome.</p></br><p><h3>03/10/2024 - Version 1.5: </h3> - Remonte la fênetre dans la pille.</br> - Gestion du nombre de colonne dans la légend.</br></p></br><p><h3>02/10/2024 - Version 1.4: </h3> - Mise en page plein écrant.</br></p></br><p><h3>01/10/2024 - Version 1.3: </h3> - Récupération du titre et sous-titre pour mise en page existente.</br> - Integration de bibliotheque de logo.</br> - Integration de gestionaire pour les source de donnée.</br> - Mise en place d'une bar d'echelle adaptative. </br></p></br><p><h3>30/09/2024 - Version 1.2: </h3> - Activation du thème. </br> - Ajouter une carte de suivie. </br><p></br><h3>27/09/2024 - Version 1.1: </h3> - Ajout d'une liste déroulante pour les sources de données. </br>- Bouton pour ajouter des fonts de carte customisés. </br>- Fonctionnalité de génération d'atlas. </p></br><p><h3>26/09/2024 - Version 1.0: </h3> - Lancement du plugin CenIsere_AutoMap avec une seul mise en page. </p></br>
|
|
||||||
|
|
||||||
# Tags are comma separated with spaces allowed
|
|
||||||
tags=python
|
|
||||||
|
|
||||||
|
|
||||||
category=Plugins
|
|
||||||
icon=icon.png
|
|
||||||
# experimental flag
|
|
||||||
experimental=False
|
|
||||||
|
|
||||||
# deprecated flag (applies to the whole plugin, not just a single version)
|
|
||||||
deprecated=False
|
|
||||||
|
|
||||||
# Since QGIS 3.8, a comma separated list of plugins to be installed
|
|
||||||
# (or upgraded) can be specified.
|
|
||||||
# Check the documentation for more information.
|
|
||||||
# plugin_dependencies=
|
|
||||||
|
|
||||||
Category of the plugin: Raster, Vector, Database or Web
|
|
||||||
# category=CenIsere,mise en page,atlas
|
|
||||||
|
|
||||||
# If the plugin can run on QGIS Server.
|
|
||||||
server=False
|
|
||||||
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
import sys
|
|
||||||
import socket
|
|
||||||
import os
|
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
|
||||||
#print(IPAddr)
|
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
|
||||||
host = "100.100.100.81"
|
|
||||||
port = "5432"
|
|
||||||
dbname = "sig4269"
|
|
||||||
sigdb="sig4269"
|
|
||||||
refdb="ref_geo4269"
|
|
||||||
password = "xxxxx"
|
|
||||||
if IPAddr[0:9] == "192.168.0": #01
|
|
||||||
host = "192.168.0.201"
|
|
||||||
port = "5432"
|
|
||||||
dbname = "sig01"
|
|
||||||
sigdb="sig01"
|
|
||||||
refdb="ref_geo01"
|
|
||||||
password = "xxxxx"
|
|
||||||
if IPAddr[0:9] == "192.168.1": #0726
|
|
||||||
host = "192.168.1.201"
|
|
||||||
port = "5432"
|
|
||||||
dbname = "sig0726"
|
|
||||||
sigdb="sig0726"
|
|
||||||
refdb="ref_geo0726"
|
|
||||||
password = "xxxxx"
|
|
||||||
if sys.platform == 'linux':
|
|
||||||
os_user = os.environ['USER']
|
|
||||||
else:
|
|
||||||
os_user = os.environ['USERNAME']
|
|
||||||
if os_user == 'STAGE':
|
|
||||||
os_user='stage'
|
|
||||||
if os_user == 'Administrateur':
|
|
||||||
os_user='stage'
|
|
||||||
|
Before Width: | Height: | Size: 154 KiB |
|
Before Width: | Height: | Size: 163 KiB |
|
Before Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 206 KiB |
|
Before Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 56 KiB |
@@ -1,120 +0,0 @@
|
|||||||
<Layout worldFileMap="" name="test.qpt" printResolution="300" units="mm">
|
|
||||||
<Snapper snapToGrid="0" snapToItems="1" tolerance="5" snapToGuides="1"/>
|
|
||||||
<Grid resolution="10" offsetUnits="mm" offsetX="0" resUnits="mm" offsetY="0"/>
|
|
||||||
<PageCollection>
|
|
||||||
<symbol name="" clip_to_extent="1" type="fill" force_rhr="0" alpha="1">
|
|
||||||
<data_defined_properties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="name" value="" type="QString"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option name="type" value="collection" type="QString"/>
|
|
||||||
</Option>
|
|
||||||
</data_defined_properties>
|
|
||||||
<layer class="SimpleFill" locked="0" enabled="1" pass="0">
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="border_width_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
|
|
||||||
<Option name="color" value="255,255,255,255" type="QString"/>
|
|
||||||
<Option name="joinstyle" value="miter" type="QString"/>
|
|
||||||
<Option name="offset" value="0,0" type="QString"/>
|
|
||||||
<Option name="offset_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
|
|
||||||
<Option name="offset_unit" value="MM" type="QString"/>
|
|
||||||
<Option name="outline_color" value="35,35,35,255" type="QString"/>
|
|
||||||
<Option name="outline_style" value="no" type="QString"/>
|
|
||||||
<Option name="outline_width" value="0.26" type="QString"/>
|
|
||||||
<Option name="outline_width_unit" value="MM" type="QString"/>
|
|
||||||
<Option name="style" value="solid" type="QString"/>
|
|
||||||
</Option>
|
|
||||||
<prop k="border_width_map_unit_scale" v="3x:0,0,0,0,0,0"/>
|
|
||||||
<prop k="color" v="255,255,255,255"/>
|
|
||||||
<prop k="joinstyle" v="miter"/>
|
|
||||||
<prop k="offset" v="0,0"/>
|
|
||||||
<prop k="offset_map_unit_scale" v="3x:0,0,0,0,0,0"/>
|
|
||||||
<prop k="offset_unit" v="MM"/>
|
|
||||||
<prop k="outline_color" v="35,35,35,255"/>
|
|
||||||
<prop k="outline_style" v="no"/>
|
|
||||||
<prop k="outline_width" v="0.26"/>
|
|
||||||
<prop k="outline_width_unit" v="MM"/>
|
|
||||||
<prop k="style" v="solid"/>
|
|
||||||
<data_defined_properties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="name" value="" type="QString"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option name="type" value="collection" type="QString"/>
|
|
||||||
</Option>
|
|
||||||
</data_defined_properties>
|
|
||||||
</layer>
|
|
||||||
</symbol>
|
|
||||||
<LayoutItem zValue="0" id="" itemRotation="0" position="0,0,mm" frame="false" templateUuid="{5c80221d-7561-455b-94fd-69a27d877679}" referencePoint="0" opacity="1" frameJoinStyle="miter" uuid="{5c80221d-7561-455b-94fd-69a27d877679}" blendMode="0" size="297,210,mm" groupUuid="" outlineWidthM="0.3,mm" positionOnPage="0,0,mm" type="65638" excludeFromExports="0" positionLock="false" background="true" visibility="1">
|
|
||||||
<FrameColor green="0" blue="0" red="0" alpha="255"/>
|
|
||||||
<BackgroundColor green="255" blue="255" red="255" alpha="255"/>
|
|
||||||
<LayoutObject>
|
|
||||||
<dataDefinedProperties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="name" value="" type="QString"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option name="type" value="collection" type="QString"/>
|
|
||||||
</Option>
|
|
||||||
</dataDefinedProperties>
|
|
||||||
<customproperties>
|
|
||||||
<Option/>
|
|
||||||
</customproperties>
|
|
||||||
</LayoutObject>
|
|
||||||
<symbol name="" clip_to_extent="1" type="fill" force_rhr="0" alpha="1">
|
|
||||||
<data_defined_properties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="name" value="" type="QString"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option name="type" value="collection" type="QString"/>
|
|
||||||
</Option>
|
|
||||||
</data_defined_properties>
|
|
||||||
<layer class="SimpleFill" locked="0" enabled="1" pass="0">
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="border_width_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
|
|
||||||
<Option name="color" value="255,255,255,255" type="QString"/>
|
|
||||||
<Option name="joinstyle" value="miter" type="QString"/>
|
|
||||||
<Option name="offset" value="0,0" type="QString"/>
|
|
||||||
<Option name="offset_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
|
|
||||||
<Option name="offset_unit" value="MM" type="QString"/>
|
|
||||||
<Option name="outline_color" value="35,35,35,255" type="QString"/>
|
|
||||||
<Option name="outline_style" value="no" type="QString"/>
|
|
||||||
<Option name="outline_width" value="0.26" type="QString"/>
|
|
||||||
<Option name="outline_width_unit" value="MM" type="QString"/>
|
|
||||||
<Option name="style" value="solid" type="QString"/>
|
|
||||||
</Option>
|
|
||||||
<prop k="border_width_map_unit_scale" v="3x:0,0,0,0,0,0"/>
|
|
||||||
<prop k="color" v="255,255,255,255"/>
|
|
||||||
<prop k="joinstyle" v="miter"/>
|
|
||||||
<prop k="offset" v="0,0"/>
|
|
||||||
<prop k="offset_map_unit_scale" v="3x:0,0,0,0,0,0"/>
|
|
||||||
<prop k="offset_unit" v="MM"/>
|
|
||||||
<prop k="outline_color" v="35,35,35,255"/>
|
|
||||||
<prop k="outline_style" v="no"/>
|
|
||||||
<prop k="outline_width" v="0.26"/>
|
|
||||||
<prop k="outline_width_unit" v="MM"/>
|
|
||||||
<prop k="style" v="solid"/>
|
|
||||||
<data_defined_properties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="name" value="" type="QString"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option name="type" value="collection" type="QString"/>
|
|
||||||
</Option>
|
|
||||||
</data_defined_properties>
|
|
||||||
</layer>
|
|
||||||
</symbol>
|
|
||||||
</LayoutItem>
|
|
||||||
<GuideCollection visible="1"/>
|
|
||||||
</PageCollection>
|
|
||||||
<customproperties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="atlasRasterFormat" value="png" type="QString"/>
|
|
||||||
<Option name="imageAntialias" value="true" type="bool"/>
|
|
||||||
<Option name="imageCropMarginBottom" value="0" type="int"/>
|
|
||||||
<Option name="imageCropMarginLeft" value="0" type="int"/>
|
|
||||||
<Option name="imageCropMarginRight" value="0" type="int"/>
|
|
||||||
<Option name="imageCropMarginTop" value="0" type="int"/>
|
|
||||||
<Option name="imageCropToContents" value="false" type="bool"/>
|
|
||||||
<Option name="singleFile" value="true" type="bool"/>
|
|
||||||
</Option>
|
|
||||||
</customproperties>
|
|
||||||
<Atlas coverageLayer="" pageNameExpression="" filterFeatures="0" filenamePattern="'output_'||@atlas_featurenumber" enabled="0" hideCoverage="0" sortFeatures="0"/>
|
|
||||||
</Layout>
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
<Layout worldFileMap="" name="test.qpt" printResolution="300" units="mm">
|
|
||||||
<Snapper snapToGrid="0" snapToItems="1" tolerance="5" snapToGuides="1"/>
|
|
||||||
<Grid resolution="10" offsetUnits="mm" offsetX="0" resUnits="mm" offsetY="0"/>
|
|
||||||
<PageCollection>
|
|
||||||
<symbol name="" clip_to_extent="1" type="fill" force_rhr="0" alpha="1">
|
|
||||||
<data_defined_properties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="name" value="" type="QString"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option name="type" value="collection" type="QString"/>
|
|
||||||
</Option>
|
|
||||||
</data_defined_properties>
|
|
||||||
<layer class="SimpleFill" locked="0" enabled="1" pass="0">
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="border_width_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
|
|
||||||
<Option name="color" value="255,255,255,255" type="QString"/>
|
|
||||||
<Option name="joinstyle" value="miter" type="QString"/>
|
|
||||||
<Option name="offset" value="0,0" type="QString"/>
|
|
||||||
<Option name="offset_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
|
|
||||||
<Option name="offset_unit" value="MM" type="QString"/>
|
|
||||||
<Option name="outline_color" value="35,35,35,255" type="QString"/>
|
|
||||||
<Option name="outline_style" value="no" type="QString"/>
|
|
||||||
<Option name="outline_width" value="0.26" type="QString"/>
|
|
||||||
<Option name="outline_width_unit" value="MM" type="QString"/>
|
|
||||||
<Option name="style" value="solid" type="QString"/>
|
|
||||||
</Option>
|
|
||||||
<prop k="border_width_map_unit_scale" v="3x:0,0,0,0,0,0"/>
|
|
||||||
<prop k="color" v="255,255,255,255"/>
|
|
||||||
<prop k="joinstyle" v="miter"/>
|
|
||||||
<prop k="offset" v="0,0"/>
|
|
||||||
<prop k="offset_map_unit_scale" v="3x:0,0,0,0,0,0"/>
|
|
||||||
<prop k="offset_unit" v="MM"/>
|
|
||||||
<prop k="outline_color" v="35,35,35,255"/>
|
|
||||||
<prop k="outline_style" v="no"/>
|
|
||||||
<prop k="outline_width" v="0.26"/>
|
|
||||||
<prop k="outline_width_unit" v="MM"/>
|
|
||||||
<prop k="style" v="solid"/>
|
|
||||||
<data_defined_properties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="name" value="" type="QString"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option name="type" value="collection" type="QString"/>
|
|
||||||
</Option>
|
|
||||||
</data_defined_properties>
|
|
||||||
</layer>
|
|
||||||
</symbol>
|
|
||||||
<LayoutItem zValue="0" id="" itemRotation="0" position="0,0,mm" frame="false" templateUuid="{5c80221d-7561-455b-94fd-69a27d877679}" referencePoint="0" opacity="1" frameJoinStyle="miter" uuid="{5c80221d-7561-455b-94fd-69a27d877679}" blendMode="0" size="297,210,mm" groupUuid="" outlineWidthM="0.3,mm" positionOnPage="0,0,mm" type="65638" excludeFromExports="0" positionLock="false" background="true" visibility="1">
|
|
||||||
<FrameColor green="0" blue="0" red="0" alpha="255"/>
|
|
||||||
<BackgroundColor green="255" blue="255" red="255" alpha="255"/>
|
|
||||||
<LayoutObject>
|
|
||||||
<dataDefinedProperties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="name" value="" type="QString"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option name="type" value="collection" type="QString"/>
|
|
||||||
</Option>
|
|
||||||
</dataDefinedProperties>
|
|
||||||
<customproperties>
|
|
||||||
<Option/>
|
|
||||||
</customproperties>
|
|
||||||
</LayoutObject>
|
|
||||||
<symbol name="" clip_to_extent="1" type="fill" force_rhr="0" alpha="1">
|
|
||||||
<data_defined_properties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="name" value="" type="QString"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option name="type" value="collection" type="QString"/>
|
|
||||||
</Option>
|
|
||||||
</data_defined_properties>
|
|
||||||
<layer class="SimpleFill" locked="0" enabled="1" pass="0">
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="border_width_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
|
|
||||||
<Option name="color" value="255,255,255,255" type="QString"/>
|
|
||||||
<Option name="joinstyle" value="miter" type="QString"/>
|
|
||||||
<Option name="offset" value="0,0" type="QString"/>
|
|
||||||
<Option name="offset_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
|
|
||||||
<Option name="offset_unit" value="MM" type="QString"/>
|
|
||||||
<Option name="outline_color" value="35,35,35,255" type="QString"/>
|
|
||||||
<Option name="outline_style" value="no" type="QString"/>
|
|
||||||
<Option name="outline_width" value="0.26" type="QString"/>
|
|
||||||
<Option name="outline_width_unit" value="MM" type="QString"/>
|
|
||||||
<Option name="style" value="solid" type="QString"/>
|
|
||||||
</Option>
|
|
||||||
<prop k="border_width_map_unit_scale" v="3x:0,0,0,0,0,0"/>
|
|
||||||
<prop k="color" v="255,255,255,255"/>
|
|
||||||
<prop k="joinstyle" v="miter"/>
|
|
||||||
<prop k="offset" v="0,0"/>
|
|
||||||
<prop k="offset_map_unit_scale" v="3x:0,0,0,0,0,0"/>
|
|
||||||
<prop k="offset_unit" v="MM"/>
|
|
||||||
<prop k="outline_color" v="35,35,35,255"/>
|
|
||||||
<prop k="outline_style" v="no"/>
|
|
||||||
<prop k="outline_width" v="0.26"/>
|
|
||||||
<prop k="outline_width_unit" v="MM"/>
|
|
||||||
<prop k="style" v="solid"/>
|
|
||||||
<data_defined_properties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="name" value="" type="QString"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option name="type" value="collection" type="QString"/>
|
|
||||||
</Option>
|
|
||||||
</data_defined_properties>
|
|
||||||
</layer>
|
|
||||||
</symbol>
|
|
||||||
</LayoutItem>
|
|
||||||
<GuideCollection visible="1"/>
|
|
||||||
</PageCollection>
|
|
||||||
<customproperties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option name="atlasRasterFormat" value="png" type="QString"/>
|
|
||||||
<Option name="imageAntialias" value="true" type="bool"/>
|
|
||||||
<Option name="imageCropMarginBottom" value="0" type="int"/>
|
|
||||||
<Option name="imageCropMarginLeft" value="0" type="int"/>
|
|
||||||
<Option name="imageCropMarginRight" value="0" type="int"/>
|
|
||||||
<Option name="imageCropMarginTop" value="0" type="int"/>
|
|
||||||
<Option name="imageCropToContents" value="false" type="bool"/>
|
|
||||||
<Option name="singleFile" value="true" type="bool"/>
|
|
||||||
</Option>
|
|
||||||
</customproperties>
|
|
||||||
<Atlas coverageLayer="" pageNameExpression="" filterFeatures="0" filenamePattern="'output_'||@atlas_featurenumber" enabled="0" hideCoverage="0" sortFeatures="0"/>
|
|
||||||
</Layout>
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
<Layout units="mm" worldFileMap="" printResolution="300" name="3. Modèle_carto_standard_cenIsere">
|
|
||||||
<Snapper snapToGuides="1" tolerance="5" snapToItems="1" snapToGrid="0"/>
|
|
||||||
<Grid offsetUnits="mm" resUnits="mm" resolution="10" offsetX="0" offsetY="0"/>
|
|
||||||
<PageCollection>
|
|
||||||
<symbol clip_to_extent="1" force_rhr="0" type="fill" name="" alpha="1">
|
|
||||||
<data_defined_properties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option value="" type="QString" name="name"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option value="collection" type="QString" name="type"/>
|
|
||||||
</Option>
|
|
||||||
</data_defined_properties>
|
|
||||||
<layer locked="0" pass="0" enabled="1" class="SimpleFill">
|
|
||||||
<Option type="Map">
|
|
||||||
<Option value="3x:0,0,0,0,0,0" type="QString" name="border_width_map_unit_scale"/>
|
|
||||||
<Option value="255,255,255,255" type="QString" name="color"/>
|
|
||||||
<Option value="miter" type="QString" name="joinstyle"/>
|
|
||||||
<Option value="0,0" type="QString" name="offset"/>
|
|
||||||
<Option value="3x:0,0,0,0,0,0" type="QString" name="offset_map_unit_scale"/>
|
|
||||||
<Option value="MM" type="QString" name="offset_unit"/>
|
|
||||||
<Option value="35,35,35,255" type="QString" name="outline_color"/>
|
|
||||||
<Option value="no" type="QString" name="outline_style"/>
|
|
||||||
<Option value="0.26" type="QString" name="outline_width"/>
|
|
||||||
<Option value="MM" type="QString" name="outline_width_unit"/>
|
|
||||||
<Option value="solid" type="QString" name="style"/>
|
|
||||||
</Option>
|
|
||||||
<prop v="3x:0,0,0,0,0,0" k="border_width_map_unit_scale"/>
|
|
||||||
<prop v="255,255,255,255" k="color"/>
|
|
||||||
<prop v="miter" k="joinstyle"/>
|
|
||||||
<prop v="0,0" k="offset"/>
|
|
||||||
<prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/>
|
|
||||||
<prop v="MM" k="offset_unit"/>
|
|
||||||
<prop v="35,35,35,255" k="outline_color"/>
|
|
||||||
<prop v="no" k="outline_style"/>
|
|
||||||
<prop v="0.26" k="outline_width"/>
|
|
||||||
<prop v="MM" k="outline_width_unit"/>
|
|
||||||
<prop v="solid" k="style"/>
|
|
||||||
<data_defined_properties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option value="" type="QString" name="name"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option value="collection" type="QString" name="type"/>
|
|
||||||
</Option>
|
|
||||||
</data_defined_properties>
|
|
||||||
</layer>
|
|
||||||
</symbol>
|
|
||||||
<LayoutItem type="65638" zValue="0" blendMode="0" referencePoint="0" frameJoinStyle="miter" outlineWidthM="0.3,mm" frame="false" groupUuid="" itemRotation="0" excludeFromExports="0" background="true" opacity="1" visibility="1" size="297,210,mm" positionOnPage="0,0,mm" id="" templateUuid="{2b090846-ab96-44d2-b168-90e1bcb35427}" uuid="{2b090846-ab96-44d2-b168-90e1bcb35427}" position="0,0,mm" positionLock="false">
|
|
||||||
<FrameColor red="0" blue="0" green="0" alpha="255"/>
|
|
||||||
<BackgroundColor red="255" blue="255" green="255" alpha="255"/>
|
|
||||||
<LayoutObject>
|
|
||||||
<dataDefinedProperties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option value="" type="QString" name="name"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option value="collection" type="QString" name="type"/>
|
|
||||||
</Option>
|
|
||||||
</dataDefinedProperties>
|
|
||||||
<customproperties>
|
|
||||||
<Option/>
|
|
||||||
</customproperties>
|
|
||||||
</LayoutObject>
|
|
||||||
<symbol clip_to_extent="1" force_rhr="0" type="fill" name="" alpha="1">
|
|
||||||
<data_defined_properties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option value="" type="QString" name="name"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option value="collection" type="QString" name="type"/>
|
|
||||||
</Option>
|
|
||||||
</data_defined_properties>
|
|
||||||
<layer locked="0" pass="0" enabled="1" class="SimpleFill">
|
|
||||||
<Option type="Map">
|
|
||||||
<Option value="3x:0,0,0,0,0,0" type="QString" name="border_width_map_unit_scale"/>
|
|
||||||
<Option value="255,255,255,255" type="QString" name="color"/>
|
|
||||||
<Option value="miter" type="QString" name="joinstyle"/>
|
|
||||||
<Option value="0,0" type="QString" name="offset"/>
|
|
||||||
<Option value="3x:0,0,0,0,0,0" type="QString" name="offset_map_unit_scale"/>
|
|
||||||
<Option value="MM" type="QString" name="offset_unit"/>
|
|
||||||
<Option value="35,35,35,255" type="QString" name="outline_color"/>
|
|
||||||
<Option value="no" type="QString" name="outline_style"/>
|
|
||||||
<Option value="0.26" type="QString" name="outline_width"/>
|
|
||||||
<Option value="MM" type="QString" name="outline_width_unit"/>
|
|
||||||
<Option value="solid" type="QString" name="style"/>
|
|
||||||
</Option>
|
|
||||||
<prop v="3x:0,0,0,0,0,0" k="border_width_map_unit_scale"/>
|
|
||||||
<prop v="255,255,255,255" k="color"/>
|
|
||||||
<prop v="miter" k="joinstyle"/>
|
|
||||||
<prop v="0,0" k="offset"/>
|
|
||||||
<prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/>
|
|
||||||
<prop v="MM" k="offset_unit"/>
|
|
||||||
<prop v="35,35,35,255" k="outline_color"/>
|
|
||||||
<prop v="no" k="outline_style"/>
|
|
||||||
<prop v="0.26" k="outline_width"/>
|
|
||||||
<prop v="MM" k="outline_width_unit"/>
|
|
||||||
<prop v="solid" k="style"/>
|
|
||||||
<data_defined_properties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option value="" type="QString" name="name"/>
|
|
||||||
<Option name="properties"/>
|
|
||||||
<Option value="collection" type="QString" name="type"/>
|
|
||||||
</Option>
|
|
||||||
</data_defined_properties>
|
|
||||||
</layer>
|
|
||||||
</symbol>
|
|
||||||
</LayoutItem>
|
|
||||||
<GuideCollection visible="1"/>
|
|
||||||
</PageCollection>
|
|
||||||
<customproperties>
|
|
||||||
<Option type="Map">
|
|
||||||
<Option value="png" type="QString" name="atlasRasterFormat"/>
|
|
||||||
<Option value="true" type="bool" name="singleFile"/>
|
|
||||||
</Option>
|
|
||||||
</customproperties>
|
|
||||||
<Atlas filterFeatures="0" pageNameExpression="" filenamePattern="'output_'||@atlas_featurenumber" hideCoverage="0" enabled="0" sortFeatures="0" coverageLayer=""/>
|
|
||||||
</Layout>
|
|
||||||
@@ -1,492 +0,0 @@
|
|||||||
from qgis.core import (
|
|
||||||
QgsLayoutSize,
|
|
||||||
QgsUnitTypes,
|
|
||||||
QgsLayoutPoint,
|
|
||||||
)
|
|
||||||
|
|
||||||
def fletch_canvas(self,values_page):
|
|
||||||
### Modèle carto standard ###
|
|
||||||
if values_page == '1. Modèle carto standard.qpt':
|
|
||||||
if self.radioButton_6.isChecked() and self.radioButton_7.isChecked():
|
|
||||||
|
|
||||||
self.template_parameters['position_map_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['position_map_position'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['map_size'] = QgsLayoutSize(199, 175+47, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['map_position'] = QgsLayoutPoint(5, 25, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['title_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['subtitle_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 12, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 205+47, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(145, 228+47, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebar_position'] = QgsLayoutPoint(145, 215+47, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['north_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['north_position'] = QgsLayoutPoint(193, 214+47, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text_position'] = QgsLayoutPoint(200, 75, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(104, 201+47, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if self.radioButton_6.isChecked() and self.radioButton_8.isChecked():
|
|
||||||
|
|
||||||
self.template_parameters['position_map_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['position_map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['map_size'] = QgsLayoutSize(285, 145, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 185, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 168, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(207, 193, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebar_position'] = QgsLayoutPoint(207, 180, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['north_position'] = QgsLayoutPoint(273, 182, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text_position'] = QgsLayoutPoint(287, 123, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(189, 168.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if self.radioButton_5.isChecked() and self.radioButton_7.isChecked():
|
|
||||||
|
|
||||||
self.template_parameters['map_size'] = QgsLayoutSize(285, 260, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 395, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 284, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(207, 310, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebar_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebar_position'] = QgsLayoutPoint(207, 298, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['north_position'] = QgsLayoutPoint(273, 297, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text_position'] = QgsLayoutPoint(287, 123, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(189, 284, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if self.radioButton_5.isChecked() and self.radioButton_8.isChecked():
|
|
||||||
|
|
||||||
self.template_parameters['map_size'] = QgsLayoutSize(408.5, 222, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['map_position'] = QgsLayoutPoint(5, 23.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['title_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['subtitle_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 249, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(323, 282, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebar_position'] = QgsLayoutPoint(323, 270, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['north_position'] = QgsLayoutPoint(402, 270, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text_position'] = QgsLayoutPoint(415, 123, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(313, 247, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
### Modèle carto plein page ###
|
|
||||||
if values_page == '2. Modèle carto plein page.qpt':
|
|
||||||
if self.radioButton_6.isChecked() and self.radioButton_7.isChecked():
|
|
||||||
|
|
||||||
self.template_parameters['position_map_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['position_map_position'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['map_size'] = QgsLayoutSize(210, 297, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['map_position'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['title_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['subtitle_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['legend_position'] = QgsLayoutPoint(133, 215, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(3, 288, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebar_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebar_position'] = QgsLayoutPoint(3, 273, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['north_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['north_position'] = QgsLayoutPoint(196, 283, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text_position'] = QgsLayoutPoint(200, 75, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(55, 292, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
if self.radioButton_6.isChecked() and self.radioButton_8.isChecked():
|
|
||||||
|
|
||||||
self.template_parameters['position_map_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['position_map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['map_size'] = QgsLayoutSize(297, 210, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['map_position'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 185, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['legend_position'] = QgsLayoutPoint(231, 135, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(3, 201, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebar_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebar_position'] = QgsLayoutPoint(3, 186, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['north_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['north_position'] = QgsLayoutPoint(283, 196, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text_position'] = QgsLayoutPoint(287, 123, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(98, 205, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
if self.radioButton_5.isChecked() and self.radioButton_7.isChecked():
|
|
||||||
|
|
||||||
self.template_parameters['position_map_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['position_map_position'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['map_size'] = QgsLayoutSize(297, 420, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['map_position'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 370, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['legend_position'] = QgsLayoutPoint(219, 324, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(3, 410, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebar_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebar_position'] = QgsLayoutPoint(3, 395, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['north_size'] = QgsLayoutSize(24, 24, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['north_position'] = QgsLayoutPoint(271, 394, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text_position'] = QgsLayoutPoint(287125, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(98, 414, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
if self.radioButton_5.isChecked() and self.radioButton_8.isChecked():
|
|
||||||
|
|
||||||
self.template_parameters['position_map_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['position_map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['map_size'] = QgsLayoutSize(420, 297, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['map_position'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['title_size'] = QgsLayoutSize(411, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['subtitle_size'] = QgsLayoutSize(411, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 247, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['legend_position'] = QgsLayoutPoint(341, 196, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(3, 287, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebar_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebar_position'] = QgsLayoutPoint(3, 272, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['north_size'] = QgsLayoutSize(24, 24, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['north_position'] = QgsLayoutPoint(394, 271, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text_position'] = QgsLayoutPoint(414, 123, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(185, 292, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
### Modèle carto standard CEN ISERE###
|
|
||||||
if values_page == '3. Modèle carto standard Cen Isere.qpt':
|
|
||||||
if self.radioButton_6.isChecked() and self.radioButton_7.isChecked():
|
|
||||||
|
|
||||||
self.template_parameters['position_map_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['position_map_position'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['map_size'] = QgsLayoutSize(199, 175+47, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['map_position'] = QgsLayoutPoint(5, 25, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['title_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['subtitle_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 12, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 205+47, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(145, 228+47, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebar_position'] = QgsLayoutPoint(145, 215+47, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['north_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['north_position'] = QgsLayoutPoint(193, 214+47, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text_position'] = QgsLayoutPoint(200, 79, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(104, 201+47, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['image_size'] = QgsLayoutSize(199, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['image_position'] = QgsLayoutPoint(5, 18, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['image_size_2'] = QgsLayoutSize(200, 12, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['image_position_2'] = QgsLayoutPoint(4.5, 194.9+47, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
if self.radioButton_6.isChecked() and self.radioButton_8.isChecked():
|
|
||||||
|
|
||||||
self.template_parameters['position_map_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['position_map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['map_size'] = QgsLayoutSize(285, 145, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 185, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 168, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(207, 193, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebar_position'] = QgsLayoutPoint(207, 180, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['north_position'] = QgsLayoutPoint(273, 182, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text_position'] = QgsLayoutPoint(287, 123, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(189, 168.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['image_size'] = QgsLayoutSize(285, 23, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['image_position'] = QgsLayoutPoint(6, 13, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['image_size_2'] = QgsLayoutSize(286, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['image_position_2'] = QgsLayoutPoint(5.5, 162.2, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
|
|
||||||
if self.radioButton_5.isChecked() and self.radioButton_7.isChecked():
|
|
||||||
|
|
||||||
self.template_parameters['map_size'] = QgsLayoutSize(285, 260, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 395, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 284, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(207, 310, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebar_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebar_position'] = QgsLayoutPoint(207, 298, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['north_position'] = QgsLayoutPoint(273, 297, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text_position'] = QgsLayoutPoint(287, 123, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(189, 284, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['image_size'] = QgsLayoutSize(285, 30, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['image_position'] = QgsLayoutPoint(6, 13, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['image_size_2'] = QgsLayoutSize(286, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['image_position_2'] = QgsLayoutPoint(5.5, 278.2, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if self.radioButton_5.isChecked() and self.radioButton_8.isChecked():
|
|
||||||
|
|
||||||
self.template_parameters['map_size'] = QgsLayoutSize(408.5, 222, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['map_position'] = QgsLayoutPoint(5, 23.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['title_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['subtitle_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 249, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(323, 282, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['scalebar_position'] = QgsLayoutPoint(323, 270, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['north_position'] = QgsLayoutPoint(402, 270, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text_position'] = QgsLayoutPoint(415, 123, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(313, 247, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['image_size'] = QgsLayoutSize(408.5, 38, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['image_position'] = QgsLayoutPoint(5, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
self.template_parameters['image_size_2'] = QgsLayoutSize(409.3, 22, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['image_position_2'] = QgsLayoutPoint(4.6, 237.15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
|
|
||||||
# Retour des info #
|
|
||||||
return self.template_parameters
|
|
||||||
@@ -1,168 +0,0 @@
|
|||||||
from qgis.core import (
|
|
||||||
QgsLayoutSize,
|
|
||||||
QgsUnitTypes,
|
|
||||||
QgsLayoutPoint,
|
|
||||||
)
|
|
||||||
def fletch_canvas(self):
|
|
||||||
if self.radioButton_6.isChecked():
|
|
||||||
values_page = 'A4'
|
|
||||||
else:
|
|
||||||
values_page = 'A3'
|
|
||||||
if self.radioButton_7.isChecked():
|
|
||||||
page_rotate = 'Portrait'
|
|
||||||
else:
|
|
||||||
page_rotate = 'Landscape'
|
|
||||||
|
|
||||||
if page_rotate == 'Portrait':
|
|
||||||
if values_page == 'A4':
|
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(199, 175, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(5, 25, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 12, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(5, 205, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(55, 5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(145, 228, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(145, 215, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(193, 214, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(205, 125, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(104, 201, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_rotate'] = 0
|
|
||||||
self.template_parameters['Carte_2_rotate'] = 0
|
|
||||||
self.template_parameters['Legande_rotate'] = 0
|
|
||||||
self.template_parameters['Arrow_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_rotate'] = 0
|
|
||||||
self.template_parameters['Titre_rotate'] = 0
|
|
||||||
self.template_parameters['Credit_rotate'] = 270
|
|
||||||
self.template_parameters['Source_rotate'] = 0
|
|
||||||
self.template_parameters['Sous_titre_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_2_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
|
||||||
if values_page == 'A3':
|
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(285, 260, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 395, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(5, 284, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(207, 310, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(207, 298, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(273, 297, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(291.5, 123, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(189, 284, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_rotate'] = 0
|
|
||||||
self.template_parameters['Carte_2_rotate'] = 0
|
|
||||||
self.template_parameters['Legande_rotate'] = 0
|
|
||||||
self.template_parameters['Arrow_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_rotate'] = 0
|
|
||||||
self.template_parameters['Titre_rotate'] = 0
|
|
||||||
self.template_parameters['Credit_rotate'] = 270
|
|
||||||
self.template_parameters['Source_rotate'] = 0
|
|
||||||
self.template_parameters['Sous_titre_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_2_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
|
||||||
|
|
||||||
if page_rotate == 'Landscape':
|
|
||||||
if values_page == 'A4':
|
|
||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(285, 145, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 185, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(5, 168, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(207, 193, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(207, 180, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(273, 182, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(291.5, 123, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(189, 168.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_rotate'] = 0
|
|
||||||
self.template_parameters['Carte_2_rotate'] = 0
|
|
||||||
self.template_parameters['Legande_rotate'] = 0
|
|
||||||
self.template_parameters['Arrow_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_rotate'] = 0
|
|
||||||
self.template_parameters['Titre_rotate'] = 0
|
|
||||||
self.template_parameters['Credit_rotate'] = 270
|
|
||||||
self.template_parameters['Source_rotate'] = 0
|
|
||||||
self.template_parameters['Sous_titre_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_2_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
|
||||||
if values_page == 'A3':
|
|
||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(408.5, 222, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(5, 23.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(5, 249, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(323, 282, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(323, 270, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(402, 270, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(415, 123, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(313, 247, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_rotate'] = 0
|
|
||||||
self.template_parameters['Carte_2_rotate'] = 0
|
|
||||||
self.template_parameters['Legande_rotate'] = 0
|
|
||||||
self.template_parameters['Arrow_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_rotate'] = 0
|
|
||||||
self.template_parameters['Titre_rotate'] = 0
|
|
||||||
self.template_parameters['Credit_rotate'] = 270
|
|
||||||
self.template_parameters['Source_rotate'] = 0
|
|
||||||
self.template_parameters['Sous_titre_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_2_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
|
||||||
|
|
||||||
return self.template_parameters
|
|
||||||
@@ -1,167 +0,0 @@
|
|||||||
|
|
||||||
from qgis.core import (
|
|
||||||
QgsLayoutSize,
|
|
||||||
QgsUnitTypes,
|
|
||||||
QgsLayoutPoint,
|
|
||||||
)
|
|
||||||
def fletch_canvas(self):
|
|
||||||
if self.radioButton_6.isChecked():
|
|
||||||
values_page = 'A4'
|
|
||||||
else:
|
|
||||||
values_page = 'A3'
|
|
||||||
if self.radioButton_7.isChecked():
|
|
||||||
page_rotate = 'Portrait'
|
|
||||||
else:
|
|
||||||
page_rotate = 'Landscape'
|
|
||||||
|
|
||||||
if page_rotate == 'Portrait':
|
|
||||||
if values_page == 'A4':
|
|
||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(200.0,200, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 6, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_rotate'] = 0
|
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(80.0,80, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(126, 210, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_2_rotate'] = 0
|
|
||||||
self.template_parameters['Legande_size'] = QgsLayoutSize(86.0,86, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(6, 208, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_rotate'] = 0
|
|
||||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.285714285714286,14, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(189, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(51.42857142857143,7, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(9, 197, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_size'] = QgsLayoutSize(45.714285714285715,11, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(3, 3, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_rotate'] = 0
|
|
||||||
self.template_parameters['Titre_size'] = QgsLayoutSize(154.28571428571428,11, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(51, 3, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_rotate'] = 0
|
|
||||||
self.template_parameters['Credit_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(151, 210, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_rotate'] = 0
|
|
||||||
self.template_parameters['Source_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(229, 197, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_rotate'] = 0
|
|
||||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(125.71428571428571,14, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(60, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(51.42857142857143,13, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(9, 184, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(28.571428571428573,29, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(9, 151, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
|
||||||
if values_page == 'A3':
|
|
||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(282,282, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(8, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_rotate'] = 0
|
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(113,113, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(178, 296, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_2_rotate'] = 0
|
|
||||||
self.template_parameters['Legande_size'] = QgsLayoutSize(121,121, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(8, 293, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_rotate'] = 0
|
|
||||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(20,20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(267, 28, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(73,10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(13, 278, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_size'] = QgsLayoutSize(64,16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(4, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_rotate'] = 0
|
|
||||||
self.template_parameters['Titre_size'] = QgsLayoutSize(218,16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(72, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_rotate'] = 0
|
|
||||||
self.template_parameters['Credit_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(213, 296, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_rotate'] = 0
|
|
||||||
self.template_parameters['Source_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(323, 278, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_rotate'] = 0
|
|
||||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(177,20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(85, 28, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(73,18, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(13, 259, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40,40, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(13, 213, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
|
||||||
if page_rotate == 'Landscape':
|
|
||||||
if values_page == 'A4':
|
|
||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(200.0,200, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 6, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_rotate'] = 0
|
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(85.71428571428571,69, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(209, 3, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_2_rotate'] = 0
|
|
||||||
self.template_parameters['Legande_size'] = QgsLayoutSize(85.71428571428571,131, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(209, 74, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_rotate'] = 0
|
|
||||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.285714285714286,14, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(189, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(51.42857142857143,7, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(9, 197, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_size'] = QgsLayoutSize(45.714285714285715,11, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(3, 3, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_rotate'] = 0
|
|
||||||
self.template_parameters['Titre_size'] = QgsLayoutSize(154.28571428571428,11, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(51, 3, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_rotate'] = 0
|
|
||||||
self.template_parameters['Credit_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(151, 197, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_rotate'] = 0
|
|
||||||
self.template_parameters['Source_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(229, 197, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_rotate'] = 0
|
|
||||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(125.71428571428571,14, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(60, 20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(51.42857142857143,13, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(9, 184, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(28.571428571428573,29, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(9, 151, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
|
||||||
if values_page == 'A3':
|
|
||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(282,282, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(8, 8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_rotate'] = 0
|
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(121,97, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(294, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Carte_2_rotate'] = 0
|
|
||||||
self.template_parameters['Legande_size'] = QgsLayoutSize(121,185, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(294, 105, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Legande_rotate'] = 0
|
|
||||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(20,20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(266, 28, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Arrow_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(73,10, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(12, 278, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_size'] = QgsLayoutSize(64,16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(4, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_rotate'] = 0
|
|
||||||
self.template_parameters['Titre_size'] = QgsLayoutSize(218,16, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(73, 4, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Titre_rotate'] = 0
|
|
||||||
self.template_parameters['Credit_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(214, 278, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Credit_rotate'] = 0
|
|
||||||
self.template_parameters['Source_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(322, 278, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Source_rotate'] = 0
|
|
||||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(177,20, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(85, 28, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Sous_titre_rotate'] = 0
|
|
||||||
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(73,18, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(12, 260, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Echelle_2_rotate'] = 0
|
|
||||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40,40, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(12, 214, QgsUnitTypes.LayoutMillimeters)
|
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
|
||||||
return self.template_parameters
|
|
||||||
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
@@ -1,477 +0,0 @@
|
|||||||
# Form implementation generated from reading ui file '/home/colas/Git/Plugin_QGIS/CenIsere_AUTOMAP/tools/ui/CenIsere_AutoMap_base.ui'
|
|
||||||
#
|
|
||||||
# Created by: PyQt6 UI code generator 6.7.0
|
|
||||||
#
|
|
||||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
|
||||||
# run again. Do not edit this file unless you know what you are doing.
|
|
||||||
|
|
||||||
|
|
||||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
|
||||||
|
|
||||||
|
|
||||||
class Ui_MapCENDialogBase(object):
|
|
||||||
def setupUi(self, MapCENDialogBase):
|
|
||||||
MapCENDialogBase.setObjectName("MapCENDialogBase")
|
|
||||||
MapCENDialogBase.resize(1150, 778)
|
|
||||||
self.tabWidget = QtWidgets.QTabWidget(parent=MapCENDialogBase)
|
|
||||||
self.tabWidget.setGeometry(QtCore.QRect(0, 0, 1150, 781))
|
|
||||||
self.tabWidget.setMinimumSize(QtCore.QSize(1150, 781))
|
|
||||||
self.tabWidget.setMaximumSize(QtCore.QSize(1150, 781))
|
|
||||||
self.tabWidget.setBaseSize(QtCore.QSize(1150, 781))
|
|
||||||
self.tabWidget.setStyleSheet("QWidget#tab{background-image: url(/Users/tlaveille/Pictures/Capturel.png);}\n"
|
|
||||||
" ")
|
|
||||||
self.tabWidget.setObjectName("tabWidget")
|
|
||||||
self.tab = QtWidgets.QWidget()
|
|
||||||
self.tab.setObjectName("tab")
|
|
||||||
self.groupBox_6 = QtWidgets.QGroupBox(parent=self.tab)
|
|
||||||
self.groupBox_6.setGeometry(QtCore.QRect(680, 350, 141, 41))
|
|
||||||
self.groupBox_6.setStyleSheet("QGroupBox#groupBox_6{background-color: rgb(255, 255, 255, 170);}")
|
|
||||||
self.groupBox_6.setTitle("")
|
|
||||||
self.groupBox_6.setObjectName("groupBox_6")
|
|
||||||
self.commandLinkButton = QtWidgets.QCommandLinkButton(parent=self.groupBox_6)
|
|
||||||
self.commandLinkButton.setGeometry(QtCore.QRect(0, 0, 141, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setFamily("Segoe UI")
|
|
||||||
font.setPointSize(10)
|
|
||||||
self.commandLinkButton.setFont(font)
|
|
||||||
self.commandLinkButton.setStyleSheet("background-color: qconicalgradient(cx:0, cy:0, angle:135, stop:0 rgba(255, 255, 0, 69), stop:0.375 rgba(255, 255, 0, 69), stop:0.423533 rgba(251, 255, 0, 145), stop:0.45 rgba(247, 255, 0, 208), stop:0.477581 rgba(255, 244, 71, 130), stop:0.518717 rgba(255, 218, 71, 130), stop:0.55 rgba(255, 255, 0, 255), stop:0.57754 rgba(255, 203, 0, 130), stop:0.625 rgba(255, 255, 0, 69), stop:1 rgba(255, 255, 0, 69));")
|
|
||||||
self.commandLinkButton.setObjectName("commandLinkButton")
|
|
||||||
self.groupBox_7 = QtWidgets.QGroupBox(parent=self.tab)
|
|
||||||
self.groupBox_7.setGeometry(QtCore.QRect(20, 70, 391, 611))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(True)
|
|
||||||
font.setWeight(75)
|
|
||||||
self.groupBox_7.setFont(font)
|
|
||||||
self.groupBox_7.setStyleSheet("QGroupBox#groupBox_7{background-color: rgb(255, 255, 255, 170);}")
|
|
||||||
self.groupBox_7.setTitle("")
|
|
||||||
self.groupBox_7.setObjectName("groupBox_7")
|
|
||||||
self.label_4 = QtWidgets.QLabel(parent=self.groupBox_7)
|
|
||||||
self.label_4.setGeometry(QtCore.QRect(30, 10, 311, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(True)
|
|
||||||
font.setUnderline(True)
|
|
||||||
font.setWeight(75)
|
|
||||||
self.label_4.setFont(font)
|
|
||||||
self.label_4.setStyleSheet("color: rgb(11, 11, 11);")
|
|
||||||
self.label_4.setObjectName("label_4")
|
|
||||||
self.comboBox = QtWidgets.QComboBox(parent=self.groupBox_7)
|
|
||||||
self.comboBox.setGeometry(QtCore.QRect(30, 40, 331, 22))
|
|
||||||
self.comboBox.setEditable(False)
|
|
||||||
self.comboBox.setCurrentText("")
|
|
||||||
self.comboBox.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
|
|
||||||
self.comboBox.setObjectName("comboBox")
|
|
||||||
self.comboBox.addItem("")
|
|
||||||
self.comboBox.setItemText(0, "")
|
|
||||||
self.lineEdit_2 = QtWidgets.QLineEdit(parent=self.groupBox_7)
|
|
||||||
self.lineEdit_2.setEnabled(True)
|
|
||||||
self.lineEdit_2.setGeometry(QtCore.QRect(40, 200, 311, 21))
|
|
||||||
self.lineEdit_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
|
|
||||||
self.lineEdit_2.setReadOnly(False)
|
|
||||||
self.lineEdit_2.setClearButtonEnabled(True)
|
|
||||||
self.lineEdit_2.setObjectName("lineEdit_2")
|
|
||||||
self.label_6 = QtWidgets.QLabel(parent=self.groupBox_7)
|
|
||||||
self.label_6.setGeometry(QtCore.QRect(30, 170, 311, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(False)
|
|
||||||
font.setUnderline(True)
|
|
||||||
font.setWeight(50)
|
|
||||||
self.label_6.setFont(font)
|
|
||||||
self.label_6.setStyleSheet("color: rgb(11, 11, 11);")
|
|
||||||
self.label_6.setObjectName("label_6")
|
|
||||||
self.lineEdit_3 = QtWidgets.QLineEdit(parent=self.groupBox_7)
|
|
||||||
self.lineEdit_3.setEnabled(True)
|
|
||||||
self.lineEdit_3.setGeometry(QtCore.QRect(40, 290, 311, 21))
|
|
||||||
self.lineEdit_3.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
|
|
||||||
self.lineEdit_3.setReadOnly(False)
|
|
||||||
self.lineEdit_3.setClearButtonEnabled(True)
|
|
||||||
self.lineEdit_3.setObjectName("lineEdit_3")
|
|
||||||
self.label_7 = QtWidgets.QLabel(parent=self.groupBox_7)
|
|
||||||
self.label_7.setGeometry(QtCore.QRect(30, 260, 311, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(False)
|
|
||||||
font.setUnderline(True)
|
|
||||||
font.setWeight(50)
|
|
||||||
self.label_7.setFont(font)
|
|
||||||
self.label_7.setStyleSheet("color: rgb(11, 11, 11);")
|
|
||||||
self.label_7.setObjectName("label_7")
|
|
||||||
self.label_8 = QtWidgets.QLabel(parent=self.groupBox_7)
|
|
||||||
self.label_8.setGeometry(QtCore.QRect(30, 330, 311, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(False)
|
|
||||||
font.setUnderline(True)
|
|
||||||
font.setWeight(50)
|
|
||||||
self.label_8.setFont(font)
|
|
||||||
self.label_8.setStyleSheet("color: rgb(11, 11, 11);")
|
|
||||||
self.label_8.setObjectName("label_8")
|
|
||||||
self.lineEdit_4 = QtWidgets.QLineEdit(parent=self.groupBox_7)
|
|
||||||
self.lineEdit_4.setEnabled(True)
|
|
||||||
self.lineEdit_4.setGeometry(QtCore.QRect(40, 360, 311, 21))
|
|
||||||
self.lineEdit_4.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
|
|
||||||
self.lineEdit_4.setReadOnly(False)
|
|
||||||
self.lineEdit_4.setClearButtonEnabled(True)
|
|
||||||
self.lineEdit_4.setObjectName("lineEdit_4")
|
|
||||||
self.mComboBox_2 = QgsCheckableComboBox(parent=self.groupBox_7)
|
|
||||||
self.mComboBox_2.setGeometry(QtCore.QRect(40, 450, 250, 20))
|
|
||||||
self.mComboBox_2.setMinimumSize(QtCore.QSize(260, 20))
|
|
||||||
self.mComboBox_2.setMaximumSize(QtCore.QSize(310, 20))
|
|
||||||
self.mComboBox_2.setStyleSheet("")
|
|
||||||
self.mComboBox_2.setCurrentText("")
|
|
||||||
self.mComboBox_2.setMaxVisibleItems(15)
|
|
||||||
self.mComboBox_2.setSizeAdjustPolicy(QtWidgets.QComboBox.SizeAdjustPolicy.AdjustToContents)
|
|
||||||
self.mComboBox_2.setDefaultText("")
|
|
||||||
self.mComboBox_2.setObjectName("mComboBox_2")
|
|
||||||
self.label_14 = QtWidgets.QLabel(parent=self.groupBox_7)
|
|
||||||
self.label_14.setGeometry(QtCore.QRect(30, 420, 290, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(False)
|
|
||||||
font.setUnderline(True)
|
|
||||||
font.setWeight(50)
|
|
||||||
self.label_14.setFont(font)
|
|
||||||
self.label_14.setStyleSheet("color: rgb(11, 11, 11);")
|
|
||||||
self.label_14.setObjectName("label_14")
|
|
||||||
self.horizontalLayoutWidget = QtWidgets.QWidget(parent=self.groupBox_7)
|
|
||||||
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(40, 80, 261, 31))
|
|
||||||
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
|
|
||||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
|
|
||||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
|
||||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
|
||||||
self.label_3 = QtWidgets.QLabel(parent=self.horizontalLayoutWidget)
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(10)
|
|
||||||
font.setBold(True)
|
|
||||||
font.setUnderline(False)
|
|
||||||
font.setWeight(75)
|
|
||||||
self.label_3.setFont(font)
|
|
||||||
self.label_3.setObjectName("label_3")
|
|
||||||
self.horizontalLayout.addWidget(self.label_3)
|
|
||||||
self.radioButton_6 = QtWidgets.QRadioButton(parent=self.horizontalLayoutWidget)
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(10)
|
|
||||||
self.radioButton_6.setFont(font)
|
|
||||||
self.radioButton_6.setIconSize(QtCore.QSize(16, 16))
|
|
||||||
self.radioButton_6.setChecked(True)
|
|
||||||
self.radioButton_6.setObjectName("radioButton_6")
|
|
||||||
self.horizontalLayout.addWidget(self.radioButton_6)
|
|
||||||
self.radioButton_5 = QtWidgets.QRadioButton(parent=self.horizontalLayoutWidget)
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(10)
|
|
||||||
self.radioButton_5.setFont(font)
|
|
||||||
self.radioButton_5.setObjectName("radioButton_5")
|
|
||||||
self.horizontalLayout.addWidget(self.radioButton_5)
|
|
||||||
self.horizontalLayoutWidget_2 = QtWidgets.QWidget(parent=self.groupBox_7)
|
|
||||||
self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(40, 110, 261, 31))
|
|
||||||
self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
|
|
||||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_2)
|
|
||||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
|
||||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
|
||||||
self.label_16 = QtWidgets.QLabel(parent=self.horizontalLayoutWidget_2)
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(10)
|
|
||||||
font.setBold(True)
|
|
||||||
font.setUnderline(False)
|
|
||||||
font.setWeight(75)
|
|
||||||
self.label_16.setFont(font)
|
|
||||||
self.label_16.setObjectName("label_16")
|
|
||||||
self.horizontalLayout_2.addWidget(self.label_16)
|
|
||||||
self.radioButton_7 = QtWidgets.QRadioButton(parent=self.horizontalLayoutWidget_2)
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(10)
|
|
||||||
self.radioButton_7.setFont(font)
|
|
||||||
self.radioButton_7.setIconSize(QtCore.QSize(16, 16))
|
|
||||||
self.radioButton_7.setChecked(True)
|
|
||||||
self.radioButton_7.setObjectName("radioButton_7")
|
|
||||||
self.horizontalLayout_2.addWidget(self.radioButton_7)
|
|
||||||
self.radioButton_8 = QtWidgets.QRadioButton(parent=self.horizontalLayoutWidget_2)
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(10)
|
|
||||||
self.radioButton_8.setFont(font)
|
|
||||||
self.radioButton_8.setObjectName("radioButton_8")
|
|
||||||
self.horizontalLayout_2.addWidget(self.radioButton_8)
|
|
||||||
self.radioButton_9 = QtWidgets.QRadioButton(parent=self.groupBox_7)
|
|
||||||
self.radioButton_9.setGeometry(QtCore.QRect(270, 570, 82, 15))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(10)
|
|
||||||
self.radioButton_9.setFont(font)
|
|
||||||
self.radioButton_9.setObjectName("radioButton_9")
|
|
||||||
self.radioButton_10 = QtWidgets.QRadioButton(parent=self.groupBox_7)
|
|
||||||
self.radioButton_10.setGeometry(QtCore.QRect(75, 390, 200, 16))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(10)
|
|
||||||
self.radioButton_10.setFont(font)
|
|
||||||
self.radioButton_10.setObjectName("radioButton_10")
|
|
||||||
self.mComboBox_3 = QgsCheckableComboBox(parent=self.groupBox_7)
|
|
||||||
self.mComboBox_3.setGeometry(QtCore.QRect(40, 360, 310, 20))
|
|
||||||
self.mComboBox_3.setMinimumSize(QtCore.QSize(310, 20))
|
|
||||||
self.mComboBox_3.setMaximumSize(QtCore.QSize(310, 20))
|
|
||||||
self.mComboBox_3.setStyleSheet("")
|
|
||||||
self.mComboBox_3.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhNone)
|
|
||||||
self.mComboBox_3.setCurrentText("")
|
|
||||||
self.mComboBox_3.setMaxVisibleItems(15)
|
|
||||||
self.mComboBox_3.setSizeAdjustPolicy(QtWidgets.QComboBox.SizeAdjustPolicy.AdjustToContents)
|
|
||||||
self.mComboBox_3.setDefaultText("")
|
|
||||||
self.mComboBox_3.setObjectName("mComboBox_3")
|
|
||||||
self.radioButton_11 = QtWidgets.QRadioButton(parent=self.groupBox_7)
|
|
||||||
self.radioButton_11.setGeometry(QtCore.QRect(75, 150, 200, 16))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(10)
|
|
||||||
self.radioButton_11.setFont(font)
|
|
||||||
self.radioButton_11.setObjectName("radioButton_11")
|
|
||||||
self.radioButton_13 = QtWidgets.QRadioButton(parent=self.groupBox_7)
|
|
||||||
self.radioButton_13.setGeometry(QtCore.QRect(75, 230, 200, 16))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(10)
|
|
||||||
self.radioButton_13.setFont(font)
|
|
||||||
self.radioButton_13.setObjectName("radioButton_13")
|
|
||||||
self.comboBox_7 = QtWidgets.QComboBox(parent=self.groupBox_7)
|
|
||||||
self.comboBox_7.setGeometry(QtCore.QRect(40, 200, 311, 22))
|
|
||||||
self.comboBox_7.setEditable(False)
|
|
||||||
self.comboBox_7.setCurrentText("")
|
|
||||||
self.comboBox_7.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
|
|
||||||
self.comboBox_7.setObjectName("comboBox_7")
|
|
||||||
self.comboBox_7.addItem("")
|
|
||||||
self.comboBox_7.setItemText(0, "")
|
|
||||||
self.mComboBox_4 = QgsCheckableComboBox(parent=self.groupBox_7)
|
|
||||||
self.mComboBox_4.setGeometry(QtCore.QRect(40, 530, 310, 20))
|
|
||||||
self.mComboBox_4.setMinimumSize(QtCore.QSize(310, 20))
|
|
||||||
self.mComboBox_4.setMaximumSize(QtCore.QSize(310, 20))
|
|
||||||
self.mComboBox_4.setStyleSheet("")
|
|
||||||
self.mComboBox_4.setCurrentText("")
|
|
||||||
self.mComboBox_4.setMaxVisibleItems(15)
|
|
||||||
self.mComboBox_4.setSizeAdjustPolicy(QtWidgets.QComboBox.SizeAdjustPolicy.AdjustToContents)
|
|
||||||
self.mComboBox_4.setDefaultText("")
|
|
||||||
self.mComboBox_4.setObjectName("mComboBox_4")
|
|
||||||
self.label_15 = QtWidgets.QLabel(parent=self.groupBox_7)
|
|
||||||
self.label_15.setGeometry(QtCore.QRect(30, 500, 311, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(False)
|
|
||||||
font.setUnderline(True)
|
|
||||||
font.setWeight(50)
|
|
||||||
self.label_15.setFont(font)
|
|
||||||
self.label_15.setStyleSheet("color: rgb(11, 11, 11);")
|
|
||||||
self.label_15.setObjectName("label_15")
|
|
||||||
self.label_17 = QtWidgets.QLabel(parent=self.groupBox_7)
|
|
||||||
self.label_17.setGeometry(QtCore.QRect(75, 465, 311, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(False)
|
|
||||||
font.setUnderline(False)
|
|
||||||
font.setWeight(50)
|
|
||||||
self.label_17.setFont(font)
|
|
||||||
self.label_17.setStyleSheet("color: rgb(11, 11, 11);")
|
|
||||||
self.label_17.setObjectName("label_17")
|
|
||||||
self.label_18 = QtWidgets.QLabel(parent=self.groupBox_7)
|
|
||||||
self.label_18.setGeometry(QtCore.QRect(155, 465, 311, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(False)
|
|
||||||
font.setUnderline(False)
|
|
||||||
font.setWeight(50)
|
|
||||||
self.label_18.setFont(font)
|
|
||||||
self.label_18.setStyleSheet("color: rgb(11, 11, 11);")
|
|
||||||
self.label_18.setObjectName("label_18")
|
|
||||||
self.spinBox = QtWidgets.QSpinBox(parent=self.groupBox_7)
|
|
||||||
self.spinBox.setGeometry(QtCore.QRect(110, 475, 42, 22))
|
|
||||||
self.spinBox.setMinimum(1)
|
|
||||||
self.spinBox.setMaximum(10)
|
|
||||||
self.spinBox.setObjectName("spinBox")
|
|
||||||
self.CustomeLogo = QtWidgets.QPushButton(parent=self.groupBox_7)
|
|
||||||
self.CustomeLogo.setGeometry(QtCore.QRect(30, 560, 180, 23))
|
|
||||||
self.CustomeLogo.setObjectName("CustomeLogo")
|
|
||||||
self.comboBox_7.raise_()
|
|
||||||
self.mComboBox_3.raise_()
|
|
||||||
self.label_4.raise_()
|
|
||||||
self.comboBox.raise_()
|
|
||||||
self.lineEdit_2.raise_()
|
|
||||||
self.label_6.raise_()
|
|
||||||
self.lineEdit_3.raise_()
|
|
||||||
self.label_7.raise_()
|
|
||||||
self.label_8.raise_()
|
|
||||||
self.lineEdit_4.raise_()
|
|
||||||
self.mComboBox_2.raise_()
|
|
||||||
self.label_14.raise_()
|
|
||||||
self.horizontalLayoutWidget.raise_()
|
|
||||||
self.horizontalLayoutWidget_2.raise_()
|
|
||||||
self.radioButton_9.raise_()
|
|
||||||
self.radioButton_10.raise_()
|
|
||||||
self.radioButton_11.raise_()
|
|
||||||
self.radioButton_13.raise_()
|
|
||||||
self.mComboBox_4.raise_()
|
|
||||||
self.label_15.raise_()
|
|
||||||
self.label_17.raise_()
|
|
||||||
self.label_18.raise_()
|
|
||||||
self.spinBox.raise_()
|
|
||||||
self.CustomeLogo.raise_()
|
|
||||||
self.label_5 = QtWidgets.QLabel(parent=self.tab)
|
|
||||||
self.label_5.setGeometry(QtCore.QRect(920, 10, 211, 71))
|
|
||||||
self.label_5.setText("")
|
|
||||||
self.label_5.setScaledContents(True)
|
|
||||||
self.label_5.setObjectName("label_5")
|
|
||||||
self.groupBox = QtWidgets.QGroupBox(parent=self.tab)
|
|
||||||
self.groupBox.setGeometry(QtCore.QRect(430, 500, 411, 201))
|
|
||||||
self.groupBox.setStyleSheet("QGroupBox#groupBox{background-color: rgb(255, 255, 255, 170);}")
|
|
||||||
self.groupBox.setTitle("")
|
|
||||||
self.groupBox.setObjectName("groupBox")
|
|
||||||
self.comboBox_4 = QtWidgets.QComboBox(parent=self.groupBox)
|
|
||||||
self.comboBox_4.setGeometry(QtCore.QRect(40, 160, 331, 22))
|
|
||||||
self.comboBox_4.setEditable(False)
|
|
||||||
self.comboBox_4.setCurrentText("")
|
|
||||||
self.comboBox_4.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
|
|
||||||
self.comboBox_4.setObjectName("comboBox_4")
|
|
||||||
self.comboBox_4.addItem("")
|
|
||||||
self.comboBox_4.setItemText(0, "")
|
|
||||||
self.label_9 = QtWidgets.QLabel(parent=self.groupBox)
|
|
||||||
self.label_9.setGeometry(QtCore.QRect(30, 130, 311, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(False)
|
|
||||||
font.setUnderline(True)
|
|
||||||
font.setWeight(50)
|
|
||||||
self.label_9.setFont(font)
|
|
||||||
self.label_9.setStyleSheet("color: rgb(11, 11, 11);")
|
|
||||||
self.label_9.setObjectName("label_9")
|
|
||||||
self.label_10 = QtWidgets.QLabel(parent=self.groupBox)
|
|
||||||
self.label_10.setGeometry(QtCore.QRect(30, 70, 311, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(False)
|
|
||||||
font.setUnderline(True)
|
|
||||||
font.setWeight(50)
|
|
||||||
self.label_10.setFont(font)
|
|
||||||
self.label_10.setStyleSheet("color: rgb(11, 11, 11);")
|
|
||||||
self.label_10.setObjectName("label_10")
|
|
||||||
self.comboBox_3 = QtWidgets.QComboBox(parent=self.groupBox)
|
|
||||||
self.comboBox_3.setGeometry(QtCore.QRect(40, 100, 331, 22))
|
|
||||||
self.comboBox_3.setEditable(False)
|
|
||||||
self.comboBox_3.setCurrentText("")
|
|
||||||
self.comboBox_3.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
|
|
||||||
self.comboBox_3.setObjectName("comboBox_3")
|
|
||||||
self.comboBox_3.addItem("")
|
|
||||||
self.comboBox_3.setItemText(0, "")
|
|
||||||
self.comboBox_2 = QtWidgets.QComboBox(parent=self.groupBox)
|
|
||||||
self.comboBox_2.setGeometry(QtCore.QRect(40, 40, 331, 22))
|
|
||||||
self.comboBox_2.setEditable(False)
|
|
||||||
self.comboBox_2.setCurrentText("")
|
|
||||||
self.comboBox_2.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
|
|
||||||
self.comboBox_2.setObjectName("comboBox_2")
|
|
||||||
self.comboBox_2.addItem("")
|
|
||||||
self.comboBox_2.setItemText(0, "")
|
|
||||||
self.label_11 = QtWidgets.QLabel(parent=self.groupBox)
|
|
||||||
self.label_11.setGeometry(QtCore.QRect(30, 10, 311, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(False)
|
|
||||||
font.setUnderline(True)
|
|
||||||
font.setWeight(50)
|
|
||||||
self.label_11.setFont(font)
|
|
||||||
self.label_11.setStyleSheet("color: rgb(11, 11, 11);")
|
|
||||||
self.label_11.setObjectName("label_11")
|
|
||||||
self.groupBox_2 = QtWidgets.QGroupBox(parent=self.tab)
|
|
||||||
self.groupBox_2.setGeometry(QtCore.QRect(960, 10, 171, 111))
|
|
||||||
self.groupBox_2.setStyleSheet("QGroupBox#groupBox_2{background-color: rgb(255, 255, 255, 170);}")
|
|
||||||
self.groupBox_2.setTitle("")
|
|
||||||
self.groupBox_2.setObjectName("groupBox_2")
|
|
||||||
self.commandLinkButton_3 = QtWidgets.QCommandLinkButton(parent=self.groupBox_2)
|
|
||||||
self.commandLinkButton_3.setGeometry(QtCore.QRect(10, 60, 161, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setFamily("Segoe UI")
|
|
||||||
font.setPointSize(10)
|
|
||||||
self.commandLinkButton_3.setFont(font)
|
|
||||||
self.commandLinkButton_3.setStyleSheet("background-color: qconicalgradient(cx:0, cy:0, angle:135, stop:0 rgba(255, 255, 0, 69), stop:0.375 rgba(255, 255, 0, 69), stop:0.423533 rgba(251, 255, 0, 145), stop:0.45 rgba(247, 255, 0, 208), stop:0.477581 rgba(255, 244, 71, 130), stop:0.518717 rgba(255, 218, 71, 130), stop:0.55 rgba(255, 255, 0, 255), stop:0.57754 rgba(255, 203, 0, 130), stop:0.625 rgba(255, 255, 0, 69), stop:1 rgba(255, 255, 0, 69));")
|
|
||||||
self.commandLinkButton_3.setObjectName("commandLinkButton_3")
|
|
||||||
self.commandLinkButton_2 = QtWidgets.QCommandLinkButton(parent=self.groupBox_2)
|
|
||||||
self.commandLinkButton_2.setGeometry(QtCore.QRect(10, 10, 141, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setFamily("Segoe UI")
|
|
||||||
font.setPointSize(10)
|
|
||||||
self.commandLinkButton_2.setFont(font)
|
|
||||||
self.commandLinkButton_2.setAutoFillBackground(False)
|
|
||||||
self.commandLinkButton_2.setStyleSheet("background-color: qconicalgradient(cx:0, cy:0, angle:135, stop:0 rgba(255, 255, 0, 69), stop:0.375 rgba(255, 255, 0, 69), stop:0.423533 rgba(251, 255, 0, 145), stop:0.45 rgba(247, 255, 0, 208), stop:0.477581 rgba(255, 244, 71, 130), stop:0.518717 rgba(255, 218, 71, 130), stop:0.55 rgba(255, 255, 0, 255), stop:0.57754 rgba(255, 203, 0, 130), stop:0.625 rgba(255, 255, 0, 69), stop:1 rgba(255, 255, 0, 69));")
|
|
||||||
self.commandLinkButton_2.setObjectName("commandLinkButton_2")
|
|
||||||
self.groupBox_3 = QtWidgets.QGroupBox(parent=self.tab)
|
|
||||||
self.groupBox_3.setGeometry(QtCore.QRect(430, 110, 251, 161))
|
|
||||||
self.groupBox_3.setStyleSheet("QGroupBox#groupBox_3{background-color: rgb(255, 255, 255, 170);}")
|
|
||||||
self.groupBox_3.setTitle("")
|
|
||||||
self.groupBox_3.setObjectName("groupBox_3")
|
|
||||||
self.comboBox_5 = QtWidgets.QComboBox(parent=self.groupBox_3)
|
|
||||||
self.comboBox_5.setGeometry(QtCore.QRect(20, 40, 211, 22))
|
|
||||||
self.comboBox_5.setEditable(False)
|
|
||||||
self.comboBox_5.setCurrentText("")
|
|
||||||
self.comboBox_5.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
|
|
||||||
self.comboBox_5.setObjectName("comboBox_5")
|
|
||||||
self.comboBox_5.addItem("")
|
|
||||||
self.comboBox_5.setItemText(0, "")
|
|
||||||
self.label_12 = QtWidgets.QLabel(parent=self.groupBox_3)
|
|
||||||
self.label_12.setGeometry(QtCore.QRect(10, 10, 311, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(False)
|
|
||||||
font.setUnderline(True)
|
|
||||||
font.setWeight(50)
|
|
||||||
self.label_12.setFont(font)
|
|
||||||
self.label_12.setStyleSheet("color: rgb(11, 11, 11);")
|
|
||||||
self.label_12.setObjectName("label_12")
|
|
||||||
self.label_13 = QtWidgets.QLabel(parent=self.groupBox_3)
|
|
||||||
self.label_13.setGeometry(QtCore.QRect(10, 70, 311, 41))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(False)
|
|
||||||
font.setUnderline(True)
|
|
||||||
font.setWeight(50)
|
|
||||||
self.label_13.setFont(font)
|
|
||||||
self.label_13.setStyleSheet("color: rgb(11, 11, 11);")
|
|
||||||
self.label_13.setObjectName("label_13")
|
|
||||||
self.radioButton_12 = QtWidgets.QRadioButton(parent=self.groupBox_3)
|
|
||||||
self.radioButton_12.setGeometry(QtCore.QRect(80, 130, 181, 16))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(10)
|
|
||||||
self.radioButton_12.setFont(font)
|
|
||||||
self.radioButton_12.setObjectName("radioButton_12")
|
|
||||||
self.comboBox_6 = QtWidgets.QComboBox(parent=self.groupBox_3)
|
|
||||||
self.comboBox_6.setGeometry(QtCore.QRect(20, 100, 211, 22))
|
|
||||||
self.comboBox_6.setEditable(False)
|
|
||||||
self.comboBox_6.setCurrentText("")
|
|
||||||
self.comboBox_6.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
|
|
||||||
self.comboBox_6.setObjectName("comboBox_6")
|
|
||||||
self.comboBox_6.addItem("")
|
|
||||||
self.comboBox_6.setItemText(0, "")
|
|
||||||
self.groupBox.raise_()
|
|
||||||
self.groupBox_6.raise_()
|
|
||||||
self.groupBox_7.raise_()
|
|
||||||
self.label_5.raise_()
|
|
||||||
self.groupBox_2.raise_()
|
|
||||||
self.groupBox_3.raise_()
|
|
||||||
self.tabWidget.addTab(self.tab, "")
|
|
||||||
|
|
||||||
self.retranslateUi(MapCENDialogBase)
|
|
||||||
self.tabWidget.setCurrentIndex(0)
|
|
||||||
QtCore.QMetaObject.connectSlotsByName(MapCENDialogBase)
|
|
||||||
|
|
||||||
def retranslateUi(self, MapCENDialogBase):
|
|
||||||
_translate = QtCore.QCoreApplication.translate
|
|
||||||
MapCENDialogBase.setWindowTitle(_translate("MapCENDialogBase", "AutoMap"))
|
|
||||||
self.commandLinkButton.setText(_translate("MapCENDialogBase", " Mise en page"))
|
|
||||||
self.label_4.setText(_translate("MapCENDialogBase", "Modèles de mise en page :"))
|
|
||||||
self.lineEdit_2.setText(_translate("MapCENDialogBase", "Titre à renseigner ici"))
|
|
||||||
self.label_6.setText(_translate("MapCENDialogBase", "Titre de la carte :"))
|
|
||||||
self.lineEdit_3.setText(_translate("MapCENDialogBase", "Sous-titre à renseigner ici"))
|
|
||||||
self.label_7.setText(_translate("MapCENDialogBase", "Sous-titre de la carte :"))
|
|
||||||
self.label_8.setText(_translate("MapCENDialogBase", "Source des données :"))
|
|
||||||
self.lineEdit_4.setText(_translate("MapCENDialogBase", "à renseigner ici"))
|
|
||||||
self.label_14.setText(_translate("MapCENDialogBase", "Éléments à intégrer à la légende :"))
|
|
||||||
self.label_3.setText(_translate("MapCENDialogBase", "Format :"))
|
|
||||||
self.radioButton_6.setText(_translate("MapCENDialogBase", "A4"))
|
|
||||||
self.radioButton_5.setText(_translate("MapCENDialogBase", "A3"))
|
|
||||||
self.label_16.setText(_translate("MapCENDialogBase", "Orientation :"))
|
|
||||||
self.radioButton_7.setText(_translate("MapCENDialogBase", "Portrait"))
|
|
||||||
self.radioButton_8.setText(_translate("MapCENDialogBase", "Paysage"))
|
|
||||||
self.radioButton_9.setText(_translate("MapCENDialogBase", "Atlas"))
|
|
||||||
self.radioButton_10.setText(_translate("MapCENDialogBase", "Utilisez le gestionnaire"))
|
|
||||||
self.radioButton_11.setText(_translate("MapCENDialogBase", "Theme et suivie de positionnement"))
|
|
||||||
self.radioButton_13.setText(_translate("MapCENDialogBase", "Mise en page existante"))
|
|
||||||
self.label_15.setText(_translate("MapCENDialogBase", "Bibliotheque de logo :"))
|
|
||||||
self.label_17.setText(_translate("MapCENDialogBase", "Sur"))
|
|
||||||
self.label_18.setText(_translate("MapCENDialogBase", "colonne(s)"))
|
|
||||||
self.CustomeLogo.setText(_translate("MapCENDialogBase", "Custom Bibliotheque"))
|
|
||||||
self.label_9.setText(_translate("MapCENDialogBase", "Colonne de sous-titre :"))
|
|
||||||
self.label_10.setText(_translate("MapCENDialogBase", "Colonne d\'identification :"))
|
|
||||||
self.label_11.setText(_translate("MapCENDialogBase", "Couche de suivie :"))
|
|
||||||
self.commandLinkButton_3.setText(_translate("MapCENDialogBase", "OpenStreetMap"))
|
|
||||||
self.commandLinkButton_2.setText(_translate("MapCENDialogBase", " Ortho"))
|
|
||||||
self.label_12.setText(_translate("MapCENDialogBase", "Théme principal :"))
|
|
||||||
self.label_13.setText(_translate("MapCENDialogBase", "Théme de suivie :"))
|
|
||||||
self.radioButton_12.setText(_translate("MapCENDialogBase", "Activé le suivie"))
|
|
||||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MapCENDialogBase", "Liste de templates existants"))
|
|
||||||
from qgscheckablecombobox import QgsCheckableComboBox
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
# Form implementation generated from reading ui file '/home/colas/Git/Plugin_QGIS/CenIsere_AUTOMAP/tools/ui/CenIsere_IssuesSend.ui'
|
|
||||||
#
|
|
||||||
# Created by: PyQt6 UI code generator 6.7.0
|
|
||||||
#
|
|
||||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
|
||||||
# run again. Do not edit this file unless you know what you are doing.
|
|
||||||
|
|
||||||
|
|
||||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
|
||||||
|
|
||||||
|
|
||||||
class Ui_CenRa_IssuesSend(object):
|
|
||||||
def setupUi(self, CenRa_IssuesSend):
|
|
||||||
CenRa_IssuesSend.setObjectName("CenRa_IssuesSend")
|
|
||||||
CenRa_IssuesSend.resize(810, 587)
|
|
||||||
icon = QtGui.QIcon()
|
|
||||||
icon.addPixmap(QtGui.QPixmap("/home/colas/Git/Plugin_QGIS/CenIsere_AUTOMAP/tools/ui/icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
|
||||||
CenRa_IssuesSend.setWindowIcon(icon)
|
|
||||||
self.gridLayoutWidget = QtWidgets.QWidget(parent=CenRa_IssuesSend)
|
|
||||||
self.gridLayoutWidget.setGeometry(QtCore.QRect(0, 550, 811, 31))
|
|
||||||
self.gridLayoutWidget.setObjectName("gridLayoutWidget")
|
|
||||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.gridLayoutWidget)
|
|
||||||
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
|
|
||||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
|
||||||
self.annuler_button = QtWidgets.QPushButton(parent=self.gridLayoutWidget)
|
|
||||||
self.annuler_button.setObjectName("annuler_button")
|
|
||||||
self.gridLayout_2.addWidget(self.annuler_button, 0, 2, 1, 1)
|
|
||||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
|
||||||
self.gridLayout_2.addItem(spacerItem, 0, 3, 1, 1)
|
|
||||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
|
||||||
self.gridLayout_2.addItem(spacerItem1, 0, 0, 1, 1)
|
|
||||||
self.ok_button = QtWidgets.QPushButton(parent=self.gridLayoutWidget)
|
|
||||||
self.ok_button.setObjectName("ok_button")
|
|
||||||
self.gridLayout_2.addWidget(self.ok_button, 0, 1, 1, 1)
|
|
||||||
self.groupBox = QtWidgets.QGroupBox(parent=CenRa_IssuesSend)
|
|
||||||
self.groupBox.setGeometry(QtCore.QRect(10, 10, 791, 531))
|
|
||||||
self.groupBox.setObjectName("groupBox")
|
|
||||||
self.titre_line = QtWidgets.QLineEdit(parent=self.groupBox)
|
|
||||||
self.titre_line.setGeometry(QtCore.QRect(240, 40, 321, 41))
|
|
||||||
self.titre_line.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
|
|
||||||
self.titre_line.setObjectName("titre_line")
|
|
||||||
self.messages_plain = QtWidgets.QPlainTextEdit(parent=self.groupBox)
|
|
||||||
self.messages_plain.setGeometry(QtCore.QRect(10, 101, 571, 421))
|
|
||||||
self.messages_plain.setObjectName("messages_plain")
|
|
||||||
self.frame = QtWidgets.QFrame(parent=self.groupBox)
|
|
||||||
self.frame.setGeometry(QtCore.QRect(589, 100, 191, 431))
|
|
||||||
self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
|
||||||
self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
|
||||||
self.frame.setObjectName("frame")
|
|
||||||
self.formLayoutWidget = QtWidgets.QWidget(parent=self.frame)
|
|
||||||
self.formLayoutWidget.setGeometry(QtCore.QRect(9, 9, 341, 411))
|
|
||||||
self.formLayoutWidget.setObjectName("formLayoutWidget")
|
|
||||||
self.formLayout = QtWidgets.QFormLayout(self.formLayoutWidget)
|
|
||||||
self.formLayout.setLabelAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
|
|
||||||
self.formLayout.setFormAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTop|QtCore.Qt.AlignmentFlag.AlignTrailing)
|
|
||||||
self.formLayout.setContentsMargins(0, 0, 0, 0)
|
|
||||||
self.formLayout.setObjectName("formLayout")
|
|
||||||
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
|
||||||
self.formLayout.setItem(0, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem2)
|
|
||||||
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
|
||||||
self.formLayout.setItem(1, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem3)
|
|
||||||
self.check_bug = QtWidgets.QCheckBox(parent=self.formLayoutWidget)
|
|
||||||
self.check_bug.setObjectName("check_bug")
|
|
||||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.check_bug)
|
|
||||||
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
|
||||||
self.formLayout.setItem(2, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem4)
|
|
||||||
self.check_aide = QtWidgets.QCheckBox(parent=self.formLayoutWidget)
|
|
||||||
self.check_aide.setObjectName("check_aide")
|
|
||||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.check_aide)
|
|
||||||
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
|
||||||
self.formLayout.setItem(3, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem5)
|
|
||||||
self.check_question = QtWidgets.QCheckBox(parent=self.formLayoutWidget)
|
|
||||||
self.check_question.setObjectName("check_question")
|
|
||||||
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.check_question)
|
|
||||||
spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
|
||||||
self.formLayout.setItem(4, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem6)
|
|
||||||
self.check_amelioration = QtWidgets.QCheckBox(parent=self.formLayoutWidget)
|
|
||||||
self.check_amelioration.setObjectName("check_amelioration")
|
|
||||||
self.formLayout.setWidget(4, QtWidgets.QFormLayout.ItemRole.FieldRole, self.check_amelioration)
|
|
||||||
spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
|
||||||
self.formLayout.setItem(5, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem7)
|
|
||||||
self.check_autre = QtWidgets.QCheckBox(parent=self.formLayoutWidget)
|
|
||||||
self.check_autre.setObjectName("check_autre")
|
|
||||||
self.formLayout.setWidget(5, QtWidgets.QFormLayout.ItemRole.FieldRole, self.check_autre)
|
|
||||||
spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
|
||||||
self.formLayout.setItem(6, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem8)
|
|
||||||
self.label = QtWidgets.QLabel(parent=self.groupBox)
|
|
||||||
self.label.setGeometry(QtCore.QRect(250, 20, 51, 21))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setFamily("Arial")
|
|
||||||
font.setPointSize(14)
|
|
||||||
self.label.setFont(font)
|
|
||||||
self.label.setObjectName("label")
|
|
||||||
self.label_2 = QtWidgets.QLabel(parent=self.groupBox)
|
|
||||||
self.label_2.setGeometry(QtCore.QRect(20, 70, 91, 31))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setFamily("Arial")
|
|
||||||
font.setPointSize(12)
|
|
||||||
self.label_2.setFont(font)
|
|
||||||
self.label_2.setObjectName("label_2")
|
|
||||||
self.label_3 = QtWidgets.QLabel(parent=self.groupBox)
|
|
||||||
self.label_3.setGeometry(QtCore.QRect(600, 70, 91, 31))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setFamily("Arial")
|
|
||||||
font.setPointSize(12)
|
|
||||||
self.label_3.setFont(font)
|
|
||||||
self.label_3.setObjectName("label_3")
|
|
||||||
|
|
||||||
self.retranslateUi(CenRa_IssuesSend)
|
|
||||||
QtCore.QMetaObject.connectSlotsByName(CenRa_IssuesSend)
|
|
||||||
CenRa_IssuesSend.setTabOrder(self.ok_button, self.annuler_button)
|
|
||||||
|
|
||||||
def retranslateUi(self, CenRa_IssuesSend):
|
|
||||||
_translate = QtCore.QCoreApplication.translate
|
|
||||||
CenRa_IssuesSend.setWindowTitle(_translate("CenRa_IssuesSend", "CEN38 Metabase"))
|
|
||||||
self.annuler_button.setText(_translate("CenRa_IssuesSend", "Annuler"))
|
|
||||||
self.ok_button.setText(_translate("CenRa_IssuesSend", "Envoyer"))
|
|
||||||
self.groupBox.setTitle(_translate("CenRa_IssuesSend", "Issues"))
|
|
||||||
self.check_bug.setText(_translate("CenRa_IssuesSend", "Bug"))
|
|
||||||
self.check_aide.setText(_translate("CenRa_IssuesSend", "Aide"))
|
|
||||||
self.check_question.setText(_translate("CenRa_IssuesSend", "Question"))
|
|
||||||
self.check_amelioration.setText(_translate("CenRa_IssuesSend", "Amélioration"))
|
|
||||||
self.check_autre.setText(_translate("CenRa_IssuesSend", "Autre"))
|
|
||||||
self.label.setText(_translate("CenRa_IssuesSend", "Titre:"))
|
|
||||||
self.label_2.setText(_translate("CenRa_IssuesSend", "Messages:"))
|
|
||||||
self.label_3.setText(_translate("CenRa_IssuesSend", "Sujet:"))
|
|
||||||
@@ -27,17 +27,24 @@ import os
|
|||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
plugin_path,
|
plugin_path,
|
||||||
resources_path,
|
resources_path,
|
||||||
|
pyperclip,
|
||||||
maj_verif,
|
maj_verif,
|
||||||
)
|
)
|
||||||
from .canvas_editor import AutoMap_Editor
|
pyperclip()
|
||||||
from .about_form import AutoMapAboutDialog
|
|
||||||
|
from .canvas_editor import AutoMap_Editor
|
||||||
|
from .style_invoke import AutoMap_Style
|
||||||
|
from .about_form import AboutDialog
|
||||||
|
|
||||||
|
|
||||||
|
from qgis.PyQt.QtCore import *
|
||||||
|
|
||||||
from PyQt5.QtCore import *
|
|
||||||
|
|
||||||
class PgAutoMap:
|
class PgAutoMap:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
""" Constructor. """
|
""" Constructor. """
|
||||||
self.canvas_editor = None
|
self.canvas_editor = None
|
||||||
|
self.style_dock = None
|
||||||
# self.issues = None
|
# self.issues = None
|
||||||
self.provider = None
|
self.provider = None
|
||||||
self.locator_filter = None
|
self.locator_filter = None
|
||||||
@@ -50,7 +57,7 @@ class PgAutoMap:
|
|||||||
maj_verif(NAME)
|
maj_verif(NAME)
|
||||||
|
|
||||||
# Display About window on first use
|
# Display About window on first use
|
||||||
version = qgis.utils.pluginMetadata('CenIsere_AUTOMAP','version')
|
version = qgis.utils.pluginMetadata('CenRa_AUTOMAP','version')
|
||||||
s = QSettings()
|
s = QSettings()
|
||||||
versionUse = s.value("automap/version", 1, type=str)
|
versionUse = s.value("automap/version", 1, type=str)
|
||||||
if str(versionUse) != str(version) :
|
if str(versionUse) != str(version) :
|
||||||
@@ -61,65 +68,70 @@ class PgAutoMap:
|
|||||||
def initGui(self):
|
def initGui(self):
|
||||||
""" Build the plugin GUI. """
|
""" Build the plugin GUI. """
|
||||||
|
|
||||||
self.toolBar = iface.addToolBar("CenIsere_AutoMap")
|
self.toolBar = iface.addToolBar("CenRa_AutoMap")
|
||||||
self.toolBar.setObjectName("CenIsere_AutoMap")
|
self.toolBar.setObjectName("CenRa_AutoMap")
|
||||||
|
|
||||||
icon = QIcon(resources_path('icons', 'icon.png'))
|
icon = QIcon(resources_path('icons', 'icon.png'))
|
||||||
|
|
||||||
# Open the online help
|
# Open the online help
|
||||||
self.help_action = QAction(icon, 'CenIsere_AutoMap', iface.mainWindow())
|
self.help_action = QAction(icon, 'CenRa_AutoMap', iface.mainWindow())
|
||||||
iface.pluginHelpMenu().addAction(self.help_action)
|
iface.pluginHelpMenu().addAction(self.help_action)
|
||||||
self.help_action.triggered.connect(self.open_help)
|
self.help_action.triggered.connect(self.open_help)
|
||||||
if not self.canvas_editor:
|
if not self.canvas_editor:
|
||||||
self.canvas_editor = AutoMap_Editor()
|
self.canvas_editor = AutoMap_Editor()
|
||||||
|
|
||||||
|
self.automap_action = QAction(icon, 'CenRa_AutoMap',None)
|
||||||
self.automap_action = QAction(icon, 'CenIsere_AutoMap',None)
|
|
||||||
self.toolBar.addAction(self.automap_action)
|
self.toolBar.addAction(self.automap_action)
|
||||||
self.automap_action.triggered.connect(self.open_editor)
|
self.automap_action.triggered.connect(self.open_editor)
|
||||||
# '''
|
|
||||||
# if not self.locator_filter:
|
|
||||||
# self.locator_filter = LocatorFilter(iface)
|
|
||||||
# iface.registerLocatorFilter(self.locator_filter)
|
|
||||||
|
|
||||||
# @staticmethod
|
if not self.style_dock:
|
||||||
# def check_invalid_connection_names():
|
self.style_dock = AutoMap_Style()
|
||||||
# """ Check for invalid connection names in the QgsSettings. """
|
|
||||||
# valid, invalid = validate_connections_names()
|
|
||||||
# n_invalid = len(invalid)
|
|
||||||
|
|
||||||
# if n_invalid == 0:
|
if os.environ['USERNAME'] == 'tlaveille' or os.environ['USERNAME'] == 'lpoulin' or os.environ['USERNAME'] == 'rclement':
|
||||||
# return
|
iface.addDockWidget(Qt.DockWidgetArea(0x1), self.style_dock)
|
||||||
|
|
||||||
# invalid_text = ', '.join(invalid)
|
'''
|
||||||
# msg = QMessageBox()
|
if not self.locator_filter:
|
||||||
# msg.setIcon(QMessageBox.Warning)
|
self.locator_filter = LocatorFilter(iface)
|
||||||
# msg.setWindowTitle(tr('PgMetadata: Database connection(s) not available'))
|
iface.registerLocatorFilter(self.locator_filter)
|
||||||
# msg.setText(tr(
|
|
||||||
# f'{n_invalid} connection(s) listed in PgMetadata’s settings are invalid or '
|
|
||||||
# f'no longer available: {invalid_text}'))
|
|
||||||
# msg.setInformativeText(tr(
|
|
||||||
# 'Do you want to remove these connection(s) from the PgMetadata settings? '
|
|
||||||
# '(You can also do this later with the “Set Connections” tool.)'))
|
|
||||||
# msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
|
|
||||||
# clicked = msg.exec()
|
|
||||||
|
|
||||||
# if clicked == QMessageBox.Yes:
|
@staticmethod
|
||||||
# iface.messageBar().pushSuccess('PgMetadata', tr(f'{n_invalid} invalid connection(s) removed.'))
|
def check_invalid_connection_names():
|
||||||
# store_connections(valid)
|
""" Check for invalid connection names in the QgsSettings. """
|
||||||
# if clicked == QMessageBox.No:
|
valid, invalid = validate_connections_names()
|
||||||
# iface.messageBar().pushInfo('PgMetadata', tr(f'Keeping {n_invalid} invalid connections.'))
|
n_invalid = len(invalid)
|
||||||
# '''
|
|
||||||
|
if n_invalid == 0:
|
||||||
|
return
|
||||||
|
|
||||||
|
invalid_text = ', '.join(invalid)
|
||||||
|
msg = QMessageBox()
|
||||||
|
msg.setIcon(QMessageBox.Warning)
|
||||||
|
msg.setWindowTitle(tr('PgMetadata: Database connection(s) not available'))
|
||||||
|
msg.setText(tr(
|
||||||
|
f'{n_invalid} connection(s) listed in PgMetadata’s settings are invalid or '
|
||||||
|
f'no longer available: {invalid_text}'))
|
||||||
|
msg.setInformativeText(tr(
|
||||||
|
'Do you want to remove these connection(s) from the PgMetadata settings? '
|
||||||
|
'(You can also do this later with the “Set Connections” tool.)'))
|
||||||
|
msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
|
||||||
|
clicked = msg.exec()
|
||||||
|
|
||||||
|
if clicked == QMessageBox.Yes:
|
||||||
|
iface.messageBar().pushSuccess('PgMetadata', tr(f'{n_invalid} invalid connection(s) removed.'))
|
||||||
|
store_connections(valid)
|
||||||
|
if clicked == QMessageBox.No:
|
||||||
|
iface.messageBar().pushInfo('PgMetadata', tr(f'Keeping {n_invalid} invalid connections.'))
|
||||||
|
'''
|
||||||
def open_about_dialog(self):
|
def open_about_dialog(self):
|
||||||
"""
|
"""
|
||||||
About dialog
|
About dialog
|
||||||
"""
|
"""
|
||||||
dialog = AutoMapAboutDialog(iface)
|
dialog = AboutDialog(iface)
|
||||||
dialog.exec_()
|
dialog.exec()
|
||||||
|
|
||||||
def open_help():
|
def open_help():
|
||||||
""" Open the online help. """
|
""" Open the online help. """
|
||||||
# QDesktopServices.openUrl(QUrl('https://plateformesig.CenIsere-outils.org/'))
|
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
||||||
|
|
||||||
def open_editor(self):
|
def open_editor(self):
|
||||||
self.canvas_editor.show()
|
self.canvas_editor.show()
|
||||||
@@ -128,7 +140,7 @@ class PgAutoMap:
|
|||||||
def unload(self):
|
def unload(self):
|
||||||
""" Unload the plugin. """
|
""" Unload the plugin. """
|
||||||
if self.canvas_editor:
|
if self.canvas_editor:
|
||||||
iface.removePluginMenu('CenIsere_AutoMap',self.automap_action)
|
iface.removePluginMenu('CenRa_AutoMap',self.automap_action)
|
||||||
|
|
||||||
if self.provider:
|
if self.provider:
|
||||||
QgsApplication.processingRegistry().removeProvider(self.provider)
|
QgsApplication.processingRegistry().removeProvider(self.provider)
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# CenRa_AutoMap
|
||||||
|
---
|
||||||
|
Outil de création de mise en page,
|
||||||
|
Permet de préprogramé des mise en page pour les mêtre à disposition des collégue.
|
||||||
|
|
||||||
|
> [Point de départ de création du plugin](https://github.com/CEN-Nouvelle-Aquitaine/MapCEN)
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
__copyright__ = "Copyright 2021, 3Liz"
|
||||||
|
__license__ = "GPL version 3"
|
||||||
|
__email__ = "info@3liz.org"
|
||||||
|
|
||||||
|
|
||||||
|
def classFactory(iface):
|
||||||
|
_ = iface
|
||||||
|
from CenRa_AUTOMAP.CenRa_AutoMap import PgAutoMap
|
||||||
|
return PgAutoMap()
|
||||||
@@ -12,12 +12,12 @@ ABOUT_FORM_CLASS, _ = uic.loadUiType(
|
|||||||
os.path.join(
|
os.path.join(
|
||||||
str(Path(__file__).resolve().parent),
|
str(Path(__file__).resolve().parent),
|
||||||
'tools/ui',
|
'tools/ui',
|
||||||
'CenIsere_AutoMap_about_form.ui'
|
'CenRa_about_form.ui'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class AutoMapAboutDialog(QDialog, ABOUT_FORM_CLASS):
|
class AboutDialog(QDialog, ABOUT_FORM_CLASS):
|
||||||
|
|
||||||
""" About - Let the user display the about dialog. """
|
""" About - Let the user display the about dialog. """
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ class AutoMapAboutDialog(QDialog, ABOUT_FORM_CLASS):
|
|||||||
self.iface = iface
|
self.iface = iface
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
self.viewer.setHtml(devlog('CenIsere_AUTOMAP'))
|
self.viewer.setHtml(devlog('CenRa_AUTOMAP'))
|
||||||
|
|
||||||
self.rejected.connect(self.onReject)
|
self.rejected.connect(self.onReject)
|
||||||
self.buttonBox.rejected.connect(self.onReject)
|
self.buttonBox.rejected.connect(self.onReject)
|
||||||
@@ -43,4 +43,4 @@ class AutoMapAboutDialog(QDialog, ABOUT_FORM_CLASS):
|
|||||||
Run some actions when
|
Run some actions when
|
||||||
the user closes the dialog
|
the user closes the dialog
|
||||||
"""
|
"""
|
||||||
self.close()
|
self.close()
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from PyQt5.QtCore import QSettings
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from functools import partial
|
from functools import partial
|
||||||
@@ -8,6 +8,7 @@ from pathlib import Path
|
|||||||
from xml.dom.minidom import parseString
|
from xml.dom.minidom import parseString
|
||||||
from qgis.gui import *
|
from qgis.gui import *
|
||||||
import qgis
|
import qgis
|
||||||
|
from importlib import import_module
|
||||||
from qgis.core import (
|
from qgis.core import (
|
||||||
NULL,
|
NULL,
|
||||||
QgsApplication,
|
QgsApplication,
|
||||||
@@ -43,10 +44,12 @@ from qgis.core import (
|
|||||||
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt
|
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt
|
||||||
from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie
|
from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie
|
||||||
from qgis.PyQt.QtPrintSupport import QPrinter
|
from qgis.PyQt.QtPrintSupport import QPrinter
|
||||||
from qgis.PyQt.QtWebKitWidgets import QWebPage
|
#from qgis.PyQt.QtWebKitWidgets import QWebPage
|
||||||
from qgis.PyQt.QtWidgets import (
|
from qgis.PyQt.QtWidgets import (
|
||||||
QDialog,
|
QDialog,
|
||||||
QAction,
|
QAction,
|
||||||
|
QMessageBox,
|
||||||
|
QPushButton,
|
||||||
QDockWidget,
|
QDockWidget,
|
||||||
QFileDialog,
|
QFileDialog,
|
||||||
QInputDialog,
|
QInputDialog,
|
||||||
@@ -56,49 +59,56 @@ from qgis.PyQt.QtWidgets import (
|
|||||||
QTableWidgetItem,
|
QTableWidgetItem,
|
||||||
QVBoxLayout,
|
QVBoxLayout,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from qgis.PyQt.QtCore import QSettings
|
||||||
|
from qgis.PyQt import QtGui
|
||||||
|
from qgis.PyQt import QtWidgets
|
||||||
|
|
||||||
|
|
||||||
from qgis.PyQt.QtXml import QDomDocument
|
from qgis.PyQt.QtXml import QDomDocument
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
import glob
|
import glob
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
resources_path,
|
||||||
# login_base,
|
|
||||||
send_issues,
|
send_issues,
|
||||||
)
|
)
|
||||||
from .tools.mises_en_pages.canvas import (fletch_canvas)
|
from .issues import CenRa_Issues
|
||||||
from .issues import CenIsere_Issues
|
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
||||||
EDITOR_CLASS = load_ui('CenIsere_AutoMap_base.ui')
|
EDITOR_CLASS = load_ui('CenRa_AutoMap_base.ui')
|
||||||
LOGGER = logging.getLogger('CenIsere_AutoMap')
|
LOGGER = logging.getLogger('CenRa_AutoMap')
|
||||||
url_osm = 'https://osm.datagrandest.fr/mapcache/?crs=EPSG:2154&featureCount=10&format=image/png&layers=pure&maxHeight=256&maxWidth=256&styles=&url=https://osm.datagrandest.fr/mapcache'
|
url_osm = 'https://osm.datagrandest.fr/mapcache/?crs=EPSG:2154&featureCount=10&format=image/png&layers=pure&maxHeight=256&maxWidth=256&styles=&url=https://osm.datagrandest.fr/mapcache'
|
||||||
url_ortho = 'http://tiles.craig.fr/ortho/service/?crs=EPSG:2154&featureCount=10&format=image/jpeg&layers=ortho&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/ortho/service'
|
url_ortho = 'http://tiles.craig.fr/ortho/service/?crs=EPSG:2154&featureCount=10&format=image/jpeg&layers=ortho&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/ortho/service'
|
||||||
url_mnt = 'http://tiles.craig.fr/mnt/crs=EPSG:2154&featureCount=10&format=image/png&layers=relief&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/mnt'
|
url_mnt = 'http://tiles.craig.fr/mnt/crs=EPSG:2154&featureCount=10&format=image/png&layers=relief&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/mnt'
|
||||||
url_pente = 'http://tiles.craig.fr/mnt/crs=EPSG:2154&featureCount=10&format=image/png&layers=pente&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/mnt'
|
url_pente = 'http://tiles.craig.fr/mnt/crs=EPSG:2154&featureCount=10&format=image/png&layers=pente&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/mnt'
|
||||||
data_source = [
|
data_source = [
|
||||||
'CEN Isère',
|
'CENRA',
|
||||||
'CEN-RA',
|
'IGN',
|
||||||
'IGN',
|
'CRAIG',
|
||||||
'CRAIG',
|
'OpenStreetMap',
|
||||||
'OpenStreetMap',
|
'Sandre',
|
||||||
'Sandre',
|
'BRGM',
|
||||||
'BRGM',
|
'MUSÉUM NATIONAL D’HISTOIRE NATURELLE',
|
||||||
'MUSÉUM NATIONAL D’HISTOIRE NATURELLE',
|
"Muséum national d'Histoire naturelle",
|
||||||
"Muséum national d'Histoire naturelle",
|
'ONF',
|
||||||
'ONF',
|
'20xx LPO',
|
||||||
'20xx LPO',
|
'ofb.gouv.fr',
|
||||||
'ofb.gouv.fr',
|
'Stamen Design',
|
||||||
'Stamen Design',
|
'MTES',
|
||||||
'MTES',
|
'MTES',
|
||||||
'MTES',
|
'FEDER',
|
||||||
'FEDER',
|
'DREAL Auvergne-Rhône-Alpes',
|
||||||
'DREAL Auvergne-Rhône-Alpes',
|
'INSEE',
|
||||||
'INSEE',
|
'DGFiP',
|
||||||
'DGFiP',
|
'Fédération des Conservatoires d’espaces naturels',
|
||||||
'Fédération des Conservatoires d’espaces naturels',
|
'Plan cadastral informatisé - Etalab - juillet 202X',
|
||||||
'Plan cadastral informatisé - Etalab - juillet 202X',
|
'Parcellaire Express - IGN - 202X',
|
||||||
'Parcellaire Express - IGN - 202X',
|
|
||||||
]
|
]
|
||||||
|
A4_size = {'Portrait':{'RIGHT':210,'LEFT':0,'TOP':0,'BOTTOM':297},'Landscape':{'RIGHT':297,'LEFT':0,'TOP':0,'BOTTOM':210}}
|
||||||
|
A3_size = {'Portrait':{'RIGHT':298,'LEFT':0,'TOP':0,'BOTTOM':420},'Landscape':{'RIGHT':420,'LEFT':0,'TOP':0,'BOTTOM':298}}
|
||||||
|
|
||||||
class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
@@ -107,6 +117,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.settings = QgsSettings()
|
self.settings = QgsSettings()
|
||||||
self.s = QSettings()
|
self.s = QSettings()
|
||||||
|
self.setWindowIcon(QtGui.QIcon(resources_path('icons','icon.png')))
|
||||||
|
|
||||||
path = ''
|
path = ''
|
||||||
ix = 0
|
ix = 0
|
||||||
@@ -114,8 +125,9 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
for i in plugin_dir[1:]:
|
for i in plugin_dir[1:]:
|
||||||
ix = ix+1
|
ix = ix+1
|
||||||
path = path+'/'+i
|
path = path+'/'+i
|
||||||
self.tabWidget.setStyleSheet('background-image: url('+path+'/tools/bg/Capture.png);')
|
#self.tabWidget.setStyleSheet('background-image: url('+path+'/tools/bg/Capture.png);')
|
||||||
|
|
||||||
|
self.verticalScrollBar.hide()
|
||||||
self.commandLinkButton.clicked.connect(self.chargement_qpt)
|
self.commandLinkButton.clicked.connect(self.chargement_qpt)
|
||||||
self.radioButton_9.clicked.connect(self.statu_atlas)
|
self.radioButton_9.clicked.connect(self.statu_atlas)
|
||||||
self.radioButton_10.clicked.connect(self.statu_source)
|
self.radioButton_10.clicked.connect(self.statu_source)
|
||||||
@@ -126,15 +138,13 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.commandLinkButton_2.clicked.connect(self.load_ortho)
|
self.commandLinkButton_2.clicked.connect(self.load_ortho)
|
||||||
self.commandLinkButton_3.clicked.connect(self.load_osm)
|
self.commandLinkButton_3.clicked.connect(self.load_osm)
|
||||||
self.CustomeLogo.clicked.connect(self.deflogoteck)
|
self.CustomeLogo.clicked.connect(self.deflogoteck)
|
||||||
|
self.verticalScrollBar.valueChanged.connect(self.moveFrame)
|
||||||
|
|
||||||
## On ajoute le nom des templates à la liste déroulante de l'onglet "mises en page" :
|
## On ajoute le nom des templates à la liste déroulante de l'onglet "mises en page" :
|
||||||
mises_en_page = []
|
mises_en_page = []
|
||||||
|
|
||||||
for filename in glob.glob(resources_path("mises_en_pages","*.qpt")):
|
for filename in glob.glob(resources_path("mises_en_pages","*.py")):
|
||||||
if filename.split("/")[-1] == "modele_carto.qpt":
|
|
||||||
continue
|
|
||||||
mises_en_page.append(filename)
|
mises_en_page.append(filename)
|
||||||
mises_en_page.sort()
|
|
||||||
|
|
||||||
|
|
||||||
for i, filename in enumerate(mises_en_page):
|
for i, filename in enumerate(mises_en_page):
|
||||||
@@ -143,32 +153,42 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.comboBox.setCurrentIndex(1)
|
self.comboBox.setCurrentIndex(1)
|
||||||
|
|
||||||
self.template_parameters = {
|
self.template_parameters = {
|
||||||
'map_size': None,
|
'Carte_size': None,
|
||||||
'map_position' : None,
|
'Carte_locals' : None,
|
||||||
'position_map_size' : None,
|
'Carte_rotate':None,
|
||||||
'position_map_position' : None,
|
'Carte_2_size' : None,
|
||||||
'title_position': None,
|
'Carte_2_locals' : None,
|
||||||
'title_size': None,
|
'Carte_2_rotate':None,
|
||||||
'subtitle_position': None,
|
'Legande_size': None,
|
||||||
'subtitle_size': None,
|
'Legande_locals': None,
|
||||||
'logo_position': None,
|
'Legande_rotate':None,
|
||||||
'logo_size': None,
|
'Arrow_size': None,
|
||||||
'legend_position': None,
|
'Arrow_locals': None,
|
||||||
'legend_size': None,
|
'Arrow_rotate':None,
|
||||||
'scalebarnumeric_position':None,
|
'Echelle_size': None,
|
||||||
'scalebarnumeric_size':None,
|
'Echelle_locals': None,
|
||||||
'scalebar_position': None,
|
'Echelle_rotate':None,
|
||||||
'scalebar_size': None,
|
'Logo_size': None,
|
||||||
'north_position': None,
|
'Logo_locals': None,
|
||||||
'north_size': None,
|
'Logo_rotate':None,
|
||||||
'credit_text_position': None,
|
'Titre_size':None,
|
||||||
'credit_text_size': None,
|
'Titre_locals':None,
|
||||||
'credit_text2_position': None,
|
'Titre_rotate':None,
|
||||||
'credit_text2_size': None,
|
'Sous_titre_size':None,
|
||||||
'image_size':None,
|
'Sous_titre_locals':None,
|
||||||
'image_position':None,
|
'Sous_titre_rotate':None,
|
||||||
'image_size_2':None,
|
'Credit_size': None,
|
||||||
'image_position_2':None,
|
'Credit_locals': None,
|
||||||
|
'Credit_rotate':None,
|
||||||
|
'Source_size': None,
|
||||||
|
'Source_locals': None,
|
||||||
|
'Source_rotate':None,
|
||||||
|
'Logo_2_size': None,
|
||||||
|
'Logo_2_locals': None,
|
||||||
|
'Logo_2_rotate': None,
|
||||||
|
'Echelle_2_size': None,
|
||||||
|
'Echelle_2_locals': None,
|
||||||
|
'Echelle_2_rotate': None,
|
||||||
# Add more variables as needed
|
# Add more variables as needed
|
||||||
}
|
}
|
||||||
self.update_logo_library()
|
self.update_logo_library()
|
||||||
@@ -178,6 +198,14 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.hide_source()
|
self.hide_source()
|
||||||
self.hide_atlas()
|
self.hide_atlas()
|
||||||
|
|
||||||
|
def wheelEvent(self,event):
|
||||||
|
if (event.angleDelta().y() >= 1):
|
||||||
|
vsb = self.verticalScrollBar.value()+20
|
||||||
|
else:
|
||||||
|
vsb = self.verticalScrollBar.value()-20
|
||||||
|
self.verticalScrollBar.setValue(vsb)
|
||||||
|
def moveFrame(self):
|
||||||
|
self.frame.move(self.frame.x(),self.verticalScrollBar.value())
|
||||||
def update_logo_library(self):
|
def update_logo_library(self):
|
||||||
self.mComboBox_4.clear()
|
self.mComboBox_4.clear()
|
||||||
logo_library = []
|
logo_library = []
|
||||||
@@ -185,9 +213,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
for l,logo_x in enumerate(custome_bibliotech):
|
for l,logo_x in enumerate(custome_bibliotech):
|
||||||
logo_library.append(' '+os.path.basename(logo_x))
|
logo_library.append(' '+os.path.basename(logo_x))
|
||||||
|
|
||||||
bibliotech_png = glob.glob(resources_path("logo_library","*.png"))
|
bibliotech = glob.glob(resources_path("logo_library","*.png"))
|
||||||
bibliotech_jpeg = glob.glob(resources_path("logo_library","*.jpg"))
|
|
||||||
bibliotech = [*bibliotech_png, *bibliotech_jpeg]
|
|
||||||
for l,logo_x in enumerate(bibliotech):
|
for l,logo_x in enumerate(bibliotech):
|
||||||
logo_library.append(os.path.basename(logo_x))
|
logo_library.append(os.path.basename(logo_x))
|
||||||
self.mComboBox_4.addItems(sorted(logo_library))
|
self.mComboBox_4.addItems(sorted(logo_library))
|
||||||
@@ -311,6 +337,8 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.comboBox_6.clear()
|
self.comboBox_6.clear()
|
||||||
self.comboBox_7.clear()
|
self.comboBox_7.clear()
|
||||||
|
|
||||||
|
if (self.s.value("automap/prenom_nom", "1", type=str) != "1"):
|
||||||
|
self.lineEdit_5.setText(self.s.value("automap/prenom_nom", 1, type=str))
|
||||||
couches = []
|
couches = []
|
||||||
couche_vecteur = ['']
|
couche_vecteur = ['']
|
||||||
mapThemes = ['']
|
mapThemes = ['']
|
||||||
@@ -424,9 +452,27 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
doc = QDomDocument()
|
doc = QDomDocument()
|
||||||
doc.setContent(template_content)
|
doc.setContent(template_content)
|
||||||
self.layout.loadFromTemplate(doc, QgsReadWriteContext(), True)
|
self.layout.loadFromTemplate(doc, QgsReadWriteContext(), True)
|
||||||
self.layout.setName(layout_name)
|
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
cutLayout = layout_name.index("¶")
|
||||||
|
except:
|
||||||
|
cutLayout = 0
|
||||||
|
|
||||||
|
if cutLayout >= 1:
|
||||||
|
self.layout.setName(layout_name)
|
||||||
|
titre_layout_name=layout_name[:cutLayout]
|
||||||
|
else:
|
||||||
|
self.layout.setName(layout_name)
|
||||||
|
titre_layout_name = layout_name
|
||||||
|
|
||||||
|
if self.radioButton_6.isChecked() and self.radioButton_7.isChecked():
|
||||||
|
logo_div = A4_size['Portrait']['RIGHT']
|
||||||
|
if self.radioButton_6.isChecked() and self.radioButton_8.isChecked():
|
||||||
|
logo_div = A4_size['Portrait']['BOTTOM']
|
||||||
|
if self.radioButton_5.isChecked() and self.radioButton_7.isChecked():
|
||||||
|
logo_div = A3_size['Portrait']['RIGHT']
|
||||||
|
if self.radioButton_5.isChecked() and self.radioButton_8.isChecked():
|
||||||
|
logo_div = A3_size['Portrait']['BOTTOM']
|
||||||
if True:#os.path.basename(filename) == "1. Modèle carto standard (consolidé).qpt":
|
if True:#os.path.basename(filename) == "1. Modèle carto standard (consolidé).qpt":
|
||||||
|
|
||||||
self.actualisation_mise_en_page()
|
self.actualisation_mise_en_page()
|
||||||
@@ -439,10 +485,10 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.map_modele_test.setExtent(iface.mapCanvas().extent())
|
self.map_modele_test.setExtent(iface.mapCanvas().extent())
|
||||||
# Position de la carte dans le composeur
|
# Position de la carte dans le composeur
|
||||||
|
|
||||||
self.map_modele_test.attemptMove(self.template_parameters['map_position'])
|
self.map_modele_test.setItemRotation(self.template_parameters['Carte_rotate'])
|
||||||
|
self.map_modele_test.attemptResize(self.template_parameters['Carte_size'])
|
||||||
|
self.map_modele_test.attemptMove(self.template_parameters['Carte_locals'])
|
||||||
# on dimensionne le rendu de la carte (pour référence la page totale est une page A4 donc 297*210)
|
# on dimensionne le rendu de la carte (pour référence la page totale est une page A4 donc 297*210)
|
||||||
self.map_modele_test.attemptResize(self.template_parameters['map_size'])
|
|
||||||
self.map_modele_test.setKeepLayerSet(True)
|
self.map_modele_test.setKeepLayerSet(True)
|
||||||
self.map_modele_test.setKeepLayerStyles(True)
|
self.map_modele_test.setKeepLayerStyles(True)
|
||||||
if self.radioButton_11.isChecked() == 1:
|
if self.radioButton_11.isChecked() == 1:
|
||||||
@@ -456,63 +502,45 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.position_map.setExtent(QgsRectangle(641552,6647386, 995856,6331104))
|
self.position_map.setExtent(QgsRectangle(641552,6647386, 995856,6331104))
|
||||||
self.position_map.setFollowVisibilityPreset(True)
|
self.position_map.setFollowVisibilityPreset(True)
|
||||||
self.position_map.setFollowVisibilityPresetName(self.comboBox_6.currentText())
|
self.position_map.setFollowVisibilityPresetName(self.comboBox_6.currentText())
|
||||||
self.position_map.attemptMove(self.template_parameters['position_map_position'])
|
self.position_map.setItemRotation(self.template_parameters['Carte_2_rotate'])
|
||||||
self.position_map.attemptResize(self.template_parameters['position_map_size'])
|
self.position_map.attemptResize(self.template_parameters['Carte_2_size'])
|
||||||
overviewitem = QgsLayoutItemMapOverviewStack(self.position_map)
|
self.position_map.attemptMove(self.template_parameters['Carte_2_locals'])
|
||||||
map_overview = self.position_map.overview()
|
self.position_map.overview().setLinkedMap(self.map_modele_test)
|
||||||
map_overview.setLinkedMap(self.map_modele_test)
|
#overviewitem = QgsLayoutItemMapOverviewStack(self.position_map)
|
||||||
map_overview.setCentered(True)
|
#map_overview = self.position_map.overview()
|
||||||
overviewitem.addOverview(map_overview)
|
#map_overview.setLinkedMap(self.map_modele_test)
|
||||||
|
#map_overview.setCentered(True)
|
||||||
|
#overviewitem.addOverview(map_overview)
|
||||||
|
|
||||||
self.position_map.refresh()
|
self.position_map.refresh()
|
||||||
self.map_modele_test.setFrameEnabled(False)
|
self.map_modele_test.setFrameEnabled(True)
|
||||||
self.layout.addLayoutItem(self.position_map)
|
self.layout.addLayoutItem(self.position_map)
|
||||||
self.position_map.setId("carte_position")
|
self.position_map.setId("Carte_locals")
|
||||||
self.map_modele_test.refresh()
|
self.map_modele_test.refresh()
|
||||||
|
|
||||||
self.map_modele_test.setBackgroundColor(QColor(255, 255, 255, 255))
|
self.map_modele_test.setBackgroundColor(QColor(255, 255, 255, 255))
|
||||||
|
self.map_modele_test.setFrameEnabled(True)
|
||||||
self.map_modele_test.setFrameEnabled(False)
|
|
||||||
|
|
||||||
if self.radioButton_9.isChecked() == 1:
|
if self.radioButton_9.isChecked() == 1:
|
||||||
self.map_modele_test.setAtlasDriven(True)
|
self.map_modele_test.setAtlasDriven(True)
|
||||||
self.layout.addLayoutItem(self.map_modele_test)
|
self.layout.addLayoutItem(self.map_modele_test)
|
||||||
self.map_modele_test.setId("carte_principale")
|
self.map_modele_test.setId("carte_principale")
|
||||||
|
|
||||||
if self.comboBox.currentText() == "3. Modèle carto standard Cen Isere.qpt":
|
|
||||||
# Ajout de la vague haute
|
|
||||||
image1 = QgsLayoutItemPicture(self.layout)
|
|
||||||
image1.setPicturePath(resources_path("mises_en_pages","vague.png"))
|
|
||||||
image1.attemptMove(self.template_parameters['image_position'])
|
|
||||||
image1.attemptResize(self.template_parameters['image_size'])
|
|
||||||
self.layout.addLayoutItem(image1)
|
|
||||||
image1.setMode(QgsLayoutItemPicture.FormatRaster)
|
|
||||||
|
|
||||||
# Ajout de la vague basse
|
|
||||||
image2 = QgsLayoutItemPicture(self.layout)
|
|
||||||
image2.setPicturePath(resources_path("mises_en_pages","vague2.png"))
|
|
||||||
image2.attemptMove(self.template_parameters['image_position_2'])
|
|
||||||
image2.attemptResize(self.template_parameters['image_size_2'])
|
|
||||||
self.layout.addLayoutItem(image2)
|
|
||||||
image2.setMode(QgsLayoutItemPicture.FormatRaster)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Ajout d'un titre à la mise en page
|
## Ajout d'un titre à la mise en page
|
||||||
title = QgsLayoutItemLabel(self.layout)
|
title = QgsLayoutItemLabel(self.layout)
|
||||||
self.layout.addLayoutItem(title)
|
self.layout.addLayoutItem(title)
|
||||||
titre = layout_name
|
titre = titre_layout_name
|
||||||
title.setText(titre)
|
title.setText(titre)
|
||||||
title.setFont(QFont("Museo 700", 15, QFont.Bold))
|
title.setFont(QFont("Calibri", 15, False))
|
||||||
title.setFontColor(QColor(62, 62, 62, 24))
|
title.setItemRotation(self.template_parameters['Titre_rotate'])
|
||||||
title.attemptMove(self.template_parameters['title_position'])
|
title.attemptResize(self.template_parameters['Titre_size'])
|
||||||
title.attemptResize(self.template_parameters['title_size'])
|
title.attemptMove(self.template_parameters['Titre_locals'])
|
||||||
|
|
||||||
title.setBackgroundEnabled(True)
|
title.setBackgroundEnabled(True)
|
||||||
title.setBackgroundColor(QColor(255, 255, 255, 130))
|
title.setBackgroundColor(QColor(255, 255, 255, 130))
|
||||||
self.layout.addItem(title)
|
self.layout.addItem(title)
|
||||||
# title.adjustSizeToText() on n'utilise plutot setFixedSize pour pouvoir centrer le titre de manière plus optimale ici
|
# title.adjustSizeToText() on n'utilise plutot setFixedSize pour pouvoir centrer le titre de manière plus optimale ici
|
||||||
title.setHAlign(Qt.AlignHCenter)
|
title.setHAlign(Qt.AlignmentFlag(0x0004))
|
||||||
title.setVAlign(Qt.AlignVCenter)
|
title.setVAlign(Qt.AlignmentFlag(0x0080))
|
||||||
|
|
||||||
|
|
||||||
## Ajout d'un sous titre à la mise en page
|
## Ajout d'un sous titre à la mise en page
|
||||||
@@ -523,24 +551,25 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
titre = titre + ' [%' + self.comboBox_4.currentText() + '%]'
|
titre = titre + ' [%' + self.comboBox_4.currentText() + '%]'
|
||||||
subtitle.setText(titre)
|
subtitle.setText(titre)
|
||||||
subtitle.setFont(QFont("Calibri", 10))
|
subtitle.setFont(QFont("Calibri", 10))
|
||||||
subtitle.setFontColor(QColor(0, 69, 148, 58))
|
subtitle.setItemRotation(self.template_parameters['Sous_titre_rotate'])
|
||||||
subtitle.attemptMove(self.template_parameters['subtitle_position'])
|
subtitle.attemptResize(self.template_parameters['Sous_titre_size'])
|
||||||
subtitle.attemptResize(self.template_parameters['subtitle_size'])
|
subtitle.attemptMove(self.template_parameters['Sous_titre_locals'])
|
||||||
subtitle.setId("SubTitle")
|
subtitle.setId("SubTitle")
|
||||||
subtitle.setBackgroundEnabled(True)
|
subtitle.setBackgroundEnabled(True)
|
||||||
subtitle.setBackgroundColor(QColor(255, 255, 255, 130))
|
subtitle.setBackgroundColor(QColor(255, 255, 255, 130))
|
||||||
self.layout.addItem(subtitle)
|
self.layout.addItem(subtitle)
|
||||||
subtitle.setHAlign(Qt.AlignHCenter)
|
subtitle.setHAlign(Qt.AlignmentFlag(0x0004))
|
||||||
subtitle.setVAlign(Qt.AlignVCenter)
|
subtitle.setVAlign(Qt.AlignmentFlag(0x0080))
|
||||||
|
|
||||||
|
|
||||||
## Ajout du logo CEN NA en haut à gauche de la page
|
## Ajout du logo CEN NA en haut à gauche de la page
|
||||||
logo = QgsLayoutItemPicture(self.layout)
|
logo = QgsLayoutItemPicture(self.layout)
|
||||||
logo.setResizeMode(QgsLayoutItemPicture.Zoom)
|
logo.setResizeMode(QgsLayoutItemPicture.Zoom)
|
||||||
logo.setMode(QgsLayoutItemPicture.FormatRaster)
|
logo.setMode(QgsLayoutItemPicture.FormatRaster)
|
||||||
logo.attemptMove(self.template_parameters['logo_position'])
|
logo.setItemRotation(self.template_parameters['Logo_rotate'])
|
||||||
logo.setFixedSize(self.template_parameters['logo_size'])
|
logo.setFixedSize(self.template_parameters['Logo_size'])
|
||||||
logo.setPicturePath(resources_path("icons","CEN38.jpg"))
|
logo.attemptMove(self.template_parameters['Logo_locals'])
|
||||||
|
logo.setPicturePath(resources_path("icons","CEN_RA.png"))
|
||||||
logo.setId('logo')
|
logo.setId('logo')
|
||||||
self.layout.addLayoutItem(logo)
|
self.layout.addLayoutItem(logo)
|
||||||
|
|
||||||
@@ -590,7 +619,8 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
layertreelayer = root.findLayer(layer.id())
|
layertreelayer = root.findLayer(layer.id())
|
||||||
|
|
||||||
# get the parent of the layer tree layer (layer tree root, or group)
|
# get the parent of the layer tree layer (layer tree root, or group)
|
||||||
parent = layertreelayer.parent()
|
if layertreelayer != None:
|
||||||
|
parent = layertreelayer.parent()
|
||||||
|
|
||||||
# if the parent is a group and has a name, find it and remove the layer
|
# if the parent is a group and has a name, find it and remove the layer
|
||||||
if isinstance(parent, QgsLayerTreeGroup) and parent.name():
|
if isinstance(parent, QgsLayerTreeGroup) and parent.name():
|
||||||
@@ -604,14 +634,9 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
legend.setEqualColumnWidth(True)
|
legend.setEqualColumnWidth(True)
|
||||||
legend.setSplitLayer(True)
|
legend.setSplitLayer(True)
|
||||||
legend.setColumnSpace(5)
|
legend.setColumnSpace(5)
|
||||||
legend.setTitle('Légende')
|
|
||||||
legend.rstyle(QgsLegendStyle.Title).setMargin(1.5) # 1 mm
|
legend.rstyle(QgsLegendStyle.Title).setMargin(1.5) # 1 mm
|
||||||
legend.rstyle(QgsLegendStyle.Title).setFont(QFont("Calibri", 12,QFont.Bold))
|
|
||||||
legend.rstyle(QgsLegendStyle.Group).setMargin(QgsLegendStyle.Top, 3)
|
legend.rstyle(QgsLegendStyle.Group).setMargin(QgsLegendStyle.Top, 3)
|
||||||
legend.rstyle(QgsLegendStyle.Group).setFont(QFont("Calibri", 10))
|
|
||||||
legend.rstyle(QgsLegendStyle.Subgroup).setMargin(QgsLegendStyle.Top, 3)
|
legend.rstyle(QgsLegendStyle.Subgroup).setMargin(QgsLegendStyle.Top, 3)
|
||||||
legend.rstyle(QgsLegendStyle.Subgroup).setFont(QFont("Calibri", 10,QFont.Bold))
|
|
||||||
legend.rstyle(QgsLegendStyle.SymbolLabel).setFont(QFont("Calibri", 10))
|
|
||||||
legend.setColumnCount(self.spinBox.value())
|
legend.setColumnCount(self.spinBox.value())
|
||||||
|
|
||||||
legend.adjustBoxSize()
|
legend.adjustBoxSize()
|
||||||
@@ -620,8 +645,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.layout.refresh()
|
self.layout.refresh()
|
||||||
|
|
||||||
legend.updateLegend()
|
legend.updateLegend()
|
||||||
legend.attemptMove(self.template_parameters['legend_position'])
|
legend.attemptMove(self.template_parameters['Legande_locals'])
|
||||||
|
|
||||||
|
|
||||||
## Ajout de l'échelle numeric à la mise en page
|
## Ajout de l'échelle numeric à la mise en page
|
||||||
self.scalebarnumeric_qpt = QgsLayoutItemScaleBar(self.layout)
|
self.scalebarnumeric_qpt = QgsLayoutItemScaleBar(self.layout)
|
||||||
@@ -633,10 +657,11 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.scalebarnumeric_qpt.setNumberOfSegments(2)
|
self.scalebarnumeric_qpt.setNumberOfSegments(2)
|
||||||
self.scalebarnumeric_qpt.setNumberOfSegmentsLeft(0)
|
self.scalebarnumeric_qpt.setNumberOfSegmentsLeft(0)
|
||||||
|
|
||||||
self.scalebarnumeric_qpt.attemptMove(self.template_parameters['scalebarnumeric_position'])
|
self.scalebarnumeric_qpt.setFont(QFont("Calibri", 12))
|
||||||
self.scalebarnumeric_qpt.attemptResize(self.template_parameters['scalebarnumeric_size'])
|
self.scalebarnumeric_qpt.attemptMove(self.template_parameters['Echelle_locals'])
|
||||||
|
self.scalebarnumeric_qpt.attemptResize(self.template_parameters['Echelle_size'])
|
||||||
|
self.scalebarnumeric_qpt.setItemRotation(self.template_parameters['Echelle_rotate'])
|
||||||
self.scalebarnumeric_qpt.setAlignment(QgsScaleBarSettings.Alignment(1))
|
self.scalebarnumeric_qpt.setAlignment(QgsScaleBarSettings.Alignment(1))
|
||||||
self.scalebarnumeric_qpt.setFont(QFont("Calibri", 10))
|
|
||||||
self.scalebarnumeric_qpt.setBackgroundEnabled(True)
|
self.scalebarnumeric_qpt.setBackgroundEnabled(True)
|
||||||
self.scalebarnumeric_qpt.setBackgroundColor(QColor(255, 255, 255, 130))
|
self.scalebarnumeric_qpt.setBackgroundColor(QColor(255, 255, 255, 130))
|
||||||
|
|
||||||
@@ -652,10 +677,11 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.scalebar_qpt.setNumberOfSegments(2)
|
self.scalebar_qpt.setNumberOfSegments(2)
|
||||||
self.scalebar_qpt.setNumberOfSegmentsLeft(0)
|
self.scalebar_qpt.setNumberOfSegmentsLeft(0)
|
||||||
|
|
||||||
self.scalebar_qpt.attemptMove(self.template_parameters['scalebar_position'])
|
self.scalebar_qpt.setFont(QFont("Calibri", 12))
|
||||||
self.scalebar_qpt.attemptResize(self.template_parameters['scalebar_size'])
|
self.scalebar_qpt.attemptMove(self.template_parameters['Echelle_2_locals'])
|
||||||
|
self.scalebar_qpt.attemptResize(self.template_parameters['Echelle_2_size'])
|
||||||
|
self.scalebar_qpt.setItemRotation(self.template_parameters['Echelle_2_rotate'])
|
||||||
self.scalebar_qpt.setAlignment(QgsScaleBarSettings.Alignment(1))
|
self.scalebar_qpt.setAlignment(QgsScaleBarSettings.Alignment(1))
|
||||||
self.scalebar_qpt.setFont(QFont("Calibri", 10))
|
|
||||||
self.scalebar_qpt.setBackgroundEnabled(True)
|
self.scalebar_qpt.setBackgroundEnabled(True)
|
||||||
self.scalebar_qpt.setBackgroundColor(QColor(255, 255, 255, 130))
|
self.scalebar_qpt.setBackgroundColor(QColor(255, 255, 255, 130))
|
||||||
|
|
||||||
@@ -666,46 +692,62 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
north = QgsLayoutItemPicture(self.layout)
|
north = QgsLayoutItemPicture(self.layout)
|
||||||
north.setPicturePath(resources_path("mises_en_pages","NorthArrow_02.svg"))
|
north.setPicturePath(resources_path("mises_en_pages","NorthArrow_02.svg"))
|
||||||
self.layout.addLayoutItem(north)
|
self.layout.addLayoutItem(north)
|
||||||
north.attemptMove(self.template_parameters['north_position'])
|
north.attemptMove(self.template_parameters['Arrow_locals'])
|
||||||
north.attemptResize(self.template_parameters['north_size'])
|
north.attemptResize(self.template_parameters['Arrow_size'])
|
||||||
|
north.setItemRotation(self.template_parameters['Arrow_rotate'])
|
||||||
|
north.setBackgroundEnabled(True)
|
||||||
|
north.setBackgroundColor(QColor(255, 255, 255, 130))
|
||||||
|
|
||||||
if self.radioButton_10.isChecked() == 1:
|
if self.radioButton_10.isChecked() == 1:
|
||||||
info_text = ["Source : ©" + ', ©'.join(self.mComboBox_3.checkedItems())][0]
|
text_source = ' '
|
||||||
|
for Item_mComboBox_3 in self.mComboBox_3.checkedItems():
|
||||||
|
text_source = text_source+Item_mComboBox_3+','
|
||||||
|
text_source = text_source[:-1]
|
||||||
|
info_text = ["Source :" + text_source][0]
|
||||||
else:
|
else:
|
||||||
info_text = ["Source : ©" + self.lineEdit_4.text()][0]
|
info_text = ["Source : " + self.lineEdit_4.text()][0]
|
||||||
# ajout note info:
|
# ajout note info:
|
||||||
info = ["Réalisation : " + "CEN Isère (" + date.today().strftime(
|
if self.radioButton_14.isChecked() == 1:
|
||||||
"%d/%m/%Y") + ")"]
|
self.s.setValue("automap/prenom_nom",self.lineEdit_5.text())
|
||||||
|
prenom_nom = self.s.value("automap/prenom_nom", 1, type=str)
|
||||||
|
info = ["Réalisation : " + "CEN Rhône-Alpes (" + date.today().strftime("%d/%m/%Y") + ") par "+prenom_nom]
|
||||||
|
else:
|
||||||
|
info = ["Réalisation : " + "CEN Rhône-Alpes (" + date.today().strftime("%d/%m/%Y") + ")"]
|
||||||
credit_text = QgsLayoutItemLabel(self.layout)
|
credit_text = QgsLayoutItemLabel(self.layout)
|
||||||
credit_text.setText(info[0])
|
credit_text.setText(info[0])
|
||||||
credit_text.setFont(QFont("Calibri", 9))
|
credit_text.setFont(QFont("Calibri", 9))
|
||||||
credit_text.setHAlign(Qt.AlignRight)
|
credit_text.setHAlign(Qt.AlignmentFlag(0x0002))
|
||||||
credit_text.setVAlign(Qt.AlignVCenter)
|
credit_text.setVAlign(Qt.AlignmentFlag(0x0080))
|
||||||
credit_text.setItemRotation(-90)
|
|
||||||
credit_text.setBackgroundEnabled(True)
|
credit_text.setBackgroundEnabled(True)
|
||||||
credit_text.setBackgroundColor(QColor(255, 255, 255, 30))
|
credit_text.setBackgroundColor(QColor(255, 255, 255, 130))
|
||||||
credit_text2 = QgsLayoutItemLabel(self.layout)
|
credit_text2 = QgsLayoutItemLabel(self.layout)
|
||||||
credit_text2.setText(info_text)
|
credit_text2.setText(info_text)
|
||||||
credit_text2.setFont(QFont("Calibri", 9))
|
credit_text2.setFont(QFont("Calibri", 9))
|
||||||
credit_text2.setHAlign(Qt.AlignRight)
|
credit_text2.setHAlign(Qt.AlignmentFlag(0x0002))
|
||||||
credit_text2.setVAlign(Qt.AlignVCenter)
|
credit_text2.setVAlign(Qt.AlignmentFlag(0x0080))
|
||||||
credit_text.attemptMove(self.template_parameters['credit_text_position'])
|
credit_text.setItemRotation(self.template_parameters['Credit_rotate'])
|
||||||
credit_text.attemptResize(self.template_parameters['credit_text_size'])
|
credit_text.attemptResize(self.template_parameters['Credit_size'])
|
||||||
credit_text2.attemptMove(self.template_parameters['credit_text2_position'])
|
credit_text.attemptMove(self.template_parameters['Credit_locals'])
|
||||||
credit_text2.attemptResize(self.template_parameters['credit_text2_size'])
|
credit_text2.setItemRotation(self.template_parameters['Source_rotate'])
|
||||||
|
credit_text2.attemptResize(self.template_parameters['Source_size'])
|
||||||
|
credit_text2.attemptMove(self.template_parameters['Source_locals'])
|
||||||
|
credit_text2.setBackgroundEnabled(True)
|
||||||
|
credit_text2.setBackgroundColor(QColor(255, 255, 255, 130))
|
||||||
self.layout.addLayoutItem(credit_text)
|
self.layout.addLayoutItem(credit_text)
|
||||||
self.layout.addLayoutItem(credit_text2)
|
self.layout.addLayoutItem(credit_text2)
|
||||||
|
|
||||||
## Ajout du logo credit en bas à droit de la page
|
## Ajout du logo credit en bas à droit de la page
|
||||||
|
len_item = (len(self.mComboBox_4.checkedItems()))
|
||||||
for logo_run in self.mComboBox_4.checkedItems():
|
for logo_run in self.mComboBox_4.checkedItems():
|
||||||
logo_credit = QgsLayoutItemPicture(self.layout)
|
logo_credit = QgsLayoutItemPicture(self.layout)
|
||||||
logo_credit.setResizeMode(QgsLayoutItemPicture.Zoom)
|
logo_credit.setResizeMode(QgsLayoutItemPicture.Zoom)
|
||||||
logo_credit.setMode(QgsLayoutItemPicture.FormatRaster)
|
logo_credit.setMode(QgsLayoutItemPicture.FormatRaster)
|
||||||
cur_x = self.template_parameters['logo_credit_position'].x()
|
cur_x = self.template_parameters['Logo_2_locals'].x()
|
||||||
logo_credit.attemptMove(self.template_parameters['logo_credit_position'])
|
logo_credit.attemptMove(self.template_parameters['Logo_2_locals'])
|
||||||
logo_credit.setPictureAnchor(4)
|
print(logo_credit.pictureAnchor())
|
||||||
self.template_parameters['logo_credit_position'].setX(cur_x+51)
|
#logo_credit.setPictureAnchor(4)
|
||||||
logo_credit.setFixedSize(self.template_parameters['logo_credit_size'])
|
self.template_parameters['Logo_2_locals'].setX(cur_x+(logo_div/len_item))
|
||||||
|
logo_credit.setFixedSize(self.template_parameters['Logo_2_size'])
|
||||||
if logo_run[0] == ' ':
|
if logo_run[0] == ' ':
|
||||||
logo_credit.setPicturePath(self.s.value("automap/logoteck", 1, type=str)+logo_run[1:])
|
logo_credit.setPicturePath(self.s.value("automap/logoteck", 1, type=str)+logo_run[1:])
|
||||||
else:
|
else:
|
||||||
@@ -721,10 +763,34 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
existing_layout = project.layoutManager().layoutByName(self.layout.name())
|
existing_layout = project.layoutManager().layoutByName(self.layout.name())
|
||||||
if existing_layout:
|
if existing_layout:
|
||||||
if self.radioButton_12.isChecked() != 1:
|
self.QMBquestion = QMessageBox()
|
||||||
project.layoutManager().removeLayout(existing_layout)
|
self.QMBquestion.setWindowTitle(u"Attention !")
|
||||||
|
self.QMBquestion.setIcon(QMessageBox.Icon.Warning)
|
||||||
|
self.QMBquestion.setText("Mise en page existante, la mise en page va être écrasée !")
|
||||||
|
self.QMBquestion.setStandardButtons(QMessageBox.StandardButton(0x00004000)|QMessageBox.StandardButton(0x00010000))
|
||||||
|
self.QMBquestion.addButton(QPushButton('Autre mise en page'),QMessageBox.ButtonRole(0))
|
||||||
|
self.QMBquestion = self.QMBquestion.exec()
|
||||||
|
|
||||||
result = project.layoutManager().addLayout(self.layout)
|
#if self.radioButton_12.isChecked() != 1:
|
||||||
|
if self.QMBquestion == QMessageBox.StandardButton(0x00004000):
|
||||||
|
project.layoutManager().removeLayout(existing_layout)
|
||||||
|
result = project.layoutManager().addLayout(self.layout)
|
||||||
|
elif self.QMBquestion != QMessageBox.StandardButton(0x00010000):
|
||||||
|
LayoutCOUNT=0
|
||||||
|
arrayManager = []
|
||||||
|
for AddArrayManager in project.layoutManager().layouts():
|
||||||
|
arrayManager.append(AddArrayManager.name())
|
||||||
|
arrayManager.sort()
|
||||||
|
for LayoutNAME in arrayManager:
|
||||||
|
if LayoutNAME == layout_name:
|
||||||
|
LayoutCOUNT = LayoutCOUNT+1
|
||||||
|
if LayoutNAME == layout_name+"¶"+str(LayoutCOUNT):
|
||||||
|
LayoutCOUNT=LayoutCOUNT+1
|
||||||
|
layout_name = (layout_name+"¶"+str(LayoutCOUNT))
|
||||||
|
self.layout.setName(layout_name)
|
||||||
|
|
||||||
|
else:
|
||||||
|
existing_layout = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -737,14 +803,24 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
fichier_mise_en_page = layout_name
|
fichier_mise_en_page = layout_name
|
||||||
layout_modifie = QgsProject.instance().layoutManager().layoutByName(fichier_mise_en_page)
|
layout_modifie = QgsProject.instance().layoutManager().layoutByName(fichier_mise_en_page)
|
||||||
iface.openLayoutDesigner(layout_modifie)
|
try:
|
||||||
self.close()
|
if (self.QMBquestion == QMessageBox.AcceptRole):
|
||||||
|
TryMessage = (self.QMBquestion == QMessageBox.AcceptRole)
|
||||||
|
elif (self.QMBquestion == QMessageBox.Yes):
|
||||||
|
TryMessage = (self.QMBquestion == QMessageBox.Yes)
|
||||||
|
else:
|
||||||
|
TryMessage = False
|
||||||
|
del self.QMBquestion
|
||||||
|
except:
|
||||||
|
TryMessage = True
|
||||||
|
|
||||||
|
if TryMessage == True:
|
||||||
|
iface.openLayoutDesigner(layout_modifie)
|
||||||
|
self.close()
|
||||||
|
else:
|
||||||
|
self.activateWindow()
|
||||||
|
|
||||||
def actualisation_mise_en_page(self):
|
def actualisation_mise_en_page(self):
|
||||||
|
|
||||||
A4_size = {'Portrait':{'RIGHT':210,'LEFT':0,'TOP':0,'BOTTOM':297},'Landscape':{'RIGHT':297,'LEFT':0,'TOP':0,'BOTTOM':210}}
|
|
||||||
A3_size = {'Portrait':{'RIGHT':298,'LEFT':0,'TOP':0,'BOTTOM':420},'Landscape':{'RIGHT':420,'LEFT':0,'TOP':0,'BOTTOM':298}}
|
|
||||||
|
|
||||||
values_page = self.comboBox.currentText()
|
values_page = self.comboBox.currentText()
|
||||||
|
|
||||||
if self.radioButton_6.isChecked() and self.radioButton_7.isChecked():
|
if self.radioButton_6.isChecked() and self.radioButton_7.isChecked():
|
||||||
@@ -763,18 +839,20 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
pc = self.layout.pageCollection()
|
pc = self.layout.pageCollection()
|
||||||
pc.pages()[0].setPageSize('A3', QgsLayoutItemPage.Landscape)
|
pc.pages()[0].setPageSize('A3', QgsLayoutItemPage.Landscape)
|
||||||
|
|
||||||
self.template_parameters = fletch_canvas(self,values_page)
|
values_page_import = values_page[:-3]
|
||||||
|
eval("exec('from .tools.mises_en_pages import '+values_page_import)")
|
||||||
|
eval("exec('self.template_parameters = '+ values_page_import + '.fletch_canvas(self)')")
|
||||||
|
|
||||||
def bar_echelle_auto(self, echelle, bar_echelle):
|
def bar_echelle_auto(self, echelle, bar_echelle):
|
||||||
|
|
||||||
if True:
|
if True:
|
||||||
if echelle.scale() >= 20000:
|
if echelle.scale() >= 40000:
|
||||||
bar_echelle.setUnits(QgsUnitTypes.DistanceKilometers)
|
bar_echelle.setUnits(QgsUnitTypes.DistanceKilometers)
|
||||||
bar_echelle.setUnitLabel("km")
|
bar_echelle.setUnitLabel("km")
|
||||||
bar_echelle.setUnitsPerSegment(round((echelle.scale()*0.02)/1000))
|
bar_echelle.setUnitsPerSegment(round((echelle.scale()*0.04)/1000))
|
||||||
else:
|
else:
|
||||||
bar_echelle.setUnits(QgsUnitTypes.DistanceMeters)
|
bar_echelle.setUnits(QgsUnitTypes.DistanceMeters)
|
||||||
bar_echelle.setUnitLabel("m")
|
bar_echelle.setUnitLabel("m")
|
||||||
bar_echelle.setUnitsPerSegment(round(echelle.scale()*0.02))
|
bar_echelle.setUnitsPerSegment(round(echelle.scale()*0.04))
|
||||||
|
|
||||||
bar_echelle.update()
|
bar_echelle.update()
|
||||||
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
@@ -0,0 +1,49 @@
|
|||||||
|
# This file contains metadata for your plugin.
|
||||||
|
|
||||||
|
# This file should be included when you package your plugin.# Mandatory items:
|
||||||
|
|
||||||
|
[general]
|
||||||
|
name=CenRa_AutoMap
|
||||||
|
qgisMinimumVersion=3.0
|
||||||
|
supportsQt6=True
|
||||||
|
description=CenRa_AutoMap
|
||||||
|
version=2.0
|
||||||
|
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||||
|
email=si_besoin@cen-rhonealpes.fr
|
||||||
|
|
||||||
|
about=Outils de création de mise en page prédéfinis pour simplifier et organiser cette étape.
|
||||||
|
|
||||||
|
repository=https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS
|
||||||
|
homepage=https://plateformesig.cenra-outils.org/
|
||||||
|
tracker=https://gitea.cenra-outils.org/api/v1/repos/CEN-RA/Plugin_QGIS/issues
|
||||||
|
# End of mandatory metadata
|
||||||
|
|
||||||
|
# Recommended items:
|
||||||
|
|
||||||
|
hasProcessingProvider=no
|
||||||
|
# Uncomment the following line and add your changelog:
|
||||||
|
changelog=<h2>CenRa_AUTOMAP:</h2></br><p><h3>19/05/2025 - Version 2.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>11/04/2025 - Version 1.7: </h3> - Correctif d'orthographe.</p></br><p><h3>09/04/2025 - Version 1.6: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 1.5: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 1.4: </h3> - Mise a jour de securite.</p></br><p><h3>20/03/2025 - Version 1.3: </h3> - Fenêtre redimensionnable avec déplaçable avec la mollette sourit.</p></br><p><h3>25/02/2025 - Version 1.2: </h3> - DockWidget pour ouverture de couche avec theme.</p></br><p><h3>28/01/2025 - Version 1.1: </h3> - Multi-Composeur pris en charge.</p></br><p><h3>27/01/2025 - Version 1.0: </h3> - Version releases.</br> - Ajoute un message d'avertissement au moment d'écraser la mise en page.</br> - Ajoute prénom et nom dans la réalisation.</br> - Utilisation de Calibri.</p></br><p><h3>13/01/2025 - Version 0.1.10: </h3> - Correctif.</p></br><p><h3>07/01/2025 - Version 0.1.9: </h3> - ByPass du certif ssl ci erreur.</p></br><p><h3>19/12/2024 - Version 0.1.8: </h3> - Nouvelle mise en page.</br> - Incrémentation automatique de nouveau modele de mise en page. </br> - Correctif de bug.</p></br><p><h3>21/10/2024 - Version 0.1.7: </h3> - Epurations du code.</p></br><p><h3>07/10/2024 - Version 0.1.6: </h3> - Option de bibliotheque de logo custome.</p></br><p><h3>03/10/2024 - Version 0.1.5: </h3> - Remonte la fênetre dans la pille.</br> - Gestion du nombre de colonne dans la légend.</br></p></br><p><h3>02/10/2024 - Version 0.1.4: </h3> - Mise en page plein écrant.</br></p></br><p><h3>01/10/2024 - Version 0.1.3: </h3> - Récupération du titre et sous-titre pour mise en page existente.</br> - Integration de bibliotheque de logo.</br> - Integration de gestionaire pour les source de donnée.</br> - Mise en place d'une bar d'echelle adaptative. </br></p></br><p><h3>30/09/2024 - Version 0.1.2: </h3> - Activation du thème. </br> - Ajouter une carte de suivie. </br><p></br><h3>27/09/2024 - Version 0.1.1: </h3> - Ajout d'une liste déroulante pour les sources de données. </br>- Bouton pour ajouter des fonts de carte customisés. </br>- Fonctionnalité de génération d'atlas. </p></br><p><h3>26/09/2024 - Version 0.1.0: </h3> - Lancement du plugin CenRa_AutoMap avec une seul mise en page. </p></br>
|
||||||
|
|
||||||
|
# Tags are comma separated with spaces allowed
|
||||||
|
tags=python
|
||||||
|
|
||||||
|
|
||||||
|
category=Plugins
|
||||||
|
icon=icon.png
|
||||||
|
# experimental flag
|
||||||
|
experimental=False
|
||||||
|
|
||||||
|
# deprecated flag (applies to the whole plugin, not just a single version)
|
||||||
|
deprecated=False
|
||||||
|
|
||||||
|
# Since QGIS 3.8, a comma separated list of plugins to be installed
|
||||||
|
# (or upgraded) can be specified.
|
||||||
|
# Check the documentation for more information.
|
||||||
|
# plugin_dependencies=
|
||||||
|
|
||||||
|
Category of the plugin: Raster, Vector, Database or Web
|
||||||
|
# category=cenra,mise en page,atlas
|
||||||
|
|
||||||
|
# If the plugin can run on QGIS Server.
|
||||||
|
server=False
|
||||||
|
|
||||||
@@ -0,0 +1,205 @@
|
|||||||
|
import logging
|
||||||
|
import os
|
||||||
|
from collections import namedtuple
|
||||||
|
from enum import Enum
|
||||||
|
from functools import partial
|
||||||
|
from pathlib import Path
|
||||||
|
from xml.dom.minidom import parseString
|
||||||
|
from qgis.gui import *
|
||||||
|
import qgis
|
||||||
|
from importlib import import_module
|
||||||
|
from qgis.core import (
|
||||||
|
NULL,
|
||||||
|
QgsApplication,
|
||||||
|
QgsScaleBarSettings,
|
||||||
|
QgsDataSourceUri,
|
||||||
|
QgsProject,
|
||||||
|
QgsProviderConnectionException,
|
||||||
|
QgsProviderRegistry,
|
||||||
|
QgsRasterLayer,
|
||||||
|
QgsSettings,
|
||||||
|
QgsVectorLayer,
|
||||||
|
QgsGeometry,
|
||||||
|
QgsPrintLayout,
|
||||||
|
QgsReadWriteContext,
|
||||||
|
QgsLayoutItemMap,
|
||||||
|
QgsLayoutItemPage,
|
||||||
|
QgsLayoutSize,
|
||||||
|
QgsUnitTypes,
|
||||||
|
QgsLayoutPoint,
|
||||||
|
QgsLayoutItemLabel,
|
||||||
|
QgsLayoutItemPicture,
|
||||||
|
QgsLayoutItemLegend,
|
||||||
|
QgsLegendStyle,
|
||||||
|
QgsLayoutItemScaleBar,
|
||||||
|
QgsLayerTreeGroup,
|
||||||
|
QgsCoordinateReferenceSystem,
|
||||||
|
QgsCoordinateTransform,
|
||||||
|
QgsLayerTree,
|
||||||
|
QgsLayoutTableColumn,
|
||||||
|
QgsRectangle,
|
||||||
|
QgsLayoutItemMapOverviewStack,
|
||||||
|
QgsMapThemeCollection,
|
||||||
|
)
|
||||||
|
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt
|
||||||
|
from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie
|
||||||
|
from qgis.PyQt.QtPrintSupport import QPrinter
|
||||||
|
from qgis.PyQt.QtWidgets import (
|
||||||
|
QDockWidget,
|
||||||
|
QAction,
|
||||||
|
QMessageBox,
|
||||||
|
QPushButton,
|
||||||
|
QDockWidget,
|
||||||
|
QFileDialog,
|
||||||
|
QInputDialog,
|
||||||
|
QMenu,
|
||||||
|
QToolButton,
|
||||||
|
QTableWidget,
|
||||||
|
QTableWidgetItem,
|
||||||
|
QVBoxLayout,
|
||||||
|
)
|
||||||
|
import psycopg2
|
||||||
|
try:
|
||||||
|
from PyQt5.QtCore import QSettings
|
||||||
|
from PyQt5 import QtGui
|
||||||
|
from PyQt5 import QtWidgets
|
||||||
|
except:
|
||||||
|
from PyQt6.QtCore import QSettings
|
||||||
|
from PyQt6 import QtGui
|
||||||
|
from PyQt6 import QtWidgets
|
||||||
|
from qgis.PyQt.QtXml import QDomDocument
|
||||||
|
from qgis.utils import iface
|
||||||
|
import glob
|
||||||
|
try:
|
||||||
|
|
||||||
|
Enabled = True
|
||||||
|
from .tools.StyleLayer import *
|
||||||
|
except:
|
||||||
|
Enabled = False
|
||||||
|
from .tools.resources import (
|
||||||
|
load_ui,
|
||||||
|
resources_path,
|
||||||
|
send_issues,
|
||||||
|
)
|
||||||
|
from .issues import CenRa_Issues
|
||||||
|
|
||||||
|
from datetime import date
|
||||||
|
|
||||||
|
EDITOR_CLASS = load_ui('CenRa_AutoMapStyle_base.ui')
|
||||||
|
LOGGER = logging.getLogger('CenRa_AutoMapStyle')
|
||||||
|
|
||||||
|
class AutoMap_Style(QDockWidget, EDITOR_CLASS):
|
||||||
|
|
||||||
|
def __init__(self, parent=None):
|
||||||
|
_ = parent
|
||||||
|
super().__init__()
|
||||||
|
self.setupUi(self)
|
||||||
|
self.settings = QgsSettings()
|
||||||
|
self.s = QSettings()
|
||||||
|
|
||||||
|
self.toolButton.setIcon(QtGui.QIcon(resources_path('icons','loader.png')))
|
||||||
|
|
||||||
|
self.loadComboBox()
|
||||||
|
self.toolButton.clicked.connect(self.loadStyle)
|
||||||
|
|
||||||
|
def loadComboBox(self):
|
||||||
|
style = self.comboBox
|
||||||
|
style.clear()
|
||||||
|
style.addItem('')
|
||||||
|
style.addItem('Foncier')
|
||||||
|
style.addItem('Administratif')
|
||||||
|
|
||||||
|
def loadStyle(self):
|
||||||
|
style = self.comboBox.currentText()
|
||||||
|
if style == 'Foncier':
|
||||||
|
self.loadFoncier()
|
||||||
|
if style == 'Administratif':
|
||||||
|
self.loadAdministratif()
|
||||||
|
|
||||||
|
def loginfo(self):
|
||||||
|
InputDialog = QInputDialog()
|
||||||
|
mdp = InputDialog.getText(None,'Foncier','Mot de pass base foncier:')
|
||||||
|
return mdp
|
||||||
|
|
||||||
|
def loadAdministratif(self):
|
||||||
|
mtc = QgsProject.instance().mapThemeCollection()
|
||||||
|
theme_name = 'Administratif'
|
||||||
|
theme_state = mtc.mapThemeState(theme_name)
|
||||||
|
|
||||||
|
mdp = self.loginfo()[0]
|
||||||
|
if mdp != '':
|
||||||
|
# couche = [['_form_power_rename','_form_power_rename_contour_2025'],['_42_bois_du_roy','_42_bois_du_roy_habitat_2021']]
|
||||||
|
couche = [['administratif','departements2024','gid'],['administratif','v_communes','id']]
|
||||||
|
for schema_table in couche:
|
||||||
|
schema = schema_table[0]
|
||||||
|
table = schema_table[1]
|
||||||
|
key = schema_table[2]
|
||||||
|
uri = QgsDataSourceUri()
|
||||||
|
uri.setConnection(host ,port ,dbname ,os_user ,mdp)
|
||||||
|
# nom du schéma à remplacer: "hydrographie" à supprimer et mettre "couches_collaboratives" lorsqu'on aura regroupé les couches à modifier dans un même schéma
|
||||||
|
uri.setDataSource(schema, table, "geom")
|
||||||
|
uri.setKeyColumn(key)
|
||||||
|
layer = QgsVectorLayer(uri.uri(), table, "postgres")
|
||||||
|
if layer.isValid() == True:
|
||||||
|
layerName = layer.name()
|
||||||
|
listStyle = layer.listStylesInDatabase()
|
||||||
|
try:
|
||||||
|
StyleExist = True
|
||||||
|
indexStyle = (listStyle[2].index(layerName))
|
||||||
|
except:
|
||||||
|
StyleExist = False
|
||||||
|
if StyleExist:
|
||||||
|
StyleId = (listStyle[1][indexStyle])
|
||||||
|
styleTuple = layer.getStyleFromDatabase(StyleId)
|
||||||
|
styleqml = styleTuple[0]
|
||||||
|
styledoc = QDomDocument()
|
||||||
|
styledoc.setContent(styleqml)
|
||||||
|
layer.importNamedStyle(styledoc)
|
||||||
|
|
||||||
|
# Ajout de la couche au canevas QGIS
|
||||||
|
QgsProject.instance().addMapLayer(layer)
|
||||||
|
|
||||||
|
layer_record = QgsMapThemeCollection.MapThemeLayerRecord(layer)
|
||||||
|
theme_state.addLayerRecord(layer_record)
|
||||||
|
mtc.insert(theme_name, theme_state)
|
||||||
|
|
||||||
|
def loadFoncier(self):
|
||||||
|
mtc = QgsProject.instance().mapThemeCollection()
|
||||||
|
theme_name = 'Foncier'
|
||||||
|
theme_state = mtc.mapThemeState(theme_name)
|
||||||
|
|
||||||
|
mdp = self.loginfo()[0]
|
||||||
|
if mdp != '':
|
||||||
|
# couche = [['_form_power_rename','_form_power_rename_contour_2025'],['_42_bois_du_roy','_42_bois_du_roy_habitat_2021']]
|
||||||
|
couche = [['sites','v_sites_parcelles'],['sites','v_sites'],['inventaires','suivi_zh'],['inventaires','suivi_ps']]
|
||||||
|
for schema_table in couche:
|
||||||
|
schema = schema_table[0]
|
||||||
|
table = schema_table[1]
|
||||||
|
uri = QgsDataSourceUri()
|
||||||
|
uri.setConnection(host ,port ,dbname ,os_user ,mdp)
|
||||||
|
# nom du schéma à remplacer: "hydrographie" à supprimer et mettre "couches_collaboratives" lorsqu'on aura regroupé les couches à modifier dans un même schéma
|
||||||
|
uri.setDataSource(schema, table, "geom")
|
||||||
|
uri.setKeyColumn('gid')
|
||||||
|
layer = QgsVectorLayer(uri.uri(), table, "postgres")
|
||||||
|
if layer.isValid() == True:
|
||||||
|
layerName = layer.name()
|
||||||
|
listStyle = layer.listStylesInDatabase()
|
||||||
|
try:
|
||||||
|
StyleExist = True
|
||||||
|
indexStyle = (listStyle[2].index(layerName))
|
||||||
|
except:
|
||||||
|
StyleExist = False
|
||||||
|
if StyleExist:
|
||||||
|
StyleId = (listStyle[1][indexStyle])
|
||||||
|
styleTuple = layer.getStyleFromDatabase(StyleId)
|
||||||
|
styleqml = styleTuple[0]
|
||||||
|
styledoc = QDomDocument()
|
||||||
|
styledoc.setContent(styleqml)
|
||||||
|
layer.importNamedStyle(styledoc)
|
||||||
|
|
||||||
|
# Ajout de la couche au canevas QGIS
|
||||||
|
QgsProject.instance().addMapLayer(layer)
|
||||||
|
|
||||||
|
layer_record = QgsMapThemeCollection.MapThemeLayerRecord(layer)
|
||||||
|
theme_state.addLayerRecord(layer_record)
|
||||||
|
mtc.insert(theme_name, theme_state)
|
||||||
|
Before Width: | Height: | Size: 750 KiB After Width: | Height: | Size: 750 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 286 KiB After Width: | Height: | Size: 286 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 165 KiB |
|
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,168 @@
|
|||||||
|
from qgis.core import (
|
||||||
|
QgsLayoutSize,
|
||||||
|
QgsUnitTypes,
|
||||||
|
QgsLayoutPoint,
|
||||||
|
)
|
||||||
|
def fletch_canvas(self):
|
||||||
|
if self.radioButton_6.isChecked():
|
||||||
|
values_page = 'A4'
|
||||||
|
else:
|
||||||
|
values_page = 'A3'
|
||||||
|
if self.radioButton_7.isChecked():
|
||||||
|
page_rotate = 'Portrait'
|
||||||
|
else:
|
||||||
|
page_rotate = 'Landscape'
|
||||||
|
|
||||||
|
if page_rotate == 'Portrait':
|
||||||
|
if values_page == 'A4':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(198.85714285714286,175, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(5, 25, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0.0
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50.0,50, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(5, 25, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0.0
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(198.85714285714286,90, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(5, 205, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0.0
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(12.0,12, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(191, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0.0
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(54.857142857142854,5, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(145, 229, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0.0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(46.0,16, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0.0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(198.85714285714286,8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0.0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(100.0,4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(205, 158.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 270.0
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(100.0,4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(104, 200, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 0.0
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(198.85714285714286,8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 12, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0.0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(54.857142857142854,15, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(145, 215, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0.0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50.0,20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0.0
|
||||||
|
if values_page == 'A3':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(280,247, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(7, 35, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0.0
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(70,70, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(7, 35, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0.0
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(280,127, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(7, 289, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0.0
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(17,17, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(269, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0.0
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(77,7, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(205, 323, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0.0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(65,23, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(7, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0.0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(280,11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(7, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0.0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(141,6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(289, 223, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 270.0
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(141,6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(147, 282, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 0.0
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(280,11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(7, 17, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0.0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(77,21, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(205, 303, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0.0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(70,28, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(7, 388, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0.0
|
||||||
|
|
||||||
|
if page_rotate == 'Landscape':
|
||||||
|
if values_page == 'A4':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(285.14285714285717,145, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0.0
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100.0,100, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0.0
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(285.14285714285717,41, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(6, 168, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0.0
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(13.142857142857142,12, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(277, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0.0
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(54.857142857142854,15, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(232, 193, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0.0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(46.0,16, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0.0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(286.0,8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0.0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(100.0,4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(291, 127.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 270.0
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(100.0,4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(189, 169, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 0.0
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(286.0,8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 12, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0.0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(54.857142857142854,15, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(232, 179, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0.0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50.0,50, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(6, 118, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0.0
|
||||||
|
if values_page == 'A3':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(402,205, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(8, 32, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0.0
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(141,141, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(8, 32, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0.0
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(402,58, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(8, 237, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0.0
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(19,17, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(391, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0.0
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(77,21, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(327, 272, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0.0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(65,23, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(7, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0.0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(403,11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(7, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0.0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(141,6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(410, 179, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 270.0
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(141,6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(267, 238, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 0.0
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(403,11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(7, 17, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0.0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(77,21, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(327, 252, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0.0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(70,70, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(8, 166, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0.0
|
||||||
|
|
||||||
|
return self.template_parameters
|
||||||
@@ -25,7 +25,7 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Logo_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Legande_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Legande_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
|
||||||
@@ -91,7 +91,7 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Logo_2_rotate'] = 0
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
|
||||||
if page_rotate == 'Landscape':
|
if page_rotate == 'Landscape':
|
||||||
if values_page == 'A4':
|
if values_page == 'A3':
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(420, 297, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_size'] = QgsLayoutSize(420, 297, QgsUnitTypes.LayoutMillimeters)
|
||||||
@@ -128,7 +128,7 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Sous_titre_rotate'] = 0
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
self.template_parameters['Echelle_2_rotate'] = 0
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
if values_page == 'A3':
|
if values_page == 'A4':
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(297, 210, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_size'] = QgsLayoutSize(297, 210, QgsUnitTypes.LayoutMillimeters)
|
||||||
@@ -4,6 +4,7 @@ import configparser
|
|||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import base64
|
import base64
|
||||||
|
import os
|
||||||
import psycopg2
|
import psycopg2
|
||||||
import psycopg2.extras
|
import psycopg2.extras
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
@@ -89,7 +90,7 @@ def resources_path(*args):
|
|||||||
:return: Absolute path to the resources folder.
|
:return: Absolute path to the resources folder.
|
||||||
:rtype: str
|
:rtype: str
|
||||||
"""
|
"""
|
||||||
path = abspath(abspath(join(plugin_path(), "CenIsere_AUTOMAP/tools")))
|
path = abspath(abspath(join(plugin_path(), "CenRa_AUTOMAP\\tools")))
|
||||||
for item in args:
|
for item in args:
|
||||||
path = abspath(join(path, item))
|
path = abspath(join(path, item))
|
||||||
return path
|
return path
|
||||||
@@ -107,25 +108,15 @@ def load_ui(*args):
|
|||||||
|
|
||||||
return ui_class
|
return ui_class
|
||||||
|
|
||||||
# def login_base(take=None):
|
def pyperclip():
|
||||||
# from CenRa_METABASE.tools.PythonSQL import host,port,dbname,password,os_user
|
dst = dirname(dirname(__file__))+"\\tools\\"
|
||||||
# first_conn = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=first_cnx password=" + password)
|
if os.access('N:/',os.R_OK):
|
||||||
# first_cur = first_conn.cursor(cursor_factory = psycopg2.extras.DictCursor)
|
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/StyleLayer.py'
|
||||||
# first_cur.execute("SELECT mdp_w, login_w FROM pg_catalog.pg_user t1, admin_sig.vm_users_sig t2 WHERE t2.oid = t1.usesysid AND (login_w = '" + os_user + "' OR login_w = '" + os_user + "')")
|
try:
|
||||||
# res_ident = first_cur.fetchone()
|
shutil.copy(src, dst)
|
||||||
|
except:
|
||||||
|
print('404')
|
||||||
|
|
||||||
# mdp = base64.b64decode(str(res_ident[0])).decode('utf-8')
|
|
||||||
# user = res_ident[1]
|
|
||||||
|
|
||||||
# con = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=" + user + " password=" + mdp)
|
|
||||||
|
|
||||||
# cur = con.cursor(cursor_factory = psycopg2.extras.DictCursor)
|
|
||||||
# first_conn.close()
|
|
||||||
|
|
||||||
# if take:
|
|
||||||
# return cur,con
|
|
||||||
# else:
|
|
||||||
# return cur
|
|
||||||
def send_issues(url,titre,body,labels):
|
def send_issues(url,titre,body,labels):
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
@@ -158,7 +149,7 @@ def maj_verif(NAME):
|
|||||||
|
|
||||||
url = qgis.utils.pluginMetadata(NAME,'repository')
|
url = qgis.utils.pluginMetadata(NAME,'repository')
|
||||||
#URL = url+'/raw/branch/main/plugins.xml'
|
#URL = url+'/raw/branch/main/plugins.xml'
|
||||||
URL = 'https://gitea.cenra-outils.org/CEN38/Plugin_QGIS/releases/download/latest/plugins.xml'
|
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
|
||||||
# print(URL)
|
# print(URL)
|
||||||
version = qgis.utils.pluginMetadata(NAME,'version')
|
version = qgis.utils.pluginMetadata(NAME,'version')
|
||||||
len_version = len(version)
|
len_version = len(version)
|
||||||
@@ -168,12 +159,15 @@ def maj_verif(NAME):
|
|||||||
except:
|
except:
|
||||||
binar = False
|
binar = False
|
||||||
if binar:
|
if binar:
|
||||||
version_web = str(urllib.request.urlopen(URL).read())
|
try:
|
||||||
plugin_num = version_web.find(NAME)
|
version_web = str(urllib.request.urlopen(URL).read())
|
||||||
valeur_version_web = version_web.find('<version>',plugin_num)+9
|
plugin_num = version_web.find(NAME)
|
||||||
version_plugin = version_web[valeur_version_web:valeur_version_web+len_version]
|
valeur_version_web = version_web.find('<version>',plugin_num)+9
|
||||||
if version_plugin != version:
|
version_plugin = version_web[valeur_version_web:valeur_version_web+len_version]
|
||||||
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
if version_plugin != version:
|
||||||
|
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
||||||
|
except:
|
||||||
|
print("error gitea version ssl")
|
||||||
else:
|
else:
|
||||||
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
||||||
|
|
||||||
@@ -184,4 +178,4 @@ def devlog(NAME):
|
|||||||
import qgis
|
import qgis
|
||||||
devmaj = '<head><style>* {margin:0; padding:0; }</style></head>'
|
devmaj = '<head><style>* {margin:0; padding:0; }</style></head>'
|
||||||
devmaj = devmaj+qgis.utils.pluginMetadata(NAME,'changelog')
|
devmaj = devmaj+qgis.utils.pluginMetadata(NAME,'changelog')
|
||||||
return devmaj
|
return devmaj
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>CenRa_AutoMapStyle</class>
|
||||||
|
<widget class="QDockWidget" name="CenRa_AutoMapStyle">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>48</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="floating">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="features">
|
||||||
|
<set>QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetMovable</set>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>CenRa_AutoMap</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="dockWidgetContents">
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalSpacing">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QComboBox" name="comboBox">
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Style:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QToolButton" name="toolButton">
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>CEN38 Metabase</string>
|
<string>CEN-RA Metabase</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset>
|
<iconset>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>SICEN</string>
|
<string>Journal des modifications</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset>
|
<iconset>
|
||||||
@@ -29,9 +29,6 @@
|
|||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -41,7 +38,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>453</width>
|
<width>453</width>
|
||||||
<height>547</height>
|
<height>570</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
@@ -56,7 +53,7 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>DevLog</string>
|
<string>DevLog</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWebView" name="viewer" native="true">
|
<widget class="QTextBrowser" name="viewer">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
@@ -65,11 +62,6 @@
|
|||||||
<height>511</height>
|
<height>511</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="url" stdset="0">
|
|
||||||
<url>
|
|
||||||
<string>about:blank</string>
|
|
||||||
</url>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -78,19 +70,12 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::NoButton</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>QWebView</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">QtWebKitWidgets/QWebView</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
@@ -12,17 +12,19 @@ import qgis
|
|||||||
|
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
import socket
|
||||||
import os
|
import os
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
plugin_path,
|
plugin_path,
|
||||||
|
pyperclip,
|
||||||
resources_path,
|
resources_path,
|
||||||
maj_verif,
|
maj_verif,
|
||||||
)
|
)
|
||||||
|
pyperclip()
|
||||||
from .copie_editor import Copie_Editor
|
from .copie_editor import Copie_Editor
|
||||||
from .about_form import CopieAboutDialog
|
from .about_form import AboutDialog
|
||||||
|
|
||||||
from PyQt5.QtCore import *
|
from qgis.PyQt.QtCore import *
|
||||||
|
|
||||||
class PgCopie:
|
class PgCopie:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -40,7 +42,7 @@ class PgCopie:
|
|||||||
maj_verif(NAME)
|
maj_verif(NAME)
|
||||||
|
|
||||||
# Display About window on first use
|
# Display About window on first use
|
||||||
version = qgis.utils.pluginMetadata('CenRa_Copie','version')
|
version = qgis.utils.pluginMetadata('CenRa_COPIE','version')
|
||||||
s = QSettings()
|
s = QSettings()
|
||||||
versionUse = s.value("copie/version", 1, type=str)
|
versionUse = s.value("copie/version", 1, type=str)
|
||||||
if str(versionUse) != str(version) :
|
if str(versionUse) != str(version) :
|
||||||
@@ -66,13 +68,17 @@ class PgCopie:
|
|||||||
self.copie_editor = QAction(icon, 'Copie',None)
|
self.copie_editor = QAction(icon, 'Copie',None)
|
||||||
self.toolBar.addAction(self.copie_editor)
|
self.toolBar.addAction(self.copie_editor)
|
||||||
self.copie_editor.triggered.connect(self.open_editor)
|
self.copie_editor.triggered.connect(self.open_editor)
|
||||||
|
self.copie_editor.setEnabled(False)
|
||||||
|
IPAddr=socket.gethostbyname(socket.gethostname())
|
||||||
|
if os.access('N:/',os.R_OK):
|
||||||
|
self.copie_editor.setEnabled(True)
|
||||||
|
|
||||||
def open_about_dialog(self):
|
def open_about_dialog(self):
|
||||||
"""
|
"""
|
||||||
About dialog
|
About dialog
|
||||||
"""
|
"""
|
||||||
dialog = CopieAboutDialog(iface)
|
dialog = AboutDialog(iface)
|
||||||
dialog.exec_()
|
dialog.exec()
|
||||||
def open_help():
|
def open_help():
|
||||||
""" Open the online help. """
|
""" Open the online help. """
|
||||||
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ ABOUT_FORM_CLASS, _ = uic.loadUiType(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class CopieAboutDialog(QDialog, ABOUT_FORM_CLASS):
|
class AboutDialog(QDialog, ABOUT_FORM_CLASS):
|
||||||
|
|
||||||
""" About - Let the user display the about dialog. """
|
""" About - Let the user display the about dialog. """
|
||||||
|
|
||||||
|
|||||||
@@ -9,17 +9,23 @@ import qgis
|
|||||||
from qgis.PyQt.QtCore import QSettings
|
from qgis.PyQt.QtCore import QSettings
|
||||||
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
|
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
|
||||||
from qgis.PyQt.QtGui import QIcon
|
from qgis.PyQt.QtGui import QIcon
|
||||||
from PyQt5.QtCore import *
|
|
||||||
from PyQt5.QtGui import *
|
from qgis.PyQt.QtCore import *
|
||||||
from PyQt5 import QtGui
|
from qgis.PyQt.QtGui import *
|
||||||
|
from qgis.PyQt import QtGui
|
||||||
|
|
||||||
from qgis.core import *
|
from qgis.core import *
|
||||||
from qgis.core import QgsDataSourceUri
|
from qgis.core import QgsDataSourceUri
|
||||||
|
import os
|
||||||
|
|
||||||
from .tools.PythonSQL import *
|
try:
|
||||||
|
from .tools.PythonSQL import login_base
|
||||||
|
except:
|
||||||
|
print('Pas de fichier PythonSQL')
|
||||||
|
from .tools.SQLRequet import *
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
resources_path,
|
||||||
login_base,
|
|
||||||
send_issues,
|
send_issues,
|
||||||
)
|
)
|
||||||
from .issues import CenRa_Issues
|
from .issues import CenRa_Issues
|
||||||
@@ -62,21 +68,22 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
|
|||||||
# tablename
|
# tablename
|
||||||
source_tablename = [s for s in list_sources if "table" in s][0].split('"')[3]
|
source_tablename = [s for s in list_sources if "table" in s][0].split('"')[3]
|
||||||
|
|
||||||
|
|
||||||
|
account = login_base("account")
|
||||||
|
sigdb = account[5]
|
||||||
|
|
||||||
|
|
||||||
if source_db != sigdb:
|
if source_db != sigdb:
|
||||||
#self.iface.messageBar().pushMessage(u"Un référentiel ne peut être copié, utilisez les filtres !", level=QgsMessageBar.CRITICAL, duration=10)
|
#self.iface.messageBar().pushMessage(u"Un référentiel ne peut être copié, utilisez les filtres !", level=QgsMessageBar.CRITICAL, duration=10)
|
||||||
self.iface.messageBar().pushMessage("Ooops", u"Vous ne pouvez copier des couches que dans sigXX", level=Qgis.Critical, duration=5)
|
self.iface.messageBar().pushMessage("Ooops", u"Vous ne pouvez copier des couches que dans sigXX", level=Qgis.Critical, duration=5)
|
||||||
|
else:
|
||||||
else :
|
user = account[0]
|
||||||
|
mdp = account[1]
|
||||||
first_conn = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=first_cnx password=" + password)
|
host = account[2]
|
||||||
first_cur = first_conn.cursor(cursor_factory = psycopg2.extras.DictCursor)
|
port = account[3]
|
||||||
first_cur.execute("SELECT mdp_w, login_w FROM pg_catalog.pg_user t1, admin_sig.vm_users_sig t2 WHERE t2.oid = t1.usesysid AND (login_w = '" + os_user + "' OR login_w = '" + os_user + "')")
|
dbname = account[4]
|
||||||
res_ident = first_cur.fetchone()
|
cur = account[7]
|
||||||
mdp = base64.b64decode(str(res_ident[0])).decode('utf-8')
|
con = account[8]
|
||||||
user = res_ident[1]
|
|
||||||
con = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=" + user + " password=" + mdp)
|
|
||||||
cur = con.cursor(cursor_factory = psycopg2.extras.DictCursor)
|
|
||||||
first_conn.close()
|
|
||||||
|
|
||||||
# Creation de la liste des schemas de la base de donnees
|
# Creation de la liste des schemas de la base de donnees
|
||||||
SQL = """WITH list_schema AS (
|
SQL = """WITH list_schema AS (
|
||||||
@@ -109,21 +116,21 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
|
|||||||
# show the dialog
|
# show the dialog
|
||||||
self.show()
|
self.show()
|
||||||
# Run the dialog event loop
|
# Run the dialog event loop
|
||||||
result = self.exec_()
|
result = self.exec()
|
||||||
# See if OK was pressed
|
# See if OK was pressed
|
||||||
if result:
|
if result:
|
||||||
#******************************debut script*********************************
|
#******************************debut script*********************************
|
||||||
|
|
||||||
|
|
||||||
first_conn = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=first_cnx password=" + password)
|
account = login_base("account")
|
||||||
first_cur = first_conn.cursor(cursor_factory = psycopg2.extras.DictCursor)
|
user = account[0]
|
||||||
first_cur.execute("SELECT mdp_w, login_w FROM pg_catalog.pg_user t1, admin_sig.vm_users_sig t2 WHERE t2.oid = t1.usesysid AND (login_w = '" + os_user + "' OR login_w = '" + os_user + "')")
|
mdp = account[1]
|
||||||
res_ident = first_cur.fetchone()
|
host = account[2]
|
||||||
mdp = base64.b64decode(str(res_ident[0])).decode('utf-8')
|
port = account[3]
|
||||||
user = res_ident[1]
|
dbname = account[4]
|
||||||
con = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=" + user + " password=" + mdp)
|
cur = account[7]
|
||||||
cur = con.cursor(cursor_factory = psycopg2.extras.DictCursor)
|
con = account[8]
|
||||||
first_conn.close()
|
|
||||||
# Récupération de la couche active
|
# Récupération de la couche active
|
||||||
layer = self.iface.activeLayer()
|
layer = self.iface.activeLayer()
|
||||||
|
|
||||||
@@ -158,7 +165,6 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
|
|||||||
else :
|
else :
|
||||||
SQL_table = "CREATE TABLE " + schema + "." + tablename + " AS SELECT * FROM " + source_schema + "." + source_tablename
|
SQL_table = "CREATE TABLE " + schema + "." + tablename + " AS SELECT * FROM " + source_schema + "." + source_tablename
|
||||||
|
|
||||||
|
|
||||||
SQL_pkey = "ALTER TABLE " + schema + "." + tablename + " ADD CONSTRAINT " + tablename + "_pkey" + " PRIMARY KEY (gid)"
|
SQL_pkey = "ALTER TABLE " + schema + "." + tablename + " ADD CONSTRAINT " + tablename + "_pkey" + " PRIMARY KEY (gid)"
|
||||||
SQL_sequence_01 = "CREATE SEQUENCE " + schema + "." + tablename + "_gid_seq" + " INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1;"
|
SQL_sequence_01 = "CREATE SEQUENCE " + schema + "." + tablename + "_gid_seq" + " INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1;"
|
||||||
SQL_sequence_02 = "ALTER TABLE " + schema + "." + tablename + " ALTER COLUMN gid SET DEFAULT nextval(\'" + schema + "." + tablename + "_gid_seq\'::regclass);"
|
SQL_sequence_02 = "ALTER TABLE " + schema + "." + tablename + " ALTER COLUMN gid SET DEFAULT nextval(\'" + schema + "." + tablename + "_gid_seq\'::regclass);"
|
||||||
@@ -169,7 +175,7 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
|
|||||||
SQL_trigger_area_ha = "CREATE TRIGGER area_ha" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.area_ha();"
|
SQL_trigger_area_ha = "CREATE TRIGGER area_ha" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.area_ha();"
|
||||||
SQL_trigger_length_m = "CREATE TRIGGER length_m" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.length_m();"
|
SQL_trigger_length_m = "CREATE TRIGGER length_m" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.length_m();"
|
||||||
SQL_trigger_length_km = "CREATE TRIGGER length_km" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.length_km();"
|
SQL_trigger_length_km = "CREATE TRIGGER length_km" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.length_km();"
|
||||||
SQL_trigger_coordonnees = "CREATE TRIGGER coordonnees" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.coordonnees();"
|
SQL_trigger_coordonnees = "CREATE TRIGGER coordonnees" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.coordonnees();"
|
||||||
|
|
||||||
cur.execute(SQL_table)
|
cur.execute(SQL_table)
|
||||||
cur.execute(SQL_pkey)
|
cur.execute(SQL_pkey)
|
||||||
@@ -178,6 +184,13 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
|
|||||||
cur.execute(SQL_sequence_03)
|
cur.execute(SQL_sequence_03)
|
||||||
cur.execute(SQL_sequence_04)
|
cur.execute(SQL_sequence_04)
|
||||||
|
|
||||||
|
RETURNE = "SELECT pg_get_serial_sequence('"+schema + "."+ tablename+"','gid')"
|
||||||
|
cur.execute(RETURNE)
|
||||||
|
sequence_name = cur.fetchone()[0]
|
||||||
|
print(sequence_name)
|
||||||
|
SQL_GRANT_TABLE="GRANT DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON "+schema+"."+tablename+" TO grp_qgis;GRANT DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON "+schema+"."+tablename+" TO grp_sig;GRANT ALL ON SEQUENCE "+sequence_name+" TO grp_qgis;"
|
||||||
|
cur.execute(SQL_GRANT_TABLE)
|
||||||
|
|
||||||
if layer.wkbType() == QgsWkbTypes.PointGeometry :
|
if layer.wkbType() == QgsWkbTypes.PointGeometry :
|
||||||
cur.execute(SQL_trigger_coordonnees)
|
cur.execute(SQL_trigger_coordonnees)
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,9 @@
|
|||||||
[general]
|
[general]
|
||||||
name=CenRA_COPIE
|
name=CenRA_COPIE
|
||||||
qgisMinimumVersion=3.0
|
qgisMinimumVersion=3.0
|
||||||
|
supportsQt6=True
|
||||||
description=Permet la copie d'une table dans une base PostGis
|
description=Permet la copie d'une table dans une base PostGis
|
||||||
version=2.0
|
version=3.0
|
||||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||||
email=si_besoin@cen-rhonealpes.fr
|
email=si_besoin@cen-rhonealpes.fr
|
||||||
|
|
||||||
@@ -19,7 +20,7 @@ email=si_besoin@cen-rhonealpes.fr
|
|||||||
# Recommended items:
|
# Recommended items:
|
||||||
|
|
||||||
# Uncomment the following line and add your changelog:
|
# Uncomment the following line and add your changelog:
|
||||||
changelog=<h2>CenRa_COPIE:</h2></br><p><h3>22/10/2024 - Version 2:</h3>- Refonte du code.</p></br><p><h3>13/09/2024 - Version 1.5:</h3>- Ajoute d'un changelog et vérification de mise à jour.</p>
|
changelog=<h2>CenRa_COPIE:</h2></br><p><h3>19/05/2025 - Version 3.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>11/04/2025 - Version 2.5: </h3> - Correctif de bug.</p></br><p><h3>09/04/2025 - Version 2.4: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 2.3: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 2.2: </h3> - Mise a jour de securite.</p></br><p><h3>07/01/2025 - Version 2.1: </h3> - ByPass du certif ssl ci erreur.</br></p><p><h3>22/10/2024 - Version 2:</h3>- Refonte du code.</p></br><p><h3>13/09/2024 - Version 1.5:</h3>- Ajoute d'un changelog et vérification de mise à jour.</p>
|
||||||
|
|
||||||
# Tags are comma separated with spaces allowed
|
# Tags are comma separated with spaces allowed
|
||||||
tags=cenra, database, table
|
tags=cenra, database, table
|
||||||
|
|||||||
@@ -1,172 +0,0 @@
|
|||||||
import sys
|
|
||||||
import socket
|
|
||||||
import os
|
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
|
||||||
host = "100.100.100.11"
|
|
||||||
port = "5432"
|
|
||||||
dbname = "sig4269"
|
|
||||||
sigdb="sig4269"
|
|
||||||
refdb="ref_geo4269"
|
|
||||||
password = "XXXXXX"
|
|
||||||
if IPAddr[0:9] == "192.168.0": #01
|
|
||||||
host = "192.168.0.201"
|
|
||||||
port = "5432"
|
|
||||||
dbname = "sig01"
|
|
||||||
sigdb="sig01"
|
|
||||||
refdb="ref_geo01"
|
|
||||||
password = "XXXXXX"
|
|
||||||
if IPAddr[0:9] == "192.168.1": #0726
|
|
||||||
host = "192.168.1.201"
|
|
||||||
port = "5432"
|
|
||||||
dbname = "sig0726"
|
|
||||||
sigdb="sig0726"
|
|
||||||
refdb="ref_geo0726"
|
|
||||||
password = "XXXXXX"
|
|
||||||
if sys.platform == 'linux':
|
|
||||||
os_user = os.environ['USER']
|
|
||||||
else:
|
|
||||||
os_user = os.environ['USERNAME']
|
|
||||||
if os_user == 'STAGE':
|
|
||||||
os_user='stage'
|
|
||||||
|
|
||||||
geom = "geom"
|
|
||||||
champ_travaux_prevus_multipolygon="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, surface_m2 double precision, surface_ha double precision, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
|
|
||||||
champ_travaux_prevus_multilinestring="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, longueur_m double precision, longueur_km double precision, date_creation date, date_maj date, geom geometry(MultiLineString,2154))"""
|
|
||||||
champ_travaux_prevus_point = """(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, x_wgs84 double precision, y_wgs84 double precision, date_creation date, date_maj date, geom geometry(Point,2154))"""
|
|
||||||
|
|
||||||
champ_viergePolygone = """(gid serial NOT NULL, commentaire text, surface_m2 double precision, surface_ha double precision, geom geometry(MultiPolygon,2154))"""
|
|
||||||
champ_viergeLigne = """(gid serial NOT NULL, commentaire text, longueur_m double precision, longueur_km double precision, geom geometry(MultiLineString,2154))"""
|
|
||||||
champ_viergePoint = """(gid serial NOT NULL, commentaire text, x_wgs84 double precision, y_wgs84 double precision, geom geometry(Point,2154))"""
|
|
||||||
|
|
||||||
champ_habitat = """(gid serial NOT NULL, cd_cb_01 text, lb_cb97_fr_01 text, occupation_01 integer, cd_cb_02 text, lb_cb97_fr_02 text, occupation_02 integer, cd_cb_03 text, lb_cb97_fr_03 text, occupation_03 integer, milieu_code text, milieu_libelle text, surface_m2 double precision, surface_ha double precision, commentaire text, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
|
|
||||||
|
|
||||||
champ_contour="""(gid serial NOT NULL, date_creation date, date_maj date, utilisateur character varying, dept character(2), nom character varying, surface_m2 double precision, surface_ha double precision, type_site character varying, type_milieu character varying, date_premier_pg integer, date_debut_pg integer, date_fin_pg integer, referent character varying, gestion_deleguee character varying, terrain_militaire character(3), ens character(3), zh character(3), adapt_pmr character(3), inform character(3), guide character(3), ouverture_public character(3), obs character(3), anim character(3), n2000_anim character(3), contrat_n2000_conseil character(3), n2000_op character(3), contrat_n2000_benef character(3), contrat_agri character(3), bc_habitat integer, bc_amphibien integer, bc_coleoptere integer, bc_crustace integer, bc_mammifere integer, bc_chiroptere integer, bc_mollusque integer, bc_odonate integer, bc_oiseau integer, bc_orthoptere integer, bc_poisson integer, bc_reptile integer, bc_rhopalocere integer, bc_heterocere integer, bc_autre_invertebre integer, bc_flore integer, bc_bryophyte integer, bc_champignon integer, suiv_analyse_sol character(3), suiv_piezo character(3), suiv_climat character(3), suiv_topo character(3), suiv_habitat character(3), suiv_amphibien character(3), suiv_coleoptere character(3), suiv_crustace character(3), suiv_mammifere character(3), suiv_chiroptere character(3), suiv_mollusque character(3), suiv_odonate character(3), suiv_oiseau character(3), suiv_orthoptere character(3), suiv_poisson character(3), suiv_reptile character(3), suiv_rhopalocere character(3), suiv_heterocere character(3), suiv_autre_invertebre character(3), suiv_flore character(3), suiv_bryophyte character(3), suiv_champignon character(3), suiv_analyse_eau character(3), suiv_phenologie character(3), suiv_frequentation character(3), suiv_paysager character(3), suiv_autre character(3), commentaire text, geom geometry(MultiPolygon,2154))
|
|
||||||
"""
|
|
||||||
|
|
||||||
champ_vegethab_point = """(
|
|
||||||
gid serial NOT NULL ,
|
|
||||||
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_1 bigint,
|
|
||||||
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_2 bigint,
|
|
||||||
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_3 bigint,
|
|
||||||
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
|
||||||
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
|
||||||
surface_m2 numeric,
|
|
||||||
surface_ha numeric,
|
|
||||||
commentair character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_creat date,
|
|
||||||
date_maj date,
|
|
||||||
num_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
type_unite character varying(254) COLLATE pg_catalog."default",
|
|
||||||
dynamique character varying(254) COLLATE pg_catalog."default",
|
|
||||||
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
eta_conser character varying(254) COLLATE pg_catalog."default",
|
|
||||||
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
syntaxon character varying(254) COLLATE pg_catalog."default",
|
|
||||||
n2000 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
|
||||||
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
|
||||||
num_photo character varying(254) COLLATE pg_catalog."default",
|
|
||||||
nature_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_sais date,
|
|
||||||
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
salli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
class_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
geom geometry(Point,2154)
|
|
||||||
)
|
|
||||||
"""
|
|
||||||
champ_vegethab_multilinestring = """(
|
|
||||||
gid serial NOT NULL ,
|
|
||||||
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_1 bigint,
|
|
||||||
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_2 bigint,
|
|
||||||
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_3 bigint,
|
|
||||||
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
|
||||||
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
|
||||||
surface_m2 numeric,
|
|
||||||
surface_ha numeric,
|
|
||||||
commentair character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_creat date,
|
|
||||||
date_maj date,
|
|
||||||
num_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
type_unite character varying(254) COLLATE pg_catalog."default",
|
|
||||||
dynamique character varying(254) COLLATE pg_catalog."default",
|
|
||||||
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
eta_conser character varying(254) COLLATE pg_catalog."default",
|
|
||||||
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
syntaxon character varying(254) COLLATE pg_catalog."default",
|
|
||||||
n2000 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
|
||||||
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
|
||||||
num_photo character varying(254) COLLATE pg_catalog."default",
|
|
||||||
nature_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_sais date,
|
|
||||||
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
salli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
class_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
geom geometry(MultiLineString,2154)
|
|
||||||
)
|
|
||||||
"""
|
|
||||||
champ_vegethab_multipolygon = """(
|
|
||||||
gid serial NOT NULL ,
|
|
||||||
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_1 bigint,
|
|
||||||
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_2 bigint,
|
|
||||||
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_3 bigint,
|
|
||||||
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
|
||||||
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
|
||||||
surface_m2 numeric,
|
|
||||||
surface_ha numeric,
|
|
||||||
commentair character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_creat date,
|
|
||||||
date_maj date,
|
|
||||||
num_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
type_unite character varying(254) COLLATE pg_catalog."default",
|
|
||||||
dynamique character varying(254) COLLATE pg_catalog."default",
|
|
||||||
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
eta_conser character varying(254) COLLATE pg_catalog."default",
|
|
||||||
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
syntaxon character varying(254) COLLATE pg_catalog."default",
|
|
||||||
n2000 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
|
||||||
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
|
||||||
num_photo character varying(254) COLLATE pg_catalog."default",
|
|
||||||
nature_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_sais date,
|
|
||||||
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
salli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
class_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
geom geometry(MultiPolygon,2154)
|
|
||||||
)
|
|
||||||
"""
|
|
||||||
@@ -1,172 +1,141 @@
|
|||||||
import sys
|
|
||||||
import socket
|
geom = "geom"
|
||||||
import os
|
champ_travaux_prevus_multipolygon="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, surface_m2 double precision, surface_ha double precision, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
champ_travaux_prevus_multilinestring="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, longueur_m double precision, longueur_km double precision, date_creation date, date_maj date, geom geometry(MultiLineString,2154))"""
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
champ_travaux_prevus_point = """(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, x_wgs84 double precision, y_wgs84 double precision, date_creation date, date_maj date, geom geometry(Point,2154))"""
|
||||||
host = "100.100.100.11"
|
|
||||||
port = "5432"
|
champ_viergePolygone = """(gid serial NOT NULL, commentaire text, surface_m2 double precision, surface_ha double precision, geom geometry(MultiPolygon,2154))"""
|
||||||
dbname = "sig4269"
|
champ_viergeLigne = """(gid serial NOT NULL, commentaire text, longueur_m double precision, longueur_km double precision, geom geometry(MultiLineString,2154))"""
|
||||||
sigdb="sig4269"
|
champ_viergePoint = """(gid serial NOT NULL, commentaire text, x_wgs84 double precision, y_wgs84 double precision, geom geometry(Point,2154))"""
|
||||||
refdb="ref_geo4269"
|
|
||||||
password = "XXXXXX"
|
champ_habitat = """(gid serial NOT NULL, cd_cb_01 text, lb_cb97_fr_01 text, occupation_01 integer, cd_cb_02 text, lb_cb97_fr_02 text, occupation_02 integer, cd_cb_03 text, lb_cb97_fr_03 text, occupation_03 integer, milieu_code text, milieu_libelle text, surface_m2 double precision, surface_ha double precision, commentaire text, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
|
||||||
if IPAddr[0:9] == "192.168.0": #01
|
|
||||||
host = "192.168.0.201"
|
champ_contour="""(gid serial NOT NULL, date_creation date, date_maj date, utilisateur character varying, dept character(2), nom character varying, surface_m2 double precision, surface_ha double precision, type_site character varying, type_milieu character varying, date_premier_pg integer, date_debut_pg integer, date_fin_pg integer, referent character varying, gestion_deleguee character varying, terrain_militaire character(3), ens character(3), zh character(3), adapt_pmr character(3), inform character(3), guide character(3), ouverture_public character(3), obs character(3), anim character(3), n2000_anim character(3), contrat_n2000_conseil character(3), n2000_op character(3), contrat_n2000_benef character(3), contrat_agri character(3), bc_habitat integer, bc_amphibien integer, bc_coleoptere integer, bc_crustace integer, bc_mammifere integer, bc_chiroptere integer, bc_mollusque integer, bc_odonate integer, bc_oiseau integer, bc_orthoptere integer, bc_poisson integer, bc_reptile integer, bc_rhopalocere integer, bc_heterocere integer, bc_autre_invertebre integer, bc_flore integer, bc_bryophyte integer, bc_champignon integer, suiv_analyse_sol character(3), suiv_piezo character(3), suiv_climat character(3), suiv_topo character(3), suiv_habitat character(3), suiv_amphibien character(3), suiv_coleoptere character(3), suiv_crustace character(3), suiv_mammifere character(3), suiv_chiroptere character(3), suiv_mollusque character(3), suiv_odonate character(3), suiv_oiseau character(3), suiv_orthoptere character(3), suiv_poisson character(3), suiv_reptile character(3), suiv_rhopalocere character(3), suiv_heterocere character(3), suiv_autre_invertebre character(3), suiv_flore character(3), suiv_bryophyte character(3), suiv_champignon character(3), suiv_analyse_eau character(3), suiv_phenologie character(3), suiv_frequentation character(3), suiv_paysager character(3), suiv_autre character(3), commentaire text, geom geometry(MultiPolygon,2154))
|
||||||
port = "5432"
|
"""
|
||||||
dbname = "sig01"
|
|
||||||
sigdb="sig01"
|
champ_vegethab_point = """(
|
||||||
refdb="ref_geo01"
|
gid serial NOT NULL ,
|
||||||
password = "XXXXXX"
|
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
||||||
if IPAddr[0:9] == "192.168.1": #0726
|
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
||||||
host = "192.168.1.201"
|
occupati_1 bigint,
|
||||||
port = "5432"
|
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
||||||
dbname = "sig0726"
|
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
||||||
sigdb="sig0726"
|
occupati_2 bigint,
|
||||||
refdb="ref_geo0726"
|
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
||||||
password = "XXXXXX"
|
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
||||||
if sys.platform == 'linux':
|
occupati_3 bigint,
|
||||||
os_user = os.environ['USER']
|
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
||||||
else:
|
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
||||||
os_user = os.environ['USERNAME']
|
surface_m2 numeric,
|
||||||
if os_user == 'STAGE':
|
surface_ha numeric,
|
||||||
os_user='stage'
|
commentair character varying(254) COLLATE pg_catalog."default",
|
||||||
|
date_creat date,
|
||||||
geom = "geom"
|
date_maj date,
|
||||||
champ_travaux_prevus_multipolygon="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, surface_m2 double precision, surface_ha double precision, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
|
num_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_travaux_prevus_multilinestring="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, longueur_m double precision, longueur_km double precision, date_creation date, date_maj date, geom geometry(MultiLineString,2154))"""
|
type_unite character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_travaux_prevus_point = """(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, x_wgs84 double precision, y_wgs84 double precision, date_creation date, date_maj date, geom geometry(Point,2154))"""
|
dynamique character varying(254) COLLATE pg_catalog."default",
|
||||||
|
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_viergePolygone = """(gid serial NOT NULL, commentaire text, surface_m2 double precision, surface_ha double precision, geom geometry(MultiPolygon,2154))"""
|
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_viergeLigne = """(gid serial NOT NULL, commentaire text, longueur_m double precision, longueur_km double precision, geom geometry(MultiLineString,2154))"""
|
eta_conser character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_viergePoint = """(gid serial NOT NULL, commentaire text, x_wgs84 double precision, y_wgs84 double precision, geom geometry(Point,2154))"""
|
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
|
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_habitat = """(gid serial NOT NULL, cd_cb_01 text, lb_cb97_fr_01 text, occupation_01 integer, cd_cb_02 text, lb_cb97_fr_02 text, occupation_02 integer, cd_cb_03 text, lb_cb97_fr_03 text, occupation_03 integer, milieu_code text, milieu_libelle text, surface_m2 double precision, surface_ha double precision, commentaire text, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
|
syntaxon character varying(254) COLLATE pg_catalog."default",
|
||||||
|
n2000 character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_contour="""(gid serial NOT NULL, date_creation date, date_maj date, utilisateur character varying, dept character(2), nom character varying, surface_m2 double precision, surface_ha double precision, type_site character varying, type_milieu character varying, date_premier_pg integer, date_debut_pg integer, date_fin_pg integer, referent character varying, gestion_deleguee character varying, terrain_militaire character(3), ens character(3), zh character(3), adapt_pmr character(3), inform character(3), guide character(3), ouverture_public character(3), obs character(3), anim character(3), n2000_anim character(3), contrat_n2000_conseil character(3), n2000_op character(3), contrat_n2000_benef character(3), contrat_agri character(3), bc_habitat integer, bc_amphibien integer, bc_coleoptere integer, bc_crustace integer, bc_mammifere integer, bc_chiroptere integer, bc_mollusque integer, bc_odonate integer, bc_oiseau integer, bc_orthoptere integer, bc_poisson integer, bc_reptile integer, bc_rhopalocere integer, bc_heterocere integer, bc_autre_invertebre integer, bc_flore integer, bc_bryophyte integer, bc_champignon integer, suiv_analyse_sol character(3), suiv_piezo character(3), suiv_climat character(3), suiv_topo character(3), suiv_habitat character(3), suiv_amphibien character(3), suiv_coleoptere character(3), suiv_crustace character(3), suiv_mammifere character(3), suiv_chiroptere character(3), suiv_mollusque character(3), suiv_odonate character(3), suiv_oiseau character(3), suiv_orthoptere character(3), suiv_poisson character(3), suiv_reptile character(3), suiv_rhopalocere character(3), suiv_heterocere character(3), suiv_autre_invertebre character(3), suiv_flore character(3), suiv_bryophyte character(3), suiv_champignon character(3), suiv_analyse_eau character(3), suiv_phenologie character(3), suiv_frequentation character(3), suiv_paysager character(3), suiv_autre character(3), commentaire text, geom geometry(MultiPolygon,2154))
|
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
||||||
"""
|
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
||||||
|
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_vegethab_point = """(
|
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
||||||
gid serial NOT NULL ,
|
num_photo character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
nature_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
date_sais date,
|
||||||
occupati_1 bigint,
|
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
alli_name character varying(254) COLLATE pg_catalog."default",
|
||||||
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
salli_name character varying(254) COLLATE pg_catalog."default",
|
||||||
occupati_2 bigint,
|
class_name character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
geom geometry(Point,2154)
|
||||||
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
)
|
||||||
occupati_3 bigint,
|
"""
|
||||||
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
champ_vegethab_multilinestring = """(
|
||||||
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
gid serial NOT NULL ,
|
||||||
surface_m2 numeric,
|
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
||||||
surface_ha numeric,
|
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
||||||
commentair character varying(254) COLLATE pg_catalog."default",
|
occupati_1 bigint,
|
||||||
date_creat date,
|
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
||||||
date_maj date,
|
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
||||||
num_phyto character varying(254) COLLATE pg_catalog."default",
|
occupati_2 bigint,
|
||||||
type_unite character varying(254) COLLATE pg_catalog."default",
|
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
||||||
dynamique character varying(254) COLLATE pg_catalog."default",
|
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
||||||
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
occupati_3 bigint,
|
||||||
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
||||||
eta_conser character varying(254) COLLATE pg_catalog."default",
|
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
||||||
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
surface_m2 numeric,
|
||||||
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
surface_ha numeric,
|
||||||
syntaxon character varying(254) COLLATE pg_catalog."default",
|
commentair character varying(254) COLLATE pg_catalog."default",
|
||||||
n2000 character varying(254) COLLATE pg_catalog."default",
|
date_creat date,
|
||||||
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
date_maj date,
|
||||||
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
num_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
type_unite character varying(254) COLLATE pg_catalog."default",
|
||||||
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
dynamique character varying(254) COLLATE pg_catalog."default",
|
||||||
num_photo character varying(254) COLLATE pg_catalog."default",
|
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
nature_obs character varying(254) COLLATE pg_catalog."default",
|
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
date_sais date,
|
eta_conser character varying(254) COLLATE pg_catalog."default",
|
||||||
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
alli_name character varying(254) COLLATE pg_catalog."default",
|
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
salli_name character varying(254) COLLATE pg_catalog."default",
|
syntaxon character varying(254) COLLATE pg_catalog."default",
|
||||||
class_name character varying(254) COLLATE pg_catalog."default",
|
n2000 character varying(254) COLLATE pg_catalog."default",
|
||||||
geom geometry(Point,2154)
|
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
||||||
)
|
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
||||||
"""
|
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_vegethab_multilinestring = """(
|
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
||||||
gid serial NOT NULL ,
|
num_photo character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
nature_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
date_sais date,
|
||||||
occupati_1 bigint,
|
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
alli_name character varying(254) COLLATE pg_catalog."default",
|
||||||
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
salli_name character varying(254) COLLATE pg_catalog."default",
|
||||||
occupati_2 bigint,
|
class_name character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
geom geometry(MultiLineString,2154)
|
||||||
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
)
|
||||||
occupati_3 bigint,
|
"""
|
||||||
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
champ_vegethab_multipolygon = """(
|
||||||
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
gid serial NOT NULL ,
|
||||||
surface_m2 numeric,
|
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
||||||
surface_ha numeric,
|
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
||||||
commentair character varying(254) COLLATE pg_catalog."default",
|
occupati_1 bigint,
|
||||||
date_creat date,
|
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
||||||
date_maj date,
|
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
||||||
num_phyto character varying(254) COLLATE pg_catalog."default",
|
occupati_2 bigint,
|
||||||
type_unite character varying(254) COLLATE pg_catalog."default",
|
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
||||||
dynamique character varying(254) COLLATE pg_catalog."default",
|
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
||||||
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
occupati_3 bigint,
|
||||||
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
||||||
eta_conser character varying(254) COLLATE pg_catalog."default",
|
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
||||||
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
surface_m2 numeric,
|
||||||
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
surface_ha numeric,
|
||||||
syntaxon character varying(254) COLLATE pg_catalog."default",
|
commentair character varying(254) COLLATE pg_catalog."default",
|
||||||
n2000 character varying(254) COLLATE pg_catalog."default",
|
date_creat date,
|
||||||
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
date_maj date,
|
||||||
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
num_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
type_unite character varying(254) COLLATE pg_catalog."default",
|
||||||
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
dynamique character varying(254) COLLATE pg_catalog."default",
|
||||||
num_photo character varying(254) COLLATE pg_catalog."default",
|
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
nature_obs character varying(254) COLLATE pg_catalog."default",
|
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
date_sais date,
|
eta_conser character varying(254) COLLATE pg_catalog."default",
|
||||||
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
alli_name character varying(254) COLLATE pg_catalog."default",
|
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
salli_name character varying(254) COLLATE pg_catalog."default",
|
syntaxon character varying(254) COLLATE pg_catalog."default",
|
||||||
class_name character varying(254) COLLATE pg_catalog."default",
|
n2000 character varying(254) COLLATE pg_catalog."default",
|
||||||
geom geometry(MultiLineString,2154)
|
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
||||||
)
|
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
||||||
"""
|
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_vegethab_multipolygon = """(
|
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
||||||
gid serial NOT NULL ,
|
num_photo character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
nature_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
date_sais date,
|
||||||
occupati_1 bigint,
|
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
alli_name character varying(254) COLLATE pg_catalog."default",
|
||||||
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
salli_name character varying(254) COLLATE pg_catalog."default",
|
||||||
occupati_2 bigint,
|
class_name character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
geom geometry(MultiPolygon,2154)
|
||||||
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
)
|
||||||
occupati_3 bigint,
|
|
||||||
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
|
||||||
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
|
||||||
surface_m2 numeric,
|
|
||||||
surface_ha numeric,
|
|
||||||
commentair character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_creat date,
|
|
||||||
date_maj date,
|
|
||||||
num_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
type_unite character varying(254) COLLATE pg_catalog."default",
|
|
||||||
dynamique character varying(254) COLLATE pg_catalog."default",
|
|
||||||
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
eta_conser character varying(254) COLLATE pg_catalog."default",
|
|
||||||
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
syntaxon character varying(254) COLLATE pg_catalog."default",
|
|
||||||
n2000 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
|
||||||
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
|
||||||
num_photo character varying(254) COLLATE pg_catalog."default",
|
|
||||||
nature_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_sais date,
|
|
||||||
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
salli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
class_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
geom geometry(MultiPolygon,2154)
|
|
||||||
)
|
|
||||||
"""
|
"""
|
||||||
@@ -6,6 +6,7 @@ import tempfile
|
|||||||
import base64
|
import base64
|
||||||
import psycopg2
|
import psycopg2
|
||||||
import psycopg2.extras
|
import psycopg2.extras
|
||||||
|
import os
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
|
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
@@ -89,7 +90,7 @@ def resources_path(*args):
|
|||||||
:return: Absolute path to the resources folder.
|
:return: Absolute path to the resources folder.
|
||||||
:rtype: str
|
:rtype: str
|
||||||
"""
|
"""
|
||||||
path = abspath(abspath(join(plugin_path(), "CenRa_Copie\\tools")))
|
path = abspath(abspath(join(plugin_path(), "CenRa_COPIE\\tools")))
|
||||||
for item in args:
|
for item in args:
|
||||||
path = abspath(join(path, item))
|
path = abspath(join(path, item))
|
||||||
return path
|
return path
|
||||||
@@ -107,24 +108,15 @@ def load_ui(*args):
|
|||||||
|
|
||||||
return ui_class
|
return ui_class
|
||||||
|
|
||||||
def login_base(take=None):
|
def pyperclip():
|
||||||
from CenRa_Metabase.resources.PythonSQL import host,port,dbname,password,os_user
|
dst = dirname(dirname(__file__))+"\\tools\\"
|
||||||
first_conn = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=first_cnx password=" + password)
|
if os.access('N:/',os.R_OK):
|
||||||
first_cur = first_conn.cursor(cursor_factory = psycopg2.extras.DictCursor)
|
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
|
||||||
first_cur.execute("SELECT mdp_w, login_w FROM pg_catalog.pg_user t1, admin_sig.vm_users_sig t2 WHERE t2.oid = t1.usesysid AND (login_w = '" + os_user + "' OR login_w = '" + os_user + "')")
|
try:
|
||||||
res_ident = first_cur.fetchone()
|
shutil.copy(src, dst)
|
||||||
mdp = base64.b64decode(str(res_ident[0])).decode('utf-8')
|
except:
|
||||||
user = res_ident[1]
|
print('404')
|
||||||
|
|
||||||
con = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=" + user + " password=" + mdp)
|
|
||||||
|
|
||||||
cur = con.cursor(cursor_factory = psycopg2.extras.DictCursor)
|
|
||||||
first_conn.close()
|
|
||||||
|
|
||||||
if take:
|
|
||||||
return cur,con
|
|
||||||
else:
|
|
||||||
return cur
|
|
||||||
def send_issues(url,titre,body,labels):
|
def send_issues(url,titre,body,labels):
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
@@ -157,7 +149,7 @@ def maj_verif(NAME):
|
|||||||
|
|
||||||
url = qgis.utils.pluginMetadata(NAME,'repository')
|
url = qgis.utils.pluginMetadata(NAME,'repository')
|
||||||
#URL = url+'/raw/branch/main/plugins.xml'
|
#URL = url+'/raw/branch/main/plugins.xml'
|
||||||
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
|
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
|
||||||
# print(URL)
|
# print(URL)
|
||||||
version = qgis.utils.pluginMetadata(NAME,'version')
|
version = qgis.utils.pluginMetadata(NAME,'version')
|
||||||
len_version = len(version)
|
len_version = len(version)
|
||||||
@@ -167,12 +159,15 @@ def maj_verif(NAME):
|
|||||||
except:
|
except:
|
||||||
binar = False
|
binar = False
|
||||||
if binar:
|
if binar:
|
||||||
version_web = str(urllib.request.urlopen(URL).read())
|
try:
|
||||||
plugin_num = version_web.find(NAME)
|
version_web = str(urllib.request.urlopen(URL).read())
|
||||||
valeur_version_web = version_web.find('<version>',plugin_num)+9
|
plugin_num = version_web.find(NAME)
|
||||||
version_plugin = version_web[valeur_version_web:valeur_version_web+len_version]
|
valeur_version_web = version_web.find('<version>',plugin_num)+9
|
||||||
if version_plugin != version:
|
version_plugin = version_web[valeur_version_web:valeur_version_web+len_version]
|
||||||
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
if version_plugin != version:
|
||||||
|
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
||||||
|
except:
|
||||||
|
print("error gitea version ssl")
|
||||||
else:
|
else:
|
||||||
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Metabase</string>
|
<string>Journal des modifications</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset>
|
<iconset>
|
||||||
@@ -29,9 +29,6 @@
|
|||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -41,7 +38,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>453</width>
|
<width>453</width>
|
||||||
<height>547</height>
|
<height>570</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
@@ -56,7 +53,7 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>DevLog</string>
|
<string>DevLog</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWebView" name="viewer" native="true">
|
<widget class="QTextBrowser" name="viewer">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
@@ -65,11 +62,6 @@
|
|||||||
<height>511</height>
|
<height>511</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="url" stdset="0">
|
|
||||||
<url>
|
|
||||||
<string>about:blank</string>
|
|
||||||
</url>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -78,19 +70,12 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::NoButton</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>QWebView</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">QtWebKitWidgets/QWebView</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -12,17 +12,20 @@ import qgis
|
|||||||
|
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
import socket
|
||||||
import os
|
import os
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
plugin_path,
|
plugin_path,
|
||||||
|
pyperclip,
|
||||||
resources_path,
|
resources_path,
|
||||||
maj_verif,
|
maj_verif,
|
||||||
)
|
)
|
||||||
|
pyperclip()
|
||||||
from .flux_editor import Flux_Editor
|
from .flux_editor import Flux_Editor
|
||||||
from .about_form import FluxAboutDialog
|
from .about_form import AboutDialog
|
||||||
|
|
||||||
|
from qgis.PyQt.QtCore import *
|
||||||
|
|
||||||
from PyQt5.QtCore import *
|
|
||||||
|
|
||||||
class PgFlux:
|
class PgFlux:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -40,7 +43,7 @@ class PgFlux:
|
|||||||
maj_verif(NAME)
|
maj_verif(NAME)
|
||||||
|
|
||||||
# Display About window on first use
|
# Display About window on first use
|
||||||
version = qgis.utils.pluginMetadata('CenRa_Flux','version')
|
version = qgis.utils.pluginMetadata('CenRa_FLUX','version')
|
||||||
s = QSettings()
|
s = QSettings()
|
||||||
versionUse = s.value("flux/version", 1, type=str)
|
versionUse = s.value("flux/version", 1, type=str)
|
||||||
if str(versionUse) != str(version) :
|
if str(versionUse) != str(version) :
|
||||||
@@ -63,16 +66,20 @@ class PgFlux:
|
|||||||
if not self.action_editor:
|
if not self.action_editor:
|
||||||
self.action_editor = Flux_Editor()
|
self.action_editor = Flux_Editor()
|
||||||
|
|
||||||
|
|
||||||
self.flux_editor = QAction(icon, 'SigCEN',None)
|
self.flux_editor = QAction(icon, 'SigCEN',None)
|
||||||
self.toolBar.addAction(self.flux_editor)
|
self.toolBar.addAction(self.flux_editor)
|
||||||
self.flux_editor.triggered.connect(self.open_editor)
|
self.flux_editor.triggered.connect(self.open_editor)
|
||||||
|
self.flux_editor.setEnabled(False)
|
||||||
|
if os.access('N:/',os.R_OK):
|
||||||
|
self.flux_editor.setEnabled(True)
|
||||||
|
|
||||||
def open_about_dialog(self):
|
def open_about_dialog(self):
|
||||||
"""
|
"""
|
||||||
About dialog
|
About dialog
|
||||||
"""
|
"""
|
||||||
dialog = CopieAboutDialog(iface)
|
dialog = AboutDialog(iface)
|
||||||
dialog.exec_()
|
dialog.exec()
|
||||||
def open_help():
|
def open_help():
|
||||||
""" Open the online help. """
|
""" Open the online help. """
|
||||||
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
||||||
|
|||||||
@@ -1,60 +1,6 @@
|
|||||||
# <p align="center">FluxCEN</p>
|
|
||||||
|
|
||||||
<img align="left" src=https://raw.githubusercontent.com/CEN-Nouvelle-Aquitaine/fluxcen/main/icon.png width="220"/>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
Le plugin QGIS FluxCEN permet d'accéder rapidement à un large éventail de flux WFS/WMS organisés par catégories et interrogeables sous forme de mots-clés.
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
Il évite ainsi d'avoir à gérer dans QGIS une multitude de connexions.
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
|
|
||||||
## 🧐 Features
|
|
||||||
- Sélection rapide des ressources par autocomplétion
|
|
||||||
- Regroupement des flux au sein de catégories
|
|
||||||
- Gestion des styles par défaut à l'ouverture dans QGIS pour les données WFS
|
|
||||||
- Centralisation et gestion des flux simplifiée dans un fichier .csv
|
|
||||||
- Code et ressources attachées gérées directement via le git
|
|
||||||
- Prise en charge des flux Geoserver et Mapserver
|
|
||||||
- Lien direct vers la fiche de métadonnées de la ressource
|
|
||||||
|
|
||||||
## Composition du fichier .csv
|
|
||||||
|
|
||||||
* service : type de service utilisé (WFS ou WMS)
|
|
||||||
* categorie : categorie de la couche pour affichage et recherche dans le plugin
|
|
||||||
* Nom_couche_plugin : nom de la couche qui s'affichera dans le plugin
|
|
||||||
* nom_technique : nom technique de la couche utilisé sur le serveur source (caché dans le plugin)
|
|
||||||
* url : URL du serveur pour accéder à la couche
|
|
||||||
* source : Source de la donnée
|
|
||||||
* style : nom du fichier de style pour affichage à l'ouverture dans QGIS
|
|
||||||
* metadonnees : URL d'accès à la fiche de métadonnées liée à la resource
|
|
||||||
|
|
||||||
Exemple pour accéder à la BD ORTHO® :
|
|
||||||
|
|
||||||
| service | categorie | Nom_couche_plugin | nom_technique | url | source | style |
|
|
||||||
| -------- | -------- | -------- | -------- | -------- |-------- | -------- |
|
|
||||||
| WMS Raster| Fonds cartos | BD ORTHO® | HR.ORTHOIMAGERY.ORTHOPHOTOS |https://wxs.ign.fr/ortho/geoportail/r/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities| IGN | |
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Style des couches
|
|
||||||
|
|
||||||
Le dossier *styles_couches* stocke les styles QGIS au format .qml afin d'appliquer par défaut ce style à l'ouverture de la couche dans QGIS. L'ajout d'un style dans ce dossier nécessite de reporter le nom du fichier .qml dans le champ "style" du csv.
|
|
||||||
|
|
||||||
|
|
||||||
## Accès aux données protégées
|
|
||||||
|
|
||||||
Si l'accès à la majorité des ressources reste public, certaines peuvent être protégées par un mot de passe (données métier confidentielles par exemple).
|
|
||||||
|
|
||||||
Cette authentification est gérée via le serveur cartographique qui génère les flux.
|
|
||||||
Pour y accéder, il faut créer en amont une authentification dans QGIS. L'ouverture des données protégées se fera alors à partir de la première authentification enregistrée dans QGIS (pas de gestion multi-authentification pour le moment)
|
|
||||||
|
|
||||||
## Interface du plugin:
|
|
||||||
|
|
||||||
<img align="center" src=https://raw.githubusercontent.com/CEN-Nouvelle-Aquitaine/fluxcen/main/fluxcen_interface.PNG width="600"/>
|
|
||||||
|
|
||||||
|
> [Point de départ de création du plugin](https://github.com/CEN-Nouvelle-Aquitaine/MapCEN)
|
||||||
|
|
||||||
|
Le plugin QGIS CenRa_FLUX permet d'accéder rapidement à un large éventail de données organisés dans PostGIS par catégories et interrogeables sous forme de mots-clés.
|
||||||
|
|
||||||
|
Il évite ainsi d'avoir à gérer dans QGIS une multitude de connexions.
|
||||||
@@ -17,7 +17,7 @@ ABOUT_FORM_CLASS, _ = uic.loadUiType(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class FluxAboutDialog(QDialog, ABOUT_FORM_CLASS):
|
class AboutDialog(QDialog, ABOUT_FORM_CLASS):
|
||||||
|
|
||||||
""" About - Let the user display the about dialog. """
|
""" About - Let the user display the about dialog. """
|
||||||
|
|
||||||
|
|||||||
@@ -11,11 +11,18 @@ from qgis.PyQt.QtCore import QSettings
|
|||||||
from qgis.PyQt import QtWidgets
|
from qgis.PyQt import QtWidgets
|
||||||
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
|
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
|
||||||
from qgis.PyQt.QtGui import QIcon
|
from qgis.PyQt.QtGui import QIcon
|
||||||
from PyQt5.QtCore import *
|
try:
|
||||||
from PyQt5.QtGui import *
|
from PyQt5.QtCore import *
|
||||||
from PyQt5 import QtGui
|
from PyQt5.QtGui import *
|
||||||
|
from PyQt5 import QtGui
|
||||||
|
except:
|
||||||
|
from PyQt6.QtCore import *
|
||||||
|
from PyQt6.QtGui import *
|
||||||
|
from PyQt6 import QtGui
|
||||||
|
|
||||||
from qgis.core import *
|
from qgis.core import *
|
||||||
from qgis.core import QgsDataSourceUri
|
from qgis.core import QgsDataSourceUri
|
||||||
|
from qgis.PyQt.QtSvg import QSvgWidget
|
||||||
from qgis.PyQt.QtWidgets import (
|
from qgis.PyQt.QtWidgets import (
|
||||||
QDialog,
|
QDialog,
|
||||||
QAction,
|
QAction,
|
||||||
@@ -29,15 +36,20 @@ from qgis.PyQt.QtWidgets import (
|
|||||||
QMessageBox,
|
QMessageBox,
|
||||||
QVBoxLayout,
|
QVBoxLayout,
|
||||||
)
|
)
|
||||||
from .tools.PythonSQL import *
|
from .tools.SQLRequet import *
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
resources_path,
|
||||||
login_base,
|
|
||||||
send_issues,
|
send_issues,
|
||||||
)
|
)
|
||||||
|
try:
|
||||||
|
from .tools.PythonSQL import login_base
|
||||||
|
except:
|
||||||
|
print('Pas de fichier PythonSQL')
|
||||||
|
|
||||||
from .issues import CenRa_Issues
|
from .issues import CenRa_Issues
|
||||||
|
|
||||||
|
from ast import literal_eval
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
import os.path
|
import os.path
|
||||||
import webbrowser, os
|
import webbrowser, os
|
||||||
@@ -45,15 +57,136 @@ import psycopg2
|
|||||||
import psycopg2.extras
|
import psycopg2.extras
|
||||||
import base64
|
import base64
|
||||||
|
|
||||||
first_conn = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=first_cnx password=" + password)
|
global DeBUG
|
||||||
first_cur = first_conn.cursor(cursor_factory = psycopg2.extras.DictCursor)
|
DeBUG = 0
|
||||||
first_cur.execute("SELECT mdp_w, login_w FROM pg_catalog.pg_user t1, admin_sig.vm_users_sig t2 WHERE t2.oid = t1.usesysid AND (login_w = '" + os_user + "' OR login_w = '" + os_user + "')")
|
|
||||||
res_ident = first_cur.fetchone()
|
|
||||||
mdp = base64.b64decode(str(res_ident[0])).decode('utf-8')
|
|
||||||
user = res_ident[1]
|
|
||||||
first_conn.close()
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
account = login_base('account')
|
||||||
|
user = account[0]
|
||||||
|
mdp = account[1]
|
||||||
|
host = account[2]
|
||||||
|
port = account[3]
|
||||||
|
dbname = account[4]
|
||||||
|
sigdb = account[5]
|
||||||
|
refdb = account[6]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
except:
|
||||||
|
print('')
|
||||||
EDITOR_CLASS = load_ui('CenRa_Flux_base.ui')
|
EDITOR_CLASS = load_ui('CenRa_Flux_base.ui')
|
||||||
|
html = '''<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
|
||||||
|
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
|
||||||
|
crossorigin=""/>
|
||||||
|
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
|
||||||
|
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
|
||||||
|
crossorigin=""></script>
|
||||||
|
<style>
|
||||||
|
body { padding: 0; margin: 0; }
|
||||||
|
html, body, #map { height: 100%; }
|
||||||
|
.leaflet-control-layers-toggle {
|
||||||
|
background-image: url(https://intranet.cenra-outils.org/Intranet/css/images/layers.png);
|
||||||
|
}
|
||||||
|
.legend_parc {
|
||||||
|
border-radius: 15px;
|
||||||
|
box-shadow: 2px 2px 3px 0 #6a6a6a;
|
||||||
|
background-color: #fefafab3;
|
||||||
|
opacity:0;
|
||||||
|
}
|
||||||
|
.legend_parc:hover{
|
||||||
|
opacity:1;
|
||||||
|
}
|
||||||
|
.popup-with-no-events {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="map"></div>
|
||||||
|
<script src="map.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
<script>'''
|
||||||
|
font = '''var OrthoIGN = L.tileLayer('https://wmts.geopf.fr/wmts?'+
|
||||||
|
'&LAYER={ignLayer}&STYLE={style}&TILEMATRIXSET=PM'+
|
||||||
|
'&SERVICE={service}&REQUEST=GetTile&VERSION=1.0.0'+
|
||||||
|
'&FORMAT={format}&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}',
|
||||||
|
{
|
||||||
|
ignLayer: 'ORTHOIMAGERY.ORTHOPHOTOS',
|
||||||
|
style: 'normal',
|
||||||
|
service: 'WMTS',
|
||||||
|
format: 'image/jpeg',
|
||||||
|
minZoom: 0,
|
||||||
|
maxZoom: 19,
|
||||||
|
attribution: '© IGN'
|
||||||
|
}).addTo(map);
|
||||||
|
// Plan IGN avec une transparence de 50%
|
||||||
|
var PlanIGN = L.tileLayer('https://wmts.geopf.fr/wmts?'+
|
||||||
|
'&LAYER={ignLayer}&STYLE={style}&TILEMATRIXSET=PM'+
|
||||||
|
'&SERVICE={service}&REQUEST=GetTile&VERSION=1.0.0'+
|
||||||
|
'&FORMAT={format}&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}',
|
||||||
|
{
|
||||||
|
ignLayer: 'GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2',
|
||||||
|
style: 'normal',
|
||||||
|
service: 'WMTS',
|
||||||
|
format: 'image/png',
|
||||||
|
minZoom: 0,
|
||||||
|
maxZoom: 19,
|
||||||
|
attribution: '© IGN'
|
||||||
|
});
|
||||||
|
var baseMaps = {
|
||||||
|
// "BDORTHO2" : bdortho,
|
||||||
|
// "Openstreetmap": openStreetMap,
|
||||||
|
// "Opentopomap": openTopoMap,
|
||||||
|
"BDORTHO" : OrthoIGN,
|
||||||
|
"PlanIGN": PlanIGN
|
||||||
|
};
|
||||||
|
var overlayMaps = {
|
||||||
|
"Sites": Sites,
|
||||||
|
//"Parcelle":JSON
|
||||||
|
};
|
||||||
|
L.control.layers(baseMaps,overlayMaps).addTo(map);
|
||||||
|
var scale = L.control.scale({position: 'bottomleft', metric:true, imperial:false});
|
||||||
|
scale.addTo(map);
|
||||||
|
var legend = L.control({position: 'bottomleft'});
|
||||||
|
|
||||||
|
legend.onAdd = function (map) {
|
||||||
|
var div = L.DomUtil.create('div', 'info legend_parc'),
|
||||||
|
labels = [];
|
||||||
|
labels.push('<i style="background:#73004c;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Acquisition')
|
||||||
|
|
||||||
|
labels.push('<i style="background:#ff00c5;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Acquis en partie BND')
|
||||||
|
|
||||||
|
labels.push('<i style="background:#f0ade1ab;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Acquisition pour partie')
|
||||||
|
|
||||||
|
labels.push('<i style="background:#73462e;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Acquisition / Convention')
|
||||||
|
|
||||||
|
labels.push('<i style="background:#e69800;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Convention')
|
||||||
|
|
||||||
|
labels.push('<i style="background:#ffd37f;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Convention en partie BND')
|
||||||
|
|
||||||
|
labels.push('<i style="background:#ffebaf;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Convention pour partie')
|
||||||
|
|
||||||
|
labels.push('<i style="background:#c8c8c8;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Autre')
|
||||||
|
|
||||||
|
labels.push('<i style="background:#f9ff08;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Projet en cours')
|
||||||
|
|
||||||
|
labels.push('<i style="background:#fe0000;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Problème de mise à jour')
|
||||||
|
|
||||||
|
labels.push('<i style="background:#000;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Pas de maitrise')
|
||||||
|
|
||||||
|
div.innerHTML = labels.join('<br>');
|
||||||
|
return div;
|
||||||
|
};
|
||||||
|
|
||||||
|
legend.addTo(map);
|
||||||
|
</script>'''
|
||||||
|
targetCrs = QgsCoordinateReferenceSystem('EPSG:4326')
|
||||||
|
layerCrs = QgsCoordinateReferenceSystem('EPSG:2154')
|
||||||
|
TranformCRS = QgsCoordinateTransform(layerCrs, targetCrs,QgsProject.instance())
|
||||||
|
|
||||||
class Flux_Editor(QDialog, EDITOR_CLASS):
|
class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||||
|
|
||||||
@@ -70,8 +203,9 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.commandLinkButton.setIcon(QtGui.QIcon(resources_path('ui','arrow-bottom.png')))
|
self.commandLinkButton.setIcon(QtGui.QIcon(resources_path('ui','arrow-bottom.png')))
|
||||||
self.commandLinkButton_2.setIcon(QtGui.QIcon(resources_path('ui','arrow-up.png')))
|
self.commandLinkButton_2.setIcon(QtGui.QIcon(resources_path('ui','arrow-up.png')))
|
||||||
|
|
||||||
self.tableWidget.setSelectionBehavior(QTableWidget.SelectRows)
|
#self.tableWidget.setSelectionBehavior(QTableWidget.selectRow)
|
||||||
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger(0))
|
||||||
|
self.toolButton.setIcon(QtGui.QIcon(resources_path('ui','find.png')))
|
||||||
self.comboBox_2.addItem("SIG")
|
self.comboBox_2.addItem("SIG")
|
||||||
self.comboBox_2.addItem('REF')
|
self.comboBox_2.addItem('REF')
|
||||||
self.comboBox.currentIndexChanged.connect(self.initialisation_flux)
|
self.comboBox.currentIndexChanged.connect(self.initialisation_flux)
|
||||||
@@ -81,9 +215,20 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.commandLinkButton_2.clicked.connect(self.suppression_flux)
|
self.commandLinkButton_2.clicked.connect(self.suppression_flux)
|
||||||
self.tableWidget_2.itemDoubleClicked.connect(self.suppression_flux)
|
self.tableWidget_2.itemDoubleClicked.connect(self.suppression_flux)
|
||||||
self.comboBox_2.currentIndexChanged.connect(self.bd_source)
|
self.comboBox_2.currentIndexChanged.connect(self.bd_source)
|
||||||
|
self.checkBox.hide()
|
||||||
|
self.checkBox.stateChanged.connect(self.modeCarte)
|
||||||
|
self.toolButton.clicked.connect(self.getCanevas)
|
||||||
layout = QVBoxLayout()
|
layout = QVBoxLayout()
|
||||||
self.lineEdit.textChanged.connect(self.filtre_dynamique)
|
self.lineEdit.textChanged.connect(self.filtre_dynamique)
|
||||||
|
self.viewer.textChanged.connect(self.NewTitle)
|
||||||
layout.addWidget(self.lineEdit)
|
layout.addWidget(self.lineEdit)
|
||||||
|
self.viewer.hide()
|
||||||
|
self.DeBUG.addItem('')
|
||||||
|
self.DeBUG.addItem('01')
|
||||||
|
self.DeBUG.addItem('0726')
|
||||||
|
self.DeBUG.addItem('4269')
|
||||||
|
|
||||||
|
self.DeBUG.hide()
|
||||||
#self.lineEdit.mousePressEvent = self._mousePressEvent
|
#self.lineEdit.mousePressEvent = self._mousePressEvent
|
||||||
|
|
||||||
#metadonnees_plugin = open(self.plugin_path + '/metadata.txt')
|
#metadonnees_plugin = open(self.plugin_path + '/metadata.txt')
|
||||||
@@ -92,6 +237,141 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
def raise_(self):
|
def raise_(self):
|
||||||
"""Run method that performs all the real work"""
|
"""Run method that performs all the real work"""
|
||||||
self.bd_source()
|
self.bd_source()
|
||||||
|
def ModeDeBUG(self):
|
||||||
|
self.DeBUG.show()
|
||||||
|
|
||||||
|
def mousePressEvent(self, event):
|
||||||
|
global DeBUG
|
||||||
|
if 330 <= event.pos().x() <= 560 and 5 <= event.pos().y() <= 75:
|
||||||
|
DeBUG = DeBUG+1
|
||||||
|
if DeBUG == 3:
|
||||||
|
DeBUG = 0
|
||||||
|
self.ModeDeBUG()
|
||||||
|
else:
|
||||||
|
DeBUG = 0
|
||||||
|
self.DeBUG.hide()
|
||||||
|
|
||||||
|
def NewTitle(self):
|
||||||
|
if self.viewer.title() != '':
|
||||||
|
Tsplit = ((self.viewer.title()).split('.'))
|
||||||
|
print(Tsplit[0],Tsplit[1])
|
||||||
|
self.openPostGIS(Tsplit[0],Tsplit[1])
|
||||||
|
|
||||||
|
def modeCarte(self):
|
||||||
|
if self.checkBox.isChecked():
|
||||||
|
self.viewer.show()
|
||||||
|
|
||||||
|
cur.execute("SELECT ST_AsGeoJSON(st_centroid(ST_Transform(geom,4326))) FROM _agregation_ra._agreg_contour")
|
||||||
|
varcenter = literal_eval(cur.fetchall()[0][0])
|
||||||
|
varcenter = [varcenter['coordinates'][1],varcenter['coordinates'][0]]
|
||||||
|
|
||||||
|
cur.execute("SELECT ST_AsGeoJSON(ST_Transform(st_collect(geom),4326)),tschema,tname FROM _agregation_ra._agreg_contour WHERE geom IS NOT NULL GROUP BY tschema,tname;" )
|
||||||
|
varSite = cur.fetchall()
|
||||||
|
cur.execute("SELECT ST_AsGeoJSON(ST_Transform(st_collect(geom),4326)),tschema,tname FROM _agregation_ra._agreg_travaux_prevus_poly WHERE geom IS NOT NULL GROUP BY tschema,tname;")
|
||||||
|
varTravaux = cur.fetchall()
|
||||||
|
cur.execute("SELECT ST_AsGeoJSON(ST_Transform(geom,4326)),milieu_libelle ,lb_eu_01,tschema,tname FROM _agregation_ra._agreg_eu_habitat WHERE geom IS NOT NULL;")
|
||||||
|
varHabitat = cur.fetchall()
|
||||||
|
|
||||||
|
vargeomS = literal_eval(varSite[0][0])
|
||||||
|
vargeomT = literal_eval(varTravaux[0][0])
|
||||||
|
vargeomH = literal_eval(varHabitat[0][0])
|
||||||
|
#new_objectS = self.SwitchGeom(vargeomS)
|
||||||
|
#new_objectT = self.SwitchGeom(vargeomT)
|
||||||
|
#new_objectH = self.SwitchGeom(vargeomH)
|
||||||
|
|
||||||
|
script = 'var map = L.map("map").setView('+str(varcenter)+', 13);'
|
||||||
|
|
||||||
|
id = 0
|
||||||
|
varSiteJSON = '''var ParcelleJSON = {
|
||||||
|
"type": "FeatureCollection",
|
||||||
|
"features":['''
|
||||||
|
for varP in varSite:
|
||||||
|
id = id+1
|
||||||
|
varSiteJSON = varSiteJSON+'{"properties": {"code": "'+str(varP[1])+'.'+str(varP[2])+'" },'+str(varP[0][1:])+','
|
||||||
|
varSiteJSON = varSiteJSON[:-1]+''']};
|
||||||
|
var Sites = L.geoJSON(ParcelleJSON,{
|
||||||
|
style: function(feature) {
|
||||||
|
switch (feature.geometry.properties.code) {
|
||||||
|
case 'Ensemble de sites': return {fillColor: "#9a7863",color:"white",weight: 1,fillOpacity: 0.7};
|
||||||
|
case 'Sous-site conservatoire': return {fillColor: "#e69800",color:"white",weight: 1,fillOpacity: 0.7};
|
||||||
|
case 'Site non géré': return {fillColor: "#73004c",color:"white",weight: 1,fillOpacity: 0.7};
|
||||||
|
case 'Animation territoriale': return {fillColor: "#ffebaf",color:"white",weight: 1,fillOpacity: 0.7};
|
||||||
|
case 'Site conservatoire': return {fillColor: "#f9ff08",color:"white",weight: 1,fillOpacity: 0.7};
|
||||||
|
default: return {fillColor: "#c8c8c8",color:"white",weight: 1,fillOpacity: 0.7};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onEachFeature: function (feature,layer) {
|
||||||
|
layer.on('click', function(e) {
|
||||||
|
map.fitBounds(layer.getBounds());
|
||||||
|
document.title = feature.properties.code.toString();
|
||||||
|
});
|
||||||
|
layer.on('mouseover', function(e) {
|
||||||
|
layer.setStyle({
|
||||||
|
weight: 5,
|
||||||
|
color: '#fe0000',
|
||||||
|
dashArray: '',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
//layer.on('mousemove', function(e) {
|
||||||
|
//layer.openPopup(e.latlng);
|
||||||
|
//});
|
||||||
|
layer.on('mouseout', function(e) {
|
||||||
|
layer.setStyle({
|
||||||
|
color:"white",
|
||||||
|
weight: 1,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
layer.bindTooltip(feature.properties.code.toString(), {
|
||||||
|
sticky: true,
|
||||||
|
permanent: false,
|
||||||
|
direction: 'right',
|
||||||
|
className: 'label_parc'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).addTo(map);'''
|
||||||
|
id = 0
|
||||||
|
varTravauxJSON = '''var TravauxJSON = {
|
||||||
|
"type": "FeatureCollection",
|
||||||
|
"features":['''
|
||||||
|
for varT in varTravaux:
|
||||||
|
id = id+1
|
||||||
|
varTravauxJSON = varTravauxJSON+'{"properties": {"code": "'+str(varT[1])+'.'+str(varT[2])+'" },'+str(varT[0][1:])+','
|
||||||
|
varTravauxJSON = varTravauxJSON[:-1]+''']};
|
||||||
|
var Travaux = L.geoJSON(TravauxJSON,{
|
||||||
|
onEachFeature: function (feature,layer) {
|
||||||
|
layer.on('click', function(e) {
|
||||||
|
map.fitBounds(layer.getBounds());
|
||||||
|
document.title = feature.properties.code.toString();
|
||||||
|
});
|
||||||
|
layer.on('mouseover', function(e) {
|
||||||
|
layer.setStyle({
|
||||||
|
weight: 5,
|
||||||
|
color: '#fe0000',
|
||||||
|
dashArray: '',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
//layer.on('mousemove', function(e) {
|
||||||
|
//layer.openPopup(e.latlng);
|
||||||
|
//});
|
||||||
|
layer.on('mouseout', function(e) {
|
||||||
|
layer.setStyle({
|
||||||
|
color:"white",
|
||||||
|
weight: 1,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
layer.bindTooltip(feature.properties.code.toString(), {
|
||||||
|
sticky: true,
|
||||||
|
permanent: false,
|
||||||
|
direction: 'right',
|
||||||
|
className: 'label_parc'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).addTo(map);'''
|
||||||
|
script = script+varSiteJSON+varTravauxJSON
|
||||||
|
self.viewer.setHtml(html+script+font)
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.viewer.hide()
|
||||||
|
|
||||||
def bd_source(self):
|
def bd_source(self):
|
||||||
self.activateWindow()
|
self.activateWindow()
|
||||||
@@ -119,7 +399,7 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
# show the dialog
|
# show the dialog
|
||||||
self.show()
|
self.show()
|
||||||
# Run the dialog event loop
|
# Run the dialog event loop
|
||||||
result = self.exec_()
|
result = self.exec()
|
||||||
# See if OK was pressed
|
# See if OK was pressed
|
||||||
if result:
|
if result:
|
||||||
# Do something useful here - delete the line containing pass and
|
# Do something useful here - delete the line containing pass and
|
||||||
@@ -143,7 +423,7 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
# show the dialog
|
# show the dialog
|
||||||
self.show()
|
self.show()
|
||||||
# Run the dialog event loop
|
# Run the dialog event loop
|
||||||
result = self.exec_()
|
result = self.exec()
|
||||||
# See if OK was pressed
|
# See if OK was pressed
|
||||||
if result:
|
if result:
|
||||||
# Do something useful here - delete the line containing pass and
|
# Do something useful here - delete the line containing pass and
|
||||||
@@ -158,6 +438,7 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
def initialisation_flux(self):
|
def initialisation_flux(self):
|
||||||
if dbtype == sigdb:
|
if dbtype == sigdb:
|
||||||
|
# self.toolButton.setEnabled(1)
|
||||||
if self.comboBox.currentText() == 'toutes les catégories':
|
if self.comboBox.currentText() == 'toutes les catégories':
|
||||||
custom_list=schemaname_list
|
custom_list=schemaname_list
|
||||||
elif self.comboBox.currentText() == 'travaux':
|
elif self.comboBox.currentText() == 'travaux':
|
||||||
@@ -175,6 +456,13 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
cur.execute(custom_list)
|
cur.execute(custom_list)
|
||||||
list_schema = cur.fetchall()
|
list_schema = cur.fetchall()
|
||||||
|
|
||||||
|
SQLraster = """SELECT concat(r_table_schema,'.',r_table_name) from public.raster_columns; """
|
||||||
|
cur.execute(SQLraster)
|
||||||
|
list_raster = cur.fetchall()
|
||||||
|
RasterList = []
|
||||||
|
for rasterFind in list_raster:
|
||||||
|
RasterList.append(rasterFind[0])
|
||||||
|
|
||||||
self.tableWidget.setRowCount(len(list_schema))
|
self.tableWidget.setRowCount(len(list_schema))
|
||||||
self.tableWidget.setColumnCount(3)
|
self.tableWidget.setColumnCount(3)
|
||||||
i=0
|
i=0
|
||||||
@@ -182,7 +470,11 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
if dbtype == sigdb:
|
if dbtype == sigdb:
|
||||||
type_val = str(value[0])[1:3]
|
type_val = str(value[0])[1:3]
|
||||||
schema_name=str(value[0])[4:]
|
schema_name=str(value[0])[4:]
|
||||||
table_name=str(value[1])
|
table_name=str(value[1][len(value[0])+1:])
|
||||||
|
if value[0] == value[1][:len(value[0])]:
|
||||||
|
table_name=str(value[1][len(value[0])+1:])
|
||||||
|
else:
|
||||||
|
table_name=str(value[1])
|
||||||
else:
|
else:
|
||||||
type_val = ''
|
type_val = ''
|
||||||
schema_name=str(value[0])
|
schema_name=str(value[0])
|
||||||
@@ -190,18 +482,33 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
if type_val == 'fo':
|
if type_val == 'fo':
|
||||||
type_val=str(value[0])[1:5]
|
type_val=str(value[0])[1:5]
|
||||||
schema_name=str(value[0])[6:]
|
schema_name=str(value[0])[6:]
|
||||||
table_name=str(value[1])
|
if value[0] == value[1][:len(value[0])]:
|
||||||
|
table_name=str(value[1][len(value[0])+1:])
|
||||||
|
else:
|
||||||
|
table_name=str(value[1])
|
||||||
elif type_val == 'ra':
|
elif type_val == 'ra':
|
||||||
type_val='travaux'
|
type_val='travaux'
|
||||||
schema_name=str(value[0])
|
schema_name=str(value[0])
|
||||||
table_name=str(value[1])
|
table_name=str(value[1])
|
||||||
elif type_val != '00' and type_val != '01' and type_val != '07' and type_val != '26' and type_val != '42' and type_val != '69' and type_val != 'ra':
|
elif type_val != '00' and type_val != '01' and type_val != '07' and type_val != '26' and type_val != '42' and type_val != '69' and type_val != 'ra':
|
||||||
type_val='agregation'
|
if dbtype == refdb:
|
||||||
|
if (schema_name+'.'+table_name) in RasterList:
|
||||||
|
SVG = 'mIconRaster.svg'
|
||||||
|
else:
|
||||||
|
SVG = 'mIconWfs.svg'
|
||||||
|
svgWidget = QSvgWidget(resources_path('icons',SVG))
|
||||||
|
else:
|
||||||
|
type_val='agregation'
|
||||||
schema_name=str(value[0])
|
schema_name=str(value[0])
|
||||||
table_name=str(value[1])
|
table_name=str(value[1])
|
||||||
|
|
||||||
item = QTableWidgetItem(type_val)
|
item = QTableWidgetItem(type_val)
|
||||||
self.tableWidget.setItem(i,0,item)
|
if dbtype == refdb:
|
||||||
|
self.tableWidget.setCellWidget(i,0,svgWidget)
|
||||||
|
self.tableWidget.setItem(i,0,QTableWidgetItem(''))
|
||||||
|
else:
|
||||||
|
self.tableWidget.setCellWidget(i,0,None)
|
||||||
|
self.tableWidget.setItem(i,0,item)
|
||||||
item = QTableWidgetItem(schema_name)
|
item = QTableWidgetItem(schema_name)
|
||||||
self.tableWidget.setItem(i,1,item)
|
self.tableWidget.setItem(i,1,item)
|
||||||
item = QTableWidgetItem(table_name)
|
item = QTableWidgetItem(table_name)
|
||||||
@@ -211,11 +518,13 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.tableWidget.setColumnWidth(1, 300)
|
self.tableWidget.setColumnWidth(1, 300)
|
||||||
self.tableWidget.setColumnWidth(2, 300)
|
self.tableWidget.setColumnWidth(2, 300)
|
||||||
self.tableWidget.setHorizontalHeaderLabels(["Code","Schema","Table"])
|
self.tableWidget.setHorizontalHeaderLabels(["Code","Schema","Table"])
|
||||||
|
|
||||||
def selection_flux(self):
|
def selection_flux(self):
|
||||||
selected_row = 0
|
selected_row = 0
|
||||||
selected_items = self.tableWidget.selectedItems()
|
selected_items = self.tableWidget.selectedItems()
|
||||||
|
|
||||||
# Assuming you want to compare items in the first column for uniqueness
|
# Assuming you want to compare items in the first column for uniqueness
|
||||||
|
svgTake = (selected_items[2].tableWidget().cellWidget(0,0))
|
||||||
new_item_text = selected_items[2].text()
|
new_item_text = selected_items[2].text()
|
||||||
|
|
||||||
if not self.item_already_exists(new_item_text):
|
if not self.item_already_exists(new_item_text):
|
||||||
@@ -234,7 +543,7 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
def item_already_exists(self, new_item_text):
|
def item_already_exists(self, new_item_text):
|
||||||
# Assuming you want to compare items in the first column for uniqueness
|
# Assuming you want to compare items in the first column for uniqueness
|
||||||
existing_items = self.tableWidget_2.findItems(new_item_text, QtCore.Qt.MatchExactly)
|
existing_items = self.tableWidget_2.findItems(new_item_text, QtCore.Qt.MatchFlag(0))
|
||||||
|
|
||||||
# Check if there are any existing items with the same text in the first column
|
# Check if there are any existing items with the same text in the first column
|
||||||
return len(existing_items) > 0
|
return len(existing_items) > 0
|
||||||
@@ -247,15 +556,31 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.QMBquestion = QMessageBox.question(iface.mainWindow(), u"Attention !",
|
self.QMBquestion = QMessageBox.question(iface.mainWindow(), u"Attention !",
|
||||||
"Le nombre de flux à charger en une seule fois est limité à 5 pour des questions de performances. Souhaitez vous tout de même charger les " + str(
|
"Le nombre de flux à charger en une seule fois est limité à 5 pour des questions de performances. Souhaitez vous tout de même charger les " + str(
|
||||||
self.tableWidget_2.rowCount()) + " flux sélectionnés ? (risque de plantage de QGIS)",
|
self.tableWidget_2.rowCount()) + " flux sélectionnés ? (risque de plantage de QGIS)",
|
||||||
QMessageBox.Yes | QMessageBox.No)
|
QMessageBox.StandardButton(0x00004000)|QMessageBox.StandardButton(0x00010000))
|
||||||
if self.QMBquestion == QMessageBox.Yes:
|
if self.QMBquestion == QMessageBox.StandardButton(0x00004000):
|
||||||
self.chargement_flux()
|
self.chargement_flux()
|
||||||
|
|
||||||
if self.QMBquestion == QMessageBox.No:
|
if self.QMBquestion == QMessageBox.StandardButton(0x00001000):
|
||||||
print("Annulation du chargement des couches")
|
print("Annulation du chargement des couches")
|
||||||
|
|
||||||
if self.tableWidget_2.rowCount() <= 5:
|
if self.tableWidget_2.rowCount() <= 5:
|
||||||
self.chargement_flux()
|
self.chargement_flux()
|
||||||
|
def openPostGIS(self,schema,table):
|
||||||
|
uri = QgsDataSourceUri()
|
||||||
|
uri.setConnection(host ,port ,sigdb ,user ,mdp)
|
||||||
|
|
||||||
|
if (schema+'.'+table) in RasterList:
|
||||||
|
uri.setDataSource(schema, table, "rast")
|
||||||
|
uri.setKeyColumn('rid')
|
||||||
|
uri.setSrid('2154')
|
||||||
|
layer = QgsRasterLayer(uri.uri(), table, "postgresraster")
|
||||||
|
else:
|
||||||
|
uri.setDataSource(schema, table, "geom")
|
||||||
|
uri.setKeyColumn('gid')
|
||||||
|
uri.setSrid('2154')
|
||||||
|
layer = QgsVectorLayer(uri.uri(), table, "postgres")
|
||||||
|
# Ajout de la couche au canevas QGIS
|
||||||
|
QgsProject.instance().addMapLayer(layer)
|
||||||
|
|
||||||
def chargement_flux(self):
|
def chargement_flux(self):
|
||||||
|
|
||||||
@@ -273,17 +598,30 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
return switcher.get(type, "nothing")
|
return switcher.get(type, "nothing")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def displayOnWindows(type, uri, name):
|
def displayOnWindows(type, uri, name):
|
||||||
p = []
|
p = []
|
||||||
|
|
||||||
|
SQLraster = """SELECT concat(r_table_schema,'.',r_table_name) from public.raster_columns; """
|
||||||
|
cur.execute(SQLraster)
|
||||||
|
list_raster = cur.fetchall()
|
||||||
|
RasterList = []
|
||||||
|
for rasterFind in list_raster:
|
||||||
|
RasterList.append(rasterFind[0])
|
||||||
|
|
||||||
for row in range(0, self.tableWidget_2.rowCount()):
|
for row in range(0, self.tableWidget_2.rowCount()):
|
||||||
|
color_rgba = 855030089
|
||||||
|
if self.tableWidget_2.item(row, 0).background().color().rgba() != 855030089:
|
||||||
## supression de la partie de l'url après le point d'interrogation
|
## supression de la partie de l'url après le point d'interrogation
|
||||||
if dbtype == sigdb:
|
if dbtype == sigdb:
|
||||||
code = self.tableWidget_2.item(row,0).text()
|
code = self.tableWidget_2.item(row,0).text()
|
||||||
schema = '_'+code+'_'+self.tableWidget_2.item(row,1).text()
|
schema = '_'+code+'_'+self.tableWidget_2.item(row,1).text()
|
||||||
if code == 'travaux' or code == 'agregation':
|
if code == 'travaux' or code == 'agregation':
|
||||||
schema = self.tableWidget_2.item(row,1).text()
|
schema = self.tableWidget_2.item(row,1).text()
|
||||||
table = self.tableWidget_2.item(row,2).text()#.split("?", 1)[0]
|
table = self.tableWidget_2.item(row,2).text()
|
||||||
|
else:
|
||||||
|
table = self.tableWidget_2.item(row,2).text()
|
||||||
|
table = schema+'_'+table
|
||||||
if dbtype == refdb:
|
if dbtype == refdb:
|
||||||
# code = self.tableWidget_2.item(row,0).text()
|
# code = self.tableWidget_2.item(row,0).text()
|
||||||
schema = self.tableWidget_2.item(row,1).text()
|
schema = self.tableWidget_2.item(row,1).text()
|
||||||
@@ -293,40 +631,48 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
# nom du schéma à remplacer: "hydrographie" à supprimer et mettre "couches_collaboratives" lorsqu'on aura regroupé les couches à modifier dans un même schéma
|
# nom du schéma à remplacer: "hydrographie" à supprimer et mettre "couches_collaboratives" lorsqu'on aura regroupé les couches à modifier dans un même schéma
|
||||||
|
|
||||||
uri.setDataSource(schema, table, "geom")
|
if (schema+'.'+table) in RasterList:
|
||||||
uri.setKeyColumn('gid')
|
uri.setDataSource(schema, table, "rast")
|
||||||
|
uri.setKeyColumn('rid')
|
||||||
# Chargement de la couche PostGIS
|
uri.setSrid('2154')
|
||||||
geom_type ='SELECT right(st_geometrytype(geom),-3) as a FROM '+schema+'.'+table+' GROUP BY a'
|
layer = QgsRasterLayer(uri.uri(), table, "postgresraster")
|
||||||
cur.execute(geom_type)
|
|
||||||
list_typegeom = cur.fetchall()
|
|
||||||
print(len(list_typegeom))
|
|
||||||
if len(list_typegeom) > 1:
|
|
||||||
for typegeom in list_typegeom:
|
|
||||||
if typegeom[0] == 'MultiPolygon':
|
|
||||||
uri.setWkbType(QgsWkbTypes.MultiPolygon)
|
|
||||||
elif typegeom[0] == 'MultiLineString':
|
|
||||||
uri.setWkbType(QgsWkbTypes.MultiLineString)
|
|
||||||
elif typegeom[0] == 'Point':
|
|
||||||
uri.setWkbType(QgsWkbTypes.Point)
|
|
||||||
if typegeom[0] == 'Polygon':
|
|
||||||
uri.setWkbType(QgsWkbTypes.Polygon)
|
|
||||||
elif typegeom[0] == 'LineString':
|
|
||||||
uri.setWkbType(QgsWkbTypes.LineString)
|
|
||||||
elif typegeom[0] == 'MultiPoint':
|
|
||||||
uri.setWkbType(QgsWkbTypes.MultiPoint)
|
|
||||||
if (typegeom[0] != None and typegeom[0] != 'Polygon'):
|
|
||||||
uri.setSrid('2154')
|
|
||||||
layer = QgsVectorLayer(uri.uri(), table, "postgres")
|
|
||||||
# Ajout de la couche au canevas QGIS
|
|
||||||
QgsProject.instance().addMapLayer(layer)
|
|
||||||
else:
|
|
||||||
layer = QgsVectorLayer(uri.uri(), table, "postgres")
|
|
||||||
# Ajout de la couche au canevas QGIS
|
|
||||||
QgsProject.instance().addMapLayer(layer)
|
QgsProject.instance().addMapLayer(layer)
|
||||||
|
else:
|
||||||
|
uri.setDataSource(schema, table, "geom")
|
||||||
|
uri.setKeyColumn('gid')
|
||||||
|
|
||||||
|
# Chargement de la couche PostGIS
|
||||||
|
geom_type ='SELECT right(st_geometrytype(geom),-3) as a FROM '+schema+'.'+table+' GROUP BY a'
|
||||||
|
cur.execute(geom_type)
|
||||||
|
list_typegeom = cur.fetchall()
|
||||||
|
if len(list_typegeom) > 1:
|
||||||
|
for typegeom in list_typegeom:
|
||||||
|
if typegeom[0] == 'MultiPolygon':
|
||||||
|
uri.setWkbType(QgsWkbTypes.MultiPolygon)
|
||||||
|
elif typegeom[0] == 'MultiLineString':
|
||||||
|
uri.setWkbType(QgsWkbTypes.MultiLineString)
|
||||||
|
elif typegeom[0] == 'Point':
|
||||||
|
uri.setWkbType(QgsWkbTypes.Point)
|
||||||
|
if typegeom[0] == 'Polygon':
|
||||||
|
uri.setWkbType(QgsWkbTypes.Polygon)
|
||||||
|
elif typegeom[0] == 'LineString':
|
||||||
|
uri.setWkbType(QgsWkbTypes.LineString)
|
||||||
|
elif typegeom[0] == 'MultiPoint':
|
||||||
|
uri.setWkbType(QgsWkbTypes.MultiPoint)
|
||||||
|
if (typegeom[0] != None and typegeom[0] != 'Polygon'):
|
||||||
|
uri.setSrid('2154')
|
||||||
|
layer = QgsVectorLayer(uri.uri(), table, "postgres")
|
||||||
|
# Ajout de la couche au canevas QGIS
|
||||||
|
QgsProject.instance().addMapLayer(layer)
|
||||||
|
else:
|
||||||
|
layer = QgsVectorLayer(uri.uri(), table, "postgres")
|
||||||
|
# Ajout de la couche au canevas QGIS
|
||||||
|
QgsProject.instance().addMapLayer(layer)
|
||||||
|
else:
|
||||||
|
self.QMBquestion = QMessageBox.question(iface.mainWindow(), u"Attention !","La couche «" + str(self.tableWidget_2.item(row,1).text()) +' '+ str(self.tableWidget_2.item(row,2).text()) + "» ne ce trouve pas dans cette BD !",QMessageBox.StandardButton(0x00004000))
|
||||||
def combobox_custom(self):
|
def combobox_custom(self):
|
||||||
if dbtype == sigdb:
|
if dbtype == sigdb:
|
||||||
|
self.toolButton.setEnabled(1)
|
||||||
self.comboBox.clear()
|
self.comboBox.clear()
|
||||||
self.comboBox.addItem("toutes les catégories")
|
self.comboBox.addItem("toutes les catégories")
|
||||||
self.comboBox.addItem('00')
|
self.comboBox.addItem('00')
|
||||||
@@ -339,6 +685,7 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.comboBox.addItem('travaux')
|
self.comboBox.addItem('travaux')
|
||||||
self.comboBox.addItem('form')
|
self.comboBox.addItem('form')
|
||||||
if dbtype == refdb:
|
if dbtype == refdb:
|
||||||
|
self.toolButton.setEnabled(0)
|
||||||
custom_list=schemaname_distinct
|
custom_list=schemaname_distinct
|
||||||
cur.execute(custom_list)
|
cur.execute(custom_list)
|
||||||
list_schema = cur.fetchall()
|
list_schema = cur.fetchall()
|
||||||
@@ -346,8 +693,10 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.comboBox.addItem("toutes les catégories")
|
self.comboBox.addItem("toutes les catégories")
|
||||||
for baxval in list_schema:
|
for baxval in list_schema:
|
||||||
self.comboBox.addItem(baxval[0])
|
self.comboBox.addItem(baxval[0])
|
||||||
def filtre_dynamique(self, filter_text):
|
|
||||||
|
|
||||||
|
def filtre_dynamique(self, filter_text):
|
||||||
|
if filter_text.find(' ') >= 0:
|
||||||
|
filter_text=filter_text.replace(" ","_")
|
||||||
for i in range(self.tableWidget.rowCount()):
|
for i in range(self.tableWidget.rowCount()):
|
||||||
for j in range(self.tableWidget.columnCount()):
|
for j in range(self.tableWidget.columnCount()):
|
||||||
item = self.tableWidget.item(i, j)
|
item = self.tableWidget.item(i, j)
|
||||||
@@ -356,6 +705,64 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
if not match:
|
if not match:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
def getCanevas(self):
|
||||||
|
poly = iface.mapCanvas().extent()
|
||||||
|
geom = (str(poly.xMinimum())+','+str(poly.yMinimum())+','+str(poly.xMaximum())+','+str(poly.yMaximum()))
|
||||||
|
|
||||||
|
SQL_GEOM_CONTOUR = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_contour" WHERE st_intersects(geom,ST_MakeEnvelope("""+geom+",2154)) ORDER BY tname"
|
||||||
|
SQL_GEOM_HABITAT = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_habitat" WHERE st_intersects(geom,ST_MakeEnvelope("""+geom+",2154)) ORDER BY tname"
|
||||||
|
SQL_GEOM_EU_HABITAT = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_eu_habitat" WHERE st_intersects(geom,ST_MakeEnvelope("""+geom+",2154)) ORDER BY tname"
|
||||||
|
SQL_GEOM_TRAVAUX_PREVUS_LIGNE = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_travaux_prevus_ligne" WHERE st_intersects(geom,ST_MakeEnvelope("""+geom+",2154)) ORDER BY tname"
|
||||||
|
SQL_GEOM_TRAVAUX_PREVUS_POINT = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_travaux_prevus_point" WHERE st_intersects(geom,ST_MakeEnvelope("""+geom+",2154)) ORDER BY tname"
|
||||||
|
SQL_GEOM_TRAVAUX_PREVUS_POLY = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_travaux_prevus_poly" WHERE st_intersects(geom,ST_MakeEnvelope("""+geom+",2154)) ORDER BY tname"
|
||||||
|
|
||||||
|
cur.execute(SQL_GEOM_CONTOUR)
|
||||||
|
TableContour = cur.fetchall()
|
||||||
|
cur.execute(SQL_GEOM_HABITAT)
|
||||||
|
TableHabitat = cur.fetchall()
|
||||||
|
cur.execute(SQL_GEOM_EU_HABITAT)
|
||||||
|
TableEuHabitat = cur.fetchall()
|
||||||
|
cur.execute(SQL_GEOM_TRAVAUX_PREVUS_LIGNE)
|
||||||
|
TableTravauxLigne = cur.fetchall()
|
||||||
|
cur.execute(SQL_GEOM_TRAVAUX_PREVUS_POINT)
|
||||||
|
TableTravauxPoint = cur.fetchall()
|
||||||
|
cur.execute(SQL_GEOM_TRAVAUX_PREVUS_POLY)
|
||||||
|
TableTravauxPoly = cur.fetchall()
|
||||||
|
|
||||||
|
TableHaveGeom = sorted(TableContour+TableHabitat+TableEuHabitat+TableTravauxLigne+TableTravauxPoint+TableTravauxPoly)
|
||||||
|
row_count = 0
|
||||||
|
self.tableWidget.setRowCount(0)
|
||||||
|
for e in TableHaveGeom:
|
||||||
|
cur.execute("""SELECT DISTINCT count(*) FROM pg_catalog.pg_tables WHERE schemaname LIKE '"""+e[0]+"""' AND tablename LIKE '"""+e[1]+"""';""")
|
||||||
|
TableSomme = cur.fetchall()[0][0]
|
||||||
|
|
||||||
|
if e[0][1:3] != 'fo':
|
||||||
|
DepName = QTableWidgetItem(e[0][1:3])
|
||||||
|
SchemaName = QTableWidgetItem(e[0][4:])
|
||||||
|
else:
|
||||||
|
DepName = QTableWidgetItem('form')
|
||||||
|
SchemaName = QTableWidgetItem(e[0][6:])
|
||||||
|
TableName = QTableWidgetItem(e[1][len(e[0])+1:])
|
||||||
|
self.tableWidget.insertRow(row_count)
|
||||||
|
self.tableWidget.setItem(row_count,0,DepName)
|
||||||
|
self.tableWidget.setItem(row_count,1,SchemaName)
|
||||||
|
self.tableWidget.setItem(row_count,2,TableName)
|
||||||
|
if TableSomme == 0:
|
||||||
|
for j in range(self.tableWidget.columnCount()):
|
||||||
|
self.tableWidget.item(row_count, j).setBackground(QtGui.QColor(246, 185, 73,50))
|
||||||
|
self.tableWidget.item(row_count,j).setToolTip('Couche dans une autre BD !')
|
||||||
|
row_count = row_count+1
|
||||||
|
if self.lineEdit.text() != 'Recherche par mots-clés':
|
||||||
|
self.filtre_dynamique(self.lineEdit.text())
|
||||||
|
|
||||||
|
def SwitchGeom(self,vargeom):
|
||||||
|
new_object = '['
|
||||||
|
obj = vargeom['coordinates'][0][0]
|
||||||
|
for obj_X in obj:
|
||||||
|
new_object = new_object+'['+str(obj_X[1])+','+str(obj_X[0])+'],'
|
||||||
|
new_object = new_object[:-1]+']'
|
||||||
|
return(new_object)
|
||||||
|
|
||||||
def popup(self):
|
def popup(self):
|
||||||
|
|
||||||
self.dialog = Popup() # +++ - self
|
self.dialog = Popup() # +++ - self
|
||||||
|
|||||||
@@ -5,8 +5,9 @@
|
|||||||
[general]
|
[general]
|
||||||
name=CenRa_FLUX
|
name=CenRa_FLUX
|
||||||
qgisMinimumVersion=3.0
|
qgisMinimumVersion=3.0
|
||||||
|
supportsQt6=True
|
||||||
description=Permet d'ouvrire une table dans la base PostGis
|
description=Permet d'ouvrire une table dans la base PostGis
|
||||||
version=2.1
|
version=3.1
|
||||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||||
email=si_besoin@cen-rhonealpes.fr
|
email=si_besoin@cen-rhonealpes.fr
|
||||||
|
|
||||||
@@ -32,7 +33,7 @@ icon=icon.png
|
|||||||
# experimental flag
|
# experimental flag
|
||||||
experimental=False
|
experimental=False
|
||||||
|
|
||||||
changelog=<h1>CenRA_FLUX:</h1></br><p><h3>22/10/2024 - Version 2.1:</h3> - Correctif de bug.</br> - Evolution de la limit de 3 à 5. </br></p></br><p><h3>22/10/2024 - Version 2.0:</h3> - Reformatage du code.</br></p></br><p><h3>03/10/2024 - Version 1.14:</h3> - Remonte la fênetre dans la pille.</br></p><p><h3>13/09/2024 - Version 1.13:</h3>- MAJ sur le lien du changelog</br>- Bug-fix: Ouvre MultiPolygone et Polygon séparément.</p></br><p><h3>10/09/2024 - Version 1.11:</h3>- Ouverture de table contenant plusieurs géométries.</p></br><p><h3>26/08/2024 - Version 1.10:</h3>- Ajoute d'un changelog et vérification de mise à jour.</p>
|
changelog=<h2>CenRa_FLUX:</h2></br><p><h3>21/07/2025 - Version 3.1: </h3> - Bug fix pour l'ouverture de plus de 5 couches.</p></br><p><h3>19/05/2025 - Version 3.0: </h3> - Compatible PyQt5 et PyQt6.</p></br><p><h3>09/04/2025 - Version 2.9: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 2.8: </h3> - Optimisation pour le TT.</p></br><p><h3>07/04/2025 - Version 2.7: </h3> - mode debug.</p></br><p><h3>03/04/2025 - Version 2.6: </h3> - Mise a jour de securite.</p></br><p><h3>20/03/2025 - Version 2.5: </h3> - Visualisation distincte des couches ne se trouvant pas dans l'antenne.</p></br><p><h3>13/02/2025 - Version 2.4: </h3> - Ajoute redimensionnement et déplacement mollette.</p></br><p><h3>05/02/2025 - Version 2.3: </h3> - Bouton de visualisation des couches se trouvent uniquement dans le canva de la carte.</p></br><p><h3>07/01/2025 - Version 2.2: </h3> - ByPass du certif ssl ci erreur.</p></br><p><h3>22/10/2024 - Version 2.1:</h3> - Correctif de bug.</br> - Evolution de la limit de 3 à 5. </br></p></br><p><h3>22/10/2024 - Version 2.0:</h3> - Reformatage du code.</br></p></br><p><h3>03/10/2024 - Version 1.14:</h3> - Remonte la fênetre dans la pille.</br></p><p><h3>13/09/2024 - Version 1.13:</h3>- MAJ sur le lien du changelog</br>- Bug-fix: Ouvre MultiPolygone et Polygon séparément.</p></br><p><h3>10/09/2024 - Version 1.11:</h3>- Ouverture de table contenant plusieurs géométries.</p></br><p><h3>26/08/2024 - Version 1.10:</h3>- Ajoute d'un changelog et vérification de mise à jour.</p>
|
||||||
|
|
||||||
# deprecated flag (applies to the whole plugin, not just a single version)
|
# deprecated flag (applies to the whole plugin, not just a single version)
|
||||||
deprecated=False
|
deprecated=False
|
||||||
|
|||||||
@@ -1,185 +1,151 @@
|
|||||||
import sys
|
|
||||||
import socket
|
schemaname_distinct="""SELECT DISTINCT schemaname from pg_catalog.pg_tables
|
||||||
import os
|
WHERE schemaname NOT LIKE '_archives' AND schemaname NOT LIKE 'topology' AND schemaname NOT LIKE 'information_schema' AND schemaname NOT LIKE 'pg_catalog' and schemaname NOT LIKE 'public' AND schemaname NOT LIKE '_trier'
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
order by schemaname;"""
|
||||||
print(IPAddr)
|
schemaname_list_ref="""SELECT schemaname,tablename from pg_catalog.pg_tables
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
WHERE schemaname NOT LIKE '_archives' AND schemaname NOT LIKE 'topology' AND schemaname NOT LIKE 'information_schema' AND schemaname NOT LIKE 'pg_catalog' and schemaname NOT LIKE 'public' AND schemaname NOT LIKE '_trier'
|
||||||
host = "100.100.100.11"
|
order by schemaname,tablename;"""
|
||||||
port = "5432"
|
schemaname_list="""(SELECT schemaname,tablename from pg_catalog.pg_tables
|
||||||
dbname = "sig4269"
|
where schemaname like 'trav%' or schemaname like '\_ag%' or schemaname like '\_00%' or schemaname like '\_01%' or schemaname like '\_07%' or schemaname like '\_26%' or schemaname like '\_form%' or schemaname like '\_42%' or schemaname like '\_69%' order by schemaname,tablename)
|
||||||
sigdb="sig4269"
|
UNION
|
||||||
refdb="ref_geo4269"
|
(SELECT schemaname,matviewname AS tablename FROM pg_catalog.pg_matviews order by schemaname,tablename) order by schemaname,tablename;"""
|
||||||
password = "XXXXXX"
|
geom = "geom"
|
||||||
if IPAddr[0:9] == "192.168.0": #01
|
champ_travaux_prevus_multipolygon="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, surface_m2 double precision, surface_ha double precision, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
|
||||||
host = "192.168.0.201"
|
champ_travaux_prevus_multilinestring="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, longueur_m double precision, longueur_km double precision, date_creation date, date_maj date, geom geometry(MultiLineString,2154))"""
|
||||||
port = "5432"
|
champ_travaux_prevus_point = """(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, x_wgs84 double precision, y_wgs84 double precision, date_creation date, date_maj date, geom geometry(Point,2154))"""
|
||||||
dbname = "sig01"
|
|
||||||
sigdb="sig01"
|
champ_viergePolygone = """(gid serial NOT NULL, commentaire text, surface_m2 double precision, surface_ha double precision, geom geometry(MultiPolygon,2154))"""
|
||||||
refdb="ref_geo01"
|
champ_viergeLigne = """(gid serial NOT NULL, commentaire text, longueur_m double precision, longueur_km double precision, geom geometry(MultiLineString,2154))"""
|
||||||
password = "XXXXXX"
|
champ_viergePoint = """(gid serial NOT NULL, commentaire text, x_wgs84 double precision, y_wgs84 double precision, geom geometry(Point,2154))"""
|
||||||
if IPAddr[0:9] == "192.168.1": #0726
|
|
||||||
host = "192.168.1.201"
|
champ_habitat = """(gid serial NOT NULL, cd_cb_01 text, lb_cb97_fr_01 text, occupation_01 integer, cd_cb_02 text, lb_cb97_fr_02 text, occupation_02 integer, cd_cb_03 text, lb_cb97_fr_03 text, occupation_03 integer, milieu_code text, milieu_libelle text, surface_m2 double precision, surface_ha double precision, commentaire text, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
|
||||||
port = "5432"
|
|
||||||
dbname = "sig0726"
|
champ_contour="""(gid serial NOT NULL, date_creation date, date_maj date, utilisateur character varying, dept character(2), nom character varying, surface_m2 double precision, surface_ha double precision, type_site character varying, type_milieu character varying, date_premier_pg integer, date_debut_pg integer, date_fin_pg integer, referent character varying, gestion_deleguee character varying, terrain_militaire character(3), ens character(3), zh character(3), adapt_pmr character(3), inform character(3), guide character(3), ouverture_public character(3), obs character(3), anim character(3), n2000_anim character(3), contrat_n2000_conseil character(3), n2000_op character(3), contrat_n2000_benef character(3), contrat_agri character(3), bc_habitat integer, bc_amphibien integer, bc_coleoptere integer, bc_crustace integer, bc_mammifere integer, bc_chiroptere integer, bc_mollusque integer, bc_odonate integer, bc_oiseau integer, bc_orthoptere integer, bc_poisson integer, bc_reptile integer, bc_rhopalocere integer, bc_heterocere integer, bc_autre_invertebre integer, bc_flore integer, bc_bryophyte integer, bc_champignon integer, suiv_analyse_sol character(3), suiv_piezo character(3), suiv_climat character(3), suiv_topo character(3), suiv_habitat character(3), suiv_amphibien character(3), suiv_coleoptere character(3), suiv_crustace character(3), suiv_mammifere character(3), suiv_chiroptere character(3), suiv_mollusque character(3), suiv_odonate character(3), suiv_oiseau character(3), suiv_orthoptere character(3), suiv_poisson character(3), suiv_reptile character(3), suiv_rhopalocere character(3), suiv_heterocere character(3), suiv_autre_invertebre character(3), suiv_flore character(3), suiv_bryophyte character(3), suiv_champignon character(3), suiv_analyse_eau character(3), suiv_phenologie character(3), suiv_frequentation character(3), suiv_paysager character(3), suiv_autre character(3), commentaire text, geom geometry(MultiPolygon,2154))
|
||||||
sigdb="sig0726"
|
"""
|
||||||
refdb="ref_geo0726"
|
|
||||||
password = "XXXXXX"
|
champ_vegethab_point = """(
|
||||||
if sys.platform == 'linux':
|
gid serial NOT NULL ,
|
||||||
os_user = os.environ['USER']
|
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
||||||
else:
|
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
||||||
os_user = os.environ['USERNAME']
|
occupati_1 bigint,
|
||||||
if os_user == 'STAGE':
|
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
||||||
os_user='stage'
|
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
||||||
if os_user == 'Administrateur':
|
occupati_2 bigint,
|
||||||
os_user = 'stage'
|
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
||||||
|
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
||||||
schemaname_distinct="""SELECT DISTINCT schemaname from pg_catalog.pg_tables
|
occupati_3 bigint,
|
||||||
WHERE schemaname NOT LIKE '_archives' AND schemaname NOT LIKE 'topology' AND schemaname NOT LIKE 'information_schema' AND schemaname NOT LIKE 'pg_catalog' and schemaname NOT LIKE 'public' AND schemaname NOT LIKE '_trier'
|
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
||||||
order by schemaname;"""
|
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
||||||
schemaname_list_ref="""SELECT schemaname,tablename from pg_catalog.pg_tables
|
surface_m2 numeric,
|
||||||
WHERE schemaname NOT LIKE '_archives' AND schemaname NOT LIKE 'topology' AND schemaname NOT LIKE 'information_schema' AND schemaname NOT LIKE 'pg_catalog' and schemaname NOT LIKE 'public' AND schemaname NOT LIKE '_trier'
|
surface_ha numeric,
|
||||||
order by schemaname,tablename;"""
|
commentair character varying(254) COLLATE pg_catalog."default",
|
||||||
schemaname_list="""(SELECT schemaname,tablename from pg_catalog.pg_tables
|
date_creat date,
|
||||||
where schemaname like 'trav%' or schemaname like '\_ag%' or schemaname like '\_00%' or schemaname like '\_01%' or schemaname like '\_07%' or schemaname like '\_26%' or schemaname like '\_form%' or schemaname like '\_42%' or schemaname like '\_69%' order by schemaname,tablename)
|
date_maj date,
|
||||||
UNION
|
num_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
(SELECT schemaname,matviewname AS tablename FROM pg_catalog.pg_matviews order by schemaname,tablename) order by schemaname,tablename;"""
|
type_unite character varying(254) COLLATE pg_catalog."default",
|
||||||
geom = "geom"
|
dynamique character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_travaux_prevus_multipolygon="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, surface_m2 double precision, surface_ha double precision, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
|
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_travaux_prevus_multilinestring="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, longueur_m double precision, longueur_km double precision, date_creation date, date_maj date, geom geometry(MultiLineString,2154))"""
|
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_travaux_prevus_point = """(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, x_wgs84 double precision, y_wgs84 double precision, date_creation date, date_maj date, geom geometry(Point,2154))"""
|
eta_conser character varying(254) COLLATE pg_catalog."default",
|
||||||
|
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_viergePolygone = """(gid serial NOT NULL, commentaire text, surface_m2 double precision, surface_ha double precision, geom geometry(MultiPolygon,2154))"""
|
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_viergeLigne = """(gid serial NOT NULL, commentaire text, longueur_m double precision, longueur_km double precision, geom geometry(MultiLineString,2154))"""
|
syntaxon character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_viergePoint = """(gid serial NOT NULL, commentaire text, x_wgs84 double precision, y_wgs84 double precision, geom geometry(Point,2154))"""
|
n2000 character varying(254) COLLATE pg_catalog."default",
|
||||||
|
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_habitat = """(gid serial NOT NULL, cd_cb_01 text, lb_cb97_fr_01 text, occupation_01 integer, cd_cb_02 text, lb_cb97_fr_02 text, occupation_02 integer, cd_cb_03 text, lb_cb97_fr_03 text, occupation_03 integer, milieu_code text, milieu_libelle text, surface_m2 double precision, surface_ha double precision, commentaire text, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
|
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
||||||
|
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_contour="""(gid serial NOT NULL, date_creation date, date_maj date, utilisateur character varying, dept character(2), nom character varying, surface_m2 double precision, surface_ha double precision, type_site character varying, type_milieu character varying, date_premier_pg integer, date_debut_pg integer, date_fin_pg integer, referent character varying, gestion_deleguee character varying, terrain_militaire character(3), ens character(3), zh character(3), adapt_pmr character(3), inform character(3), guide character(3), ouverture_public character(3), obs character(3), anim character(3), n2000_anim character(3), contrat_n2000_conseil character(3), n2000_op character(3), contrat_n2000_benef character(3), contrat_agri character(3), bc_habitat integer, bc_amphibien integer, bc_coleoptere integer, bc_crustace integer, bc_mammifere integer, bc_chiroptere integer, bc_mollusque integer, bc_odonate integer, bc_oiseau integer, bc_orthoptere integer, bc_poisson integer, bc_reptile integer, bc_rhopalocere integer, bc_heterocere integer, bc_autre_invertebre integer, bc_flore integer, bc_bryophyte integer, bc_champignon integer, suiv_analyse_sol character(3), suiv_piezo character(3), suiv_climat character(3), suiv_topo character(3), suiv_habitat character(3), suiv_amphibien character(3), suiv_coleoptere character(3), suiv_crustace character(3), suiv_mammifere character(3), suiv_chiroptere character(3), suiv_mollusque character(3), suiv_odonate character(3), suiv_oiseau character(3), suiv_orthoptere character(3), suiv_poisson character(3), suiv_reptile character(3), suiv_rhopalocere character(3), suiv_heterocere character(3), suiv_autre_invertebre character(3), suiv_flore character(3), suiv_bryophyte character(3), suiv_champignon character(3), suiv_analyse_eau character(3), suiv_phenologie character(3), suiv_frequentation character(3), suiv_paysager character(3), suiv_autre character(3), commentaire text, geom geometry(MultiPolygon,2154))
|
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
||||||
"""
|
num_photo character varying(254) COLLATE pg_catalog."default",
|
||||||
|
nature_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_vegethab_point = """(
|
date_sais date,
|
||||||
gid serial NOT NULL ,
|
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
alli_name character varying(254) COLLATE pg_catalog."default",
|
||||||
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
salli_name character varying(254) COLLATE pg_catalog."default",
|
||||||
occupati_1 bigint,
|
class_name character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
geom geometry(Point,2154)
|
||||||
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
)
|
||||||
occupati_2 bigint,
|
"""
|
||||||
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
champ_vegethab_multilinestring = """(
|
||||||
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
gid serial NOT NULL ,
|
||||||
occupati_3 bigint,
|
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
||||||
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
||||||
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
occupati_1 bigint,
|
||||||
surface_m2 numeric,
|
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
||||||
surface_ha numeric,
|
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
||||||
commentair character varying(254) COLLATE pg_catalog."default",
|
occupati_2 bigint,
|
||||||
date_creat date,
|
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
||||||
date_maj date,
|
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
||||||
num_phyto character varying(254) COLLATE pg_catalog."default",
|
occupati_3 bigint,
|
||||||
type_unite character varying(254) COLLATE pg_catalog."default",
|
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
||||||
dynamique character varying(254) COLLATE pg_catalog."default",
|
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
||||||
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
surface_m2 numeric,
|
||||||
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
surface_ha numeric,
|
||||||
eta_conser character varying(254) COLLATE pg_catalog."default",
|
commentair character varying(254) COLLATE pg_catalog."default",
|
||||||
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
date_creat date,
|
||||||
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
date_maj date,
|
||||||
syntaxon character varying(254) COLLATE pg_catalog."default",
|
num_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
n2000 character varying(254) COLLATE pg_catalog."default",
|
type_unite character varying(254) COLLATE pg_catalog."default",
|
||||||
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
dynamique character varying(254) COLLATE pg_catalog."default",
|
||||||
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
eta_conser character varying(254) COLLATE pg_catalog."default",
|
||||||
num_photo character varying(254) COLLATE pg_catalog."default",
|
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
nature_obs character varying(254) COLLATE pg_catalog."default",
|
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
date_sais date,
|
syntaxon character varying(254) COLLATE pg_catalog."default",
|
||||||
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
n2000 character varying(254) COLLATE pg_catalog."default",
|
||||||
alli_name character varying(254) COLLATE pg_catalog."default",
|
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
||||||
salli_name character varying(254) COLLATE pg_catalog."default",
|
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
||||||
class_name character varying(254) COLLATE pg_catalog."default",
|
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
||||||
geom geometry(Point,2154)
|
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
||||||
)
|
num_photo character varying(254) COLLATE pg_catalog."default",
|
||||||
"""
|
nature_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_vegethab_multilinestring = """(
|
date_sais date,
|
||||||
gid serial NOT NULL ,
|
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
alli_name character varying(254) COLLATE pg_catalog."default",
|
||||||
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
salli_name character varying(254) COLLATE pg_catalog."default",
|
||||||
occupati_1 bigint,
|
class_name character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
geom geometry(MultiLineString,2154)
|
||||||
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
)
|
||||||
occupati_2 bigint,
|
"""
|
||||||
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
champ_vegethab_multipolygon = """(
|
||||||
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
gid serial NOT NULL ,
|
||||||
occupati_3 bigint,
|
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
||||||
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
||||||
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
occupati_1 bigint,
|
||||||
surface_m2 numeric,
|
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
||||||
surface_ha numeric,
|
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
||||||
commentair character varying(254) COLLATE pg_catalog."default",
|
occupati_2 bigint,
|
||||||
date_creat date,
|
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
||||||
date_maj date,
|
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
||||||
num_phyto character varying(254) COLLATE pg_catalog."default",
|
occupati_3 bigint,
|
||||||
type_unite character varying(254) COLLATE pg_catalog."default",
|
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
||||||
dynamique character varying(254) COLLATE pg_catalog."default",
|
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
||||||
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
surface_m2 numeric,
|
||||||
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
surface_ha numeric,
|
||||||
eta_conser character varying(254) COLLATE pg_catalog."default",
|
commentair character varying(254) COLLATE pg_catalog."default",
|
||||||
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
date_creat date,
|
||||||
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
date_maj date,
|
||||||
syntaxon character varying(254) COLLATE pg_catalog."default",
|
num_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
n2000 character varying(254) COLLATE pg_catalog."default",
|
type_unite character varying(254) COLLATE pg_catalog."default",
|
||||||
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
dynamique character varying(254) COLLATE pg_catalog."default",
|
||||||
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
eta_conser character varying(254) COLLATE pg_catalog."default",
|
||||||
num_photo character varying(254) COLLATE pg_catalog."default",
|
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
nature_obs character varying(254) COLLATE pg_catalog."default",
|
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
date_sais date,
|
syntaxon character varying(254) COLLATE pg_catalog."default",
|
||||||
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
n2000 character varying(254) COLLATE pg_catalog."default",
|
||||||
alli_name character varying(254) COLLATE pg_catalog."default",
|
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
||||||
salli_name character varying(254) COLLATE pg_catalog."default",
|
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
||||||
class_name character varying(254) COLLATE pg_catalog."default",
|
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
||||||
geom geometry(MultiLineString,2154)
|
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
||||||
)
|
num_photo character varying(254) COLLATE pg_catalog."default",
|
||||||
"""
|
nature_obs character varying(254) COLLATE pg_catalog."default",
|
||||||
champ_vegethab_multipolygon = """(
|
date_sais date,
|
||||||
gid serial NOT NULL ,
|
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
alli_name character varying(254) COLLATE pg_catalog."default",
|
||||||
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
salli_name character varying(254) COLLATE pg_catalog."default",
|
||||||
occupati_1 bigint,
|
class_name character varying(254) COLLATE pg_catalog."default",
|
||||||
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
geom geometry(MultiPolygon,2154)
|
||||||
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
)
|
||||||
occupati_2 bigint,
|
|
||||||
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_3 bigint,
|
|
||||||
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
|
||||||
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
|
||||||
surface_m2 numeric,
|
|
||||||
surface_ha numeric,
|
|
||||||
commentair character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_creat date,
|
|
||||||
date_maj date,
|
|
||||||
num_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
type_unite character varying(254) COLLATE pg_catalog."default",
|
|
||||||
dynamique character varying(254) COLLATE pg_catalog."default",
|
|
||||||
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
eta_conser character varying(254) COLLATE pg_catalog."default",
|
|
||||||
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
syntaxon character varying(254) COLLATE pg_catalog."default",
|
|
||||||
n2000 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
|
||||||
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
|
||||||
num_photo character varying(254) COLLATE pg_catalog."default",
|
|
||||||
nature_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_sais date,
|
|
||||||
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
salli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
class_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
geom geometry(MultiPolygon,2154)
|
|
||||||
)
|
|
||||||
"""
|
"""
|
||||||
@@ -0,0 +1,230 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
id="svg5692"
|
||||||
|
version="1.1"
|
||||||
|
inkscape:version="0.48.3.1 r9886"
|
||||||
|
sodipodi:docname="mActionAddRasterLayer.svg"
|
||||||
|
inkscape:export-filename="/home/denis/Desktop/oracle.png"
|
||||||
|
inkscape:export-xdpi="67.5"
|
||||||
|
inkscape:export-ydpi="67.5">
|
||||||
|
<title
|
||||||
|
id="title2829">GIS icon theme 0.2</title>
|
||||||
|
<defs
|
||||||
|
id="defs5694">
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 16 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="32 : 16 : 1"
|
||||||
|
inkscape:persp3d-origin="16 : 10.666667 : 1"
|
||||||
|
id="perspective3486" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective3496"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective3600"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective7871"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective8710"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective9811"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective4762"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="22.539029"
|
||||||
|
inkscape:cx="0.66325675"
|
||||||
|
inkscape:cy="15.235866"
|
||||||
|
inkscape:current-layer="layer2"
|
||||||
|
showgrid="true"
|
||||||
|
inkscape:grid-bbox="true"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
borderlayer="false"
|
||||||
|
inkscape:window-width="1855"
|
||||||
|
inkscape:window-height="1056"
|
||||||
|
inkscape:window-x="65"
|
||||||
|
inkscape:window-y="24"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:snap-global="true"
|
||||||
|
showguides="true"
|
||||||
|
inkscape:guide-bbox="true"
|
||||||
|
inkscape:snap-object-midpoints="false"
|
||||||
|
inkscape:snap-grids="true"
|
||||||
|
inkscape:object-paths="false">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid5700"
|
||||||
|
empspacing="5"
|
||||||
|
visible="true"
|
||||||
|
enabled="true"
|
||||||
|
snapvisiblegridlinesonly="true"
|
||||||
|
dotted="true"
|
||||||
|
originx="2.5px"
|
||||||
|
originy="2.5px" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata5697">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title>GIS icon theme 0.2</dc:title>
|
||||||
|
<dc:creator>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title>Robert Szczepanek</dc:title>
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:creator>
|
||||||
|
<dc:rights>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title>Robert Szczepanek</dc:title>
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:rights>
|
||||||
|
<dc:subject>
|
||||||
|
<rdf:Bag>
|
||||||
|
<rdf:li>GIS icons</rdf:li>
|
||||||
|
</rdf:Bag>
|
||||||
|
</dc:subject>
|
||||||
|
<dc:coverage>GIS icons</dc:coverage>
|
||||||
|
<dc:description>http://robert.szczepanek.pl/</dc:description>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/licenses/by-sa/3.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer2"
|
||||||
|
inkscape:label="Layer"
|
||||||
|
style="display:inline"
|
||||||
|
transform="translate(0,-8)">
|
||||||
|
<rect
|
||||||
|
style="fill:#6e97c4;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||||
|
id="rect6419"
|
||||||
|
width="7.999999"
|
||||||
|
height="7.999999"
|
||||||
|
x="7.9999986"
|
||||||
|
y="7.9999995" />
|
||||||
|
<rect
|
||||||
|
style="fill:#2b3b4d;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
|
||||||
|
id="rect6419-6"
|
||||||
|
width="7.999999"
|
||||||
|
height="7.999999"
|
||||||
|
x="16.000002"
|
||||||
|
y="7.9999995" />
|
||||||
|
<rect
|
||||||
|
style="fill:#2b3b4d;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
|
||||||
|
id="rect6419-6-9"
|
||||||
|
width="7.999999"
|
||||||
|
height="7.999999"
|
||||||
|
x="7.9999986"
|
||||||
|
y="16"
|
||||||
|
inkscape:transform-center-x="-3.9999992"
|
||||||
|
inkscape:transform-center-y="-5.3333316" />
|
||||||
|
<rect
|
||||||
|
style="fill:#6d97c4;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
|
||||||
|
id="rect6419-0"
|
||||||
|
width="7.999999"
|
||||||
|
height="7.999999"
|
||||||
|
x="16.000002"
|
||||||
|
y="16" />
|
||||||
|
<rect
|
||||||
|
style="fill:#2d3e4d;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
|
||||||
|
id="rect6419-6-7"
|
||||||
|
width="7.999999"
|
||||||
|
height="7.999999"
|
||||||
|
x="-4.7683716e-07"
|
||||||
|
y="7.9999995" />
|
||||||
|
<rect
|
||||||
|
style="fill:#6d97c4;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
|
||||||
|
id="rect6419-3"
|
||||||
|
width="7.999999"
|
||||||
|
height="7.999999"
|
||||||
|
x="-4.7683716e-07"
|
||||||
|
y="16" />
|
||||||
|
<rect
|
||||||
|
style="fill:#6d97c4;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
|
||||||
|
id="rect6419-5"
|
||||||
|
width="7.999999"
|
||||||
|
height="7.999999"
|
||||||
|
x="7.9999986"
|
||||||
|
y="24.000002" />
|
||||||
|
<rect
|
||||||
|
style="fill:#2b3b4d;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
|
||||||
|
id="rect6419-6-6"
|
||||||
|
width="7.999999"
|
||||||
|
height="7.999999"
|
||||||
|
x="-4.7683716e-07"
|
||||||
|
y="24.000002" />
|
||||||
|
<rect
|
||||||
|
style="fill:none;stroke:none"
|
||||||
|
id="rect6554"
|
||||||
|
width="23.999998"
|
||||||
|
height="23.999998"
|
||||||
|
x="-4.7683716e-07"
|
||||||
|
y="7.9999995" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 7.2 KiB |
@@ -0,0 +1,312 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
id="svg5692"
|
||||||
|
version="1.1"
|
||||||
|
inkscape:version="0.48.3.1 r9886"
|
||||||
|
sodipodi:docname="mActionAddWfsLayer.svg"
|
||||||
|
inkscape:export-filename="/media/home1/robert/svn/graphics/trunk/toolbar-icons/32x32/layer-vector.png"
|
||||||
|
inkscape:export-xdpi="90"
|
||||||
|
inkscape:export-ydpi="90">
|
||||||
|
<title
|
||||||
|
id="title2829">GIS icon theme 0.2</title>
|
||||||
|
<defs
|
||||||
|
id="defs5694">
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 16 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="32 : 16 : 1"
|
||||||
|
inkscape:persp3d-origin="16 : 10.666667 : 1"
|
||||||
|
id="perspective3486" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective3496"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective3600"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective7871"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective8710"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective9811"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective4762"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
id="perspective4762-4" />
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
id="perspective9811-2" />
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
id="perspective8710-0" />
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
id="perspective7871-7" />
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
id="perspective3600-9" />
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
id="perspective3496-4" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective3486-0"
|
||||||
|
inkscape:persp3d-origin="16 : 10.666667 : 1"
|
||||||
|
inkscape:vp_z="32 : 16 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 16 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective3952"
|
||||||
|
inkscape:persp3d-origin="12 : 8 : 1"
|
||||||
|
inkscape:vp_z="24 : 12 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 12 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="16"
|
||||||
|
inkscape:cx="-0.094554179"
|
||||||
|
inkscape:cy="17.125349"
|
||||||
|
inkscape:current-layer="layer2"
|
||||||
|
showgrid="true"
|
||||||
|
inkscape:grid-bbox="true"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
borderlayer="false"
|
||||||
|
inkscape:window-width="1855"
|
||||||
|
inkscape:window-height="1056"
|
||||||
|
inkscape:window-x="65"
|
||||||
|
inkscape:window-y="24"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:snap-global="true"
|
||||||
|
showguides="true"
|
||||||
|
inkscape:guide-bbox="true"
|
||||||
|
inkscape:snap-object-midpoints="true"
|
||||||
|
inkscape:snap-grids="false"
|
||||||
|
inkscape:object-paths="false"
|
||||||
|
inkscape:snap-bbox="true"
|
||||||
|
inkscape:object-nodes="true">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid5700"
|
||||||
|
empspacing="5"
|
||||||
|
visible="true"
|
||||||
|
enabled="true"
|
||||||
|
snapvisiblegridlinesonly="true"
|
||||||
|
dotted="true"
|
||||||
|
originx="2.5px"
|
||||||
|
originy="2.5px" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata5697">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title>GIS icon theme 0.2</dc:title>
|
||||||
|
<dc:creator>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title>Robert Szczepanek</dc:title>
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:creator>
|
||||||
|
<dc:rights>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title>Robert Szczepanek</dc:title>
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:rights>
|
||||||
|
<dc:subject>
|
||||||
|
<rdf:Bag>
|
||||||
|
<rdf:li>GIS icons</rdf:li>
|
||||||
|
</rdf:Bag>
|
||||||
|
</dc:subject>
|
||||||
|
<dc:coverage>GIS icons</dc:coverage>
|
||||||
|
<dc:description>http://robert.szczepanek.pl/</dc:description>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/licenses/by-sa/3.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer2"
|
||||||
|
inkscape:label="Layer"
|
||||||
|
style="display:inline"
|
||||||
|
transform="translate(0,-8)">
|
||||||
|
<g
|
||||||
|
id="g3028"
|
||||||
|
transform="matrix(0.75161647,0,0,0.75161647,-0.02586348,9.4769448)">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path3775"
|
||||||
|
d="m 16.000001,1.0775438 c 9.467477,4.6992805 8.114981,22.3215822 0,25.8460432"
|
||||||
|
style="fill:none;stroke:#749fcf;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path3773"
|
||||||
|
d="m 1.1225356,14.000566 29.7549294,0"
|
||||||
|
style="fill:none;stroke:#749fcf;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path3773-1"
|
||||||
|
d="m 2.9484075,6.9340877 c 7.5739815,1.0094969 18.3939565,1.0094969 25.9679385,0"
|
||||||
|
style="fill:none;stroke:#749fcf;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path3773-4"
|
||||||
|
d="m 2.9484075,21.067042 c 7.5739815,-1.009496 18.3939565,-1.009496 25.9679385,0"
|
||||||
|
style="fill:none;stroke:#749fcf;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path3777"
|
||||||
|
d="m 16.000001,1.0775438 c -8.1149812,3.5244605 -9.467478,21.1467632 0,25.8460432"
|
||||||
|
style="fill:none;stroke:#749fcf;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||||
|
<path
|
||||||
|
transform="matrix(1.2562074,0,0,1.0871977,22.465232,-1.0129089)"
|
||||||
|
d="m 6.9656949,13.809332 c 0,6.713955 -5.4228716,12.15669 -12.1123228,12.15669 -6.6894511,0 -12.1123231,-5.442735 -12.1123231,-12.15669 0,-6.7139549 5.422872,-12.1566907 12.1123231,-12.1566907 6.6894512,0 12.1123228,5.4427358 12.1123228,12.1566907 z"
|
||||||
|
sodipodi:ry="12.156691"
|
||||||
|
sodipodi:rx="12.112323"
|
||||||
|
sodipodi:cy="13.809332"
|
||||||
|
sodipodi:cx="-5.1466279"
|
||||||
|
id="path3003"
|
||||||
|
style="fill:none;stroke:#5488c4;stroke-width:1.28353083;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||||
|
sodipodi:type="arc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cccc"
|
||||||
|
id="path2960"
|
||||||
|
d="M 7.3400991,7.2779254 13.185401,22.026434 19.613856,7.4154701 24.89957,7.3945152"
|
||||||
|
style="color:#000000;fill:none;stroke:#172739;stroke-width:1.29794168;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
transform="matrix(1.5475161,0,0,1.6212881,1.923793,-12.988176)"
|
||||||
|
d="m 4.5,12.5 c 0,0.552285 -0.4477153,1 -1,1 -0.5522847,0 -1,-0.447715 -1,-1 0,-0.552285 0.4477153,-1 1,-1 0.5522847,0 1,0.447715 1,1 z"
|
||||||
|
sodipodi:ry="1"
|
||||||
|
sodipodi:rx="1"
|
||||||
|
sodipodi:cy="12.5"
|
||||||
|
sodipodi:cx="3.5"
|
||||||
|
id="path2958"
|
||||||
|
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#172739;stroke-width:0.94698602;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||||
|
sodipodi:type="arc" />
|
||||||
|
<path
|
||||||
|
transform="matrix(1.5839392,0,0,1.6212881,7.641614,1.7603321)"
|
||||||
|
d="m 4.5,12.5 c 0,0.552285 -0.4477153,1 -1,1 -0.5522847,0 -1,-0.447715 -1,-1 0,-0.552285 0.4477153,-1 1,-1 0.5522847,0 1,0.447715 1,1 z"
|
||||||
|
sodipodi:ry="1"
|
||||||
|
sodipodi:rx="1"
|
||||||
|
sodipodi:cy="12.5"
|
||||||
|
sodipodi:cx="3.5"
|
||||||
|
id="path2958-0"
|
||||||
|
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#172739;stroke-width:0.93603462;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||||
|
sodipodi:type="arc" />
|
||||||
|
<path
|
||||||
|
transform="matrix(1.5475161,0,0,1.6212881,14.034218,-12.884972)"
|
||||||
|
d="m 4.5,12.5 c 0,0.552285 -0.4477153,1 -1,1 -0.5522847,0 -1,-0.447715 -1,-1 0,-0.552285 0.4477153,-1 1,-1 0.5522847,0 1,0.447715 1,1 z"
|
||||||
|
sodipodi:ry="1"
|
||||||
|
sodipodi:rx="1"
|
||||||
|
sodipodi:cy="12.5"
|
||||||
|
sodipodi:cx="3.5"
|
||||||
|
id="path2958-9"
|
||||||
|
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#172739;stroke-width:0.94698602;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||||
|
sodipodi:type="arc" />
|
||||||
|
<path
|
||||||
|
transform="matrix(1.5475161,0,0,1.6212881,19.483264,-12.871586)"
|
||||||
|
d="m 4.5,12.5 c 0,0.552285 -0.4477153,1 -1,1 -0.5522847,0 -1,-0.447715 -1,-1 0,-0.552285 0.4477153,-1 1,-1 0.5522847,0 1,0.447715 1,1 z"
|
||||||
|
sodipodi:ry="1"
|
||||||
|
sodipodi:rx="1"
|
||||||
|
sodipodi:cy="12.5"
|
||||||
|
sodipodi:cx="3.5"
|
||||||
|
id="path2958-6"
|
||||||
|
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#172739;stroke-width:0.94698602;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||||
|
sodipodi:type="arc" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 13 KiB |
@@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
import configparser
|
import configparser
|
||||||
import shutil
|
import shutil
|
||||||
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
import base64
|
|
||||||
import psycopg2
|
|
||||||
import psycopg2.extras
|
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
|
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
@@ -79,6 +77,14 @@ def plugin_test_data_path(*args, copy=False):
|
|||||||
else:
|
else:
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
def pyperclip():
|
||||||
|
dst = dirname(dirname(__file__))+"\\tools\\"
|
||||||
|
if os.access('N:/',os.R_OK):
|
||||||
|
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
|
||||||
|
try:
|
||||||
|
shutil.copy(src, dst)
|
||||||
|
except:
|
||||||
|
print('404')
|
||||||
|
|
||||||
def resources_path(*args):
|
def resources_path(*args):
|
||||||
"""Get the path to our resources folder.
|
"""Get the path to our resources folder.
|
||||||
@@ -106,25 +112,6 @@ def load_ui(*args):
|
|||||||
ui_class, _ = uic.loadUiType(resources_path("ui", *args))
|
ui_class, _ = uic.loadUiType(resources_path("ui", *args))
|
||||||
|
|
||||||
return ui_class
|
return ui_class
|
||||||
|
|
||||||
def login_base(take=None):
|
|
||||||
from .tools.PythonSQL import host,port,dbname,password,os_user
|
|
||||||
first_conn = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=first_cnx password=" + password)
|
|
||||||
first_cur = first_conn.cursor(cursor_factory = psycopg2.extras.DictCursor)
|
|
||||||
first_cur.execute("SELECT mdp_w, login_w FROM pg_catalog.pg_user t1, admin_sig.vm_users_sig t2 WHERE t2.oid = t1.usesysid AND (login_w = '" + os_user + "' OR login_w = '" + os_user + "')")
|
|
||||||
res_ident = first_cur.fetchone()
|
|
||||||
mdp = base64.b64decode(str(res_ident[0])).decode('utf-8')
|
|
||||||
user = res_ident[1]
|
|
||||||
|
|
||||||
con = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=" + user + " password=" + mdp)
|
|
||||||
|
|
||||||
cur = con.cursor(cursor_factory = psycopg2.extras.DictCursor)
|
|
||||||
first_conn.close()
|
|
||||||
|
|
||||||
if take:
|
|
||||||
return cur,con
|
|
||||||
else:
|
|
||||||
return cur
|
|
||||||
def send_issues(url,titre,body,labels):
|
def send_issues(url,titre,body,labels):
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
@@ -157,7 +144,7 @@ def maj_verif(NAME):
|
|||||||
|
|
||||||
url = qgis.utils.pluginMetadata(NAME,'repository')
|
url = qgis.utils.pluginMetadata(NAME,'repository')
|
||||||
#URL = url+'/raw/branch/main/plugins.xml'
|
#URL = url+'/raw/branch/main/plugins.xml'
|
||||||
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
|
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
|
||||||
# print(URL)
|
# print(URL)
|
||||||
version = qgis.utils.pluginMetadata(NAME,'version')
|
version = qgis.utils.pluginMetadata(NAME,'version')
|
||||||
len_version = len(version)
|
len_version = len(version)
|
||||||
@@ -167,12 +154,15 @@ def maj_verif(NAME):
|
|||||||
except:
|
except:
|
||||||
binar = False
|
binar = False
|
||||||
if binar:
|
if binar:
|
||||||
version_web = str(urllib.request.urlopen(URL).read())
|
try:
|
||||||
plugin_num = version_web.find(NAME)
|
version_web = str(urllib.request.urlopen(URL).read())
|
||||||
valeur_version_web = version_web.find('<version>',plugin_num)+9
|
plugin_num = version_web.find(NAME)
|
||||||
version_plugin = version_web[valeur_version_web:valeur_version_web+len_version]
|
valeur_version_web = version_web.find('<version>',plugin_num)+9
|
||||||
if version_plugin != version:
|
version_plugin = version_web[valeur_version_web:valeur_version_web+len_version]
|
||||||
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
if version_plugin != version:
|
||||||
|
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
||||||
|
except:
|
||||||
|
print("error gitea version ssl")
|
||||||
else:
|
else:
|
||||||
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>Dialog</class>
|
<class>Dialog</class>
|
||||||
<resources>
|
|
||||||
</resources>
|
|
||||||
<widget class="QDialog" name="Dialog">
|
<widget class="QDialog" name="Dialog">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@@ -65,8 +63,8 @@
|
|||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>350</x>
|
<x>345</x>
|
||||||
<y>20</y>
|
<y>10</y>
|
||||||
<width>221</width>
|
<width>221</width>
|
||||||
<height>71</height>
|
<height>71</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -75,7 +73,7 @@
|
|||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="pixmap">
|
<property name="pixmap">
|
||||||
<pixmap resource="resources.qrc">:/plugins/CenRa_FLUX/logo.jpg</pixmap>
|
<pixmap>:/plugins/CenRa_FLUX/logo.jpg</pixmap>
|
||||||
</property>
|
</property>
|
||||||
<property name="scaledContents">
|
<property name="scaledContents">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@@ -139,7 +137,7 @@
|
|||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset>
|
||||||
<normaloff>:/plugins/CenRa_FLUX/arrow-bottom.png</normaloff>:/plugins/CenRa_FLUX/arrow-bottom.png</iconset>
|
<normaloff>:/plugins/CenRa_FLUX/arrow-bottom.png</normaloff>:/plugins/CenRa_FLUX/arrow-bottom.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
@@ -162,7 +160,7 @@
|
|||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset>
|
||||||
<normaloff>:/plugins/CenRa_FLUX/arrow-up.png</normaloff>:/plugins/CenRa_FLUX/arrow-up.png</iconset>
|
<normaloff>:/plugins/CenRa_FLUX/arrow-up.png</normaloff>:/plugins/CenRa_FLUX/arrow-up.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
@@ -237,6 +235,18 @@
|
|||||||
<string>Flux sélectionné(s) à charger :</string>
|
<string>Flux sélectionné(s) à charger :</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<zorder>label_3</zorder>
|
||||||
|
<zorder>comboBox</zorder>
|
||||||
|
<zorder>comboBox_2</zorder>
|
||||||
|
<zorder>pushButton_2</zorder>
|
||||||
|
<zorder>tableWidget</zorder>
|
||||||
|
<zorder>tableWidget_2</zorder>
|
||||||
|
<zorder>commandLinkButton</zorder>
|
||||||
|
<zorder>commandLinkButton_2</zorder>
|
||||||
|
<zorder>lineEdit</zorder>
|
||||||
|
<zorder>label</zorder>
|
||||||
|
<zorder>label_2</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -9,243 +9,387 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>910</width>
|
<width>890</width>
|
||||||
<height>800</height>
|
<height>810</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>910</width>
|
<width>600</width>
|
||||||
<height>800</height>
|
<height>400</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>910</width>
|
<width>890</width>
|
||||||
<height>800</height>
|
<height>810</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>SIG CEN-RA</string>
|
<string>SIG CEN-RA</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QComboBox" name="comboBox">
|
<property name="sizeGripEnabled">
|
||||||
<property name="geometry">
|
<bool>false</bool>
|
||||||
<rect>
|
</property>
|
||||||
<x>260</x>
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<y>130</y>
|
<property name="sizeConstraint">
|
||||||
<width>171</width>
|
<enum>QLayout::SetMaximumSize</enum>
|
||||||
<height>22</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="editable">
|
<property name="leftMargin">
|
||||||
<bool>false</bool>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentText">
|
<property name="topMargin">
|
||||||
<string notr="true"/>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="rightMargin">
|
||||||
<widget class="QComboBox" name="comboBox_2">
|
<number>0</number>
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>370</x>
|
|
||||||
<y>80</y>
|
|
||||||
<width>171</width>
|
|
||||||
<height>22</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="editable">
|
<property name="bottomMargin">
|
||||||
<bool>false</bool>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentText">
|
<property name="spacing">
|
||||||
<string notr="true"/>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
<property name="geometry">
|
<property name="maximumSize">
|
||||||
<rect>
|
<size>
|
||||||
<x>345</x>
|
<width>890</width>
|
||||||
<y>10</y>
|
<height>810</height>
|
||||||
<width>221</width>
|
</size>
|
||||||
<height>71</height>
|
</property>
|
||||||
</rect>
|
<property name="inputMethodHints">
|
||||||
</property>
|
<set>Qt::ImhNoEditMenu|Qt::ImhNoTextHandles</set>
|
||||||
<property name="text">
|
</property>
|
||||||
<string/>
|
<property name="frameShape">
|
||||||
</property>
|
<enum>QFrame::NoFrame</enum>
|
||||||
<property name="pixmap">
|
</property>
|
||||||
<pixmap>:/plugins/CenRa_FLUX/logo.jpg</pixmap>
|
<property name="frameShadow">
|
||||||
</property>
|
<enum>QFrame::Sunken</enum>
|
||||||
<property name="scaledContents">
|
</property>
|
||||||
<bool>true</bool>
|
<property name="lineWidth">
|
||||||
</property>
|
<number>0</number>
|
||||||
</widget>
|
</property>
|
||||||
<widget class="QPushButton" name="pushButton_2">
|
<property name="midLineWidth">
|
||||||
<property name="geometry">
|
<number>0</number>
|
||||||
<rect>
|
</property>
|
||||||
<x>370</x>
|
<property name="verticalScrollBarPolicy">
|
||||||
<y>750</y>
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
<width>171</width>
|
</property>
|
||||||
<height>23</height>
|
<property name="horizontalScrollBarPolicy">
|
||||||
</rect>
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<widget class="QWidget" name="scrollAreaWidgetContents_2">
|
||||||
<string>Charger les couches</string>
|
<property name="geometry">
|
||||||
</property>
|
<rect>
|
||||||
</widget>
|
<x>0</x>
|
||||||
<widget class="QTableWidget" name="tableWidget">
|
<y>0</y>
|
||||||
<property name="enabled">
|
<width>890</width>
|
||||||
<bool>true</bool>
|
<height>810</height>
|
||||||
</property>
|
</rect>
|
||||||
<property name="geometry">
|
</property>
|
||||||
<rect>
|
<property name="maximumSize">
|
||||||
<x>30</x>
|
<size>
|
||||||
<y>170</y>
|
<width>890</width>
|
||||||
<width>850</width>
|
<height>810</height>
|
||||||
<height>281</height>
|
</size>
|
||||||
</rect>
|
</property>
|
||||||
</property>
|
<widget class="QCommandLinkButton" name="commandLinkButton_2">
|
||||||
<property name="selectionMode">
|
<property name="geometry">
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
<rect>
|
||||||
</property>
|
<x>450</x>
|
||||||
<property name="sortingEnabled">
|
<y>470</y>
|
||||||
<bool>true</bool>
|
<width>61</width>
|
||||||
</property>
|
<height>61</height>
|
||||||
</widget>
|
</rect>
|
||||||
<widget class="QTableWidget" name="tableWidget_2">
|
</property>
|
||||||
<property name="geometry">
|
<property name="text">
|
||||||
<rect>
|
<string/>
|
||||||
<x>30</x>
|
</property>
|
||||||
<y>550</y>
|
<property name="icon">
|
||||||
<width>850</width>
|
<iconset>
|
||||||
<height>181</height>
|
<normaloff>:/plugins/CenRa_FLUX/arrow-up.png</normaloff>:/plugins/CenRa_FLUX/arrow-up.png</iconset>
|
||||||
</rect>
|
</property>
|
||||||
</property>
|
<property name="iconSize">
|
||||||
<property name="selectionMode">
|
<size>
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
<width>50</width>
|
||||||
</property>
|
<height>40</height>
|
||||||
</widget>
|
</size>
|
||||||
<widget class="QCommandLinkButton" name="commandLinkButton">
|
</property>
|
||||||
<property name="geometry">
|
</widget>
|
||||||
<rect>
|
<widget class="QPushButton" name="pushButton_2">
|
||||||
<x>400</x>
|
<property name="geometry">
|
||||||
<y>470</y>
|
<rect>
|
||||||
<width>61</width>
|
<x>360</x>
|
||||||
<height>61</height>
|
<y>750</y>
|
||||||
</rect>
|
<width>171</width>
|
||||||
</property>
|
<height>23</height>
|
||||||
<property name="text">
|
</rect>
|
||||||
<string/>
|
</property>
|
||||||
</property>
|
<property name="text">
|
||||||
<property name="icon">
|
<string>Charger les couches</string>
|
||||||
<iconset>
|
</property>
|
||||||
<normaloff>:/plugins/CenRa_FLUX/arrow-bottom.png</normaloff>:/plugins/CenRa_FLUX/arrow-bottom.png</iconset>
|
</widget>
|
||||||
</property>
|
<widget class="QLabel" name="label">
|
||||||
<property name="iconSize">
|
<property name="geometry">
|
||||||
<size>
|
<rect>
|
||||||
<width>50</width>
|
<x>30</x>
|
||||||
<height>40</height>
|
<y>150</y>
|
||||||
</size>
|
<width>161</width>
|
||||||
</property>
|
<height>16</height>
|
||||||
</widget>
|
</rect>
|
||||||
<widget class="QCommandLinkButton" name="commandLinkButton_2">
|
</property>
|
||||||
<property name="geometry">
|
<property name="font">
|
||||||
<rect>
|
<font>
|
||||||
<x>460</x>
|
<family>Calibri</family>
|
||||||
<y>470</y>
|
<pointsize>10</pointsize>
|
||||||
<width>61</width>
|
<italic>false</italic>
|
||||||
<height>61</height>
|
</font>
|
||||||
</rect>
|
</property>
|
||||||
</property>
|
<property name="text">
|
||||||
<property name="text">
|
<string>Liste des flux disponibles :</string>
|
||||||
<string/>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<property name="icon">
|
<widget class="QTableWidget" name="tableWidget_2">
|
||||||
<iconset>
|
<property name="geometry">
|
||||||
<normaloff>:/plugins/CenRa_FLUX/arrow-up.png</normaloff>:/plugins/CenRa_FLUX/arrow-up.png</iconset>
|
<rect>
|
||||||
</property>
|
<x>20</x>
|
||||||
<property name="iconSize">
|
<y>550</y>
|
||||||
<size>
|
<width>851</width>
|
||||||
<width>50</width>
|
<height>181</height>
|
||||||
<height>40</height>
|
</rect>
|
||||||
</size>
|
</property>
|
||||||
</property>
|
<property name="inputMethodHints">
|
||||||
</widget>
|
<set>Qt::ImhNoEditMenu|Qt::ImhNoTextHandles</set>
|
||||||
<widget class="QLineEdit" name="lineEdit">
|
</property>
|
||||||
<property name="enabled">
|
<property name="selectionMode">
|
||||||
<bool>true</bool>
|
<enum>QAbstractItemView::SingleSelection</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
<property name="selectionBehavior">
|
||||||
<rect>
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
<x>480</x>
|
</property>
|
||||||
<y>130</y>
|
</widget>
|
||||||
<width>171</width>
|
<widget class="QComboBox" name="comboBox">
|
||||||
<height>21</height>
|
<property name="geometry">
|
||||||
</rect>
|
<rect>
|
||||||
</property>
|
<x>250</x>
|
||||||
<property name="text">
|
<y>130</y>
|
||||||
<string>Recherche par mots-clés</string>
|
<width>171</width>
|
||||||
</property>
|
<height>22</height>
|
||||||
<property name="alignment">
|
</rect>
|
||||||
<set>Qt::AlignCenter</set>
|
</property>
|
||||||
</property>
|
<property name="editable">
|
||||||
<property name="readOnly">
|
<bool>false</bool>
|
||||||
<bool>false</bool>
|
</property>
|
||||||
</property>
|
<property name="currentText">
|
||||||
<property name="clearButtonEnabled">
|
<string notr="true"/>
|
||||||
<bool>true</bool>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
<widget class="QLineEdit" name="lineEdit">
|
||||||
<widget class="QLabel" name="label">
|
<property name="enabled">
|
||||||
<property name="geometry">
|
<bool>true</bool>
|
||||||
<rect>
|
</property>
|
||||||
<x>40</x>
|
<property name="geometry">
|
||||||
<y>150</y>
|
<rect>
|
||||||
<width>161</width>
|
<x>470</x>
|
||||||
<height>16</height>
|
<y>130</y>
|
||||||
</rect>
|
<width>171</width>
|
||||||
</property>
|
<height>21</height>
|
||||||
<property name="font">
|
</rect>
|
||||||
<font>
|
</property>
|
||||||
<family>Calibri</family>
|
<property name="text">
|
||||||
<pointsize>10</pointsize>
|
<string>Recherche par mots-clés</string>
|
||||||
<italic>false</italic>
|
</property>
|
||||||
</font>
|
<property name="alignment">
|
||||||
</property>
|
<set>Qt::AlignCenter</set>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>Liste des flux disponibles :</string>
|
<property name="readOnly">
|
||||||
</property>
|
<bool>false</bool>
|
||||||
</widget>
|
</property>
|
||||||
<widget class="QLabel" name="label_2">
|
<property name="clearButtonEnabled">
|
||||||
<property name="geometry">
|
<bool>true</bool>
|
||||||
<rect>
|
</property>
|
||||||
<x>30</x>
|
</widget>
|
||||||
<y>530</y>
|
<widget class="QToolButton" name="toolButton">
|
||||||
<width>171</width>
|
<property name="geometry">
|
||||||
<height>16</height>
|
<rect>
|
||||||
</rect>
|
<x>660</x>
|
||||||
</property>
|
<y>130</y>
|
||||||
<property name="font">
|
<width>21</width>
|
||||||
<font>
|
<height>21</height>
|
||||||
<family>Calibri</family>
|
</rect>
|
||||||
<pointsize>10</pointsize>
|
</property>
|
||||||
<italic>false</italic>
|
<property name="text">
|
||||||
</font>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
</widget>
|
||||||
<string>Flux sélectionné(s) à charger :</string>
|
<widget class="QTableWidget" name="tableWidget">
|
||||||
</property>
|
<property name="enabled">
|
||||||
</widget>
|
<bool>true</bool>
|
||||||
<zorder>label_3</zorder>
|
</property>
|
||||||
<zorder>comboBox</zorder>
|
<property name="geometry">
|
||||||
<zorder>comboBox_2</zorder>
|
<rect>
|
||||||
<zorder>pushButton_2</zorder>
|
<x>20</x>
|
||||||
<zorder>tableWidget</zorder>
|
<y>170</y>
|
||||||
<zorder>tableWidget_2</zorder>
|
<width>850</width>
|
||||||
<zorder>commandLinkButton</zorder>
|
<height>281</height>
|
||||||
<zorder>commandLinkButton_2</zorder>
|
</rect>
|
||||||
<zorder>lineEdit</zorder>
|
</property>
|
||||||
<zorder>label</zorder>
|
<property name="sizePolicy">
|
||||||
<zorder>label_2</zorder>
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="editTriggers">
|
||||||
|
<set>QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked</set>
|
||||||
|
</property>
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::SingleSelection</enum>
|
||||||
|
</property>
|
||||||
|
<property name="selectionBehavior">
|
||||||
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sortingEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>20</x>
|
||||||
|
<y>530</y>
|
||||||
|
<width>171</width>
|
||||||
|
<height>16</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Calibri</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
<italic>false</italic>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Flux sélectionné(s) à charger :</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>335</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>221</width>
|
||||||
|
<height>71</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap">
|
||||||
|
<pixmap>:/plugins/CenRa_FLUX/logo.jpg</pixmap>
|
||||||
|
</property>
|
||||||
|
<property name="scaledContents">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QComboBox" name="comboBox_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>360</x>
|
||||||
|
<y>80</y>
|
||||||
|
<width>171</width>
|
||||||
|
<height>22</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="editable">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="currentText">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QCommandLinkButton" name="commandLinkButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>390</x>
|
||||||
|
<y>470</y>
|
||||||
|
<width>61</width>
|
||||||
|
<height>61</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>:/plugins/CenRa_FLUX/arrow-bottom.png</normaloff>:/plugins/CenRa_FLUX/arrow-bottom.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QCheckBox" name="checkBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>830</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>70</width>
|
||||||
|
<height>17</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QComboBox" name="DeBUG">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>71</width>
|
||||||
|
<height>22</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="editable">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="currentText">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QTextBrowser" name="viewer">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>90</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>731</width>
|
||||||
|
<height>731</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">background-color: rgba(255, 255, 255,0.50);</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Metabase</string>
|
<string>Journal des modifications</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset>
|
<iconset>
|
||||||
@@ -29,9 +29,6 @@
|
|||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -41,7 +38,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>453</width>
|
<width>453</width>
|
||||||
<height>547</height>
|
<height>570</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
@@ -56,7 +53,7 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>DevLog</string>
|
<string>DevLog</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWebView" name="viewer" native="true">
|
<widget class="QTextBrowser" name="viewer">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
@@ -65,11 +62,6 @@
|
|||||||
<height>511</height>
|
<height>511</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="url" stdset="0">
|
|
||||||
<url>
|
|
||||||
<string>about:blank</string>
|
|
||||||
</url>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -78,19 +70,12 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::NoButton</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>QWebView</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">QtWebKitWidgets/QWebView</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -1,220 +1,220 @@
|
|||||||
__copyright__ = "Copyright 2021, 3Liz"
|
__copyright__ = "Copyright 2021, 3Liz"
|
||||||
__license__ = "GPL version 3"
|
__license__ = "GPL version 3"
|
||||||
__email__ = "info@3liz.org"
|
__email__ = "info@3liz.org"
|
||||||
|
|
||||||
|
|
||||||
from qgis.core import QgsApplication
|
from qgis.core import QgsApplication
|
||||||
from qgis.PyQt.QtCore import QCoreApplication, Qt, QTranslator, QUrl
|
from qgis.PyQt.QtCore import QCoreApplication, Qt, QTranslator, QUrl
|
||||||
from qgis.PyQt.QtGui import QDesktopServices, QIcon
|
from qgis.PyQt.QtGui import QDesktopServices, QIcon
|
||||||
from qgis.PyQt.QtWidgets import QAction, QMessageBox
|
from qgis.PyQt.QtWidgets import QAction, QMessageBox
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
import qgis
|
import qgis
|
||||||
|
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
'''
|
'''
|
||||||
from pg_metadata.connection_manager import (
|
from pg_metadata.connection_manager import (
|
||||||
store_connections,
|
store_connections,
|
||||||
validate_connections_names,
|
validate_connections_names,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
from pg_metadata.locator import LocatorFilter
|
from pg_metadata.locator import LocatorFilter
|
||||||
from pg_metadata.processing.provider import PgMetadataProvider
|
from pg_metadata.processing.provider import PgMetadataProvider
|
||||||
from pg_metadata.qgis_plugin_tools.tools.custom_logging import setup_logger
|
from pg_metadata.qgis_plugin_tools.tools.custom_logging import setup_logger
|
||||||
'''
|
'''
|
||||||
import os
|
import os
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
plugin_path,
|
plugin_path,
|
||||||
resources_path,
|
pyperclip,
|
||||||
maj_verif,
|
resources_path,
|
||||||
)
|
maj_verif,
|
||||||
from .dock import CenRa_Metabase
|
)
|
||||||
from .editor import Metabase_Editor
|
pyperclip()
|
||||||
from .about_form import MetabaseAboutDialog
|
from .dock import CenRa_Metabase
|
||||||
#from CenRa_Metabase.issues import CenRa_Issues
|
from .editor import Metabase_Editor
|
||||||
|
from .about_form import MetabaseAboutDialog
|
||||||
from PyQt5.QtCore import *
|
#from CenRa_Metabase.issues import CenRa_Issues
|
||||||
|
|
||||||
|
from qgis.PyQt.QtCore import *
|
||||||
|
|
||||||
class PgMetadata:
|
|
||||||
def __init__(self):
|
class PgMetadata:
|
||||||
""" Constructor. """
|
def __init__(self):
|
||||||
self.dock = None
|
""" Constructor. """
|
||||||
self.editor = None
|
self.dock = None
|
||||||
# self.issues = None
|
self.editor = None
|
||||||
self.provider = None
|
# self.issues = None
|
||||||
self.locator_filter = None
|
self.provider = None
|
||||||
self.dock_action = None
|
self.locator_filter = None
|
||||||
self.help_action = None
|
self.dock_action = None
|
||||||
plugin_dir = os.path.dirname(__file__)
|
self.help_action = None
|
||||||
end_find = plugin_dir.rfind('\\')+1
|
plugin_dir = os.path.dirname(__file__)
|
||||||
global NAME
|
end_find = plugin_dir.rfind('\\')+1
|
||||||
NAME = plugin_dir[end_find:]
|
global NAME
|
||||||
maj_verif(NAME)
|
NAME = plugin_dir[end_find:]
|
||||||
|
maj_verif(NAME)
|
||||||
# Display About window on first use
|
|
||||||
version = qgis.utils.pluginMetadata('CenRa_METABASE','version')
|
# Display About window on first use
|
||||||
s = QSettings()
|
version = qgis.utils.pluginMetadata('CenRa_METABASE','version')
|
||||||
versionUse = s.value("metadata/version", 1, type=str)
|
s = QSettings()
|
||||||
if str(versionUse) != str(version) :
|
versionUse = s.value("metadata/version", 1, type=str)
|
||||||
s.setValue("metadata/version", str(version))
|
if str(versionUse) != str(version) :
|
||||||
print(versionUse,version)
|
s.setValue("metadata/version", str(version))
|
||||||
self.open_about_dialog()
|
print(versionUse,version)
|
||||||
# setup_logger('pg_metadata')
|
self.open_about_dialog()
|
||||||
|
# setup_logger('pg_metadata')
|
||||||
#locale, file_path = setup_translation(
|
|
||||||
# folder=plugin_path("i18n"), file_pattern="CenRa_Metabase_{}.qm")
|
#locale, file_path = setup_translation(
|
||||||
#if file_path:
|
# folder=plugin_path("i18n"), file_pattern="CenRa_Metabase_{}.qm")
|
||||||
# self.translator = QTranslator()
|
#if file_path:
|
||||||
# self.translator.load(file_path)
|
# self.translator = QTranslator()
|
||||||
# noinspection PyCallByClass,PyArgumentList
|
# self.translator.load(file_path)
|
||||||
# QCoreApplication.installTranslator(self.translator)
|
# noinspection PyCallByClass,PyArgumentList
|
||||||
|
# QCoreApplication.installTranslator(self.translator)
|
||||||
# noinspection PyPep8Naming
|
|
||||||
#def initProcessing(self):
|
# noinspection PyPep8Naming
|
||||||
#""" Add the QGIS Processing provider. """
|
#def initProcessing(self):
|
||||||
#if not self.provider:
|
#""" Add the QGIS Processing provider. """
|
||||||
#self.provider = PgMetadataProvider()
|
#if not self.provider:
|
||||||
#QgsApplication.processingRegistry().addProvider(self.provider)
|
#self.provider = PgMetadataProvider()
|
||||||
|
#QgsApplication.processingRegistry().addProvider(self.provider)
|
||||||
# noinspection PyPep8Naming
|
|
||||||
def initGui(self):
|
# noinspection PyPep8Naming
|
||||||
""" Build the plugin GUI. """
|
def initGui(self):
|
||||||
#self.initProcessing()
|
""" Build the plugin GUI. """
|
||||||
|
#self.initProcessing()
|
||||||
#self.check_invalid_connection_names()
|
|
||||||
|
#self.check_invalid_connection_names()
|
||||||
self.toolBar = iface.addToolBar("CenRa_Metabase")
|
|
||||||
self.toolBar.setObjectName("CenRa_Metabase")
|
self.toolBar = iface.addToolBar("CenRa_Metabase")
|
||||||
|
self.toolBar.setObjectName("CenRa_Metabase")
|
||||||
icon = QIcon(resources_path('icons', 'icon.png'))
|
|
||||||
icon2 = QIcon(resources_path('icons', 'icon_2.png'))
|
icon = QIcon(resources_path('icons', 'icon.png'))
|
||||||
|
icon2 = QIcon(resources_path('icons', 'icon_2.png'))
|
||||||
# Open the online help
|
|
||||||
self.help_action = QAction(icon, 'CenRa_Metabase', iface.mainWindow())
|
# Open the online help
|
||||||
iface.pluginHelpMenu().addAction(self.help_action)
|
self.help_action = QAction(icon, 'CenRa_Metabase', iface.mainWindow())
|
||||||
self.help_action.triggered.connect(self.open_help)
|
iface.pluginHelpMenu().addAction(self.help_action)
|
||||||
if not self.editor:
|
self.help_action.triggered.connect(self.open_help)
|
||||||
self.editor = Metabase_Editor()
|
if not self.editor:
|
||||||
|
self.editor = Metabase_Editor()
|
||||||
|
|
||||||
self.editor_action = QAction(icon2, 'CenRa_Metabase',None)
|
|
||||||
self.toolBar.addAction(self.editor_action)
|
self.editor_action = QAction(icon2, 'CenRa_Metabase',None)
|
||||||
self.editor_action.triggered.connect(self.open_editor)
|
self.toolBar.addAction(self.editor_action)
|
||||||
|
self.editor_action.triggered.connect(self.open_editor)
|
||||||
if not self.dock:
|
|
||||||
self.dock = CenRa_Metabase()
|
if not self.dock:
|
||||||
iface.addDockWidget(Qt.RightDockWidgetArea, self.dock)
|
self.dock = CenRa_Metabase()
|
||||||
|
iface.addDockWidget(Qt.DockWidgetArea(0x2), self.dock)
|
||||||
# Open/close the dock from plugin menu
|
|
||||||
self.dock_action = QAction(icon, 'CenRa_Metabase', iface.mainWindow())
|
# Open/close the dock from plugin menu
|
||||||
iface.pluginMenu().addAction(self.dock_action)
|
self.dock_action = QAction(icon, 'CenRa_Metabase', iface.mainWindow())
|
||||||
self.dock_action.triggered.connect(self.open_dock)
|
iface.pluginMenu().addAction(self.dock_action)
|
||||||
# if not self.issues:
|
self.dock_action.triggered.connect(self.open_dock)
|
||||||
# self.issues = CenRa_Issues()
|
# if not self.issues:
|
||||||
|
# self.issues = CenRa_Issues()
|
||||||
|
|
||||||
# self.issues_action = QAction(icon, 'CenRa_Metabase',None)
|
|
||||||
# self.toolBar.addAction(self.issues_action)
|
# self.issues_action = QAction(icon, 'CenRa_Metabase',None)
|
||||||
# self.issues_action.triggered.connect(self.open_issues)
|
# self.toolBar.addAction(self.issues_action)
|
||||||
# '''
|
# self.issues_action.triggered.connect(self.open_issues)
|
||||||
# if not self.locator_filter:
|
'''
|
||||||
# self.locator_filter = LocatorFilter(iface)
|
if not self.locator_filter:
|
||||||
# iface.registerLocatorFilter(self.locator_filter)
|
self.locator_filter = LocatorFilter(iface)
|
||||||
|
iface.registerLocatorFilter(self.locator_filter)
|
||||||
# @staticmethod
|
|
||||||
# def check_invalid_connection_names():
|
@staticmethod
|
||||||
# """ Check for invalid connection names in the QgsSettings. """
|
def check_invalid_connection_names():
|
||||||
# valid, invalid = validate_connections_names()
|
""" Check for invalid connection names in the QgsSettings. """
|
||||||
# n_invalid = len(invalid)
|
valid, invalid = validate_connections_names()
|
||||||
|
n_invalid = len(invalid)
|
||||||
# if n_invalid == 0:
|
|
||||||
# return
|
if n_invalid == 0:
|
||||||
|
return
|
||||||
# invalid_text = ', '.join(invalid)
|
|
||||||
# msg = QMessageBox()
|
invalid_text = ', '.join(invalid)
|
||||||
# msg.setIcon(QMessageBox.Warning)
|
msg = QMessageBox()
|
||||||
# msg.setWindowTitle(tr('PgMetadata: Database connection(s) not available'))
|
msg.setIcon(QMessageBox.Warning)
|
||||||
# msg.setText(tr(
|
msg.setWindowTitle(tr('PgMetadata: Database connection(s) not available'))
|
||||||
# f'{n_invalid} connection(s) listed in PgMetadata’s settings are invalid or '
|
msg.setText(tr(
|
||||||
# f'no longer available: {invalid_text}'))
|
f'{n_invalid} connection(s) listed in PgMetadata’s settings are invalid or '
|
||||||
# msg.setInformativeText(tr(
|
f'no longer available: {invalid_text}'))
|
||||||
# 'Do you want to remove these connection(s) from the PgMetadata settings? '
|
msg.setInformativeText(tr(
|
||||||
# '(You can also do this later with the “Set Connections” tool.)'))
|
'Do you want to remove these connection(s) from the PgMetadata settings? '
|
||||||
# msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
|
'(You can also do this later with the “Set Connections” tool.)'))
|
||||||
# clicked = msg.exec()
|
msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
|
||||||
|
clicked = msg.exec()
|
||||||
# if clicked == QMessageBox.Yes:
|
|
||||||
# iface.messageBar().pushSuccess('PgMetadata', tr(f'{n_invalid} invalid connection(s) removed.'))
|
if clicked == QMessageBox.Yes:
|
||||||
# store_connections(valid)
|
iface.messageBar().pushSuccess('PgMetadata', tr(f'{n_invalid} invalid connection(s) removed.'))
|
||||||
# if clicked == QMessageBox.No:
|
store_connections(valid)
|
||||||
# iface.messageBar().pushInfo('PgMetadata', tr(f'Keeping {n_invalid} invalid connections.'))
|
if clicked == QMessageBox.No:
|
||||||
# '''
|
iface.messageBar().pushInfo('PgMetadata', tr(f'Keeping {n_invalid} invalid connections.'))
|
||||||
def open_about_dialog(self):
|
'''
|
||||||
"""
|
def open_about_dialog(self):
|
||||||
About dialog
|
"""
|
||||||
"""
|
About dialog
|
||||||
dialog = MetabaseAboutDialog(iface)
|
"""
|
||||||
dialog.exec_()
|
dialog = MetabaseAboutDialog(iface)
|
||||||
def open_help():
|
dialog.exec()
|
||||||
""" Open the online help. """
|
def open_help():
|
||||||
# QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
""" Open the online help. """
|
||||||
|
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
||||||
def open_dock(self):
|
|
||||||
""" Open the dock. """
|
def open_dock(self):
|
||||||
self.dock.show()
|
""" Open the dock. """
|
||||||
self.dock.raise_()
|
self.dock.show()
|
||||||
|
self.dock.raise_()
|
||||||
def open_editor(self):
|
|
||||||
self.editor.show()
|
def open_editor(self):
|
||||||
self.editor.raise_()
|
self.editor.show()
|
||||||
|
self.editor.raise_()
|
||||||
# def open_issues(self):
|
|
||||||
# self.issues.show()
|
# def open_issues(self):
|
||||||
# self.issues.raise_()
|
# self.issues.show()
|
||||||
|
# self.issues.raise_()
|
||||||
def unload(self):
|
|
||||||
""" Unload the plugin. """
|
def unload(self):
|
||||||
if self.editor:
|
""" Unload the plugin. """
|
||||||
iface.removePluginMenu('CenRa_Metabase',self.editor_action)
|
#if self.editor:
|
||||||
#self.editor.removeToolBarIcon(self.editor_action)
|
#iface.removePluginMenu('CenRa_Metabase',self.editor_action)
|
||||||
|
#self.editor.removeToolBarIcon(self.editor_action)
|
||||||
|
|
||||||
|
if self.dock:
|
||||||
if self.dock:
|
iface.removeDockWidget(self.dock)
|
||||||
iface.removeDockWidget(self.dock)
|
self.dock.deleteLater()
|
||||||
self.dock.deleteLater()
|
|
||||||
|
if self.provider:
|
||||||
if self.provider:
|
QgsApplication.processingRegistry().removeProvider(self.provider)
|
||||||
QgsApplication.processingRegistry().removeProvider(self.provider)
|
del self.provider
|
||||||
del self.provider
|
|
||||||
|
if self.locator_filter:
|
||||||
if self.locator_filter:
|
iface.deregisterLocatorFilter(self.locator_filter)
|
||||||
iface.deregisterLocatorFilter(self.locator_filter)
|
del self.locator_filter
|
||||||
del self.locator_filter
|
|
||||||
|
if self.help_action:
|
||||||
if self.dock_action:
|
iface.pluginHelpMenu().removeAction(self.help_action)
|
||||||
iface.pluginMenu().removeAction(self.dock_action)
|
del self.help_action
|
||||||
del self.dock_action
|
|
||||||
|
if self.dock_action:
|
||||||
if self.help_action:
|
iface.pluginMenu().removeAction(self.dock_action)
|
||||||
iface.pluginHelpMenu().removeAction(self.help_action)
|
del self.dock_action
|
||||||
del self.help_action
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def run_tests(pattern='test_*.py', package=None):
|
def run_tests(pattern='test_*.py', package=None):
|
||||||
"""Run the test inside QGIS."""
|
"""Run the test inside QGIS."""
|
||||||
try:
|
try:
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from pg_metadata.qgis_plugin_tools.infrastructure.test_runner import (
|
from pg_metadata.qgis_plugin_tools.infrastructure.test_runner import (
|
||||||
test_package,
|
test_package,
|
||||||
)
|
)
|
||||||
if package is None:
|
if package is None:
|
||||||
package = '{}.__init__'.format(Path(__file__).parent.name)
|
package = '{}.__init__'.format(Path(__file__).parent.name)
|
||||||
test_package(package, pattern)
|
test_package(package, pattern)
|
||||||
except (AttributeError, ModuleNotFoundError):
|
except (AttributeError, ModuleNotFoundError):
|
||||||
message = 'Could not load tests. Are you using a production package?'
|
message = 'Could not load tests. Are you using a production package?'
|
||||||
print(message) # NOQA
|
print(message) # NOQA
|
||||||
@@ -12,11 +12,10 @@ ABOUT_FORM_CLASS, _ = uic.loadUiType(
|
|||||||
os.path.join(
|
os.path.join(
|
||||||
str(Path(__file__).resolve().parent),
|
str(Path(__file__).resolve().parent),
|
||||||
'tools/ui',
|
'tools/ui',
|
||||||
'CenRa_Metabase_about_form.ui'
|
'CenRa_about_form.ui'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class MetabaseAboutDialog(QDialog, ABOUT_FORM_CLASS):
|
class MetabaseAboutDialog(QDialog, ABOUT_FORM_CLASS):
|
||||||
|
|
||||||
""" About - Let the user display the about dialog. """
|
""" About - Let the user display the about dialog. """
|
||||||
@@ -1,488 +1,498 @@
|
|||||||
"""Dock file."""
|
"""Dock file."""
|
||||||
|
|
||||||
__copyright__ = 'Copyright 2020, 3Liz'
|
__copyright__ = 'Copyright 2020, 3Liz'
|
||||||
__license__ = 'GPL version 3'
|
__license__ = 'GPL version 3'
|
||||||
__email__ = 'info@3liz.org'
|
__email__ = 'info@3liz.org'
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from xml.dom.minidom import parseString
|
from xml.dom.minidom import parseString
|
||||||
|
|
||||||
from qgis.core import (
|
from qgis.core import (
|
||||||
NULL,
|
NULL,
|
||||||
QgsApplication,
|
QgsApplication,
|
||||||
QgsDataSourceUri,
|
QgsDataSourceUri,
|
||||||
QgsProject,
|
QgsProject,
|
||||||
QgsProviderConnectionException,
|
QgsProviderConnectionException,
|
||||||
QgsProviderRegistry,
|
QgsProviderRegistry,
|
||||||
QgsRasterLayer,
|
QgsRasterLayer,
|
||||||
QgsSettings,
|
QgsSettings,
|
||||||
QgsVectorLayer,
|
QgsVectorLayer,
|
||||||
)
|
)
|
||||||
from qgis.PyQt.QtCore import QLocale, QUrl
|
from qgis.PyQt.QtCore import QLocale, QUrl
|
||||||
from qgis.PyQt.QtGui import QDesktopServices, QIcon
|
from qgis.PyQt.QtGui import QDesktopServices, QIcon
|
||||||
from qgis.PyQt.QtPrintSupport import QPrinter
|
from qgis.PyQt.QtPrintSupport import QPrinter
|
||||||
from qgis.PyQt.QtWebKitWidgets import QWebPage
|
#from qgis.PyQt.QtWebKitWidgets import QWebPage
|
||||||
from qgis.PyQt.QtWidgets import (
|
from qgis.PyQt.QtWidgets import (
|
||||||
QDialog,
|
QDialog,
|
||||||
QAction,
|
QAction,
|
||||||
QDockWidget,
|
QDockWidget,
|
||||||
QFileDialog,
|
QFileDialog,
|
||||||
QInputDialog,
|
QInputDialog,
|
||||||
QMenu,
|
QMenu,
|
||||||
QToolButton,
|
QToolButton,
|
||||||
)
|
)
|
||||||
from qgis.gui import *
|
from qgis.gui import *
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
'''
|
import qgis
|
||||||
from pg_metadata.connection_manager import (
|
'''
|
||||||
check_pgmetadata_is_installed,
|
from pg_metadata.connection_manager import (
|
||||||
connections_list,
|
check_pgmetadata_is_installed,
|
||||||
settings_connections_names,
|
connections_list,
|
||||||
)
|
settings_connections_names,
|
||||||
'''
|
)
|
||||||
|
'''
|
||||||
from .tools.resources import (
|
try:
|
||||||
load_ui,
|
from .tools.PythonSQL import login_base
|
||||||
resources_path,
|
except:
|
||||||
login_base,
|
print('Pas de fichier PythonSQL')
|
||||||
)
|
|
||||||
|
from .tools.resources import (
|
||||||
DOCK_CLASS = load_ui('CenRa_Metabase_dockwidget_base.ui')
|
load_ui,
|
||||||
LOGGER = logging.getLogger('CenRa_Metabase')
|
resources_path,
|
||||||
|
)
|
||||||
|
|
||||||
class Format(namedtuple('Format', ['label', 'ext'])):
|
DOCK_CLASS = load_ui('CenRa_Metabase_dockwidget_base.ui')
|
||||||
""" Format available for exporting metadata. """
|
LOGGER = logging.getLogger('CenRa_Metabase')
|
||||||
pass
|
|
||||||
|
|
||||||
|
class Format(namedtuple('Format', ['label', 'ext'])):
|
||||||
class OutputFormats(Format, Enum):
|
""" Format available for exporting metadata. """
|
||||||
""" Output format for a metadata sheet. """
|
pass
|
||||||
PDF = Format(label='PDF', ext='pdf')
|
|
||||||
HTML = Format(label='HTML', ext='html')
|
|
||||||
DCAT = Format(label='DCAT', ext='xml')
|
class OutputFormats(Format, Enum):
|
||||||
|
""" Output format for a metadata sheet. """
|
||||||
|
PDF = Format(label='PDF', ext='pdf')
|
||||||
class CenRa_Metabase(QDockWidget, DOCK_CLASS):
|
HTML = Format(label='HTML', ext='html')
|
||||||
|
DCAT = Format(label='DCAT', ext='xml')
|
||||||
def __init__(self, parent=None):
|
|
||||||
_ = parent
|
|
||||||
super().__init__()
|
class CenRa_Metabase(QDockWidget, DOCK_CLASS):
|
||||||
self.setupUi(self)
|
|
||||||
self.settings = QgsSettings()
|
def __init__(self, parent=None):
|
||||||
|
_ = parent
|
||||||
self.current_datasource_uri = None
|
super().__init__()
|
||||||
self.current_connection = None
|
self.setupUi(self)
|
||||||
|
self.settings = QgsSettings()
|
||||||
self.viewer.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
|
|
||||||
self.viewer.page().linkClicked.connect(self.open_link)
|
self.current_datasource_uri = None
|
||||||
|
self.current_connection = None
|
||||||
# Help button
|
|
||||||
self.external_help.setText('')
|
#self.viewer.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
|
||||||
self.external_help.setIcon(QIcon(QgsApplication.iconPath('mActionHelpContents.svg')))
|
#self.viewer.page().linkClicked.connect(self.open_link)
|
||||||
self.external_help.clicked.connect(self.open_external_help)
|
|
||||||
|
# Help button
|
||||||
# Flat table button
|
self.external_help.setText('')
|
||||||
self.flatten_dataset_table.setText('')
|
self.external_help.setIcon(QIcon(QgsApplication.iconPath('mActionHelpContents.svg')))
|
||||||
#self.flatten_dataset_table.setToolTip(tr("Add the catalog table"))
|
self.external_help.clicked.connect(self.open_external_help)
|
||||||
self.flatten_dataset_table.setIcon(QgsApplication.getThemeIcon("/mActionAddHtml.svg"))
|
|
||||||
#self.flatten_dataset_table.clicked.connect(self.add_flatten_dataset_table)
|
# Flat table button
|
||||||
|
self.flatten_dataset_table.setText('')
|
||||||
# Settings menu
|
#self.flatten_dataset_table.setToolTip(tr("Add the catalog table"))
|
||||||
self.config.setAutoRaise(True)
|
self.flatten_dataset_table.setIcon(QgsApplication.getThemeIcon("/mActionAddHtml.svg"))
|
||||||
#self.config.setToolTip(tr("Settings"))
|
#self.flatten_dataset_table.clicked.connect(self.add_flatten_dataset_table)
|
||||||
self.config.setPopupMode(QToolButton.InstantPopup)
|
|
||||||
self.config.setIcon(QgsApplication.getThemeIcon("/mActionOptions.svg"))
|
# Settings menu
|
||||||
|
self.config.setAutoRaise(True)
|
||||||
self.auto_open_dock_action = QAction(
|
#self.config.setToolTip(tr("Settings"))
|
||||||
("Dommage, cette option n'existe pas encore."),
|
self.config.setPopupMode(QToolButton.ToolButtonPopupMode(2))
|
||||||
iface.mainWindow())
|
self.config.setIcon(QgsApplication.getThemeIcon("/mActionOptions.svg"))
|
||||||
self.auto_open_dock_action.setCheckable(True)
|
|
||||||
self.auto_open_dock_action.setChecked(
|
self.auto_open_dock_action = QAction(
|
||||||
self.settings.value("pgmetadata/auto_open_dock", True, type=bool)
|
("Dommage, cette option n'existe pas encore."),
|
||||||
)
|
iface.mainWindow())
|
||||||
self.auto_open_dock_action.triggered.connect(self.save_auto_open_dock)
|
self.auto_open_dock_action.setCheckable(True)
|
||||||
menu = QMenu()
|
self.auto_open_dock_action.setChecked(
|
||||||
menu.addAction(self.auto_open_dock_action)
|
self.settings.value("pgmetadata/auto_open_dock", True, type=bool)
|
||||||
self.config.setMenu(menu)
|
)
|
||||||
|
self.auto_open_dock_action.triggered.connect(self.save_auto_open_dock)
|
||||||
# Setting PDF/HTML menu
|
menu = QMenu()
|
||||||
self.save_button.setAutoRaise(True)
|
menu.addAction(self.auto_open_dock_action)
|
||||||
#self.save_button.setToolTip(tr("Save metadata"))
|
self.config.setMenu(menu)
|
||||||
self.save_button.setPopupMode(QToolButton.InstantPopup)
|
|
||||||
self.save_button.setIcon(QIcon(QgsApplication.iconPath('mActionFileSave.svg')))
|
# Setting PDF/HTML menu
|
||||||
|
self.save_button.setAutoRaise(True)
|
||||||
self.save_as_pdf = QAction(
|
#self.save_button.setToolTip(tr("Save metadata"))
|
||||||
('Enregistrer en PDF') + '…',
|
self.save_button.setPopupMode(QToolButton.ToolButtonPopupMode(2))
|
||||||
iface.mainWindow())
|
self.save_button.setIcon(QIcon(QgsApplication.iconPath('mActionFileSave.svg')))
|
||||||
self.save_as_pdf.triggered.connect(partial(self.export_dock_content, OutputFormats.PDF))
|
|
||||||
|
self.save_as_pdf = QAction(
|
||||||
self.save_as_html = QAction(
|
('Enregistrer en PDF') + '…',
|
||||||
('Enregistrer en HTML') + '…',
|
iface.mainWindow())
|
||||||
iface.mainWindow())
|
self.save_as_pdf.triggered.connect(partial(self.export_dock_content, OutputFormats.PDF))
|
||||||
self.save_as_html.triggered.connect(partial(self.export_dock_content, OutputFormats.HTML))
|
|
||||||
self.save_as_dcat = QAction(
|
self.save_as_html = QAction(
|
||||||
('Enregistrer en DCAT') + '…',
|
('Enregistrer en HTML') + '…',
|
||||||
iface.mainWindow())
|
iface.mainWindow())
|
||||||
self.save_as_dcat.triggered.connect(partial(self.export_dock_content, OutputFormats.DCAT))
|
self.save_as_html.triggered.connect(partial(self.export_dock_content, OutputFormats.HTML))
|
||||||
|
self.save_as_dcat = QAction(
|
||||||
self.menu_save = QMenu()
|
('Enregistrer en DCAT') + '…',
|
||||||
self.menu_save.addAction(self.save_as_pdf)
|
iface.mainWindow())
|
||||||
self.menu_save.addAction(self.save_as_html)
|
self.save_as_dcat.triggered.connect(partial(self.export_dock_content, OutputFormats.DCAT))
|
||||||
self.menu_save.addAction(self.save_as_dcat)
|
|
||||||
self.save_button.setMenu(self.menu_save)
|
self.menu_save = QMenu()
|
||||||
self.save_button.setEnabled(False)
|
self.menu_save.addAction(self.save_as_pdf)
|
||||||
|
self.menu_save.addAction(self.save_as_html)
|
||||||
self.metadata = QgsProviderRegistry.instance().providerMetadata('postgres')
|
self.menu_save.addAction(self.save_as_dcat)
|
||||||
|
self.save_button.setMenu(self.menu_save)
|
||||||
# Display message in the dock
|
self.save_button.setEnabled(False)
|
||||||
#if not settings_connections_names():
|
|
||||||
#self.default_html_content_not_installed()
|
self.metadata = QgsProviderRegistry.instance().providerMetadata('postgres')
|
||||||
#else:
|
|
||||||
self.default_html_content_not_pg_layer()
|
# Display message in the dock
|
||||||
|
#if not settings_connections_names():
|
||||||
iface.layerTreeView().currentLayerChanged.connect(self.layer_changed)
|
#self.default_html_content_not_installed()
|
||||||
|
#else:
|
||||||
if iface.activeLayer():
|
self.default_html_content_not_pg_layer()
|
||||||
layer=iface.activeLayer()
|
|
||||||
iface.layerTreeView().setCurrentLayer(None)
|
try:
|
||||||
iface.layerTreeView().setCurrentLayer(layer)
|
login_base()
|
||||||
|
iface.layerTreeView().currentLayerChanged.connect(self.layer_changed)
|
||||||
def export_dock_content(self, output_format: OutputFormats):
|
except:
|
||||||
""" Export the current displayed metadata sheet to the given format. """
|
#qgis.utils.plugins['CenRa_METABASE'].initGui()
|
||||||
layer_name = iface.activeLayer().name()
|
qgis.utils.plugins['CenRa_METABASE'].unload()
|
||||||
|
#self.default_html_content_not_pg_layer()
|
||||||
file_path = os.path.join(
|
|
||||||
os.environ['USERPROFILE'],
|
if iface.activeLayer():
|
||||||
'Desktop\\{name}.{ext}'.format(name=layer_name, ext=output_format.ext)
|
layer=iface.activeLayer()
|
||||||
)
|
iface.layerTreeView().setCurrentLayer(None)
|
||||||
output_file = QFileDialog.getSaveFileName(
|
iface.layerTreeView().setCurrentLayer(layer)
|
||||||
self,
|
|
||||||
("Enregistrer en {format}").format(format=output_format.label),
|
def export_dock_content(self, output_format: OutputFormats):
|
||||||
file_path,
|
""" Export the current displayed metadata sheet to the given format. """
|
||||||
"{label} (*.{ext})".format(
|
layer_name = iface.activeLayer().name()
|
||||||
label=output_format.label,
|
|
||||||
ext=output_format.ext,
|
file_path = os.path.join(
|
||||||
)
|
os.environ['USERPROFILE'],
|
||||||
)
|
'Desktop\\{name}.{ext}'.format(name=layer_name, ext=output_format.ext)
|
||||||
if output_file[0] == '':
|
)
|
||||||
return
|
output_file = QFileDialog.getSaveFileName(
|
||||||
|
self,
|
||||||
self.settings.setValue("UI/lastFileNameWidgetDir", os.path.dirname(output_file[0]))
|
("Enregistrer en {format}").format(format=output_format.label),
|
||||||
|
file_path,
|
||||||
output_file_path = output_file[0]
|
"{label} (*.{ext})".format(
|
||||||
parent_folder = str(Path(output_file_path).parent)
|
label=output_format.label,
|
||||||
|
ext=output_format.ext,
|
||||||
if output_format == OutputFormats.PDF:
|
)
|
||||||
printer = QPrinter()
|
)
|
||||||
printer.setOutputFormat(QPrinter.PdfFormat)
|
if output_file[0] == '':
|
||||||
printer.setPageMargins(20, 20, 20, 20, QPrinter.Millimeter)
|
return
|
||||||
printer.setOutputFileName(output_file_path)
|
|
||||||
self.viewer.print(printer)
|
self.settings.setValue("UI/lastFileNameWidgetDir", os.path.dirname(output_file[0]))
|
||||||
iface.messageBar().pushSuccess(
|
|
||||||
("Export PDF"),
|
output_file_path = output_file[0]
|
||||||
(
|
parent_folder = str(Path(output_file_path).parent)
|
||||||
"The metadata has been exported as PDF successfully in "
|
|
||||||
"<a href=\"{}\">{}</a>").format(parent_folder, output_file_path)
|
if output_format == OutputFormats.PDF:
|
||||||
)
|
printer = QPrinter()
|
||||||
|
printer.setOutputFormat(QPrinter.OutputFormat(1))
|
||||||
elif output_format in [OutputFormats.HTML,OutputFormats.DCAT]:
|
#printer.setPageMargins(20,20,20,20,QPrinter.Unit(0))
|
||||||
if output_format == OutputFormats.HTML:
|
printer.setOutputFileName(output_file_path)
|
||||||
data_str = self.viewer.page().currentFrame().toHtml()
|
self.viewer.print(printer)
|
||||||
else:
|
iface.messageBar().pushSuccess(
|
||||||
layer = iface.activeLayer()
|
("Export PDF"),
|
||||||
uri = layer.dataProvider().uri()
|
(
|
||||||
dataall = self.sql_info(uri)
|
"The metadata has been exported as PDF successfully in "
|
||||||
data = self.sql_to_xml(dataall)
|
"<a href=\"{}\">{}</a>").format(parent_folder, output_file_path)
|
||||||
|
)
|
||||||
with open(resources_path('xml', 'dcat.xml'), encoding='utf8') as xml_file:
|
|
||||||
xml_template = xml_file.read()
|
elif output_format in [OutputFormats.HTML,OutputFormats.DCAT]:
|
||||||
|
if output_format == OutputFormats.HTML:
|
||||||
xml = parseString(xml_template.format(language=data[0][0], content=data[0][1]))
|
data_str = self.viewer.page().currentFrame().toHtml()
|
||||||
|
else:
|
||||||
data_str = xml.toprettyxml()
|
layer = iface.activeLayer()
|
||||||
|
uri = layer.dataProvider().uri()
|
||||||
with open(output_file[0], "w", encoding='utf8') as file_writer:
|
dataall = self.sql_info(uri)
|
||||||
file_writer.write(data_str)
|
data = self.sql_to_xml(dataall)
|
||||||
iface.messageBar().pushSuccess(
|
|
||||||
("Export") + ' ' + output_format.label,
|
with open(resources_path('xml', 'dcat.xml'), encoding='utf8') as xml_file:
|
||||||
(
|
xml_template = xml_file.read()
|
||||||
"The metadata has been exported as {format} successfully in "
|
|
||||||
"<a href=\"{folder}\">{path}</a>").format(
|
xml = parseString(xml_template.format(language=data[0][0], content=data[0][1]))
|
||||||
format=output_format.label, folder=parent_folder, path=output_file_path)
|
|
||||||
)
|
data_str = xml.toprettyxml()
|
||||||
|
|
||||||
def save_auto_open_dock(self):
|
with open(output_file[0], "w", encoding='utf8') as file_writer:
|
||||||
""" Save settings about the dock. """
|
file_writer.write(data_str)
|
||||||
self.settings.setValue("pgmetadata/auto_open_dock", self.auto_open_dock_action.isChecked())
|
iface.messageBar().pushSuccess(
|
||||||
def sql_to_xml(self,dataall):
|
("Export") + ' ' + output_format.label,
|
||||||
distribution=''
|
(
|
||||||
for y in dataall[1]:
|
"The metadata has been exported as {format} successfully in "
|
||||||
distribution = distribution + (
|
"<a href=\"{folder}\">{path}</a>").format(
|
||||||
'<dcat:distribution>'+
|
format=output_format.label, folder=parent_folder, path=output_file_path)
|
||||||
'<dcat:Distribution>'+
|
)
|
||||||
'<dct:title>{data}</dct:title>'.format(data=y[0])+
|
|
||||||
'<dcat:downloadURL>{data}</dcat:downloadURL>'.format(data=y[1])+
|
def save_auto_open_dock(self):
|
||||||
'<dcat:mediaType>{data}</dcat:mediaType>'.format(data=y[2])+
|
""" Save settings about the dock. """
|
||||||
'<dct:format>{data}</dct:format>'.format(data=y[3])+
|
self.settings.setValue("pgmetadata/auto_open_dock", self.auto_open_dock_action.isChecked())
|
||||||
'<dct:bytesize>{data}</dct:bytesize>'.format(data=y[4])+
|
def sql_to_xml(self,dataall):
|
||||||
'</dcat:Distribution>'+
|
distribution=''
|
||||||
'</dcat:distribution>')
|
for y in dataall[1]:
|
||||||
publisher=''
|
distribution = distribution + (
|
||||||
for z in dataall[2]:
|
'<dcat:distribution>'+
|
||||||
publisher = publisher + (
|
'<dcat:Distribution>'+
|
||||||
'<dct:publisher>'+
|
'<dct:title>{data}</dct:title>'.format(data=y[0])+
|
||||||
'<foaf:Organization>'+
|
'<dcat:downloadURL>{data}</dcat:downloadURL>'.format(data=y[1])+
|
||||||
'<foaf:name>{data}</foaf:name>'.format(data=z[1])+
|
'<dcat:mediaType>{data}</dcat:mediaType>'.format(data=y[2])+
|
||||||
'<foaf:mbox>{data}</foaf:mbox>'.format(data=z[3])+
|
'<dct:format>{data}</dct:format>'.format(data=y[3])+
|
||||||
'</foaf:Organization>'+
|
'<dct:bytesize>{data}</dct:bytesize>'.format(data=y[4])+
|
||||||
'</dct:publisher>')
|
'</dcat:Distribution>'+
|
||||||
data_str = [[dataall[0][26],
|
'</dcat:distribution>')
|
||||||
'<dct:identifier>{data}</dct:identifier>'.format(data=dataall[0][1])+
|
publisher=''
|
||||||
'<dct:title>{data}</dct:title>'.format(data=dataall[0][4])+
|
for z in dataall[2]:
|
||||||
'<dct:description>{data}</dct:description>'.format(data=dataall[0][5])+
|
publisher = publisher + (
|
||||||
'<dct:language>{data}</dct:language>'.format(data=dataall[0][26])+
|
'<dct:publisher>'+
|
||||||
'<dct:spatial>{data}</dct:spatial>'.format(data=dataall[0][28])+
|
'<foaf:Organization>'+
|
||||||
'<dct:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">{data}</dct:created>'.format(data=dataall[0][20])+
|
'<foaf:name>{data}</foaf:name>'.format(data=z[1])+
|
||||||
'<dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">{data}</dct:issued>'.format(data=dataall[0][11])+
|
'<foaf:mbox>{data}</foaf:mbox>'.format(data=z[3])+
|
||||||
'<dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">{data}</dct:modified>'.format(data=dataall[0][21])+
|
'</foaf:Organization>'+
|
||||||
'<dct:license>{data}</dct:license>'.format(data=dataall[0][13])+
|
'</dct:publisher>')
|
||||||
distribution+
|
data_str = [[dataall[0][26],
|
||||||
publisher+
|
'<dct:identifier>{data}</dct:identifier>'.format(data=dataall[0][1])+
|
||||||
'<dcat:theme>{data}</dcat:theme>'.format(data=", ".join(str(x) for x in dataall[0][24]))+
|
'<dct:title>{data}</dct:title>'.format(data=dataall[0][4])+
|
||||||
'<dcat:keyword>{data}</dcat:keyword>'.format(data=", ".join(str(x) for x in dataall[0][6]))+
|
'<dct:description>{data}</dct:description>'.format(data=dataall[0][5])+
|
||||||
'<dct:accrualPeriodicity>{data}</dct:accrualPeriodicity>'.format(data=dataall[0][12])]]
|
'<dct:language>{data}</dct:language>'.format(data=dataall[0][26])+
|
||||||
|
'<dct:spatial>{data}</dct:spatial>'.format(data=dataall[0][28])+
|
||||||
return data_str
|
'<dct:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">{data}</dct:created>'.format(data=dataall[0][20])+
|
||||||
|
'<dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">{data}</dct:issued>'.format(data=dataall[0][11])+
|
||||||
@staticmethod
|
'<dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">{data}</dct:modified>'.format(data=dataall[0][21])+
|
||||||
def sql_for_layer(uri, output_format: OutputFormats):
|
'<dct:license>{data}</dct:license>'.format(data=dataall[0][13])+
|
||||||
""" Get the SQL query for a given layer and output format. """
|
distribution+
|
||||||
locale = QgsSettings().value("locale/userLocale", QLocale().name())
|
publisher+
|
||||||
locale = locale.split('_')[0].lower()
|
'<dcat:theme>{data}</dcat:theme>'.format(data=", ".join(str(x) for x in dataall[0][24]))+
|
||||||
|
'<dcat:keyword>{data}</dcat:keyword>'.format(data=", ".join(str(x) for x in dataall[0][6]))+
|
||||||
if output_format == [OutputFormats.HTML,OutputFormats.DCAT]:
|
'<dct:accrualPeriodicity>{data}</dct:accrualPeriodicity>'.format(data=dataall[0][12])]]
|
||||||
sql = (
|
|
||||||
"SELECT pgmetadata.get_dataset_item_html_content('{schema}', '{table}', '{locale}');"
|
return data_str
|
||||||
).format(schema=uri.schema(), table=uri.table(), locale=locale)
|
|
||||||
else:
|
@staticmethod
|
||||||
raise NotImplementedError('Output format is not yet implemented.')
|
def sql_for_layer(uri, output_format: OutputFormats):
|
||||||
|
""" Get the SQL query for a given layer and output format. """
|
||||||
return sql
|
locale = QgsSettings().value("locale/userLocale", QLocale().name())
|
||||||
|
locale = locale.split('_')[0].lower()
|
||||||
def layer_changed(self, layer):
|
|
||||||
""" When the layer has changed in the legend, we must check this new layer. """
|
if output_format == [OutputFormats.HTML,OutputFormats.DCAT]:
|
||||||
self.current_datasource_uri = None
|
sql = (
|
||||||
self.current_connection = None
|
"SELECT pgmetadata.get_dataset_item_html_content('{schema}', '{table}', '{locale}');"
|
||||||
self.ce_trouve_dans_psql(layer)
|
).format(schema=uri.schema(), table=uri.table(), locale=locale)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError('Output format is not yet implemented.')
|
||||||
def add_flatten_dataset_table(self):
|
|
||||||
""" Add a flatten dataset table with all links and contacts. """
|
return sql
|
||||||
'''
|
|
||||||
connections, message = connections_list()
|
def layer_changed(self, layer):
|
||||||
if not connections:
|
""" When the layer has changed in the legend, we must check this new layer. """
|
||||||
LOGGER.critical(message)
|
self.current_datasource_uri = None
|
||||||
self.set_html_content('PgMetadata', message)
|
self.current_connection = None
|
||||||
return
|
self.ce_trouve_dans_psql(layer)
|
||||||
|
|
||||||
if len(connections) > 1:
|
|
||||||
dialog = QInputDialog()
|
def add_flatten_dataset_table(self):
|
||||||
dialog.setComboBoxItems(connections)
|
""" Add a flatten dataset table with all links and contacts. """
|
||||||
dialog.setWindowTitle(tr("Database"))
|
'''
|
||||||
dialog.setLabelText(tr("Choose the database to add the catalog"))
|
connections, message = connections_list()
|
||||||
if not dialog.exec_():
|
if not connections:
|
||||||
return
|
LOGGER.critical(message)
|
||||||
connection_name = dialog.textValue()
|
self.set_html_content('PgMetadata', message)
|
||||||
else:
|
return
|
||||||
connection_name = connections[0]
|
|
||||||
|
if len(connections) > 1:
|
||||||
metadata = QgsProviderRegistry.instance().providerMetadata('postgres')
|
dialog = QInputDialog()
|
||||||
connection = metadata.findConnection(connection_name)
|
dialog.setComboBoxItems(connections)
|
||||||
|
dialog.setWindowTitle(tr("Database"))
|
||||||
locale = QgsSettings().value("locale/userLocale", QLocale().name())
|
dialog.setLabelText(tr("Choose the database to add the catalog"))
|
||||||
locale = locale.split('_')[0].lower()
|
if not dialog.exec_():
|
||||||
|
return
|
||||||
uri = QgsDataSourceUri(connection.uri())
|
connection_name = dialog.textValue()
|
||||||
uri.setTable(f'(SELECT * FROM pgmetadata.export_datasets_as_flat_table(\'{locale}\'))')
|
else:
|
||||||
uri.setKeyColumn('uid')
|
connection_name = connections[0]
|
||||||
|
|
||||||
layer = QgsVectorLayer(uri.uri(), '{} - {}'.format(tr("Catalog"), connection_name), 'postgres')
|
metadata = QgsProviderRegistry.instance().providerMetadata('postgres')
|
||||||
QgsProject.instance().addMapLayer(layer)
|
connection = metadata.findConnection(connection_name)
|
||||||
'''
|
|
||||||
|
locale = QgsSettings().value("locale/userLocale", QLocale().name())
|
||||||
@staticmethod
|
locale = locale.split('_')[0].lower()
|
||||||
def open_external_help():
|
|
||||||
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
uri = QgsDataSourceUri(connection.uri())
|
||||||
|
uri.setTable(f'(SELECT * FROM pgmetadata.export_datasets_as_flat_table(\'{locale}\'))')
|
||||||
@staticmethod
|
uri.setKeyColumn('uid')
|
||||||
def open_link(url):
|
|
||||||
QDesktopServices.openUrl(url)
|
layer = QgsVectorLayer(uri.uri(), '{} - {}'.format(tr("Catalog"), connection_name), 'postgres')
|
||||||
|
QgsProject.instance().addMapLayer(layer)
|
||||||
def set_html_content(self, title=None, body=None):
|
'''
|
||||||
""" Set the content in the dock. """
|
|
||||||
#link_logo=resources_path('icons', 'CEN_RA.png')
|
@staticmethod
|
||||||
css_file = resources_path('css', 'dock.css')
|
def open_external_help():
|
||||||
with open(css_file, 'r', encoding='utf8') as f:
|
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
||||||
css = f.read()
|
|
||||||
|
@staticmethod
|
||||||
html = '<html><head>'
|
def open_link(url):
|
||||||
#html += '<script src="http://ignf.github.io/geoportal-sdk/latest/dist/2d/GpSDK2D.js" defer ></script>'
|
QDesktopServices.openUrl(url)
|
||||||
html += '<style>{css}</style></head><body>'.format(css=css)
|
|
||||||
#html += '<link rel="stylesheet" href="http://ignf.github.io/geoportal-sdk/latest/dist/2d/GpSDK2D.css" >'
|
def set_html_content(self, title=None, body=None):
|
||||||
#html += '<script src="file:///C:/Users/tlaveille/Desktop/maps.js" defer></script>'
|
""" Set the content in the dock. """
|
||||||
#html += '<noscript>Your browser does not support JavaScript!</noscript>'
|
#link_logo=resources_path('icons', 'CEN_RA.png')
|
||||||
if title:
|
css_file = resources_path('css', 'dock.css')
|
||||||
html += '<h2>{title} <img class=logo src=https://i2.wp.com/www.cen-rhonealpes.fr/wp-content/uploads/2013/04/cen-rhonealpes-couleurs1.jpg?w=340&ssl=1></h2>'.format(title=title)
|
with open(css_file, 'r', encoding='utf8') as f:
|
||||||
if body:
|
css = f.read()
|
||||||
html += body
|
|
||||||
|
html = '<html><head>'
|
||||||
html += '</body></html>'
|
#html += '<script src="http://ignf.github.io/geoportal-sdk/latest/dist/2d/GpSDK2D.js" defer ></script>'
|
||||||
|
html += '<style>{css}</style></head><body>'.format(css=css)
|
||||||
# It must be a file, even if it does not exist on the file system.
|
#html += '<link rel="stylesheet" href="http://ignf.github.io/geoportal-sdk/latest/dist/2d/GpSDK2D.css" >'
|
||||||
base_url = QUrl.fromLocalFile(resources_path('images', 'must_be_a_file.png'))
|
#html += '<script src="file:///C:/Users/tlaveille/Desktop/maps.js" defer></script>'
|
||||||
self.viewer.setHtml(html, base_url)
|
#html += '<noscript>Your browser does not support JavaScript!</noscript>'
|
||||||
|
if title:
|
||||||
def ce_trouve_dans_psql(self,layer):
|
html += '<h2>{title} <img class=logo src=https://i2.wp.com/www.cen-rhonealpes.fr/wp-content/uploads/2013/04/cen-rhonealpes-couleurs1.jpg?w=340&ssl=1></h2>'.format(title=title)
|
||||||
try:
|
if body:
|
||||||
uri = layer.dataProvider().uri()
|
html += body
|
||||||
except:
|
|
||||||
self.default_html_content_not_pg_layer()
|
html += '</body></html>'
|
||||||
self.save_button.setEnabled(False)
|
|
||||||
uri=''
|
# It must be a file, even if it does not exist on the file system.
|
||||||
if uri != '':
|
base_url = QUrl.fromLocalFile(resources_path('images', 'must_be_a_file.png'))
|
||||||
if not uri.table():
|
self.viewer.setHtml(html)#, base_url)
|
||||||
layertype = layer.providerType().lower()
|
|
||||||
if layertype == 'wms' or layertype == 'wfs':
|
def ce_trouve_dans_psql(self,layer):
|
||||||
self.set_html_to_wms(layer)
|
try:
|
||||||
else:
|
uri = layer.dataProvider().uri()
|
||||||
self.default_html_content_not_pg_layer()
|
except:
|
||||||
self.save_button.setEnabled(False)
|
self.default_html_content_not_pg_layer()
|
||||||
else:
|
self.save_button.setEnabled(False)
|
||||||
data_count = self.sql_check(uri)
|
uri=''
|
||||||
#print(data_count)
|
if uri != '':
|
||||||
if data_count == 0:
|
if not uri.table():
|
||||||
self.default_html_content_not_metadata()
|
layertype = layer.providerType().lower()
|
||||||
self.save_button.setEnabled(False)
|
if layertype == 'wms' or layertype == 'wfs':
|
||||||
else:
|
self.set_html_to_wms(layer)
|
||||||
self.build_html_content(layer,uri)
|
else:
|
||||||
self.save_button.setEnabled(True)
|
self.default_html_content_not_pg_layer()
|
||||||
|
self.save_button.setEnabled(False)
|
||||||
def build_html_content(self,layer,uri):
|
else:
|
||||||
body = ''
|
data_count = self.sql_check(uri)
|
||||||
|
#print(data_count)
|
||||||
dataall=self.sql_info(uri)
|
if data_count == 0:
|
||||||
data=dataall[0]
|
self.default_html_content_not_metadata()
|
||||||
data_url=dataall[1]
|
self.save_button.setEnabled(False)
|
||||||
data_contact=dataall[2]
|
else:
|
||||||
#print(len(data_url))
|
self.build_html_content(layer,uri)
|
||||||
data_collonne=[field.name() for field in layer.dataProvider().fields()]
|
self.save_button.setEnabled(True)
|
||||||
|
|
||||||
body += '<div><h3>Identification</h3><table class="table table-condensed">'
|
def build_html_content(self,layer,uri):
|
||||||
body += '<tr><th>Titre</th><td>{data[4]}</td></tr>'.format(data=data)
|
body = ''
|
||||||
body += '<tr><th>Description</th><td>{data[5]}</td></tr>'.format(data=data)
|
|
||||||
body += '<tr><th>Categories</th><td>{data}</td></tr>'.format(data=(", ".join(str(x) for x in data[6])))
|
dataall=self.sql_info(uri)
|
||||||
body += '<tr><th>Thèmes</th><td>{data}</td></tr>'.format(data=(", ".join(str(x) for x in data[24])))
|
data=dataall[0]
|
||||||
body += '<tr><th>Mots-clés</th><td>{data[7]}</td></tr>'.format(data=data)
|
data_url=dataall[1]
|
||||||
body += '<tr><th>Dernier mise à jour</th><td>{data[23]}</td></tr>'.format(data=data)
|
data_contact=dataall[2]
|
||||||
body += '<tr><th>Langue</th><td>{data[26]}</td></tr>'.format(data=data)
|
#print(len(data_url))
|
||||||
body += '</table></div>'
|
data_collonne=[field.name() for field in layer.dataProvider().fields()]
|
||||||
|
|
||||||
body += '<div><h3>Properties spatial</h3><table class="table table-condensed">'
|
body += '<div><h3>Identification</h3><table class="table table-condensed">'
|
||||||
body += '<tr><th>Niveau</th><td>{data[8]}</td></tr>'.format(data=data)
|
body += '<tr><th>Titre</th><td>{data[4]}</td></tr>'.format(data=data)
|
||||||
body += '<tr><th>Echelle minimum</th><td>{data[9]}</td></tr>'.format(data=data)
|
body += '<tr><th>Description</th><td>{data[5]}</td></tr>'.format(data=data)
|
||||||
body += '<tr><th>Echelle maximum</th><td>{data[10]}</td></tr>'.format(data=data)
|
body += '<tr><th>Categories</th><td>{data}</td></tr>'.format(data=(", ".join(str(x) for x in data[6])))
|
||||||
body += '<tr><th>Nombre d\'entités </th><td>{data[15]}</td></tr>'.format(data=data)
|
body += '<tr><th>Thèmes</th><td>{data}</td></tr>'.format(data=(", ".join(str(x) for x in data[24])))
|
||||||
body += '<tr><th>Type de géométrie</th><td>{data[16]}</td></tr>'.format(data=data)
|
body += '<tr><th>Mots-clés</th><td>{data[7]}</td></tr>'.format(data=data)
|
||||||
body += '<tr><th>Nom de projection</th><td>{data[17]}</td></tr>'.format(data=data)
|
body += '<tr><th>Dernier mise à jour</th><td>{data[23]}</td></tr>'.format(data=data)
|
||||||
body += '<tr><th>ID de projection</th><td>{data[18]}</td></tr>'.format(data=data)
|
body += '<tr><th>Langue</th><td>{data[26]}</td></tr>'.format(data=data)
|
||||||
body += '<tr><th>Emprise</th><td>{data[28]}</td></tr>'.format(data=data)
|
body += '</table></div>'
|
||||||
body += '</table></div>'
|
|
||||||
|
body += '<div><h3>Properties spatial</h3><table class="table table-condensed">'
|
||||||
#body += '<div id="map"></div>'
|
body += '<tr><th>Niveau</th><td>{data[8]}</td></tr>'.format(data=data)
|
||||||
|
body += '<tr><th>Echelle minimum</th><td>{data[9]}</td></tr>'.format(data=data)
|
||||||
body += '<div><h3>Publication</h3><table class="table table-condensed">'
|
body += '<tr><th>Echelle maximum</th><td>{data[10]}</td></tr>'.format(data=data)
|
||||||
body += '<tr><th>Date</th><td>{data[11]}</td></tr>'.format(data=data)
|
body += '<tr><th>Nombre d\'entités </th><td>{data[15]}</td></tr>'.format(data=data)
|
||||||
body += '<tr><th>Fréquence de mise à jour</th><td>{data[12]}</td></tr>'.format(data=data)
|
body += '<tr><th>Type de géométrie</th><td>{data[16]}</td></tr>'.format(data=data)
|
||||||
body += '<tr><th>Licence</th><td>{data[13]}</td></tr>'.format(data=data)
|
body += '<tr><th>Nom de projection</th><td>{data[17]}</td></tr>'.format(data=data)
|
||||||
body += '<tr><th>Licence attribué</th><td>{data[25]}</td></tr>'.format(data=data)
|
body += '<tr><th>ID de projection</th><td>{data[18]}</td></tr>'.format(data=data)
|
||||||
body += '<tr><th>Restriction</th><td>{data[14]}</td></tr>'.format(data=data)
|
body += '<tr><th>Emprise</th><td>{data[28]}</td></tr>'.format(data=data)
|
||||||
body += '</table></div>'
|
body += '</table></div>'
|
||||||
|
|
||||||
body += '<div><h3>Lien</h3><table class="table table-condensed table-striped table-bordered">'
|
#body += '<div id="map"></div>'
|
||||||
body += '<tr><th>Type</th><th>URL</th><th>Type MIME</th><th>Format</th><th>Taille</th></tr>'
|
|
||||||
for value_url in data_url:
|
body += '<div><h3>Publication</h3><table class="table table-condensed">'
|
||||||
body += '<tr><td>{value_url[0]}</td><td>{value_url[1]}</td><td>{value_url[2]}</td><td>{value_url[3]}</td><td>{value_url[4]}</td></tr>'.format(value_url=value_url)
|
body += '<tr><th>Date</th><td>{data[11]}</td></tr>'.format(data=data)
|
||||||
body += '</table></div>'
|
body += '<tr><th>Fréquence de mise à jour</th><td>{data[12]}</td></tr>'.format(data=data)
|
||||||
'''
|
body += '<tr><th>Licence</th><td>{data[13]}</td></tr>'.format(data=data)
|
||||||
body += '<div><h3>Liste des champs</h3><table class="table table-condensed table-striped table-bordered">'
|
body += '<tr><th>Licence attribué</th><td>{data[25]}</td></tr>'.format(data=data)
|
||||||
for collonne in data_collonne:
|
body += '<tr><th>Restriction</th><td>{data[14]}</td></tr>'.format(data=data)
|
||||||
body += '<tr><th>{collonne}</th><td>{defini}</td></tr>'.format(collonne=collonne,defini='')
|
body += '</table></div>'
|
||||||
body += '</table></div>'
|
|
||||||
'''
|
body += '<div><h3>Lien</h3><table class="table table-condensed table-striped table-bordered">'
|
||||||
body += '<div><h3>Contacts</h3><table class="table table-condensed table-striped table-bordered">'
|
body += '<tr><th>Type</th><th>URL</th><th>Type MIME</th><th>Format</th><th>Taille</th></tr>'
|
||||||
body += '<tr><th>Rôle</th><th>Nom</th><th>Organisation</th><th>Email</th><th>Télèphone</th></tr>'
|
for value_url in data_url:
|
||||||
for value_contact in data_contact:
|
body += '<tr><td>{value_url[0]}</td><td>{value_url[1]}</td><td>{value_url[2]}</td><td>{value_url[3]}</td><td>{value_url[4]}</td></tr>'.format(value_url=value_url)
|
||||||
body += '<tr><td>{value_contact[0]}</td><td>{value_contact[1]}</td><td>{value_contact[2]}</td><td>{value_contact[3]}</td><td>{value_contact[4]}</td></tr>'.format(value_contact=value_contact)
|
body += '</table></div>'
|
||||||
body += '</table></div>'
|
'''
|
||||||
|
body += '<div><h3>Liste des champs</h3><table class="table table-condensed table-striped table-bordered">'
|
||||||
body += '<div><h3>Metadata</h3><table class="table table-condensed">'
|
for collonne in data_collonne:
|
||||||
body += '<tr><th>Table</th><td>{data[2]}</td></tr>'.format(data=data)
|
body += '<tr><th>{collonne}</th><td>{defini}</td></tr>'.format(collonne=collonne,defini='')
|
||||||
body += '<tr><th>Schema</th><td>{data[3]}</td></tr>'.format(data=data)
|
body += '</table></div>'
|
||||||
body += '<tr><th>Date de création</th><td>{data[20]}</td></tr>'.format(data=data)
|
'''
|
||||||
body += '<tr><th>Date de modification</th><td>{data[21]}</td></tr>'.format(data=data)
|
body += '<div><h3>Contacts</h3><table class="table table-condensed table-striped table-bordered">'
|
||||||
body += '<tr><th>Encodage</th><td>{data[27]}</td></tr>'.format(data=data)
|
body += '<tr><th>Rôle</th><th>Nom</th><th>Organisation</th><th>Email</th><th>Télèphone</th></tr>'
|
||||||
body += '<tr><th>UUID</th><td>{data[1]}</td></tr>'.format(data=data)
|
for value_contact in data_contact:
|
||||||
body += '</table></div>'
|
body += '<tr><td>{value_contact[0]}</td><td>{value_contact[1]}</td><td>{value_contact[2]}</td><td>{value_contact[3]}</td><td>{value_contact[4]}</td></tr>'.format(value_contact=value_contact)
|
||||||
|
body += '</table></div>'
|
||||||
self.set_html_content(
|
|
||||||
layer.name(), body)
|
body += '<div><h3>Metadata</h3><table class="table table-condensed">'
|
||||||
|
body += '<tr><th>Table</th><td>{data[2]}</td></tr>'.format(data=data)
|
||||||
def set_html_to_wms(self,layer):
|
body += '<tr><th>Schema</th><td>{data[3]}</td></tr>'.format(data=data)
|
||||||
self.set_html_content(
|
body += '<tr><th>Date de création</th><td>{data[20]}</td></tr>'.format(data=data)
|
||||||
'CenRa Metadata',(layer.htmlMetadata()))
|
body += '<tr><th>Date de modification</th><td>{data[21]}</td></tr>'.format(data=data)
|
||||||
def default_html_content_not_pg_layer(self):
|
body += '<tr><th>Encodage</th><td>{data[27]}</td></tr>'.format(data=data)
|
||||||
""" When it's not a PostgreSQL layer. """
|
body += '<tr><th>UUID</th><td>{data[1]}</td></tr>'.format(data=data)
|
||||||
self.set_html_content(
|
body += '</table></div>'
|
||||||
'CenRa Metadata', ('Vous devez cliquer sur une couche dans la légende qui est stockée dans PostgreSQL.'))
|
|
||||||
def default_html_content_not_metadata(self):
|
self.set_html_content(
|
||||||
self.set_html_content(
|
layer.name(), body)
|
||||||
'CenRa Metadata', ('La couche ne contien pas de métadonnée.'))
|
|
||||||
|
def set_html_to_wms(self,layer):
|
||||||
def sql_check(self,uri):
|
self.set_html_content(
|
||||||
cur=login_base()
|
'CenRa Metadata',(layer.htmlMetadata()))
|
||||||
table = uri.table()
|
def default_html_content_not_pg_layer(self):
|
||||||
schema = uri.schema()
|
""" When it's not a PostgreSQL layer. """
|
||||||
|
self.set_html_content(
|
||||||
sql_count = """SELECT count(uid) FROM metadata.dataset
|
'CenRa Metadata', ('Vous devez cliquer sur une couche dans la légende qui est stockée dans PostgreSQL.'))
|
||||||
WHERE schema_name LIKE '"""+schema+"""' AND table_name LIKE '"""+table+"""';"""
|
def default_html_content_not_metadata(self):
|
||||||
|
self.set_html_content(
|
||||||
cur.execute(sql_count)
|
'CenRa Metadata', ('La couche ne contien pas de métadonnée.'))
|
||||||
data_count = cur.fetchall()
|
|
||||||
cur.close()
|
def sql_check(self,uri):
|
||||||
return data_count[0][0]
|
cur=login_base()
|
||||||
|
table = uri.table()
|
||||||
def sql_info(self,uri):
|
schema = uri.schema()
|
||||||
cur=login_base()
|
|
||||||
table = uri.table()
|
sql_count = """SELECT count(uid) FROM metadata.dataset
|
||||||
schema = uri.schema()
|
WHERE schema_name LIKE '"""+schema+"""' AND table_name LIKE '"""+table+"""';"""
|
||||||
#[s for s in iface.activeLayer().source().split(" ") if "dbname" in s][0].split("'")[1]
|
|
||||||
sql_find = """SELECT *,right(left(st_astext(geom,2),-2),-9) FROM metadata.dataset
|
cur.execute(sql_count)
|
||||||
WHERE schema_name LIKE '"""+schema+"""' AND table_name LIKE '"""+table+"""';"""
|
data_count = cur.fetchall()
|
||||||
cur.execute(sql_find)
|
cur.close()
|
||||||
data_general = cur.fetchall()
|
return data_count[0][0]
|
||||||
sql_findurl = """SELECT type,url,mime,format,taille FROM metadata.dataurl WHERE schema_name LIKE '"""+schema+"""' AND table_name LIKE '"""+table+"""';"""
|
|
||||||
cur.execute(sql_findurl)
|
def sql_info(self,uri):
|
||||||
data_url = cur.fetchall()
|
cur=login_base()
|
||||||
sql_findcontact = """SELECT role,nom,organisation,email,telephone FROM metadata.datacontact WHERE schema_name LIKE '"""+schema+"""' AND table_name LIKE '"""+table+"""';"""
|
table = uri.table()
|
||||||
cur.execute(sql_findcontact)
|
schema = uri.schema()
|
||||||
data_contact = cur.fetchall()
|
#[s for s in iface.activeLayer().source().split(" ") if "dbname" in s][0].split("'")[1]
|
||||||
cur.close()
|
sql_find = """SELECT *,right(left(st_astext(geom,2),-2),-9) FROM metadata.dataset
|
||||||
return data_general[0],data_url,data_contact
|
WHERE schema_name LIKE '"""+schema+"""' AND table_name LIKE '"""+table+"""';"""
|
||||||
|
cur.execute(sql_find)
|
||||||
|
data_general = cur.fetchall()
|
||||||
|
sql_findurl = """SELECT type,url,mime,format,taille FROM metadata.dataurl WHERE schema_name LIKE '"""+schema+"""' AND table_name LIKE '"""+table+"""';"""
|
||||||
|
cur.execute(sql_findurl)
|
||||||
|
data_url = cur.fetchall()
|
||||||
|
sql_findcontact = """SELECT role,nom,organisation,email,telephone FROM metadata.datacontact WHERE schema_name LIKE '"""+schema+"""' AND table_name LIKE '"""+table+"""';"""
|
||||||
|
cur.execute(sql_findcontact)
|
||||||
|
data_contact = cur.fetchall()
|
||||||
|
cur.close()
|
||||||
|
return data_general[0],data_url,data_contact
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
@@ -1,89 +1,89 @@
|
|||||||
import os
|
import os
|
||||||
plugin_dir = os.path.dirname(__file__)
|
plugin_dir = os.path.dirname(__file__)
|
||||||
end_find = plugin_dir.rfind('\\')+1
|
end_find = plugin_dir.rfind('\\')+1
|
||||||
|
|
||||||
NAME = plugin_dir[end_find:]
|
NAME = plugin_dir[end_find:]
|
||||||
#print(NAME)
|
#print(NAME)
|
||||||
|
|
||||||
from qgis.gui import *
|
from qgis.gui import *
|
||||||
|
|
||||||
from qgis.core import (
|
from qgis.core import (
|
||||||
NULL,
|
NULL,
|
||||||
QgsApplication,
|
QgsApplication,
|
||||||
QgsDataSourceUri,
|
QgsDataSourceUri,
|
||||||
QgsProject,
|
QgsProject,
|
||||||
QgsProviderConnectionException,
|
QgsProviderConnectionException,
|
||||||
QgsProviderRegistry,
|
QgsProviderRegistry,
|
||||||
QgsRasterLayer,
|
QgsRasterLayer,
|
||||||
QgsSettings,
|
QgsSettings,
|
||||||
QgsVectorLayer,
|
QgsVectorLayer,
|
||||||
QgsGeometry,
|
QgsGeometry,
|
||||||
)
|
)
|
||||||
from qgis.PyQt.QtWidgets import (
|
from qgis.PyQt.QtWidgets import (
|
||||||
QDialog,
|
QDialog,
|
||||||
QAction,
|
QAction,
|
||||||
QDockWidget,
|
QDockWidget,
|
||||||
QFileDialog,
|
QFileDialog,
|
||||||
QInputDialog,
|
QInputDialog,
|
||||||
QMenu,
|
QMenu,
|
||||||
QToolButton,
|
QToolButton,
|
||||||
QTableWidget,
|
QTableWidget,
|
||||||
QTableWidgetItem,
|
QTableWidgetItem,
|
||||||
)
|
)
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
|
|
||||||
|
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
resources_path,
|
||||||
send_issues,
|
send_issues,
|
||||||
)
|
)
|
||||||
|
|
||||||
EDITOR_CLASS = load_ui('CenIsere_IssuesSend.ui')
|
EDITOR_CLASS = load_ui('CenRa_IssuesSend.ui')
|
||||||
|
|
||||||
class CenIsere_Issues(QDialog, EDITOR_CLASS):
|
class CenRa_Issues(QDialog, EDITOR_CLASS):
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
_ = parent
|
_ = parent
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.settings = QgsSettings()
|
self.settings = QgsSettings()
|
||||||
|
|
||||||
#place connect here
|
#place connect here
|
||||||
self.annuler_button.clicked.connect(self.close)
|
self.annuler_button.clicked.connect(self.close)
|
||||||
self.ok_button.clicked.connect(self.run_sendissues)
|
self.ok_button.clicked.connect(self.run_sendissues)
|
||||||
|
|
||||||
def run_sendissues(self):
|
def run_sendissues(self):
|
||||||
text_titre = self.titre_line.text()
|
text_titre = self.titre_line.text()
|
||||||
text_message = self.messages_plain.toPlainText()
|
text_message = self.messages_plain.toPlainText()
|
||||||
statu_bug = self.check_bug.isChecked()
|
statu_bug = self.check_bug.isChecked()
|
||||||
statu_aide = self.check_aide.isChecked()
|
statu_aide = self.check_aide.isChecked()
|
||||||
statu_question = self.check_question.isChecked()
|
statu_question = self.check_question.isChecked()
|
||||||
statu_amelioration = self.check_amelioration.isChecked()
|
statu_amelioration = self.check_amelioration.isChecked()
|
||||||
statu_autre = self.check_autre.isChecked()
|
statu_autre = self.check_autre.isChecked()
|
||||||
|
|
||||||
statu = []
|
statu = []
|
||||||
if statu_bug == True : statu = statu + [1]
|
if statu_bug == True : statu = statu + [1]
|
||||||
if statu_aide == True : statu = statu + [3]
|
if statu_aide == True : statu = statu + [3]
|
||||||
if statu_question == True : statu = statu + [5]
|
if statu_question == True : statu = statu + [5]
|
||||||
if statu_amelioration == True : statu = statu + [2]
|
if statu_amelioration == True : statu = statu + [2]
|
||||||
if statu_autre == True : statu = statu + [6]
|
if statu_autre == True : statu = statu + [6]
|
||||||
|
|
||||||
if len(statu) >= 1:
|
if len(statu) >= 1:
|
||||||
import qgis
|
import qgis
|
||||||
url = qgis.utils.pluginMetadata(NAME,'tracker')
|
url = qgis.utils.pluginMetadata(NAME,'tracker')
|
||||||
print(text_message)
|
print(text_message)
|
||||||
send_info = send_issues(url,text_titre,text_message,statu)
|
send_info = send_issues(url,text_titre,text_message,statu)
|
||||||
code = send_info.status_code
|
code = send_info.status_code
|
||||||
print(code)
|
print(code)
|
||||||
else:
|
else:
|
||||||
code = 423
|
code = 423
|
||||||
if code == 201:
|
if code == 201:
|
||||||
iface.messageBar().pushMessage("Envoyer :", "Votre messages à bien été envoyer.", level=Qgis.Success, duration=20)
|
iface.messageBar().pushMessage("Envoyer :", "Votre messages à bien été envoyer.", level=Qgis.Success, duration=20)
|
||||||
self.close()
|
self.close()
|
||||||
elif code == 422:
|
elif code == 422:
|
||||||
iface.messageBar().pushMessage("Erreur :", "Erreur dans le contenu du messages.", level=Qgis.Critical, duration=20)
|
iface.messageBar().pushMessage("Erreur :", "Erreur dans le contenu du messages.", level=Qgis.Critical, duration=20)
|
||||||
elif code == 423:
|
elif code == 423:
|
||||||
iface.messageBar().pushMessage("Erreur :", "Pas de sujet sélectionné.", level=Qgis.Critical, duration=20)
|
iface.messageBar().pushMessage("Erreur :", "Pas de sujet sélectionné.", level=Qgis.Critical, duration=20)
|
||||||
elif code == 404:
|
elif code == 404:
|
||||||
iface.messageBar().pushMessage("Missing :", "Le serveur de messagerie est injoignable.", level=Qgis.Warning, duration=20)
|
iface.messageBar().pushMessage("Missing :", "Le serveur de messagerie est injoignable.", level=Qgis.Warning, duration=20)
|
||||||