[GRASS-dev] Re: [GRASS-user] v.coordinate.sh - improve this script?

On Jan 24, 2008, at 6:52 AM, grass-user-request@lists.osgeo.org wrote:

Date: Thu, 24 Jan 2008 05:12:03 -0800 (PST)
From: "Gabriele N." <gis.gn@libero.it>
Subject: [GRASS-user] v.coordinate.sh - improve this script?
To: grass-user@lists.osgeo.org
Message-ID: <15063748.post@talk.nabble.com>
Content-Type: text/plain; charset=us-ascii

Hi list.
I made a script (attached) for the definition of interactive text file
(containing the coordinates input and output) to be loaded later in
v.transform.

It is useful to write automatically coordinates in the text file.

Operation is simple:
- A load map (not georeference) and the map B (which may be raster or
vector) and will open 2 monitor.

- We need to move the first monitor to the side of the second monitor.

- Proceed doing a zoom (if necessary) on the first monitor (A map) and then
identifying the input point (GCP) with one click. After this transaction
will be made to locate the point on the second monitor (B map).
The pairs of points are identifying 4 (at least 4). For more points see a
graphic which will require to continue with the process or not.

- After the inclusion of the points in your / home will be a text file
'coordinate.txt' formatted for use in v.transform.

The script is certainly improved. For example viewing points included (as eg
in i.points on in d.path) or shifting automatically monitors or using snap
for the insertion points etc. ...

I have no programming experience, and I hope that someone can help me
improve.

Gabriele

PS
Necessary installing xdialog and xmessage
    
http://www.nabble.com/file/p15063748/v.coordinate.sh v.coordinate.sh
--
View this message in context: http://www.nabble.com/v.coordinate.sh---improve-this-script--tp15063748p15063748.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Gabriele,

It is good to learn scripting of some kind because it really expands the analytical capabilities of GRASS. However, I'm not sure why you are trying to create a bash script for interactive georectifying.

i.points already does with with xmonitors. However, this will not work on Windows because it doesn't support the underlying socket code for the monitor drivers.

The TclTk GUI already has a more sophisticated replacement for this function that works on all platforms.

Also, given issues (long known) that we've run into again with running bash scripts on Windows, I think that now is the time to begin to strongly encourage GRASS users and developers to try to begin shifting their scripting to a platform that works on all OS's. Since the new GUI will be in Python, I strongly suggest that we start developing new scripts in Python and for anyone with time on their hands :wink: start to create Python versions of existing scripts. The more scripts that are available in Python, the more people will make sure that Python is installed and will take a look at it, which will lead to more scripts in Python, etc...

Already, a Python script can pop up the same TclTk GUI that a bash script can, and has the option of popping up a wxPython GUI if this is installed.

Michael

____________________
C. Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

Hi,

Nikos Alexandris píše v Čt 24. 01. 2008 v 16:34 +0100:

Michael,

thank you for these important details for new GRASS users (like me). On
the web I have found some good resrources for bash scripting. Is there
something for Python (for beginners) and maybe GRASS-oriented as well?

Thank you,

Nikos

just look at the manual page to g.parser:
http://grass.osgeo.org/grass63/manuals/html63_user/g.parser.html

jachym

