<div dir="ltr"><div><div><div>Dear grass-user group<br></div>Could you help me, How to create watershed boundary using grass-gis (step by steps).<br></div>Thank you very much for your support<br></div>Best regards<br><br></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-01 19:05 GMT+07:00  <span dir="ltr"><<a href="mailto:grass-user-request@lists.osgeo.org" target="_blank">grass-user-request@lists.osgeo.org</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send grass-user mailing list submissions to<br>
        <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:grass-user-request@lists.osgeo.org">grass-user-request@lists.osgeo.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:grass-user-owner@lists.osgeo.org">grass-user-owner@lists.osgeo.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of grass-user digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Python modules problems after last OSX GIS updates<br>
      (Carlos Grohmann)<br>
   2. Re: [Qgis-user] Python modules problems after last OSX    GIS<br>
      updates (William Kyngesburye)<br>
   3. Re: [Qgis-user] Python modules problems after last OSX GIS<br>
      updates (Anna Petr??ov?)<br>
   4. Re: [GRASS-dev] Parallelize a job using multiprocess python<br>
      library without destroying environmental variable (Annalisa Minelli)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 30 Jun 2014 17:28:38 -0300<br>
From: Carlos Grohmann <<a href="mailto:carlos.grohmann@gmail.com">carlos.grohmann@gmail.com</a>><br>
To: William Kyngesburye <<a href="mailto:kyngchaos@kyngchaos.com">kyngchaos@kyngchaos.com</a>>,      GRASS user list<br>
        <<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>>,   QGis Mailinglist<br>
        <<a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a>><br>
Subject: [GRASS-user] Python modules problems after last OSX GIS<br>
        updates<br>
Message-ID:<br>
        <CALkQ4RCN6V93S=Lr5sKDLTUsVJsgMNOFw9pMGf9fjAZ=<a href="mailto:25ha-Q@mail.gmail.com">25ha-Q@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hello, apologies for cross-posting but this might be happening to other<br>
users<br>
<br>
After installing the latest packages updates from William Kyngesburye on<br>
OSX 10.9 Mavericks, I'm getting lots of errors, both in Matplotlib and<br>
GDAL. From what I could see, that all return the "mach-o, but wrong<br>
architecture" error, so this might be related to William's recent setup for<br>
packaging using a virtual machine.<br>
<br>
I'm also getting the some errors with wxpython running GRASS 6.4.4<br>
<br>
Unfortunately for me, Matplotlib is pretty much essential, so I'm hoping<br>
this issues get fixed soon.<br>
<br>
best<br>
<br>
Carlos<br>
<br>
<br>
<br>
<br>
<br>
--<br>
Prof. Carlos Henrique Grohmann<br>
Institute of Energy and Environment - Univ. of S?o Paulo, Brazil<br>
- Digital Terrain Analysis | GIS | Remote Sensing -<br>
<br>
<a href="http://carlosgrohmann.com" target="_blank">http://carlosgrohmann.com</a><br>
<a href="http://orcid.org/0000-0001-5073-5572" target="_blank">http://orcid.org/0000-0001-5073-5572</a><br>
________________<br>
Can't stop the signal.<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.osgeo.org/pipermail/grass-user/attachments/20140630/fb0c3d97/attachment-0001.html" target="_blank">http://lists.osgeo.org/pipermail/grass-user/attachments/20140630/fb0c3d97/attachment-0001.html</a>><br>

<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Mon, 30 Jun 2014 18:57:06 -0500<br>
From: William Kyngesburye <<a href="mailto:woklist@kyngchaos.com">woklist@kyngchaos.com</a>><br>
To: Carlos Grohmann <<a href="mailto:carlos.grohmann@gmail.com">carlos.grohmann@gmail.com</a>><br>
Cc: GRASS user list <<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>>,       QGis Mailinglist<br>
        <<a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a>><br>
Subject: Re: [GRASS-user] [Qgis-user] Python modules problems after<br>
        last OSX        GIS updates<br>
