diff --git a/CenRa_FLUX/flux_editor.py b/CenRa_FLUX/flux_editor.py index ea5013de..af7149d4 100644 --- a/CenRa_FLUX/flux_editor.py +++ b/CenRa_FLUX/flux_editor.py @@ -72,6 +72,7 @@ class Flux_Editor(QDialog, EDITOR_CLASS): self.tableWidget.setSelectionBehavior(QTableWidget.SelectRows) 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('REF') 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.tableWidget_2.itemDoubleClicked.connect(self.suppression_flux) self.comboBox_2.currentIndexChanged.connect(self.bd_source) + self.toolButton.clicked.connect(self.getCanevas) layout = QVBoxLayout() self.lineEdit.textChanged.connect(self.filtre_dynamique) layout.addWidget(self.lineEdit) @@ -356,6 +358,20 @@ class Flux_Editor(QDialog, EDITOR_CLASS): if not match: 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): self.dialog = Popup() # +++ - self diff --git a/CenRa_FLUX/tools/ui/CenRa_Flux_base - Copie.ui b/CenRa_FLUX/tools/ui/CenRa_Flux_base - Copie.ui index 1e5a380a..dbeae75f 100644 --- a/CenRa_FLUX/tools/ui/CenRa_Flux_base - Copie.ui +++ b/CenRa_FLUX/tools/ui/CenRa_Flux_base - Copie.ui @@ -1,8 +1,6 @@ Dialog - - true @@ -65,8 +63,8 @@ - 350 - 20 + 345 + 10 221 71 @@ -75,7 +73,7 @@ - :/plugins/CenRa_FLUX/logo.jpg + :/plugins/CenRa_FLUX/logo.jpg true @@ -139,7 +137,7 @@ - + :/plugins/CenRa_FLUX/arrow-bottom.png:/plugins/CenRa_FLUX/arrow-bottom.png @@ -162,7 +160,7 @@ - + :/plugins/CenRa_FLUX/arrow-up.png:/plugins/CenRa_FLUX/arrow-up.png @@ -237,6 +235,18 @@ Flux sélectionné(s) à charger : + label_3 + comboBox + comboBox_2 + pushButton_2 + tableWidget + tableWidget_2 + commandLinkButton + commandLinkButton_2 + lineEdit + label + label_2 + diff --git a/CenRa_FLUX/tools/ui/CenRa_Flux_base.ui b/CenRa_FLUX/tools/ui/CenRa_Flux_base.ui index dbeae75f..89c98c2d 100644 --- a/CenRa_FLUX/tools/ui/CenRa_Flux_base.ui +++ b/CenRa_FLUX/tools/ui/CenRa_Flux_base.ui @@ -235,6 +235,19 @@ Flux sélectionné(s) à charger : + + + + 670 + 130 + 21 + 21 + + + + + + label_3 comboBox comboBox_2 @@ -246,6 +259,7 @@ lineEdit label label_2 + toolButton diff --git a/CenRa_POSTGIS/metadata.txt b/CenRa_POSTGIS/metadata.txt index 5f793ce4..48fffbf1 100644 --- a/CenRa_POSTGIS/metadata.txt +++ b/CenRa_POSTGIS/metadata.txt @@ -12,7 +12,7 @@ name=CenRa_POSTGIS qgisMinimumVersion=3.0 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 email=si_besoin@cen-rhonealpes.fr @@ -21,7 +21,7 @@ email=si_besoin@cen-rhonealpes.fr # Optional items: # Uncomment the following line and add your changelog entries: -changelog=

CenRa_POSTGIS:


23/01/2025 - Version 2.4:

- Correctif sur les pkey.


22/01/2025 - Version 2.3:

- Correctif sur la creation de projet.


21/01/2025 - Version 2.2:

- Correctif sur la longeur des nom.


07/01/2025 - Version 2.1:

- ByPass du certif ssl ci erreur.


22/10/2024 - Version 2.0:

- Refont du code.

+changelog=

CenRa_POSTGIS:


04/02/2025 - Version 2.5:

- Correctif bug création de couche.


23/01/2025 - Version 2.4:

- Correctif sur les pkey.


22/01/2025 - Version 2.3:

- Correctif sur la creation de projet.


21/01/2025 - Version 2.2:

- Correctif sur la longeur des nom.


07/01/2025 - Version 2.1:

- ByPass du certif ssl ci erreur.


22/10/2024 - Version 2.0:

- Refont du code.

# tags are comma separated with spaces allowed tags=cenra, postgis, database diff --git a/CenRa_POSTGIS/tools/resources.py b/CenRa_POSTGIS/tools/resources.py index 2e811070..c74fa468 100644 --- a/CenRa_POSTGIS/tools/resources.py +++ b/CenRa_POSTGIS/tools/resources.py @@ -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): ### Creation de la table habitat 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" else : tablename = schema + "_habitat_" + self.annee_2.text() 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 SQL_VEGETHAB = "CREATE TABLE "+ schema + "."+ tablename_1 + champ_vegethab_point + print(RETURNE) + print('') + print(SQL_VEGETHAB) cur.execute(SQL_VEGETHAB) cur.execute(RETURNE) sequence_name = cur.fetchone()[0] diff --git a/plugins.xml b/plugins.xml index f76c8215..9db29af0 100644 --- a/plugins.xml +++ b/plugins.xml @@ -1,8 +1,8 @@ - + - 2.4 + 2.5 3.16 https://plateformesig.cenra-outils.org/ CenRa_POSTGIS.zip @@ -11,7 +11,7 @@ https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_POSTGIS.zip CEN-Rhone-Alpes 2024-02-06 - 2025-01-23 + 2025-02-04 False False cenra,postgis