On Thu, 2008-01-24 at 08:28 -0700, Michael Barton wrote:
> On Jan 24, 2008, at 6:52 AM, grass-user-request@lists.osgeo.org wrote:
>
> > Date: Thu, 24 Jan 2008 05:12:03 -0800 (PST)
> > From: "Gabriele N." <gis.gn@libero.it>
> > Subject: [GRASS-user] v.coordinate.sh - improve this script?
> > To: grass-user@lists.osgeo.org
> > Message-ID: <15063748.post@talk.nabble.com>
> > Content-Type: text/plain; charset=us-ascii
> >
> >
> > Hi list.
> > I made a script (attached) for the definition of interactive text file
> > (containing the coordinates input and output) to be loaded later in
> > v.transform.
> >
> > It is useful to write automatically coordinates in the text file.
> >
> > Operation is simple:
> > - A load map (not georeference) and the map B (which may be raster or
> > vector) and will open 2 monitor.
> >
> > - We need to move the first monitor to the side of the second monitor.
> >
> > - Proceed doing a zoom (if necessary) on the first monitor (A map)
> > and then
> > identifying the input point (GCP) with one click. After this
> > transaction
> > will be made to locate the point on the second monitor (B map).
> > The pairs of points are identifying 4 (at least 4). For more points
> > see a
> > graphic which will require to continue with the process or not.
> >
> > - After the inclusion of the points in your / home will be a text file
> > 'coordinate.txt' formatted for use in v.transform.
> >
> >
> > The script is certainly improved. For example viewing points
> > included (as eg
> > in i.points on in d.path) or shifting automatically monitors or
> > using snap
> > for the insertion points etc. ...
> >
> > I have no programming experience, and I hope that someone can help me
> > improve.
> >
> > Gabriele
> >
> > PS
> > Necessary installing xdialog and xmessage
> >
> > http://www.nabble.com/file/p15063748/v.coordinate.sh v.coordinate.sh
> > --
> > View this message in context: http://www.nabble.com/
> > v.coordinate.sh---improve-this-script--tp15063748p15063748.html
> > Sent from the Grass - Users mailing list archive at Nabble.com.
>
> Gabriele,
>
> It is good to learn scripting of some kind because it really expands
> the analytical capabilities of GRASS. However, I'm not sure why you
> are trying to create a bash script for interactive georectifying.
>
> i.points already does with with xmonitors. However, this will not
> work on Windows because it doesn't support the underlying socket code
> for the monitor drivers.
>
> The TclTk GUI already has a more sophisticated replacement for this
> function that works on all platforms.
>
> Also, given issues (long known) that we've run into again with
> running bash scripts on Windows, I think that now is the time to
> begin to strongly encourage GRASS users and developers to try to
> begin shifting their scripting to a platform that works on all OS's.
> Since the new GUI will be in Python, I strongly suggest that we start
> developing new scripts in Python and for anyone with time on their
> hands :wink: start to create Python versions of existing scripts. The
> more scripts that are available in Python, the more people will make
> sure that Python is installed and will take a look at it, which will
> lead to more scripts in Python, etc...
>
> Already, a Python script can pop up the same TclTk GUI that a bash
> script can, and has the option of popping up a wxPython GUI if this
> is installed.
>
> Michael
>
> ____________________
> C. Michael Barton, Professor of Anthropology
> Director of Graduate Studies
> School of Human Evolution & Social Change
> Center for Social Dynamics & Complexity
> Arizona State University
>
> Phone: 480-965-6262
> Fax: 480-965-7671
> www: <www.public.asu.edu/~cmbarton>
> _______________________________________________
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

--
Jachym Cepicky
e-mail: jachym.cepicky@gmail.com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub

I would have asked the same question as Luca. Wouldn’t it be more profitable using QT, as it is already the way Python script are written in QGis? I know the two projects are independent, but having a common GUI language could improve the development of scripts in both the environments and the portability of them.
My impression is that wxWindow is a bit easier to manage then QT, but since many of us write scripts for QGis too, it would be better to learn well one system (QT) then two (QT and wxWindow) :slight_smile:

Anyway, I’m sure you have good reasons for having chosen wxWindow fro Grass.

Giovanni

2008/1/25, Luca Casagrande <luca.casagrande@gmail.com>:

On Jan 24, 2008 4:28 PM, Michael Barton <michael.barton@asu.edu> wrote:

Since the new GUI will be in Python, I strongly suggest that we start
developing new scripts in Python and for anyone with time on their
hands :wink: start to create Python versions of existing scripts. The
more scripts that are available in Python, the more people will make
sure that Python is installed and will take a look at it, which will
lead to more scripts in Python, etc…

Hi Michael,

I have started studying python more deeper for using it in pyWPS and
for creating new Qgis modules (with QT).
Just for knowing, is there any reason for using wxWindow instead of Qt
for the new GUI?
is it a matter of license?

Thank you very much

Luca


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Hi Luca,

2008/1/25, Luca Casagrande <luca.casagrande@gmail.com>:

[snip]

I have started studying python more deeper for using it in pyWPS and
for creating new Qgis modules (with QT).
Just for knowing, is there any reason for using wxWindow instead of Qt
for the new GUI?
is it a matter of license?

which graphical toolkit to use for native GRASS GUI has been discussed
in grass-dev ML several times in the past. At the end it was decided
to use wxWidgets:

* powerful Python binding (know as wxPython).
* uses native platform SDK (native look and feel)
* Free OpenGL widget for NVIZ replacement

see

http://grass.gdf-hannover.de/wiki/GRASS_GUI
http://grass.gdf-hannover.de/wiki/WxPython-based_GUI_for_GRASS
http://www.nabble.com/v.digit%3A-Qt-or-wxWidgets-to4472391.html#a4472391
http://www.nabble.com/Platform-for-next-generation-UI-to2114044.html#a2115028
http://www.nabble.com/Discussing-new-GUI-toolkit%3A-v.pydigit-to4637114.html#a4642371
http://www.nabble.com/Python-GUI-toolkits-to4755513.html#a4788219