Message-ID: <<a href="mailto:49A4EFB2-11B1-4F7E-9D1E-99BFB786063A@kyngchaos.com">49A4EFB2-11B1-4F7E-9D1E-99BFB786063A@kyngchaos.com</a>><br>
Content-Type: text/plain; charset=windows-1252<br>
<br>
What are the errors?  Do you have simple examples I can try?  I updated matplotlib and GDAL a month ago and this is the first I've heard of problems.  I am not packaging with a virtual machine.<br>
<br>
I did hear about GRASS problems.  There are font warnings due to a slip in wxPython bugfixing - fixed for wx Carbon but not wx Cocoa.  I am now using wxPython 3 Cocoa, and I read that there were fixes in GRASS for that version, but maybe there are other problems, or it may be an OS X thing.<br>

<br>
On Jun 30, 2014, at 3:28 PM, Carlos Grohmann <<a href="mailto:carlos.grohmann@gmail.com">carlos.grohmann@gmail.com</a>> wrote:<br>
<br>
> Hello, apologies for cross-posting but this might be happening to other users<br>
><br>
> After installing the latest packages updates from William Kyngesburye on OSX 10.9 Mavericks, I'm getting lots of errors, both in Matplotlib and GDAL. From what I could see, that all return the "mach-o, but wrong architecture" error, so this might be related to William's recent setup for packaging using a virtual machine.<br>

><br>
> I'm also getting the some errors with wxpython running GRASS 6.4.4<br>
><br>
> Unfortunately for me, Matplotlib is pretty much essential, so I'm hoping this issues get fixed soon.<br>
><br>
> best<br>
><br>
> Carlos<br>
><br>
><br>
><br>
><br>
><br>
> --<br>
> Prof. Carlos Henrique Grohmann<br>
> Institute of Energy and Environment - Univ. of S?o Paulo, Brazil<br>
> - Digital Terrain Analysis | GIS | Remote Sensing -<br>
><br>
> <a href="http://carlosgrohmann.com" target="_blank">http://carlosgrohmann.com</a><br>
> <a href="http://orcid.org/0000-0001-5073-5572" target="_blank">http://orcid.org/0000-0001-5073-5572</a><br>
> ________________<br>
> Can?t stop the signal.<br>
> _______________________________________________<br>
> Qgis-user mailing list<br>
> <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
<br>
-----<br>
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com><br>
<a href="http://www.kyngchaos.com/" target="_blank">http://www.kyngchaos.com/</a><br>
<br>
"Those people who most want to rule people are, ipso-facto, those least suited to do it."<br>
<br>
- A rule of the universe, from the HitchHiker's Guide to the Galaxy<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Mon, 30 Jun 2014 21:08:45 -0400<br>
From: Anna Petr??ov? <<a href="mailto:kratochanna@gmail.com">kratochanna@gmail.com</a>><br>
To: William Kyngesburye <<a href="mailto:kyngchaos@kyngchaos.com">kyngchaos@kyngchaos.com</a>><br>
Cc: GRASS user list <<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>>,       QGis Mailinglist<br>
        <<a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a>><br>
Subject: Re: [GRASS-user] [Qgis-user] Python modules problems after<br>
        last OSX GIS updates<br>
Message-ID:<br>
        <CAE0EDEpbyrRaB2zN2sR2RDU9VoZeGF8U8wk1rm1=<a href="mailto:6%2Bm7XJBymw@mail.gmail.com">6+m7XJBymw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi,<br>
