Oslandia / qgis-swmm

Project migrated to : https://gitlab.com/Oslandia/qgis/qgis-swmm
https://gitlab.com/Oslandia/qgis/qgis-swmm
GNU General Public License v2.0
34 stars 19 forks source link

swmm no output #9

Open gmusumeci opened 8 years ago

gmusumeci commented 8 years ago

I edit the SwmmAlgorythm.py with the same kind of changes that are in the commit: Oslandia/qgis-epanet@be1b5c6

I run the example getting the following error: [Error 2] Impossibile trovare il file specificato: u'C:\Users\pc04.qgis2\processing\outputs\swmm.out' See log for more details

I tried to create an empty file 'swmn.out' in \processing\outputs

The processing runs but output tables and vectors are empty

I'm running Qgis 2.14 on Windows7 64bit

vmora commented 8 years ago

Have you got a log file under "u'C:\Users\pc04.qgis2\processing\outputs\" ?

vmora commented 8 years ago

Normally you should have the generated swmm input file in there too.

gmusumeci commented 8 years ago

I uninstalled the plugin then reinstalled it Running a new simulation I get the following error:

there were errors, look into logs for details See log for more details

Now in the output folder I have swmm.inp I have no log file

I have an output file with many error of this kind:

ERROR 211: invalid number PyQt4.QtCore.QDateTime(1988, at line 120 of [TIMESERIES] section: INFLOW@82309 PyQt4.QtCore.QDateTime(1988, 1, 1, 0, 0) 0.0

The date in tables linked to postgres are as follows:

1988-01-01T00:00:00

vmora commented 8 years ago

Can you check if there is something strange in the swmm.inp, in the TIMESERIES section

gmusumeci commented 8 years ago

This is my swmm.inp, TIMESERIES section

[TIMESERIES] ;name datetime value
INFLOW@82309 PyQt4.QtCore.QDateTime(1988, 1, 1, 0, 0) 0.0 INFLOW@82309 PyQt4.QtCore.QDateTime(1988, 1, 1, 0, 15) 40.0
INFLOW@82309 PyQt4.QtCore.QDateTime(1988, 1, 1, 3, 0) 40.0
INFLOW@82309 PyQt4.QtCore.QDateTime(1988, 1, 1, 3, 15) 0.0 INFLOW@82309 PyQt4.QtCore.QDateTime(1988, 1, 1, 12, 0) 0.0 INFLOW@80408 PyQt4.QtCore.QDateTime(1988, 1, 1, 0, 0) 0.0 INFLOW@80408 PyQt4.QtCore.QDateTime(1988, 1, 1, 0, 15) 45.0
INFLOW@80408 PyQt4.QtCore.QDateTime(1988, 1, 1, 3, 0) 45.0
INFLOW@80408 PyQt4.QtCore.QDateTime(1988, 1, 1, 3, 15) 0.0 INFLOW@80408 PyQt4.QtCore.QDateTime(1988, 1, 1, 12, 0) 0.0 INFLOW@81009 PyQt4.QtCore.QDateTime(1988, 1, 1, 0, 0) 0.0 INFLOW@81009 PyQt4.QtCore.QDateTime(1988, 1, 1, 0, 15) 50.0
INFLOW@81009 PyQt4.QtCore.QDateTime(1988, 1, 1, 3, 0) 50.0
INFLOW@81009 PyQt4.QtCore.QDateTime(1988, 1, 1, 3, 15) 0.0 INFLOW@81009 PyQt4.QtCore.QDateTime(1988, 1, 1, 12, 0) 0.0

vmora commented 8 years ago

The date as not been converted to string, does the date otherwise correspond to the dates you have entered in your time series ?

vmora commented 8 years ago

Where do your timeseries come from ?

I suspect the plugin expects strings for dates, not QDateTime.

vmora commented 8 years ago

Found it, its in https://github.com/Oslandia/qgis-swmm/blob/master/SwmmAlgorithm.py#L210

We should test the type of v and act accordingly to handle this case. PR welcome if you are willing to code, otherwise you can convert your input data to string instead of QDateTime

gmusumeci commented 8 years ago

My timeseries is stored in postgreSQL.

The format is "datetime timestamp without time zone"

Now I try to convert to text to see if it works

gmusumeci commented 8 years ago

Now error are of this kind: ERROR 211: invalid number 01/01/1988 at line 113 of [TIMESERIES] section: INFLOW@82309 0.0 01/01/1988 00:00

The input file is: [TIMESERIES] ;name value datetime
INFLOW@82309 0.0 01/01/1988 00:00
INFLOW@82309 40.0 01/01/1988 00:15
...omissis....

vmora commented 8 years ago

the date format is YYYY-mm-dd HH:MM:ss

gmusumeci commented 8 years ago

In my DB the date format is correct: YYYY-mm-dd HH:MM:ss.

input