mirror of https://gitlab.com/pamhyr/pamhyr2
Compare commits
No commits in common. "70eae5f7d2a970a8c025f6b919499402c0ad60ee" and "a97717a624b4fac8d9b00aa21b3b23770564c2ad" have entirely different histories.
70eae5f7d2
...
a97717a624
|
|
@ -24,13 +24,6 @@ stages:
|
|||
- antivirus
|
||||
- release
|
||||
|
||||
#########################
|
||||
# PYINSTALLER VARIABLES #
|
||||
#########################
|
||||
|
||||
variables:
|
||||
HIDDEN_IMPORTS: "--hiddenimport rasterio --collect-submodules rasterio"
|
||||
|
||||
#############
|
||||
# DOWNLOADS #
|
||||
#############
|
||||
|
|
@ -299,7 +292,7 @@ build-linux:
|
|||
- pip3 install -r ../requirements.txt
|
||||
- pip3 install -U -r ../requirements.txt
|
||||
# Run Pyinstaller
|
||||
- pyinstaller -y $HIDDEN_IMPORTS --paths linux-venv/lib/python3.8/site-packages ../src/pamhyr.py
|
||||
- pyinstaller -y --hiddenimport rasterio --paths linux-venv/lib/python3.8/site-packages ../src/pamhyr.py
|
||||
# Create directory
|
||||
- mkdir -p pamhyr
|
||||
- mkdir -p pamhyr/_internal
|
||||
|
|
@ -402,7 +395,7 @@ build-windows:
|
|||
- python -m pip install -U -r ..\requirements.txt
|
||||
# Run Pyinstaller
|
||||
# - pyinstaller --noconsole -y ..\src\pamhyr.py
|
||||
- pyinstaller -i ../src/View/ui/ressources/icon.ico $HIDDEN_IMPORTS --hide-console hide-early -y ..\src\pamhyr.py
|
||||
- pyinstaller -i ../src/View/ui/ressources/icon.ico --hide-console hide-early -y ..\src\pamhyr.py
|
||||
# Create directory
|
||||
- mkdir pamhyr
|
||||
- dir
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ class TableModel(PamhyrTableModel):
|
|||
elif self._opt_data == "profile" or self._opt_data == "raw_data":
|
||||
self._lst = _river.reach(reach).profiles
|
||||
# self._lst = list(compress(_river.reach(reach).profiles,
|
||||
# _river.reach(reach).profile_mask))
|
||||
# _river.reach(reach).profile_mask))
|
||||
elif self._opt_data == "solver":
|
||||
self._lst = self._parent._solvers
|
||||
|
||||
|
|
|
|||
|
|
@ -21,14 +21,9 @@ import csv
|
|||
import logging
|
||||
try:
|
||||
import rasterio
|
||||
import rasterio.control
|
||||
import rasterio.crs
|
||||
import rasterio.sample
|
||||
import rasterio.vrt
|
||||
import rasterio._features
|
||||
_rasterio_loaded = True
|
||||
except Exception as e:
|
||||
print(f"Module 'rasterio' is not available: {e}")
|
||||
print("Module 'rasterio' is not available")
|
||||
_rasterio_loaded = False
|
||||
|
||||
from numpy import sqrt
|
||||
|
|
@ -1181,47 +1176,48 @@ class ResultsWindow(PamhyrWindow):
|
|||
self.update_table_selection_profile(profile_id)
|
||||
|
||||
def import_geotiff(self):
|
||||
options = QFileDialog.Options()
|
||||
settings = QSettings(QSettings.IniFormat,
|
||||
QSettings.UserScope, 'MyOrg', )
|
||||
options |= QFileDialog.DontUseNativeDialog
|
||||
|
||||
file_types = [
|
||||
self._trad["file_geotiff"],
|
||||
self._trad["file_all"],
|
||||
]
|
||||
|
||||
filename, _ = QFileDialog.getOpenFileName(
|
||||
self,
|
||||
self._trad["open_file"],
|
||||
"",
|
||||
";; ".join(file_types),
|
||||
options=options
|
||||
)
|
||||
|
||||
if filename != "":
|
||||
with rasterio.open(filename) as data:
|
||||
img = data.read()
|
||||
b = data.bounds[:]
|
||||
# b[0] left
|
||||
# b[1] bottom
|
||||
# b[2] right
|
||||
# b[3] top
|
||||
xlim = self.canvas.axes.get_xlim()
|
||||
ylim = self.canvas.axes.get_ylim()
|
||||
if b[2] > b[0] and b[1] < b[3]:
|
||||
self.canvas.axes.imshow(img.transpose((1, 2, 0)),
|
||||
extent=[b[0], b[2], b[1], b[3]])
|
||||
else:
|
||||
dlg = CoordinatesDialog(
|
||||
xlim,
|
||||
ylim,
|
||||
trad=self._trad,
|
||||
parent=self
|
||||
)
|
||||
if dlg.exec():
|
||||
self.canvas.axes.imshow(img.transpose((1, 2, 0)),
|
||||
extent=dlg.values)
|
||||
self.plot_xy.idle()
|
||||
self.canvas.axes.set_xlim(xlim)
|
||||
self.canvas.axes.set_ylim(ylim)
|
||||
# options = QFileDialog.Options()
|
||||
# settings = QSettings(QSettings.IniFormat,
|
||||
# QSettings.UserScope, 'MyOrg', )
|
||||
# options |= QFileDialog.DontUseNativeDialog
|
||||
#
|
||||
# file_types = [
|
||||
# self._trad["file_geotiff"],
|
||||
# self._trad["file_all"],
|
||||
# ]
|
||||
#
|
||||
# filename, _ = QFileDialog.getOpenFileName(
|
||||
# self,
|
||||
# self._trad["open_file"],
|
||||
# "",
|
||||
# ";; ".join(file_types),
|
||||
# options=options
|
||||
# )
|
||||
#
|
||||
# if filename != "":
|
||||
# with rasterio.open(filename) as data:
|
||||
# img = data.read()
|
||||
# b = data.bounds[:]
|
||||
# # b[0] left
|
||||
# # b[1] bottom
|
||||
# # b[2] right
|
||||
# # b[3] top
|
||||
# xlim = self.canvas.axes.get_xlim()
|
||||
# ylim = self.canvas.axes.get_ylim()
|
||||
# if b[2] > b[0] and b[1] < b[3]:
|
||||
# self.canvas.axes.imshow(img.transpose((1, 2, 0)),
|
||||
# extent=[b[0], b[2], b[1], b[3]])
|
||||
# else:
|
||||
# dlg = CoordinatesDialog(
|
||||
# xlim,
|
||||
# ylim,
|
||||
# trad=self._trad,
|
||||
# parent=self
|
||||
# )
|
||||
# if dlg.exec():
|
||||
# self.canvas.axes.imshow(img.transpose((1, 2, 0)),
|
||||
# extent=dlg.values)
|
||||
# self.plot_xy.idle()
|
||||
# self.canvas.axes.set_xlim(xlim)
|
||||
# self.canvas.axes.set_ylim(ylim)
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in New Issue