<br>
<br>
On Mon, Jun 30, 2014 at 7:57 PM, William Kyngesburye <<a href="mailto:woklist@kyngchaos.com">woklist@kyngchaos.com</a>><br>
wrote:<br>
<br>
> What are the errors?  Do you have simple examples I can try?  I updated<br>
> matplotlib and GDAL a month ago and this is the first I've heard of<br>
> problems.  I am not packaging with a virtual machine.<br>
><br>
> I did hear about GRASS problems.  There are font warnings due to a slip in<br>
> wxPython bugfixing - fixed for wx Carbon but not wx Cocoa.  I am now using<br>
> wxPython 3 Cocoa, and I read that there were fixes in GRASS for that<br>
> version, but maybe there are other problems, or it may be an OS X thing.<br>
><br>
<br>
Regarding wxPython3 Cocoa, there is still a lot of problems. I found<br>
several tickets on wxWidgets which we are affected by and only for some of<br>
them there is a workaround. WxGUI works only to certain extent, but there<br>
are problems with dialog modality, map selection widget, toolbars and other<br>
pretty serious things. On the other hand, wxnviz seems to work pretty well,<br>
although switching back to 2D mode, makes the GUI unresponsive which is bug<br>
in a notebook widget, not wxNviz.<br>
<br>
><br>
> On Jun 30, 2014, at 3:28 PM, Carlos Grohmann <<a href="mailto:carlos.grohmann@gmail.com">carlos.grohmann@gmail.com</a>><br>
> wrote:<br>
><br>
> > Hello, apologies for cross-posting but this might be happening to other<br>
> users<br>
> ><br>
> > After installing the latest packages updates from William Kyngesburye on<br>
> OSX 10.9 Mavericks, I'm getting lots of errors, both in Matplotlib and<br>
> GDAL. From what I could see, that all return the "mach-o, but wrong<br>
> architecture" error, so this might be related to William's recent setup for<br>
> packaging using a virtual machine.<br>
> ><br>
> > I'm also getting the some errors with wxpython running GRASS 6.4.4<br>
> ><br>
> > Unfortunately for me, Matplotlib is pretty much essential, so I'm hoping<br>
> this issues get fixed soon.<br>
><br>
<br>
sorry, no idea about this<br>
<br>
Anna<br>
<br>
<br>
> ><br>
> > best<br>
> ><br>
> > Carlos<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > Prof. Carlos Henrique Grohmann<br>
> > Institute of Energy and Environment - Univ. of S?o Paulo, Brazil<br>
> > - Digital Terrain Analysis | GIS | Remote Sensing -<br>
> ><br>
> > <a href="http://carlosgrohmann.com" target="_blank">http://carlosgrohmann.com</a><br>
> > <a href="http://orcid.org/0000-0001-5073-5572" target="_blank">http://orcid.org/0000-0001-5073-5572</a><br>
> > ________________<br>
> > Can?t stop the signal.<br>
> > _______________________________________________<br>
> > Qgis-user mailing list<br>
> > <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
> > <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
><br>
> -----<br>
> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com><br>
> <a href="http://www.kyngchaos.com/" target="_blank">http://www.kyngchaos.com/</a><br>
><br>
> "Those people who most want to rule people are, ipso-facto, those least<br>
> suited to do it."<br>
><br>
> - A rule of the universe, from the HitchHiker's Guide to the Galaxy<br>
><br>
><br>
> _______________________________________________<br>
> grass-user mailing list<br>
> <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.osgeo.org/pipermail/grass-user/attachments/20140630/89412d9f/attachment-0001.html" target="_blank">http://lists.osgeo.org/pipermail/grass-user/attachments/20140630/89412d9f/attachment-0001.html</a>><br>

<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Tue, 1 Jul 2014 14:05:33 +0200<br>
From: Annalisa Minelli <<a href="mailto:annagrass6@gmail.com">annagrass6@gmail.com</a>><br>
To: Javier Mart?nez-L?pez       <<a href="mailto:javi.martinez.lopez@gmail.com">javi.martinez.lopez@gmail.com</a>><br>
Cc: grass-user grass-user <<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>>,<br>
        "<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a>" <<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a>><br>
Subject: Re: [GRASS-user] [GRASS-dev] Parallelize a job using<br>
        multiprocess python library without destroying environmental variable<br>
Message-ID:<br>
        <<a href="mailto:CAOVnxB8o9iMvAzUjmRBucaDjNAuQJFM6j5rnaPC8%2BJgSK-Xb3Q@mail.gmail.com">CAOVnxB8o9iMvAzUjmRBucaDjNAuQJFM6j5rnaPC8+JgSK-Xb3Q@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Thanks to both,<br>
