fix bug
This commit is contained in:
parent
be3a082f93
commit
80a563357d
@ -72,6 +72,7 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
self.tableWidget.setSelectionBehavior(QTableWidget.SelectRows)
|
self.tableWidget.setSelectionBehavior(QTableWidget.SelectRows)
|
||||||
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||||
|
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,6 +82,7 @@ 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.toolButton.clicked.connect(self.getCanevas)
|
||||||
layout = QVBoxLayout()
|
layout = QVBoxLayout()
|
||||||
self.lineEdit.textChanged.connect(self.filtre_dynamique)
|
self.lineEdit.textChanged.connect(self.filtre_dynamique)
|
||||||
layout.addWidget(self.lineEdit)
|
layout.addWidget(self.lineEdit)
|
||||||
@ -356,6 +358,20 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
|||||||
if not match:
|
if not match:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
def getCanevas(self):
|
||||||
|
print(iface.mapCanvas().extent())
|
||||||
|
# SQL_EXTENT = ''
|
||||||
|
# SQL_GEOM = "SELECT f_table_schema,f_table_name FROM geometry_columns WHERE f_geometry_column = 'geom'"
|
||||||
|
# cur.execute(SQL_GEOM)
|
||||||
|
# TableHaveGeom = cur.fetchall()
|
||||||
|
# for e in TableHaveGeom:
|
||||||
|
# SchemaName = e[0]
|
||||||
|
# TableName = e[1]
|
||||||
|
# if SchemaName[0:5] != '_form':
|
||||||
|
# if SchemaName[0:4] == '_01_' or SchemaName[0:4] == '_42_' or SchemaName[0:4] == '_69_':
|
||||||
|
# SQL_EXTENT=SQL_EXTENT+"SELECT st_envelope(st_union(geom)),'"+TableName+"' AS table_name FROM "+'"'+SchemaName+'"."'+TableName+'"'+' UNION ALL '
|
||||||
|
# SQL_EXTENT = SQL_EXTENT[:-11]
|
||||||
|
# print(SQL_EXTENT)
|
||||||
def popup(self):
|
def popup(self):
|
||||||
|
|
||||||
self.dialog = Popup() # +++ - self
|
self.dialog = Popup() # +++ - self
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
@ -235,6 +235,19 @@
|
|||||||
<string>Flux sélectionné(s) à charger :</string>
|
<string>Flux sélectionné(s) à charger :</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QToolButton" name="toolButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>670</x>
|
||||||
|
<y>130</y>
|
||||||
|
<width>21</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
<zorder>label_3</zorder>
|
<zorder>label_3</zorder>
|
||||||
<zorder>comboBox</zorder>
|
<zorder>comboBox</zorder>
|
||||||
<zorder>comboBox_2</zorder>
|
<zorder>comboBox_2</zorder>
|
||||||
@ -246,6 +259,7 @@
|
|||||||
<zorder>lineEdit</zorder>
|
<zorder>lineEdit</zorder>
|
||||||
<zorder>label</zorder>
|
<zorder>label</zorder>
|
||||||
<zorder>label_2</zorder>
|
<zorder>label_2</zorder>
|
||||||
|
<zorder>toolButton</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
name=CenRa_POSTGIS
|
name=CenRa_POSTGIS
|
||||||
qgisMinimumVersion=3.0
|
qgisMinimumVersion=3.0
|
||||||
description=Permet de crée un dossier dans la base PostGis
|
description=Permet de crée un dossier dans la base PostGis
|
||||||
version=2.4
|
version=2.5
|
||||||
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
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ email=si_besoin@cen-rhonealpes.fr
|
|||||||
# Optional items:
|
# Optional items:
|
||||||
|
|
||||||
# Uncomment the following line and add your changelog entries:
|
# Uncomment the following line and add your changelog entries:
|
||||||
changelog=<h2>CenRa_POSTGIS:</h2></br><p><h3>23/01/2025 - Version 2.4: </h3> - Correctif sur les pkey.</p></br><p><h3>22/01/2025 - Version 2.3: </h3> - Correctif sur la creation de projet.</p></br><p><h3>21/01/2025 - Version 2.2: </h3> - Correctif sur la longeur des nom.</p></br><p><h3>07/01/2025 - Version 2.1: </h3> - ByPass du certif ssl ci erreur.</p></br><p><h3>22/10/2024 - Version 2.0:</h3>- Refont du code.</p>
|
changelog=<h2>CenRa_POSTGIS:</h2></br><p><h3>04/02/2025 - Version 2.5: </h3> - Correctif bug création de couche.</p></br><p><h3>23/01/2025 - Version 2.4: </h3> - Correctif sur les pkey.</p></br><p><h3>22/01/2025 - Version 2.3: </h3> - Correctif sur la creation de projet.</p></br><p><h3>21/01/2025 - Version 2.2: </h3> - Correctif sur la longeur des nom.</p></br><p><h3>07/01/2025 - Version 2.1: </h3> - ByPass du certif ssl ci erreur.</p></br><p><h3>22/10/2024 - Version 2.0:</h3>- Refont du code.</p>
|
||||||
|
|
||||||
# tags are comma separated with spaces allowed
|
# tags are comma separated with spaces allowed
|
||||||
tags=cenra, postgis, database
|
tags=cenra, postgis, database
|
||||||
|
|||||||
@ -373,16 +373,19 @@ def create_travaux(self,schema,cur,con,host ,port ,dbname ,user ,mdp):
|
|||||||
def create_habita(self,schema,cur,con,host ,port ,dbname ,user ,mdp):
|
def create_habita(self,schema,cur,con,host ,port ,dbname ,user ,mdp):
|
||||||
### Creation de la table habitat
|
### Creation de la table habitat
|
||||||
if self.couche_habitat.isChecked():
|
if self.couche_habitat.isChecked():
|
||||||
if self.annee_2.text() == 'aaaa' or self.annee_2.text() == '':
|
if self.annee_2.text() == 'aaaa' or self.annee_2.text() == '':
|
||||||
tablename = schema + "_habitat"
|
tablename = schema + "_habitat"
|
||||||
else :
|
else :
|
||||||
tablename = schema + "_habitat_" + self.annee_2.text()
|
tablename = schema + "_habitat_" + self.annee_2.text()
|
||||||
|
|
||||||
tablename_1=tablename+"_points"
|
tablename_1=tablename+"_points"
|
||||||
RETURNE = "SELECT pg_get_serial_sequence('"+schema + "."+ tablename_1[len(schema):]+"','gid')"
|
RETURNE = "SELECT pg_get_serial_sequence('"+schema + "."+tablename_1+"','gid')"
|
||||||
tablename_qgis = tablename_1[1:] # Permet d'enlever le "_", ajouter a la premiere etape, dans qgis
|
tablename_qgis = tablename_1[1:] # Permet d'enlever le "_", ajouter a la premiere etape, dans qgis
|
||||||
SQL_VEGETHAB = "CREATE TABLE "+ schema + "."+ tablename_1 + champ_vegethab_point
|
SQL_VEGETHAB = "CREATE TABLE "+ schema + "."+ tablename_1 + champ_vegethab_point
|
||||||
|
|
||||||
|
print(RETURNE)
|
||||||
|
print('')
|
||||||
|
print(SQL_VEGETHAB)
|
||||||
cur.execute(SQL_VEGETHAB)
|
cur.execute(SQL_VEGETHAB)
|
||||||
cur.execute(RETURNE)
|
cur.execute(RETURNE)
|
||||||
sequence_name = cur.fetchone()[0]
|
sequence_name = cur.fetchone()[0]
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
<?xml version = '1.0' encoding = 'UTF-8'?>
|
<?xml version = '1.0' encoding = 'UTF-8'?>
|
||||||
<plugins>
|
<plugins>
|
||||||
<pyqgis_plugin name="CenRa_POSTGIS" version="2.4">
|
<pyqgis_plugin name="CenRa_POSTGIS" version="2.5">
|
||||||
<description><![CDATA[Dépôt pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.]]></description>
|
<description><![CDATA[Dépôt pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.]]></description>
|
||||||
<version>2.4</version>
|
<version>2.5</version>
|
||||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||||
<file_name>CenRa_POSTGIS.zip</file_name>
|
<file_name>CenRa_POSTGIS.zip</file_name>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_POSTGIS.zip</download_url>
|
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_POSTGIS.zip</download_url>
|
||||||
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||||
<create_date>2024-02-06</create_date>
|
<create_date>2024-02-06</create_date>
|
||||||
<update_date>2025-01-23</update_date>
|
<update_date>2025-02-04</update_date>
|
||||||
<experimental>False</experimental>
|
<experimental>False</experimental>
|
||||||
<deprecated>False</deprecated>
|
<deprecated>False</deprecated>
|
||||||
<tags>cenra,postgis</tags>
|
<tags>cenra,postgis</tags>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user