[Qgis-user] QGIS_EPANET - command line tool

Larry Shaffer larrys at dakotacarto.com
Tue Aug 26 18:59:06 PDT 2014


Hi Francesco,

On Tue, Aug 26, 2014 at 4:39 AM, Francesco Liva <fr.liva at gmail.com> wrote:

> Hi
>
> Sorry to bother you again, but I really need to solve my problem
>
> When I run the AppleScript:
>
> *tell* *application* "Terminal"
> *do script* "open /Applications/EPANET2.00.12.app"
> *end* *tell*
>
> It open the EPANET programme. But when I run the AppleScript from QGIS he
> gives me the error:
>
> Algorithm Simulate flow in drinking water network starting...
> running simulation
> [Errno 13] Permission denied See log for more details
>

The AppleScript you are running merely opens
/Applications/EPANET2.00.12.app. In other words, the script accepts no
stdin or provides no stdout for Processing to work with.

Generally, for a wrapper script, you will want to do this with bash, and
the executable you want to call will be inside the .app bundle, e.g.
/Applications/EPANET2.00.12.app/Contents/MacOS/EPANET (<-- just guessing on
the binary's name).

For example, the contents of such an 'epanet_wrapper.sh' might be:

#!/binbash

wine /Applications/EPANET2.00.12.app/Contents/MacOS/EPANET $1


This would presumably call wine and pass the wine-installed program EPANET
any arguments passed to the script (assuming EPANET was installed by wine
in /Applications... was it?). Then the results would be output to stdout
for Processing or the plugin to catch. There might be some consideration
for ensure proper escaping of arguments needed as well.

NOTE: I have not tested any of this. However, I can tonight. *Do you have
to sample data I can play with?* I don't do water work.

I need to figure this out for Mac, since there are other Processing tools,
like LASTools and Fusion for LiDAR that really only work under Windows, too.

Regards,

Larry



> Thank you
>
> Best Regards
> Francesco Liva
>
> ______________________________
> 27, Triq Ix-Xatt, Kalkara, Malta
> ☎ +356 99 38 01 68 mobile
> ☎ +356 27 32 76 78 home
>
> Via Tevere 13-A, 00198 Rome
> ☎ +39 06 841 32 64 home
> ☎ +39 333 750 99 83 mobile
>
> 30, Rue V. Contesso, Villefranche/S/M
> ☎ +33 (0) 4 93 80 67 21
>
> Tsintsadze Str.
> Tbilisi  Georgia
> +995 577 17 70 81
>
> Fr.Liva at gmail.com
> ☏ Francesco.Liva
>
>
>
>
>
> On 26 Aug 2014, at 05:11, Larry Shaffer <larrys at dakotacarto.com> wrote:
>
> Hi Francesco,
>
> To call a wine-based Windows app, with arguments from the command line,
> consult the wine man page [0].
>
> However, I am not certain this will work as a configuration value, because
> the program itself needs to be prefaced with the 'wine' executable as the
> caller, e.g.:
>
> wine win_app args
>
> whereas, the QGIS_EPANET plugin may expecting the "Epanet command line
> tool" value to be explicitly a single file path. In other words, either the
> plugin will need to be adapted to handle wine calls and output, or you can
> write a wrapper script.
>
> I recommend trying to craft a wrapper shell script that acts as a proxy to
> calling wine and passing on any arguments to the wine-based app, then a
> single file path to the wrapper script will probably satisfy the plugin's
> configuration.
>
> No guarantee on any of this, or whether the wine-based app's output will
> be readable to the plugin.  :-)
>
> There is also an older post that may be of interest on using Homebrew's
> wine installation and where the Windows programs/files are located in your
> Home folder [1].
>
> Alternatively, and if you have a Windows OS license, you can use a wrapper
> script for calling a program from within a running instance of a virtual
> machine, e.g. VirtualBox via 'VBoxManage guestcontrol' [2].
>
> [0] https://www.winehq.org/docs/wine
> [1] http://www.davidbaumgold.com/tutorials/wine-mac/
> [2] http://www.virtualbox.org/manual/ch08.html#vboxmanage-guestcontrol
>
> Regards,
>
> Larry Shaffer
> Dakota Cartography
> Black Hills, South Dakota
>
>
> On Sun, Aug 24, 2014 at 3:09 AM, Francesco Liva <fr.liva at gmail.com> wrote:
>
>> Hello
>> I have a MAC computer, running QGIS. Have installed EPANET with WINE
>> 1.7.16.
>> I have installed the experimental plugins:  QGIS_EPANET.
>> Does anybody knows how to use the EPANET (Drinking water flow simulation)
>> and how to define the "Epanet command line tool" under the PROCESSING
>> OPTIONS.
>> Thank you
>>
>> Best Regards
>> Francesco Liva
>>
>> ______________________________
>>     27, Triq Ix-Xatt, Kalkara, Malta
>> ☎ +356 99 38 01 68 mobile
>> ☎ +356 27 32 76 78 home
>>
>>     Via Tevere 13-A, 00198 Rome
>> ☎ +39 06 841 32 64 home
>> ☎ +39 333 750 99 83 mobile
>>
>>      30, Rue V. Contesso, Villefranche/S/M
>> ☎ +33 (0) 4 93 80 67 21
>>
>> Tsintsadze Str.
>> Tbilisi  Georgia
>> +995 577 17 70 81
>>
>> Fr.Liva at gmail.com
>> ☏ Francesco.Liva
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140826/4af2b443/attachment.html>


More information about the Qgis-user mailing list