etc.

Since native wxPython GUI is under development more then one year it
makes hard to switch to PyQT now. wxPython seems to be a good choice
at the end, at least from my point of view.

Regards, Martin

--
Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *

Hi,

2008/1/25, G. Allegri <giohappy@gmail.com>:

I would have asked the same question as Luca. Wouldn't it be more profitable
using QT, as it is already the way Python script are written in QGis? I know

yes, that's true, it would be profitable at the end.

the two projects are independent, but having a common GUI language could
improve the development of scripts in both the environments and the
portability of them.
My impression is that wxWindow is a bit easier to manage then QT, but since
many of us write scripts for QGis too, it would be better to learn well one
system (QT) then two (QT and wxWindow) :slight_smile:

After discussion (one/two years ago) we found wxWidgets as the best
option for our needs. Since we have limited resources I don't see
switching from wxPython to something else as a realistic option.
Currenly wxPython GUI is under active development, the future shows...

Regards, Martin

--
Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *

Thanks, the reasons of the choice are clear. I obviously were not asking to switch to pyQT! I know it would a completely new work.
I was just considering how to take advantage from the fact that Python is common to Grass and QGis…

Giovanni

2008/1/25, Martin Landa <landa.martin@gmail.com>:

Hi,

2008/1/25, G. Allegri <giohappy@gmail.com>:

I would have asked the same question as Luca. Wouldn’t it be more profitable
using QT, as it is already the way Python script are written in QGis? I know

yes, that’s true, it would be profitable at the end.

the two projects are independent, but having a common GUI language could
improve the development of scripts in both the environments and the
portability of them.
My impression is that wxWindow is a bit easier to manage then QT, but since
many of us write scripts for QGis too, it would be better to learn well one
system (QT) then two (QT and wxWindow) :slight_smile:

After discussion (one/two years ago) we found wxWidgets as the best
option for our needs. Since we have limited resources I don’t see
switching from wxPython to something else as a realistic option.
Currenly wxPython GUI is under active development, the future shows…

Regards, Martin


Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *

We are using wxPython instead of wxWindows. There was a long discussion about this a couple years back. As I understand it, both wxWindows and QT are natively built in C++. This, and related factors of how one actually operationalizes an interface, makes their programming considerably more difficult for the GRASS development group (mostly scientists rather than dedicated programmers) to develop and maintain.

However, wxPython (Python bindings for wxWindows) runs under Python. This is much more widely known and easier to develop in. This means that there are more potential developers available--and user/scientists like me can actually work with it. It also has the added value of ultimately making Python a dependency of GRASS, which makes it a favored scripting environment. Like native wxWindows and QT, wxPython is completely cross-platform. AFAICT, its development closely parallels that of wxWindows, giving us access to the power of wxWindows with the easy of Python.

Michael
______________________________
Michael Barton, Professor
Professor of Anthropology
Director of Graduate Studies
School of Human Diversity & Social Change
Center for Social Dynamics & Complexity
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

On Jan 25, 2008, at 5:34 AM, Luca Casagrande wrote:

On Jan 24, 2008 4:28 PM, Michael Barton <michael.barton@asu.edu> wrote:

Since the new GUI will be in Python, I strongly suggest that we start
developing new scripts in Python and for anyone with time on their
hands :wink: start to create Python versions of existing scripts. The
more scripts that are available in Python, the more people will make
sure that Python is installed and will take a look at it, which will
lead to more scripts in Python, etc...

Hi Michael,

I have started studying python more deeper for using it in pyWPS and
for creating new Qgis modules (with QT).
Just for knowing, is there any reason for using wxWindow instead of Qt
for the new GUI?
is it a matter of license?

Thank you very much

Luca

Another reason beyond the one that I mentioned to Luca is that we went through many potential interface development languages 2 years ago, decided on wxPython, and the wxPython is now almost complete. It would be an enormous time sink to do this all over again.

Michael


Michael Barton, Professor

Professor of Anthropology
Director of Graduate Studies
School of Human Diversity & Social Change
Center for Social Dynamics & Complexity

Arizona State University

Tempe, AZ 85287-2402

USA

voice: 480-965-6262; fax: 480-965-7671

www: http://www.public.asu.edu/~cmbarton

On Jan 25, 2008, at 6:14 AM, G. Allegri wrote:

