mauroalberti / qProf

Python plugin for QGIS, to create topographic and geological profiles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Save defined topographic sources

mixedbredie opened this issue · comments

I'm running qProf in QGIS 2.14.12 and 2.18.3. I have a polyline layer with 20 records and need to generate a profile for each line in the dataset. It would be nice if I could set the source DEM and polyline layer once and then generate all the profiles. However, to generate a profile I need to reset the source DEM and line layer each time I select one of the lines.

So, is it possible to save the defined sources once for the session?

And (or) is it possible to batch create a profile for each feature in the input line layer and output as Shp/Image/CSV?

I have just discovered your plugin and it already covers a lot of what I need to do, however, the comment above about a batch process for multiple survey lines would really be a perfect solution. Is this still something you are working on?

Yes, even if in a basic version, where multiple profiles are provided in a source line layer, should be released and submitted to the official QGIS plugin repository within days.

fantastic, I look forward to it. will be happy to test it in any way you would need.

If you want to test a pre-release, I will appreciate.
I've created this one:
https://github.com/mauroalberti/qProf/releases/tag/v0.3.4-prerelease-01

I am currently testing the export section, the Topography and Geology ones should work. The help part is to be updated with the version changes.
The multiple (topographic-only) profiles choice is available from the "Line layer" -> "Choose layer" -> "Layer has multiple profiles" choice.

Happy to test, any pointers on how to get the plugin into QGIS? i tried extracting to the plugin folder but it shows up as invalid, so i must be missing a step?

After unzipping, you have to put just the single folder containing the Python files (plus the other modules) in the plugin repository and rename it to "qProf".
I have tried now in Windows 7 - QGIS 2.16 and QGIS does not complain, the plugin opens normally.
If it continues to show up as invalid when you try to activate it in the QGIS Python plugin manager, there is possibly some additional Python module missing or to-be-updated in your QGIS installation. In that case, any errror message could be useful to detect which module is to install/update.

Thank you, I hadn't renamed the folder to qProf. It works ok now. On first look, the plugin works exactly as I had hoped. I need to do some testing with data to verify the right information is being collected but it looks good so far!

Thanks very much for this. Just tested now in QGIS 2.18.12 (Win 7 x64) and works perfectly. Installed without a problem.

Yesterday it worked perfectly - this morning I get an error. My QGIS has tkinter in site-packages:

C:\Program Files\QGIS 2.18\apps\Python27\Lib\site-packages\tkinter

I can't find any reference to tkinter/Tkinter in the qProf files

ImportError: No module named Tkinter 
Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 308, in loadPlugin
    __import__(packageName)
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/me/.qgis2/python/plugins\qProf\__init__.py", line 24, in 
    from qProf_main import qProf_main
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/me/.qgis2/python/plugins\qProf\qProf_main.py", line 10, in 
    from qProf_QWidget import qprof_QWidget
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/me/.qgis2/python/plugins\qProf\qProf_QWidget.py", line 28, in 
    from qProf_plotting import plot_geoprofiles
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/me/.qgis2/python/plugins\qProf\qProf_plotting.py", line 8, in 
    from .mpl_utils.mpl_widget import MplWidget, plot_line, plot_filled_line
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/me/.qgis2/python/plugins\qProf\mpl_utils\mpl_widget.py", line 15, in 
    from matplotlib import pyplot
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\matplotlib\pyplot.py", line 115, in 
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\matplotlib\backends\__init__.py", line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 6, in 
    from six.moves import tkinter as Tk
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\six.py", line 203, in load_module
    mod = mod._resolve()
  File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\six.py", line 115, in _resolve
    return _import_module(self.mod)
  File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\six.py", line 82, in _import_module
    __import__(name)
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named Tkinter```

It should be a classic problem for tools - QGIS plugins or others - that rely on Matplotlib. It should be not an issue specific of qProf. For instance, at my work, Windows 64 bit with QGIS 2.16, the Tkinter module does not result available from the Python console but the plugin works..
Possibly the used 64 bit Windows Python configuration in QGIS is missing some details and updating
QGIS or Matplotlib or the apparently missing could solve the problem... Sorry for not being able to help more.