I will have a look at your advices/ideas and tell you if I can solve!<br>
<br>
All the best,<br>
Annalisa<br>
<br>
<br>
2014-06-30 20:17 GMT+02:00 Javier Mart?nez-L?pez <<br>
<a href="mailto:javi.martinez.lopez@gmail.com">javi.martinez.lopez@gmail.com</a>>:<br>
<br>
> Hi Annalisa,<br>
><br>
> I still need to learn a lot about this and have not tested Vaclav's<br>
> advice yet, which is probably the best way to go, but you can take a<br>
> look at some scripts I wrote for doing this:<br>
><br>
><br>
> <a href="https://github.com/javimarlop/eHabpy/blob/master/pas/tmp/parallel_segmentation_pca.py" target="_blank">https://github.com/javimarlop/eHabpy/blob/master/pas/tmp/parallel_segmentation_pca.py</a><br>
><br>
><br>
> <a href="https://github.com/javimarlop/eHabpy/blob/master/pas/parallel_grass_example.py" target="_blank">https://github.com/javimarlop/eHabpy/blob/master/pas/parallel_grass_example.py</a><br>
><br>
> They are working for me, but as Markus Metz also mentioned me once, if<br>
> you are not using a cluster and there is a lot of writing/reading from<br>
> the same hard disk, you will probably not speed up considerably the<br>
> processing. In any case, I am also very interested in further<br>
> developing this script, so any ideas are welcome!<br>
><br>
> Cheers,<br>
><br>
> Javier<br>
><br>
><br>
> On Mon, Jun 30, 2014 at 4:05 PM, Vaclav Petras <<a href="mailto:wenzeslaus@gmail.com">wenzeslaus@gmail.com</a>><br>
> wrote:<br>
> ><br>
> ><br>
> ><br>
> > On Mon, Jun 30, 2014 at 5:21 AM, Annalisa Minelli <<a href="mailto:annagrass6@gmail.com">annagrass6@gmail.com</a>><br>
> > wrote:<br>
> >><br>
> >> Hi all,<br>
> >> I'm attempting to parallelize a job in a python script using<br>
> multiprocess<br>
> >> library in grass70.<br>
> >> I had a look at the following links:<br>
> >> <a href="http://grasswiki.osgeo.org/wiki/Parallel_GRASS_jobs" target="_blank">http://grasswiki.osgeo.org/wiki/Parallel_GRASS_jobs</a><br>
> >> and <a href="http://grasswiki.osgeo.org/wiki/Parallelizing_Scripts" target="_blank">http://grasswiki.osgeo.org/wiki/Parallelizing_Scripts</a>.<br>
> >><br>
> >> I would like to work in the same location but in different mapsets<br>
> because<br>
> >> my jobs touch the region settings, but I don't know how to set separate<br>
> >> mapset for separate jobs.<br>
> >><br>
> >> Since now I discovered that this processes, if run in the same mapset,<br>
> >> clean all the environmental variables (GISDBASE, LOCATION, MAPSET) so<br>
> then<br>
> >> GRASS does not start anymore and I have to restore the .grass70/rc<br>
> file..<br>
> >><br>
> >> can anyone hint me on how to set different mapsets for different jobs?<br>
> >><br>
> ><br>
> > First, look at the PyGRASS GridModule [1] whether this can help you.<br>
> ><br>
> > For general case, there is unfortunately no API. From what I understand,<br>
> you<br>
> > have to create a file "gisrc" somewhere and then do something like env =<br>
> > copy(os.environ) and change GISRC there to your custom "gisrc". Then you<br>
> the<br>
> > change the mapset and region by standard GRASS means but you must pass<br>
> `env`<br>
> > parameter to all command/module calls (env is used by Python subprocess<br>
> to<br>
> > set environment just for one process).<br>
> ><br>
> > Note that GISRC, GISBASE and LOCATION are (system) environmental<br>
> variables<br>
> > while GISDBASE, LOCATION_NAME and MAPSET are GRASS GIS<br>
> session/environment<br>
> > variables and are stored in "gisrc" file. I don't have an idea what<br>
> LOCATION<br>
> > variable is for (it contains full path to the mapset).<br>
> ><br>
> > I would be glad to hear what others think about this.<br>
> ><br>
> > You can of course read source code of GridModule, rendering in wxGUI,<br>
> > g.gui.animation, or the following snipped but I don't say that it will be<br>
> > easy to understand and there might be a lot of imperfections.<br>
> ><br>
> > Vaclav<br>
> ><br>
> >     # we rely on the tmp dir having enough space for our map<br>
> >     tgt_gisdbase = tempfile.mkdtemp()<br>
> >     # this is not needed if we use mkdtemp but why not<br>
> >     tgt_location = 'r.out.png.proj_location_%s' % epsg_code<br>
> >     # because we are using PERMANENT we don't have to create mapset<br>
> > explicitly<br>
> >     tgt_mapset_name = 'PERMANENT'<br>
> ><br>
> >     src_mapset = Mapset(src_mapset_name)<br>
> ><br>
> >     # get source (old) and set target (new) GISRC enviromental variable<br>
> >     # TODO: set environ only for child processes could be enough and it<br>
> > would<br>
> >     # enable (?) parallel runs<br>
> >     src_gisrc = os.environ['GISRC']<br>
> >     tgt_gisrc = gsetup.write_gisrc(tgt_gisdbase,<br>
> >                                    tgt_location, tgt_mapset_name)<br>
> >     # we should use a copy and pass it but then it would not be possible<br>
> to<br>
> > use create_location<br>
> >     os.environ['GISRC'] = tgt_gisrc<br>
> >     if os.environ.get('WIND_OVERRIDE'):<br>
> >         old_temp_region = os.environ['WIND_OVERRIDE']<br>
> >         del os.environ['WIND_OVERRIDE']<br>
> >     else:<br>
> >         old_temp_region = None<br>
> >     # these lines looks good but anyway when developing the module<br>
> >     # switching location seemed fragile and on some errors (while running<br>
> >     # unfinished module) location was switched in the command line<br>
> ><br>
> >     try:<br>
> >         # the function itself is not safe for other (backgroud) processes<br>
> >         # (e.g. GUI), however we already switched GISRC for us<br>
> >         # and child processes, so we don't influece others<br>
> >         gcore.create_location(dbase=tgt_gisdbase,<br>
> >                               location=tgt_location,<br>
> >                               epsg=epsg_code,<br>
> >                               datum=None,<br>
> >                               datum_trans=None)<br>
> ><br>
> >         # Mapset object cannot be created if the real mapset does not<br>
> exists<br>
> >         tgt_mapset = Mapset(gisdbase=tgt_gisdbase, location=tgt_location,<br>
> >                             mapset=tgt_mapset_name)<br>
> >         # set the current mapset in the library<br>
> >         # we actually don't need to switch when only calling modules<br>
> >         # (right GISRC is enough for them)<br>
> >         tgt_mapset.current()<br>
> > ...<br>
> ><br>
> ><br>
> ><br>
> > [1] <a href="http://grass.osgeo.org/grass71/manuals/pygrass/modules_grid.html" target="_blank">http://grass.osgeo.org/grass71/manuals/pygrass/modules_grid.html</a><br>
> ><br>
> ><br>
> >><br>
> >> All the best,<br>
> >> Annalisa<br>
> >><br>
> >> _______________________________________________<br>
> >> grass-dev mailing list<br>
> >> <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
> >> <a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > grass-dev mailing list<br>
> > <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
> > <a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.osgeo.org/pipermail/grass-user/attachments/20140701/405b02e6/attachment.html" target="_blank">http://lists.osgeo.org/pipermail/grass-user/attachments/20140701/405b02e6/attachment.html</a>><br>

<br>
------------------------------<br>
<br>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
<br>
End of grass-user Digest, Vol 99, Issue 1<br>
*****************************************<br>
</blockquote></div><br><br clear="all"><br>-- <br>Lê Anh Hùng<br>Center for Forest Information and Consultancy (CFIC)<br>No. 340, Bach Dang street, Hoan Kiem district, Ha Noi,<br>Tel (office): 04.3.9320734<br>Mobile: 0914574246<br>
Email1: <a href="mailto:Hungcfic@gmail.com">Hungcfic@gmail.com</a><br>Email2: <a href="mailto:Hung_cfic75@yahoo.com">Hung_cfic75@yahoo.com</a>
</div>