I would have asked the same question as Luca. Wouldn’t it be more profitable using QT, as it is already the way Python script are written in QGis? I know the two projects are independent, but having a common GUI language could improve the development of scripts in both the environments and the portability of them.
My impression is that wxWindow is a bit easier to manage then QT, but since many of us write scripts for QGis too, it would be better to learn well one system (QT) then two (QT and wxWindow) :slight_smile:

Anyway, I’m sure you have good reasons for having chosen wxWindow fro Grass.

Giovanni

2008/1/25, Luca Casagrande <luca.casagrande@gmail.com>:

On Jan 24, 2008 4:28 PM, Michael Barton <michael.barton@asu.edu> wrote:

Since the new GUI will be in Python, I strongly suggest that we start
developing new scripts in Python and for anyone with time on their
hands :wink: start to create Python versions of existing scripts. The
more scripts that are available in Python, the more people will make
sure that Python is installed and will take a look at it, which will
lead to more scripts in Python, etc…

Hi Michael,

I have started studying python more deeper for using it in pyWPS and
for creating new Qgis modules (with QT).
Just for knowing, is there any reason for using wxWindow instead of Qt
for the new GUI?
is it a matter of license?

Thank you very much

Luca


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Eh, maybe I was misundertsood. I didn’t mean to consider the hypothesis to move to QT. I was asking, as Luca, about the reasons of the choice. I’m not a programmer too, so it’s better to me (as many of us) to use an easier development framework like wxPython then QT.
I just noted that it could have been a chance to develop both QGis and Grass on the same GUI environment. It hasn’t been so, and that’s ok. I also would have vote for wxPython two years ago! :slight_smile:

Giovanni

2008/1/25, Michael Barton <michael.barton@asu.edu>:

Another reason beyond the one that I mentioned to Luca is that we went through many potential interface development languages 2 years ago, decided on wxPython, and the wxPython is now almost complete. It would be an enormous time sink to do this all over again.

Michael


Michael Barton, Professor

Professor of Anthropology
Director of Graduate Studies
School of Human Diversity & Social Change
Center for Social Dynamics & Complexity

Arizona State University

Tempe, AZ 85287-2402

USA

voice: 480-965-6262; fax: 480-965-7671

www: http://www.public.asu.edu/~cmbarton

On Jan 25, 2008, at 6:14 AM, G. Allegri wrote:

I would have asked the same question as Luca. Wouldn’t it be more profitable using QT, as it is already the way Python script are written in QGis? I know the two projects are independent, but having a common GUI language could improve the development of scripts in both the environments and the portability of them.
My impression is that wxWindow is a bit easier to manage then QT, but since many of us write scripts for QGis too, it would be better to learn well one system (QT) then two (QT and wxWindow) :slight_smile:

Anyway, I’m sure you have good reasons for having chosen wxWindow fro Grass.

Giovanni

2008/1/25, Luca Casagrande <luca.casagrande@gmail.com>:

On Jan 24, 2008 4:28 PM, Michael Barton <michael.barton@asu.edu> wrote:

Since the new GUI will be in Python, I strongly suggest that we start
developing new scripts in Python and for anyone with time on their
hands :wink: start to create Python versions of existing scripts. The
more scripts that are available in Python, the more people will make
sure that Python is installed and will take a look at it, which will
lead to more scripts in Python, etc…

Hi Michael,

I have started studying python more deeper for using it in pyWPS and
for creating new Qgis modules (with QT).
Just for knowing, is there any reason for using wxWindow instead of Qt
for the new GUI?
is it a matter of license?

Thank you very much

Luca


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Hi,

Luca Casagrande píše v Pá 25. 01. 2008 v 13:34 +0100:

Hi Michael,

I have started studying python more deeper for using it in pyWPS

cool, we need more people :slight_smile: We have to move to WPS 1.0.0, so I'm
looking forward to see your code :wink:

and
for creating new Qgis modules (with QT).
Just for knowing, is there any reason for using wxWindow instead of Qt
for the new GUI?
is it a matter of license?

Thank you very much

Luca

As others were mentioning before me, it was discussed several times ago.
When I started to experiment with Python GUI in GRASS, I took Gtk,
because of I simply liked it. Then Michael started to experiment, mainly
on Mac OS and wxWidgets seemed the best choice for him. Others were not
complaining. When we asked around, how the best approach should be, we
were told to use Java :frowning:

Maybe next GRASS GUI will be Qt :slight_smile: But the current (wxWidgets-based)
should be here at least as long, as the Tcl/Tk was.

Just my 2 cents

Jachym

--
Jachym Cepicky
e-mail: jachym.cepicky@gmail.com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub