[GRASS-dev] d.* commands

I think there are around 56 d.* commands for interacting with the X11
terminals. What needs to be done to these modules so that they can
communicate with the new Tk display canvas?

Has anyone thought about the best way to integrate d.* commands from
the terminal and GIS manager?

I guess I envision that they need to create a layer in the png driver
and add it to the stack used by g.pngcomp and then cause a refresh of
the screen. I figure they should get the new transparency options as
well a hard or soft screen redraw option.

A few questions:

Is the drawing stack accessible from outside of GIS Manager so that
g.pngcomp can be called with the existing screen elements intact?

Is there a good way to let GIS manager know that the screen has a new
drawing element

Maybe command line draws should not be persistent in the GUI at all?

If this is something that I can do, I would like to try and get a few
of the more important ones updated before the feature freeze. I am not
a great C coder, however, so this could get ugly.

--
David Finlayson

I think there are around 56 d.* commands for interacting with the X11
terminals.

no, they talk to the display and raster libraries, which in turn render
to a display driver, which will then send it on to X11, PNG file, other..

e.g. a module calls R_text() to draw some text or R_polygon_abs() to
draw a polygon. The display drivers take care of how to actually draw
that. Look in grass6/display/drivers/

What needs to be done to these modules so that they can communicate
with the new Tk display canvas?

very little. e.g. in gis.m's GIS Manager window, click the "add command
layer" button and add a d.* command and watch it go.

We only have to worry about interactive modules.

Hamish

Hamish wrote:

I think there are around 56 d.* commands for interacting with the X11
terminals.

no, they talk to the display and raster libraries, which in turn render
to a display driver, which will then send it on to X11, PNG file, other..

e.g. a module calls R_text() to draw some text or R_polygon_abs() to
draw a polygon. The display drivers take care of how to actually draw
that. Look in grass6/display/drivers/

What needs to be done to these modules so that they can communicate
with the new Tk display canvas?

very little. e.g. in gis.m's GIS Manager window, click the "add command
layer" button and add a d.* command and watch it go.

We only have to worry about interactive modules.

I think what is at discussion here is whether one will still be able to use the CLI to display things, i.e. run d.* on the CLI and see the results in the monitor.

Currently, you can use the gis.m to display anything (including by entering d.* commands as command layers, but if you want to use the CLI to display something, you have to launch an x-monitor.

The questions are:

- Is this a problem ? I.e. how many times does one want to combine display commands from the gis manager and from the CLI ?

- If it is, what needs to be done to make a d.* command typed at the CLI display a map in the gis.m monitor ?

Moritz

Moritz Lennert wrote:

>> I think there are around 56 d.* commands for interacting with the X11
>> terminals.
>
> no, they talk to the display and raster libraries, which in turn render
> to a display driver, which will then send it on to X11, PNG file, other..
>
> e.g. a module calls R_text() to draw some text or R_polygon_abs() to
> draw a polygon. The display drivers take care of how to actually draw
> that. Look in grass6/display/drivers/
>
>
>> What needs to be done to these modules so that they can communicate
>> with the new Tk display canvas?
>
> very little. e.g. in gis.m's GIS Manager window, click the "add command
> layer" button and add a d.* command and watch it go.
>
> We only have to worry about interactive modules.

I think what is at discussion here is whether one will still be able to
use the CLI to display things, i.e. run d.* on the CLI and see the
results in the monitor.

Currently, you can use the gis.m to display anything (including by
entering d.* commands as command layers, but if you want to use the CLI
to display something, you have to launch an x-monitor.

The questions are:

- Is this a problem ? I.e. how many times does one want to combine
display commands from the gis manager and from the CLI ?

- If it is, what needs to be done to make a d.* command typed at the CLI
display a map in the gis.m monitor ?

It is trivial to write a program which sends commands to a running
gis.m instance using the Tk "send" command. However, recent versions
of Tk only support the send command if the X server is using
authentication (which is a pain to set up on Cygwin). Also, I don't
know whether this feature is limited to the X11 version or works on
other platforms.

A slightly more complex (but portable) approach is to have gis.m act
as a server, i.e. create a socket and execute commands which are
received on it.

As Tcl only supports TCP/IP sockets (and not Unix sockets), you would
need to include a simple authentication mechanism, e.g. sending a
token which is stored in a non-world-readable file in the user's home
directory, the same way that X's authentication mechanism works.

As the longer-term plan is to eliminate monitor processes altogether
and have the raster library generate image files directly, there will
need to be an option to feed each new image file to a user-specified
command to display the image, so that running d.* commands from an
interactive shell continues to work (more or less) as it does at
present.

--
Glynn Clements <glynn@gclements.plus.com>

Hi
On Wed, May 24, 2006 at 10:42:11AM +0100, Glynn Clements wrote:

>
> I think what is at discussion here is whether one will still be able to
> use the CLI to display things, i.e. run d.* on the CLI and see the
> results in the monitor.
>
> Currently, you can use the gis.m to display anything (including by
> entering d.* commands as command layers, but if you want to use the CLI
> to display something, you have to launch an x-monitor.
>
> The questions are:
>
> - Is this a problem ? I.e. how many times does one want to combine
> display commands from the gis manager and from the CLI ?
>
> - If it is, what needs to be done to make a d.* command typed at the CLI
> display a map in the gis.m monitor ?

It is trivial to write a program which sends commands to a running
gis.m instance using the Tk "send" command. However, recent versions
of Tk only support the send command if the X server is using
authentication (which is a pain to set up on Cygwin). Also, I don't
know whether this feature is limited to the X11 version or works on
other platforms.

A slightly more complex (but portable) approach is to have gis.m act
as a server, i.e. create a socket and execute commands which are
received on it.

As Tcl only supports TCP/IP sockets (and not Unix sockets), you would
need to include a simple authentication mechanism, e.g. sending a
token which is stored in a non-world-readable file in the user's home
directory, the same way that X's authentication mechanism works.

As the longer-term plan is to eliminate monitor processes altogether
and have the raster library generate image files directly, there will
need to be an option to feed each new image file to a user-specified
command to display the image, so that running d.* commands from an
interactive shell continues to work (more or less) as it does at
present.

I wonder, how complicated would it be to send the "monitor" process to
background (fork), where it would watch over some PNG or other file and display
it or similar process? This could solve the d.rast|vect commands.

Jachym

--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/jachym_cepicky-gpg_public_key.asc
-----------------------------------------
OFFICE:
GDF-Hannover
Mengendamm 16d
30177 Hannover
Germany
e-mail: cepicky@gdf-hannover.de
URL: http://gdf-hannover.de
Tel.: +49 511-39088507

Hamish answered some of these overnight. I'll add some more items of
explanation.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: David Finlayson <david.p.finlayson@gmail.com>
Date: Tue, 23 May 2006 14:32:02 -0700
To: grass developers list <grass-dev@grass.itc.it>
Subject: [GRASS-dev] d.* commands

I think there are around 56 d.* commands for interacting with the X11
terminals. What needs to be done to these modules so that they can
communicate with the new Tk display canvas?

Most of them either already do display, using the PNG driver, or I've
written alternative versions in TclTk. The latter are ones that require
interactive input via the X display window (e.g., d.zoom). This is why Glynn
is emphasizing getting rid of *requirements* for interactive use of GRASS
commands. There is no way to make d.zoom do interactive zooming in a TclTk
canvas, because it *requires* interaction with an X display. The same goes
for d.what.vect.

In the former case, I wrote a set of TclTk functions that handle zooming and
panning by sending coordinates to g.region. In the latter case, Trevor Wiens
wrote v.what that can do a query by inputing xy coordinates and outputing
the vector information at that locality. I then added a TclTk wrapper to get
the xy coordinates from the screen and sent them to the command.

This is kind a model of how things probably should work. Basic display
management (e.g., zooming) should be handled by the GUI/display system;
interaction between the display and GRASS data files (e.g., querying) should
be handled by interaction between the GUI/display system controls and GRASS
commands that accept text input and produce text output.

Has anyone thought about the best way to integrate d.* commands from
the terminal and GIS manager?

Yes. Glynn is working on this. The goal is to produce a generic protocol
that could be applied in different GUI/display systems.

I guess I envision that they need to create a layer in the png driver
and add it to the stack used by g.pngcomp and then cause a refresh of
the screen. I figure they should get the new transparency options as
well a hard or soft screen redraw option.

Thre are really 3 levels to deal with. At the most basic of typing a command
to display a map, an easier way might be simply to build in a simple PNG/PPM
display command that could give a quick view of items to be displayed. At
the level of scripting, all display functions can currently be scripted
using GRASS commands (that's how TclTk does it now). Interactive display
management is best done with a dedicated interactive display management
system.

A few questions:

Is the drawing stack accessible from outside of GIS Manager so that
g.pngcomp can be called with the existing screen elements intact?

g.pnmcomp only composites a set of ppm/pnm graphic files of the same
geometry into a single output graphic file. It can set tranparency,
background color, and output geometry also. Because this is a GRASS command
that accepts text input and produces output in the form of a pnm graphic
file, it is completely accessible from any program that can run GRASS
commands.

Is there a good way to let GIS manager know that the screen has a new
drawing element

This has been tricky, but basically checks to see if any of the options
(including file name) of a layer has changed. If anything has changed the
file is re-rendered (i.e., a new *.ppm file is created); if not, the
existing file on disk is used by g.pnmcomp. This is why if you change the
color table using r.colors or change a color in an rgb file for a vector
using an external dabase manager, the GIS Manager has no way of knowing. I
added the re-render button to deal with this.

Maybe command line draws should not be persistent in the GUI at all?

Not sure what you mean, but I'll try to answer what I think you mean. It
would be difficult to get something called from the command line to display
in an existing canvas, and I'm not sure what the advantage would be of doing
so. Each canvas is incrementally numbered in an array variable $can($mon)
and has an associated layer tree it uses for input. This allows each canvas
to have its own individual set of layers to display and individual
zoom/region settings. Also, displaying something in a TclTk canvas requires
TclTk commands, not GRASS commands.

It would be much easier if something from the command line were to display
in a simple display window (e.g., a simple command line PNG/PPM displayer).
The commands needed to display a set of maps, using the PNG driver,
compositing the maps into a single graphic display, calling wish,
determining the array value for the canvas desired, and creating the image
for the canvas are complicated and would take considerably longer to figure
out and type than simply adding the desired layers to the layer tree and
pushing the display button.

On the other hand, you can use display commands to create a *.PPM image that
can be displayed or imported into another application, without bothering
with a TclTk canvas.

If this is something that I can do, I would like to try and get a few
of the more important ones updated before the feature freeze. I am not
a great C coder, however, so this could get ugly.

Thanks very much for offering to help. IMHO, the most valuable thing anyone
could do to make GRASS 6.2 a complete system would be to port i.points
and/or v.digit to the new architecture so that they could work in a TclTk
canvas rather than requiring X11. NVIZ seems already on track to get there
soon.

Michael

Michael,

> Is there a good way to let GIS manager know that the screen has a new
> drawing element

This has been tricky, but basically checks to see if any of the options
(including file name) of a layer has changed. If anything has changed the
file is re-rendered (i.e., a new *.ppm file is created); if not, the
existing file on disk is used by g.pnmcomp. This is why if you change the
color table using r.colors or change a color in an rgb file for a vector
using an external dabase manager, the GIS Manager has no way of knowing. I
added the re-render button to deal with this.

Regarding color table, etc: A regular redraw can do this if layers check the
mtime of all database elements of refered to database things as another
reason to redraw. This should be implemented once for all layers, with each
layer indicating which database elements it depends upon.

--Cedric

Jachym Cepicky wrote:

> As the longer-term plan is to eliminate monitor processes altogether
> and have the raster library generate image files directly, there will
> need to be an option to feed each new image file to a user-specified
> command to display the image, so that running d.* commands from an
> interactive shell continues to work (more or less) as it does at
> present.

I wonder, how complicated would it be to send the "monitor" process to
background (fork), where it would watch over some PNG or other file and display
it or similar process? This could solve the d.rast|vect commands.

It would be easier (and more reliable) to make the raster library do
this explicitly in R_close_driver(). I'm thinking along the lines of a
GRASS variable or environment variable which can be used to specify a
program which would be run whenever the library finishes writing an
image file.

This could either run an image viewer (e.g. xview, xli etc) directly
(which would give you one instance per image), or a "remote-control"
program (along the lines of gimp-remote) to force a persistent process
to load the image. A remote-control command for gis.m would be a high
priority at that point.

If you were running the d.* commands from the GUI, you wouldn't
specify a program; the GUI would load the file when the command
completes.

--
Glynn Clements <glynn@gclements.plus.com>

Michael Barton wrote:

> Maybe command line draws should not be persistent in the GUI at all?

Not sure what you mean, but I'll try to answer what I think you mean. It
would be difficult to get something called from the command line to display
in an existing canvas, and I'm not sure what the advantage would be of doing
so. Each canvas is incrementally numbered in an array variable $can($mon)
and has an associated layer tree it uses for input. This allows each canvas
to have its own individual set of layers to display and individual
zoom/region settings. Also, displaying something in a TclTk canvas requires
TclTk commands, not GRASS commands.

If you are mostly using the terminal for generating maps, it would
probably be useful to be able to type a command to add a newly-created
map to the gis.m display, rather than having to switch to gis.m to add
the new map then switch back to the terminal afterwards.

This wouldn't be particularly hard to implement, although gis.m would
need some way to determine which canvas/layer-tree to use if you have
more than one.

--
Glynn Clements <glynn@gclements.plus.com>

On Wed, 24 May 2006, Michael Barton wrote:

If this is something that I can do, I would like to try and get a few
of the more important ones updated before the feature freeze. I am not
a great C coder, however, so this could get ugly.

Thanks very much for offering to help. IMHO, the most valuable thing anyone
could do to make GRASS 6.2 a complete system would be to port i.points
and/or v.digit to the new architecture so that they could work in a TclTk
canvas rather than requiring X11. NVIZ seems already on track to get there
soon.

How about making a v.edit that would work a bit like this:

v.edit task=[add,del,move,etc..] what=[point,line,centroid]
        db=[an SQL statement for UPDATE
        args=[task and what specific]

so for example to add a new point one could call

v.edit task=add what=point db='name="survey location 73" depth=34' args=x=25.242424,y=34.45634

and to add a line one could call

v.edit task=add what=line db='name="road #73" speed=70' args=25.242424:34.45634,25.34343:34.34353,25.6754:34.6453

delete is trivial

v.edit task=del what=line args=345
         ^This is the cat ID.

Just as an idea. If you like this I can start working on defining the syntax so that one can edit all sorts of shapes. Another possibility would be that it would read commands from a file (or stdin). Which would you guys prefer?

If reading from a file then the syntax can be more complex (even XML if we want it to).

--Wolf

--

<:3 )---- Wolf Bergenheim ----( 8:>

This is along the lines of what I thought would be a good replacement for
v.digit. Glynn had some ideas too, so I hope he offers an opinion here. This
kind of command line module for modifying vector objects could then be
accessed by any GUI/display management system that could draw on a display,
capture coordinates, and pass them to the relevant vector. The on-screen
vector could then be redrawn to reflect the change.

Michael

On 5/24/06 2:49 PM, "Wolf Bergenheim" <wolf+grass@bergenheim.net> wrote:

On Wed, 24 May 2006, Michael Barton wrote:

If this is something that I can do, I would like to try and get a few
of the more important ones updated before the feature freeze. I am not
a great C coder, however, so this could get ugly.

Thanks very much for offering to help. IMHO, the most valuable thing anyone
could do to make GRASS 6.2 a complete system would be to port i.points
and/or v.digit to the new architecture so that they could work in a TclTk
canvas rather than requiring X11. NVIZ seems already on track to get there
soon.

How about making a v.edit that would work a bit like this:

v.edit task=[add,del,move,etc..] what=[point,line,centroid]
        db=[an SQL statement for UPDATE
        args=[task and what specific]

so for example to add a new point one could call

v.edit task=add what=point db='name="survey location 73" depth=34'
args=x=25.242424,y=34.45634

and to add a line one could call

v.edit task=add what=line db='name="road #73" speed=70'
args=25.242424:34.45634,25.34343:34.34353,25.6754:34.6453

delete is trivial

v.edit task=del what=line args=345
^This is the cat ID.

Just as an idea. If you like this I can start working on defining the
syntax so that one can edit all sorts of shapes. Another possibility would
be that it would read commands from a file (or stdin). Which would you
guys prefer?

If reading from a file then the syntax can be more complex (even XML if we
want it to).

--Wolf

___________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

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

On Wed, 24 May 2006 20:50:20 -0700
Michael Barton <michael.barton@asu.edu> wrote:

This is along the lines of what I thought would be a good replacement for
v.digit. Glynn had some ideas too, so I hope he offers an opinion here. This
kind of command line module for modifying vector objects could then be
accessed by any GUI/display management system that could draw on a display,
capture coordinates, and pass them to the relevant vector. The on-screen
vector could then be redrawn to reflect the change.

Would this type of implementation also allow for adding functions like
joining polygons in a digitizing window environment. This might be
really elegant if one could specify which of the two or more objects
attributes of the objects being merged would be retained. Right, AFAIK
we need to manually delete the common boundary and one of the
centroids. Since there is a function to dissolve common boundaries in
v.extract, perhaps this might be a nice addition. I've used v.reclass
and v.extract for this, but sometimes it is necessary to do some of
this interactively. I suppose I could assign attributes accordingly and
then extract to dissolve, but it would be nice to do this interactively.

Also, it would be really nice to have an undo function built in. I find
using v.digit very frustrating because I can't just "undo" my mistakes
or exit without saving.

On 5/24/06 2:49 PM, "Wolf Bergenheim" <wolf+grass@bergenheim.net> wrote:

> On Wed, 24 May 2006, Michael Barton wrote:
>>>
>>> If this is something that I can do, I would like to try and get a few
>>> of the more important ones updated before the feature freeze. I am not
>>> a great C coder, however, so this could get ugly.
>>
>> Thanks very much for offering to help. IMHO, the most valuable thing anyone
>> could do to make GRASS 6.2 a complete system would be to port i.points
>> and/or v.digit to the new architecture so that they could work in a TclTk
>> canvas rather than requiring X11. NVIZ seems already on track to get there
>> soon.
>>
>
> How about making a v.edit that would work a bit like this:
>
> v.edit task=[add,del,move,etc..] what=[point,line,centroid]
> db=[an SQL statement for UPDATE
> args=[task and what specific]
>
> so for example to add a new point one could call
>
> v.edit task=add what=point db='name="survey location 73" depth=34'
> args=x=25.242424,y=34.45634
>
> and to add a line one could call
>
> v.edit task=add what=line db='name="road #73" speed=70'
> args=25.242424:34.45634,25.34343:34.34353,25.6754:34.6453
>
> delete is trivial
>
> v.edit task=del what=line args=345
> ^This is the cat ID.
>
> Just as an idea. If you like this I can start working on defining the
> syntax so that one can edit all sorts of shapes. Another possibility would
> be that it would read commands from a file (or stdin). Which would you
> guys prefer?
>
> If reading from a file then the syntax can be more complex (even XML if we
> want it to).
>
> --Wolf

___________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

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

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

--
Trevor Wiens
twiens@interbaun.com

The significant problems that we face cannot be solved at the same
level of thinking we were at when we created them.
(Albert Einstein)

These would be very good functions to build in. The undo, would probably
best be implemented in the GUI/display management system. It could store up
changes and implement them on command. I'm not sure how this could be done,
but it probably could be.

Michael

On 5/24/06 9:01 PM, "Trevor Wiens" <twiens@interbaun.com> wrote:

On Wed, 24 May 2006 20:50:20 -0700
Michael Barton <michael.barton@asu.edu> wrote:

This is along the lines of what I thought would be a good replacement for
v.digit. Glynn had some ideas too, so I hope he offers an opinion here. This
kind of command line module for modifying vector objects could then be
accessed by any GUI/display management system that could draw on a display,
capture coordinates, and pass them to the relevant vector. The on-screen
vector could then be redrawn to reflect the change.

Would this type of implementation also allow for adding functions like
joining polygons in a digitizing window environment. This might be
really elegant if one could specify which of the two or more objects
attributes of the objects being merged would be retained. Right, AFAIK
we need to manually delete the common boundary and one of the
centroids. Since there is a function to dissolve common boundaries in
v.extract, perhaps this might be a nice addition. I've used v.reclass
and v.extract for this, but sometimes it is necessary to do some of
this interactively. I suppose I could assign attributes accordingly and
then extract to dissolve, but it would be nice to do this interactively.

Also, it would be really nice to have an undo function built in. I find
using v.digit very frustrating because I can't just "undo" my mistakes
or exit without saving.

On 5/24/06 2:49 PM, "Wolf Bergenheim" <wolf+grass@bergenheim.net> wrote:

On Wed, 24 May 2006, Michael Barton wrote:

If this is something that I can do, I would like to try and get a few
of the more important ones updated before the feature freeze. I am not
a great C coder, however, so this could get ugly.

Thanks very much for offering to help. IMHO, the most valuable thing anyone
could do to make GRASS 6.2 a complete system would be to port i.points
and/or v.digit to the new architecture so that they could work in a TclTk
canvas rather than requiring X11. NVIZ seems already on track to get there
soon.

How about making a v.edit that would work a bit like this:

v.edit task=[add,del,move,etc..] what=[point,line,centroid]
        db=[an SQL statement for UPDATE
        args=[task and what specific]

so for example to add a new point one could call

v.edit task=add what=point db='name="survey location 73" depth=34'
args=x=25.242424,y=34.45634

and to add a line one could call

v.edit task=add what=line db='name="road #73" speed=70'
args=25.242424:34.45634,25.34343:34.34353,25.6754:34.6453

delete is trivial

v.edit task=del what=line args=345
^This is the cat ID.

Just as an idea. If you like this I can start working on defining the
syntax so that one can edit all sorts of shapes. Another possibility would
be that it would read commands from a file (or stdin). Which would you
guys prefer?

If reading from a file then the syntax can be more complex (even XML if we
want it to).

--Wolf

___________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

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

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

___________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

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

On Wed, 24 May 2006, Michael Barton wrote:

These would be very good functions to build in. The undo, would probably
best be implemented in the GUI/display management system. It could store up
changes and implement them on command. I'm not sure how this could be done,
but it probably could be.

I agree I would also like to see this undo feature, and exit without saving. the GUI part could simply store a queue of v.edit commands to execute for the save part, and somehow put the drawn objects in a display queue. In the event of an undo it could simply remove the last item from both queues and then redraw the screen.

One concern I have before I start to design the interface, is that will it be an expensive operation to execute an external program for each object to digitize? I mean the program will have to be launched, then it will do its thing and then it will recalculate the topology, right? I'm mainly wondering whether it would make sense to allow multiple edit commands in one go of v.edit? Would it increase the speed? On the other hand the v.edit commands can be executed in the background, and the user doesn't have to sit and wait for them to complete.

--W

Michael

On 5/24/06 9:01 PM, "Trevor Wiens" <twiens@interbaun.com> wrote:

On Wed, 24 May 2006 20:50:20 -0700
Michael Barton <michael.barton@asu.edu> wrote:

This is along the lines of what I thought would be a good replacement for
v.digit. Glynn had some ideas too, so I hope he offers an opinion here. This
kind of command line module for modifying vector objects could then be
accessed by any GUI/display management system that could draw on a display,
capture coordinates, and pass them to the relevant vector. The on-screen
vector could then be redrawn to reflect the change.

Would this type of implementation also allow for adding functions like
joining polygons in a digitizing window environment. This might be
really elegant if one could specify which of the two or more objects
attributes of the objects being merged would be retained. Right, AFAIK
we need to manually delete the common boundary and one of the
centroids. Since there is a function to dissolve common boundaries in
v.extract, perhaps this might be a nice addition. I've used v.reclass
and v.extract for this, but sometimes it is necessary to do some of
this interactively. I suppose I could assign attributes accordingly and
then extract to dissolve, but it would be nice to do this interactively.

Also, it would be really nice to have an undo function built in. I find
using v.digit very frustrating because I can't just "undo" my mistakes
or exit without saving.

On 5/24/06 2:49 PM, "Wolf Bergenheim" <wolf+grass@bergenheim.net> wrote:

On Wed, 24 May 2006, Michael Barton wrote:

If this is something that I can do, I would like to try and get a few
of the more important ones updated before the feature freeze. I am not
a great C coder, however, so this could get ugly.

Thanks very much for offering to help. IMHO, the most valuable thing anyone
could do to make GRASS 6.2 a complete system would be to port i.points
and/or v.digit to the new architecture so that they could work in a TclTk
canvas rather than requiring X11. NVIZ seems already on track to get there
soon.

How about making a v.edit that would work a bit like this:

v.edit task=[add,del,move,etc..] what=[point,line,centroid]
        db=[an SQL statement for UPDATE
        args=[task and what specific]

so for example to add a new point one could call

v.edit task=add what=point db='name="survey location 73" depth=34'
args=x=25.242424,y=34.45634

and to add a line one could call

v.edit task=add what=line db='name="road #73" speed=70'
args=25.242424:34.45634,25.34343:34.34353,25.6754:34.6453

delete is trivial

v.edit task=del what=line args=345
^This is the cat ID.

Just as an idea. If you like this I can start working on defining the
syntax so that one can edit all sorts of shapes. Another possibility would
be that it would read commands from a file (or stdin). Which would you
guys prefer?

If reading from a file then the syntax can be more complex (even XML if we
want it to).

--Wolf

___________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

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

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

___________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

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

--

<:3 )---- Wolf Bergenheim ----( 8:>

I don't know whether multiple edits or single edits work better from the
standpoint of a v.edit module.

Michael

On 5/24/06 10:59 PM, "Wolf Bergenheim" <wolf+grass@bergenheim.net> wrote:

On Wed, 24 May 2006, Michael Barton wrote:

These would be very good functions to build in. The undo, would probably
best be implemented in the GUI/display management system. It could store up
changes and implement them on command. I'm not sure how this could be done,
but it probably could be.

I agree I would also like to see this undo feature, and exit without
saving. the GUI part could simply store a queue of v.edit commands to
execute for the save part, and somehow put the drawn objects in a display
queue. In the event of an undo it could simply remove the last item from
both queues and then redraw the screen.

One concern I have before I start to design the interface, is that will it
be an expensive operation to execute an external program for each object
to digitize? I mean the program will have to be launched, then it will do
its thing and then it will recalculate the topology, right? I'm mainly
wondering whether it would make sense to allow multiple edit commands in
one go of v.edit? Would it increase the speed? On the other hand the
v.edit commands can be executed in the background, and the user doesn't
have to sit and wait for them to complete.

--W

Michael

On 5/24/06 9:01 PM, "Trevor Wiens" <twiens@interbaun.com> wrote:

On Wed, 24 May 2006 20:50:20 -0700
Michael Barton <michael.barton@asu.edu> wrote:

This is along the lines of what I thought would be a good replacement for
v.digit. Glynn had some ideas too, so I hope he offers an opinion here.
This
kind of command line module for modifying vector objects could then be
accessed by any GUI/display management system that could draw on a display,
capture coordinates, and pass them to the relevant vector. The on-screen
vector could then be redrawn to reflect the change.

Would this type of implementation also allow for adding functions like
joining polygons in a digitizing window environment. This might be
really elegant if one could specify which of the two or more objects
attributes of the objects being merged would be retained. Right, AFAIK
we need to manually delete the common boundary and one of the
centroids. Since there is a function to dissolve common boundaries in
v.extract, perhaps this might be a nice addition. I've used v.reclass
and v.extract for this, but sometimes it is necessary to do some of
this interactively. I suppose I could assign attributes accordingly and
then extract to dissolve, but it would be nice to do this interactively.

Also, it would be really nice to have an undo function built in. I find
using v.digit very frustrating because I can't just "undo" my mistakes
or exit without saving.

On 5/24/06 2:49 PM, "Wolf Bergenheim" <wolf+grass@bergenheim.net> wrote:

On Wed, 24 May 2006, Michael Barton wrote:

If this is something that I can do, I would like to try and get a few
of the more important ones updated before the feature freeze. I am not
a great C coder, however, so this could get ugly.

Thanks very much for offering to help. IMHO, the most valuable thing
anyone
could do to make GRASS 6.2 a complete system would be to port i.points
and/or v.digit to the new architecture so that they could work in a TclTk
canvas rather than requiring X11. NVIZ seems already on track to get
there
soon.

How about making a v.edit that would work a bit like this:

v.edit task=[add,del,move,etc..] what=[point,line,centroid]
        db=[an SQL statement for UPDATE
        args=[task and what specific]

so for example to add a new point one could call

v.edit task=add what=point db='name="survey location 73" depth=34'
args=x=25.242424,y=34.45634

and to add a line one could call

v.edit task=add what=line db='name="road #73" speed=70'
args=25.242424:34.45634,25.34343:34.34353,25.6754:34.6453

delete is trivial

v.edit task=del what=line args=345
^This is the cat ID.

Just as an idea. If you like this I can start working on defining the
syntax so that one can edit all sorts of shapes. Another possibility would
be that it would read commands from a file (or stdin). Which would you
guys prefer?

If reading from a file then the syntax can be more complex (even XML if we
want it to).

--Wolf

___________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

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

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

___________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

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

___________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

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

Hi,

On Thu, May 25, 2006 at 12:49:38AM +0300, Wolf Bergenheim wrote:

How about making a v.edit that would work a bit like this:

v.edit task=[add,del,move,etc..] what=[point,line,centroid]
       db=[an SQL statement for UPDATE
       args=[task and what specific]

so for example to add a new point one could call

v.edit task=add what=point db='name="survey location 73" depth=34'
args=x=25.242424,y=34.45634

and to add a line one could call

v.edit task=add what=line db='name="road #73" speed=70'
args=25.242424:34.45634,25.34343:34.34353,25.6754:34.6453

delete is trivial

v.edit task=del what=line args=345
        ^This is the cat ID.

Just as an idea. If you like this I can start working on defining the
syntax so that one can edit all sorts of shapes. Another possibility would
be that it would read commands from a file (or stdin). Which would you
guys prefer?

If reading from a file then the syntax can be more complex (even XML if we
want it to).

This sounds great! I would suggest, that v.edit should be able to work
with both - command line arguments for easy editing, file (stdin) for
more complex ones.

I also thing, that XML is the way, GRASS should follow.

Jachym
--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/jachym_cepicky-gpg_public_key.asc
-----------------------------------------
OFFICE:
GDF-Hannover
Mengendamm 16d
30177 Hannover
Germany
e-mail: cepicky@gdf-hannover.de
URL: http://gdf-hannover.de
Tel.: +49 511-39088507

Sounds well thought to me!

Best,
Maciek

On Thu, 25 May 2006 00:49:38 +0300 (EEST)
Wolf Bergenheim <wolf+grass@bergenheim.net> wrote:

On Wed, 24 May 2006, Michael Barton wrote:
>>
>> If this is something that I can do, I would like to try and get a
>> few of the more important ones updated before the feature freeze.
>> I am not a great C coder, however, so this could get ugly.
>
> Thanks very much for offering to help. IMHO, the most valuable
> thing anyone could do to make GRASS 6.2 a complete system would be
> to port i.points and/or v.digit to the new architecture so that
> they could work in a TclTk canvas rather than requiring X11. NVIZ
> seems already on track to get there soon.
>

How about making a v.edit that would work a bit like this:

v.edit task=[add,del,move,etc..] what=[point,line,centroid]
        db=[an SQL statement for UPDATE
        args=[task and what specific]

so for example to add a new point one could call

v.edit task=add what=point db='name="survey location 73" depth=34'
args=x=25.242424,y=34.45634

and to add a line one could call

v.edit task=add what=line db='name="road #73" speed=70'
args=25.242424:34.45634,25.34343:34.34353,25.6754:34.6453

delete is trivial

v.edit task=del what=line args=345
         ^This is the cat ID.

Just as an idea. If you like this I can start working on defining the
syntax so that one can edit all sorts of shapes. Another possibility
would be that it would read commands from a file (or stdin). Which
would you guys prefer?

If reading from a file then the syntax can be more complex (even XML
if we want it to).

--Wolf

--

<:3 )---- Wolf Bergenheim ----( 8:>

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/

what about adding the -n flag or --no-topology? This would make it
usable for external programs and also for single command line operations

Jachym

On Wed, May 24, 2006 at 11:13:45PM -0700, Michael Barton wrote:

I don't know whether multiple edits or single edits work better from the
standpoint of a v.edit module.

Michael

On 5/24/06 10:59 PM, "Wolf Bergenheim" <wolf+grass@bergenheim.net> wrote:

> On Wed, 24 May 2006, Michael Barton wrote:
>
>> These would be very good functions to build in. The undo, would probably
>> best be implemented in the GUI/display management system. It could store up
>> changes and implement them on command. I'm not sure how this could be done,
>> but it probably could be.
>
> I agree I would also like to see this undo feature, and exit without
> saving. the GUI part could simply store a queue of v.edit commands to
> execute for the save part, and somehow put the drawn objects in a display
> queue. In the event of an undo it could simply remove the last item from
> both queues and then redraw the screen.
>
> One concern I have before I start to design the interface, is that will it
> be an expensive operation to execute an external program for each object
> to digitize? I mean the program will have to be launched, then it will do
> its thing and then it will recalculate the topology, right? I'm mainly
> wondering whether it would make sense to allow multiple edit commands in
> one go of v.edit? Would it increase the speed? On the other hand the
> v.edit commands can be executed in the background, and the user doesn't
> have to sit and wait for them to complete.
>
> --W
>
>>
>> Michael
>>
>>
>> On 5/24/06 9:01 PM, "Trevor Wiens" <twiens@interbaun.com> wrote:
>>
>>> On Wed, 24 May 2006 20:50:20 -0700
>>> Michael Barton <michael.barton@asu.edu> wrote:
>>>
>>>> This is along the lines of what I thought would be a good replacement for
>>>> v.digit. Glynn had some ideas too, so I hope he offers an opinion here.
>>>> This
>>>> kind of command line module for modifying vector objects could then be
>>>> accessed by any GUI/display management system that could draw on a display,
>>>> capture coordinates, and pass them to the relevant vector. The on-screen
>>>> vector could then be redrawn to reflect the change.
>>>>
>>>
>>> Would this type of implementation also allow for adding functions like
>>> joining polygons in a digitizing window environment. This might be
>>> really elegant if one could specify which of the two or more objects
>>> attributes of the objects being merged would be retained. Right, AFAIK
>>> we need to manually delete the common boundary and one of the
>>> centroids. Since there is a function to dissolve common boundaries in
>>> v.extract, perhaps this might be a nice addition. I've used v.reclass
>>> and v.extract for this, but sometimes it is necessary to do some of
>>> this interactively. I suppose I could assign attributes accordingly and
>>> then extract to dissolve, but it would be nice to do this interactively.
>>>
>>> Also, it would be really nice to have an undo function built in. I find
>>> using v.digit very frustrating because I can't just "undo" my mistakes
>>> or exit without saving.
>>>
>>>> On 5/24/06 2:49 PM, "Wolf Bergenheim" <wolf+grass@bergenheim.net> wrote:
>>>>
>>>>> On Wed, 24 May 2006, Michael Barton wrote:
>>>>>>>
>>>>>>> If this is something that I can do, I would like to try and get a few
>>>>>>> of the more important ones updated before the feature freeze. I am not
>>>>>>> a great C coder, however, so this could get ugly.
>>>>>>
>>>>>> Thanks very much for offering to help. IMHO, the most valuable thing
>>>>>> anyone
>>>>>> could do to make GRASS 6.2 a complete system would be to port i.points
>>>>>> and/or v.digit to the new architecture so that they could work in a TclTk
>>>>>> canvas rather than requiring X11. NVIZ seems already on track to get
>>>>>> there
>>>>>> soon.
>>>>>>
>>>>>
>>>>> How about making a v.edit that would work a bit like this:
>>>>>
>>>>> v.edit task=[add,del,move,etc..] what=[point,line,centroid]
>>>>> db=[an SQL statement for UPDATE
>>>>> args=[task and what specific]
>>>>>
>>>>> so for example to add a new point one could call
>>>>>
>>>>> v.edit task=add what=point db='name="survey location 73" depth=34'
>>>>> args=x=25.242424,y=34.45634
>>>>>
>>>>> and to add a line one could call
>>>>>
>>>>> v.edit task=add what=line db='name="road #73" speed=70'
>>>>> args=25.242424:34.45634,25.34343:34.34353,25.6754:34.6453
>>>>>
>>>>> delete is trivial
>>>>>
>>>>> v.edit task=del what=line args=345
>>>>> ^This is the cat ID.
>>>>>
>>>>> Just as an idea. If you like this I can start working on defining the
>>>>> syntax so that one can edit all sorts of shapes. Another possibility would
>>>>> be that it would read commands from a file (or stdin). Which would you
>>>>> guys prefer?
>>>>>
>>>>> If reading from a file then the syntax can be more complex (even XML if we
>>>>> want it to).
>>>>>
>>>>> --Wolf
>>>>
>>>> ___________________________
>>>> Michael Barton, Professor of Anthropology
>>>> School of Human Evolution & Social Change
>>>> Center for Social Dynamics & Complexity
>>>> Arizona State University
>>>>
>>>> WWW - http://www.public.asu.edu/~cmbarton
>>>> Phone: 480-965-6262
>>>> Fax: 480-965-7671
>>>>
>>>> _______________________________________________
>>>> grass-dev mailing list
>>>> grass-dev@grass.itc.it
>>>> http://grass.itc.it/mailman/listinfo/grass-dev
>>>
>>
>> ___________________________
>> Michael Barton, Professor of Anthropology
>> School of Human Evolution & Social Change
>> Center for Social Dynamics & Complexity
>> Arizona State University
>>
>> WWW - http://www.public.asu.edu/~cmbarton
>> Phone: 480-965-6262
>> Fax: 480-965-7671
>>
>>

___________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

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

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/jachym_cepicky-gpg_public_key.asc
-----------------------------------------
OFFICE:
GDF-Hannover
Mengendamm 16d
30177 Hannover
Germany
e-mail: cepicky@gdf-hannover.de
URL: http://gdf-hannover.de
Tel.: +49 511-39088507

On Thu, 25 May 2006, Jachym Cepicky wrote:

what about adding the -n flag or --no-topology? This would make it
usable for external programs and also for single command line operations

Good idea.

--W

--

<:3 )---- Wolf Bergenheim ----( 8:>

On Thu, 25 May 2006, Jachym Cepicky wrote:

If reading from a file then the syntax can be more complex (even XML if we
want it to).

This sounds great! I would suggest, that v.edit should be able to work
with both - command line arguments for easy editing, file (stdin) for
more complex ones.

I also thing, that XML is the way, GRASS should follow.

OK, it will do both. if the file argument is given it will read an xml
document which will contain the actions to take. Do we have an XML parser in
GRASS? I think however that I'll add this file parameter later.

--Wolf

--

<:3 )---- Wolf Bergenheim ----( 8:>