[GRASS-dev] Re: [GRASS-user] Re: Cygwin winGRASS 6.2 Errors! [SUCESS}

In scanning through the --helps to see if the cygwin modules worked
I found it got stuck on i.ortho.photo. I've now changed the main menu of
that to use G_parser().

(the i.ortho.photo menu could easily be rewritten BTW, it just lists 8
programs and runs the one you ask for. But then the ones it calls will
generally call I_ask() and want a interactive terminal, so there might
be little gained in the short term..)

remaining modules not using the parser:

d.rast.edit
g.parser
g.setproj
r.mapcalc

slowly getting there...

Hamish

On Thu, 2007-02-15 at 19:44 +1300, Hamish wrote:

In scanning through the --helps to see if the cygwin modules worked
I found it got stuck on i.ortho.photo. I've now changed the main menu of
that to use G_parser().

(the i.ortho.photo menu could easily be rewritten BTW, it just lists 8
programs and runs the one you ask for. But then the ones it calls will
generally call I_ask() and want a interactive terminal, so there might
be little gained in the short term..)

I had completed the majority of rewriting i.ortho.photo, but quit
working on it when it became clear that there was no consensus as to
whether I should A) break it up into 6-7 separate modules or B) a single
module with an 'option='. (My tree is full of incomplete work :slight_smile:

I much prefer B to A due to the ever growing number of modules. It is
already becoming unwieldy. My memory isn't as good as most and I find
it sometimes difficult to find the module I'm looking for when I have to
scan through 2-3 pages of listings. I imagine new users will be
overwhelmed, but the GUI does help in that respect.

--
Brad Douglas <rez touchofmadness com> KB8UYR/6
Address: 37.493,-121.924 / WGS84 National Map Corps #TNMC-3785

Brad Douglas wrote:

> In scanning through the --helps to see if the cygwin modules worked
> I found it got stuck on i.ortho.photo. I've now changed the main menu of
> that to use G_parser().
>
> (the i.ortho.photo menu could easily be rewritten BTW, it just lists 8
> programs and runs the one you ask for. But then the ones it calls will
> generally call I_ask() and want a interactive terminal, so there might
> be little gained in the short term..)

I had completed the majority of rewriting i.ortho.photo, but quit
working on it when it became clear that there was no consensus as to
whether I should A) break it up into 6-7 separate modules or B) a single
module with an 'option='. (My tree is full of incomplete work :slight_smile:

or C) delete it, then bang your head against a hard surface until
you've forgotten that it ever existed in the first place.

i.ortho.photo is the 100-tonne anchor weighing down GRASS. When
considering any non-trivial API change, the first question is always:
does i.ortho.photo rely upon existing behaviour? If it does, then the
change isn't going to happen. If it doesn't, then the worst that can
happen is that you merely have to re-write everything except
i.ortho.photo.

Oddly enough (not!), most of the lesser "anchors" are also to be found
in the imagery directory.

I've been looking at the work involved in updating the graphics API to
something more useful. The main issue isn't writing a new API, but
modifying existing clients to make use of it. In terms of existing
usage of the R_* functions, the top 10 users are:

     79 imagery/i.ortho.photo/photo.2image
     72 imagery/i.vpoints
     69 imagery/i.ortho.photo/photo.2target
     63 imagery/i.points
     45 imagery/i.class
     38 display/d.vect
     32 display/d.histogram
     27 display/d.profile
     19 imagery/i.ask
     18 raster/r.le/r.le.setup

In spite of the "d." prefix being intended for display modules, the
first d.* module (d.vect) is in 6th place, behind 5 imagery modules (2
of which are part of i.ortho.photo).

The above is limited to modules; for libraries, the statistics
are:

     78 lib/display
     25 lib/raster
     15 lib/D

Yep, photo.2image is a heavier user of the raster library than
lib/display.

In summary, unless we can either find a very dedicated volunteer, or
are willing to accept much of i.* being dumped altogether, we're stuck
with the existing graphics API.

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

If it's any help, I've already written pure TclTk replacements for
    i.vpoints
    i.points
    d.profile

Also, r.li.* looks to be replacing r.le.* soon.

I'd like to replace d.histogram with wx.Python in the new GUI.

Probably the i.orthophoto modules can be replace with GUI versions in the
same way I did with the georectifier.

Michael

On 2/15/07 6:44 AM, "Glynn Clements" <glynn@gclements.plus.com> wrote:

I've been looking at the work involved in updating the graphics API to
something more useful. The main issue isn't writing a new API, but
modifying existing clients to make use of it. In terms of existing
usage of the R_* functions, the top 10 users are:

     79 imagery/i.ortho.photo/photo.2image
     72 imagery/i.vpoints
     69 imagery/i.ortho.photo/photo.2target
     63 imagery/i.points
     45 imagery/i.class
     38 display/d.vect
     32 display/d.histogram
     27 display/d.profile
     19 imagery/i.ask
     18 raster/r.le/r.le.setup

In spite of the "d." prefix being intended for display modules, the
first d.* module (d.vect) is in 6th place, behind 5 imagery modules (2
of which are part of i.ortho.photo).

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

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

Michael Barton wrote:

If it's any help, I've already written pure TclTk replacements for
    i.vpoints
    i.points
    d.profile

Also, r.li.* looks to be replacing r.le.* soon.

I'd like to replace d.histogram with wx.Python in the new GUI.

Probably the i.orthophoto modules can be replace with GUI versions in the
same way I did with the georectifier.

I'm sure it can be done; it's just likely to be a lot of work.

The main problem with the imagery stuff, AFAICT, is that it consists
largely of "GUI applications", using a mix of libraster and vask as
the UI toolkit. There are better toolkits available.

The same applies to v.digit, although it isn't as much of a
monstrosity as i.ortho.photo (OTOH, it's probably more critical).

Isn't there a FOSS vector drawing package (i.e. CorelDraw imitation)
or CAD package which can export to something which OGR can import? If
there is, I would expect that it would provide a better user
experience than something which we can put together with our rather
limited manpower.

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

There is Inkscape, which does SVG. But the problem with this and CAD
packages is that they aren't automatically georeferenced. And doing this
post hoc can lead to problems occasionally. But it IS a lot easier to work
with.

Michael

On 2/15/07 1:50 PM, "Glynn Clements" <glynn@gclements.plus.com> wrote:

Isn't there a FOSS vector drawing package (i.e. CorelDraw imitation)
or CAD package which can export to something which OGR can import? If
there is, I would expect that it would provide a better user
experience than something which we can put together with our rather
limited manpower.

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

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

Michael Barton wrote:

There is Inkscape, which does SVG. But the problem with this and CAD
packages is that they aren't automatically georeferenced. And doing this
post hoc can lead to problems occasionally. But it IS a lot easier to work
with.

Would it help if there was some way to pre-generate a "template" file?

E.g. if you started with a file containing an existing map (or even
just a grid) using geographic coordinates, would you then be able to
easily add data using the same coordinate system?

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

I haven't used Inscape enough to know if this is workable or not. Nice idea.

Michael

On 2/15/07 5:57 PM, "Glynn Clements" <glynn@gclements.plus.com> wrote:

Michael Barton wrote:

There is Inkscape, which does SVG. But the problem with this and CAD
packages is that they aren't automatically georeferenced. And doing this
post hoc can lead to problems occasionally. But it IS a lot easier to work
with.

Would it help if there was some way to pre-generate a "template" file?

E.g. if you started with a file containing an existing map (or even
just a grid) using geographic coordinates, would you then be able to
easily add data using the same coordinate system?

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

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

Glynn Clements wrote:

> There is Inkscape, which does SVG. But the problem with this and CAD
> packages is that they aren't automatically georeferenced. And doing this
> post hoc can lead to problems occasionally. But it IS a lot easier to work
> with.

Would it help if there was some way to pre-generate a "template" file?

E.g. if you started with a file containing an existing map (or even
just a grid) using geographic coordinates, would you then be able to
easily add data using the same coordinate system?

Nope. I've had a look at Inkscape; at a user level, it operates
entirely in user coordinates, i.e. after mapping the bounding box to
the "page".

Realistically, I think that a 2D CAD package would be more likely to
be suitable, but I don't know of any free ones.

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

On Fri, February 16, 2007 17:45, Glynn Clements wrote:

Realistically, I think that a 2D CAD package would be more likely to
be suitable, but I don't know of any free ones.

http://www.qcad.org/qcad.html
(see http://www.qcad.org/qcad_doc_faq.html#36 ff for licensing)

http://www.pythoncad.org/

Moritz

Moritz Lennert wrote:

> Realistically, I think that a 2D CAD package would be more likely to
> be suitable, but I don't know of any free ones.

http://www.qcad.org/qcad.html
(see http://www.qcad.org/qcad_doc_faq.html#36 ff for licensing)

Requires Qt 3.x, the native Windows version of which isn't free. I
suppose that you could build it for Cygwin.

http://www.pythoncad.org/

  PythonCAD is a CAD package written, surprisingly enough, in
  Python. The PythonCAD project aims to produce a scriptable,
  open-source, easy to use CAD package for Linux, the various
  flavors of BSD Unix, commercial Unix, and other platforms to
  which someone who is interested ports the program.

I take that as meaning "doesn't work on Windows yet"; also, uses PyGTK
(rather than wxPython), and generally doesn't seem particularly
mature.

OTOH, v.digit doesn't work natively on Windows either.

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

Glynn Clements wrote:

> > Realistically, I think that a 2D CAD package would be more likely to
> > be suitable, but I don't know of any free ones.
>
> http://www.qcad.org/qcad.html
> (see http://www.qcad.org/qcad_doc_faq.html#36 ff for licensing)

Requires Qt 3.x, the native Windows version of which isn't free. I
suppose that you could build it for Cygwin.

It turns out that you can, but the GPL version doesn't support
polylines, which is probably a fairly major omission for a potential
v.digit replacement.

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

Glynn Clements wrote:

Moritz Lennert wrote:

Realistically, I think that a 2D CAD package would be more likely to
be suitable, but I don't know of any free ones.

http://www.qcad.org/qcad.html
(see http://www.qcad.org/qcad_doc_faq.html#36 ff for licensing)

Requires Qt 3.x, the native Windows version of which isn't free.

As of 2006/03/20, Qcad was ported to QT 4 [1].

Qt 4 license allows for Open Source developement on Windows [2].

[1]http://www.qcad.org/qcad_doc_changelog.html
[2]http://www.trolltech.com/company/newsroom/announcements/00000209

Maciek

Maciej Sieczka wrote:

>>> Realistically, I think that a 2D CAD package would be more likely to
>>> be suitable, but I don't know of any free ones.
>> http://www.qcad.org/qcad.html
>> (see http://www.qcad.org/qcad_doc_faq.html#36 ff for licensing)
>
> Requires Qt 3.x, the native Windows version of which isn't free.

As of 2006/03/20, Qcad was ported to QT 4 [1].

However, that version (2.1.0.0) still isn't available under the GPL
yet (the most recent GPL version is 2.0.5.0).

But the lack of polyline support in the GPL version is probably fatal
in terms of using QCad as a v.digit replacement. AFAICT, the omission
is intentional, to encourage users to purchase the full version.

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

Glynn Clements wrote:

Maciej Sieczka wrote:

Realistically, I think that a 2D CAD package would be more likely to
be suitable, but I don't know of any free ones.

http://www.qcad.org/qcad.html
(see http://www.qcad.org/qcad_doc_faq.html#36 ff for licensing)

Requires Qt 3.x, the native Windows version of which isn't free.

As of 2006/03/20, Qcad was ported to QT 4 [1].

However, that version (2.1.0.0) still isn't available under the GPL
yet (the most recent GPL version is 2.0.5.0).

But the lack of polyline support in the GPL version is probably fatal
in terms of using QCad as a v.digit replacement.

Glynn,

Getting back to your previous "not enough manpower for v.digit"
argument, please note that there is already a nice v.digit replacement
in QGIS 0.8:

1. it does all that v.digit does + more
2. is actively maintained (!), mainly by Radim Blazek
3. QGIS treats GRASS vectors as any other OGR ones - let's you query,
do thematic mapping, browse attribute table, measure area/distance,
reproject on-the-fly and stuff
4. QGIS 0.8 is based on Open Source QT 4
5. works natively on Windows, Linux, Mac (more?)

Maciek

Maciej Sieczka wrote:

>>>>> Realistically, I think that a 2D CAD package would be more likely to
>>>>> be suitable, but I don't know of any free ones.
>>>> http://www.qcad.org/qcad.html
>>>> (see http://www.qcad.org/qcad_doc_faq.html#36 ff for licensing)
>>> Requires Qt 3.x, the native Windows version of which isn't free.
>> As of 2006/03/20, Qcad was ported to QT 4 [1].
>
> However, that version (2.1.0.0) still isn't available under the GPL
> yet (the most recent GPL version is 2.0.5.0).
>
> But the lack of polyline support in the GPL version is probably fatal
> in terms of using QCad as a v.digit replacement.

Getting back to your previous "not enough manpower for v.digit"
argument, please note that there is already a nice v.digit replacement
in QGIS 0.8:

1. it does all that v.digit does + more
2. is actively maintained (!), mainly by Radim Blazek
3. QGIS treats GRASS vectors as any other OGR ones - let's you query,
do thematic mapping, browse attribute table, measure area/distance,
reproject on-the-fly and stuff
4. QGIS 0.8 is based on Open Source QT 4
5. works natively on Windows, Linux, Mac (more?)

So why are we still maintaining v.digit?

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

On Mon, 2007-02-19 at 01:59 +0000, Glynn Clements wrote:

Maciej Sieczka wrote:

> >>>>> Realistically, I think that a 2D CAD package would be more likely to
> >>>>> be suitable, but I don't know of any free ones.
> >>>> http://www.qcad.org/qcad.html
> >>>> (see http://www.qcad.org/qcad_doc_faq.html#36 ff for licensing)
> >>> Requires Qt 3.x, the native Windows version of which isn't free.
> >> As of 2006/03/20, Qcad was ported to QT 4 [1].
> >
> > However, that version (2.1.0.0) still isn't available under the GPL
> > yet (the most recent GPL version is 2.0.5.0).
> >
> > But the lack of polyline support in the GPL version is probably fatal
> > in terms of using QCad as a v.digit replacement.
>
> Getting back to your previous "not enough manpower for v.digit"
> argument, please note that there is already a nice v.digit replacement
> in QGIS 0.8:
>
> 1. it does all that v.digit does + more
> 2. is actively maintained (!), mainly by Radim Blazek
> 3. QGIS treats GRASS vectors as any other OGR ones - let's you query,
> do thematic mapping, browse attribute table, measure area/distance,
> reproject on-the-fly and stuff
> 4. QGIS 0.8 is based on Open Source QT 4
> 5. works natively on Windows, Linux, Mac (more?)

So why are we still maintaining v.digit?

Because QGIS is not part of GRASS?

Until all other modules that require interactivity (i.ortho.photo,
i.vpoints, i.cca, i.spectral and others come to mind) are "ported"
there's no reason to not support v.digit unless it's broken.

No matter how much you may not like it, there are parts of GRASS that
*require* interactive input.

FWIW, I think offloading to another package or removing imagery support
is shortsighted. GRASS would become useless to me for the majority of
my work.

--
Brad Douglas <rez touchofmadness com> KB8UYR/6
Address: 37.493,-121.924 / WGS84 National Map Corps #TNMC-3785

Maciej Sieczka wrote:
> Getting back to your previous "not enough manpower for v.digit"
> argument, please note that there is already a nice v.digit
> replacement in QGIS 0.8:

Glynn Clements wrote:

So why are we still maintaining v.digit?

because it doesn't cost us much in development time to maintain and it
gives us a mostly functional solution now.

* QGIS would be a very big (too big?) new dependancy,
* the two projects have different focus, goals, & target audiences,
* at that point the debate could(should) easily morph into why we need
   our own GUI at all.

But side stepping those questions,

If the v.digit replacement must be some full featured 2D CAD program,
and we don't want to write our own, then we might as well use QGIS.
Qcad is functional, but I wouldn't say I enjoy using it. No idea about
PythonCAD, but it would be interesting to try. If it is simple enough
maybe we could rip out the core and port it to GRASS.

If all we need is something simple, I don't think it is too far beyond
our reach to write a working v.digit replacement, preferably using
Python + SWIG. Maybe Jachym already has a prototype?? I don't see it
being /that/ hard of a chore. Especially if we start out with digitizing
new maps over raster backdrops, but not allow editing of existing data.
(gui creates v.out.ascii standard format or r.in.poly format)

Anyway, because of the QGIS solution I consider the v.digit replacement
to be a low WxPython priority. Perhaps with the experience & SWIG
maturity that will come from porting the other GUIs we can revisit the
problem after the other components are done & more easily write our own
digitizer then. Or at least be in a better position to decide.

Hamish

Brad,

These are 2 different issues actually, though related.

The first has to do with interactive use generally. GRASS absolutely
requires interactive use. I couldn't agree more. AFAIC, any useable,
full-featured GIS package should permit the user to directly manipulate
geospatial data. In fact, the more and richer interaction the better for me.

The question on interactive use is how best to program this. While you
probably know much of the following, it seems a good time to review to the
list the trajectory for getting such interactivity in GRASS. Dating back to
its use on Unix workstations of the 1980's, GRASS managed this through: 1)
question and reply text sent to a terminal window and 2) in an old-style
graphics xterminal that involved a combination of on-screen menus,
question/reply in text, and key/mouse button combinations. Any interaction a
module needed was programmed into it in C.

We now have a much richer suite of interaction tools to use if we employ
interface design packages like TclTk, GTK, QT, wx.Widgets, and wx.Python.
However, to use them, we either have to 1) rewrite all GRASS modules that
need interaction to call the programming language and libraries of these
packages (e.g., TclTk C libraries, C++ for QT or wx.Widgets, Python for
wx.Python), or 2) create the interaction independently in a GUI platform and
have it interface to GRASS via shell calls to existing GRASS C modules.
Given the development team's programming resources and expertise (limited
and almost exclusively in C), option 2 seems like the most realistic way to
approach this. However, to make all GRASS functions accessible (and
accessible interactively where appropriate) to an independent GUI platform,
GRASS modules must be scriptable--i.e., it must be possible to 'turn off'
any interaction built into the GRASS C modules. Otherwise, they cannot be
used in an independent GUI platform.

Counterintuitively, we can make GRASS much more interactive only by making
it possible to completely turn off any interaction built into the functional
modules that make up GRASS. For some modules, this is pretty easy. For
others, like v.digit and i.ortho.photo, it is more difficult.

V.digit specifically is the second issue. For convenience and to ensure that
there is always a tool to create and edit GRASS files, a digitizing package
built into or accompanying GRASS is highly desirable. However, Glynn's point
questioning the current team's ability to create and support such a package
is well taken. If something like v.edit can be further developed, it may
make this possible. But we are not there yet and it will require
considerable work to make it function as we need it to. QGIS may offer
another alternative. It is farther along, but still has a way to go (at
least on my Mac). As I recently said to Glynn offlist, a third possibility
that might be almost as desirable would be if someone in the OSGEO world
decided to create a multi-platform, multi-format, dedicated digitizing
package that could create and edit various OS GIS files.

We enough rambling.

Michael

On 2/18/07 8:27 PM, "Brad Douglas" <rez@touchofmadness.com> wrote:

So why are we still maintaining v.digit?

Because QGIS is not part of GRASS?

Until all other modules that require interactivity (i.ortho.photo,
i.vpoints, i.cca, i.spectral and others come to mind) are "ported"
there's no reason to not support v.digit unless it's broken.

No matter how much you may not like it, there are parts of GRASS that
*require* interactive input.

FWIW, I think offloading to another package or removing imagery support
is shortsighted. GRASS would become useless to me for the majority of
my work.

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

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

Hamish wrote:

> > Getting back to your previous "not enough manpower for v.digit"
> > argument, please note that there is already a nice v.digit
> > replacement in QGIS 0.8:

Glynn Clements wrote:
> So why are we still maintaining v.digit?

because it doesn't cost us much in development time to maintain

The issue isn't maintaining v.digit, but everything beneath it.

If we keep v.digit (etc), we have to keep R_get_location_with_* and
R_panel_*, which means that we have to keep XDRIVER, and the existing
libdriver and libraster, which in turn ties down the structure of the
PNG driver and direct rendering, which in turn ties down the rest of
d.*.

An example: you have a function to draw a box (filled rectangle):

[lib/pngdriver/pngdriver.h]

  extern void PNG_Box_abs(int,int,int,int);

[lib/pngdriver/Box.c]

  void PNG_Box_abs(int x1, int y1, int x2, int y2)
  {
    ...
  }

So, you have a function which draws a box, and its prototype.
Straightforward enough.

Now, suppose that you need that function within the existing graphics
architecture. Instead of the above, you end up with:

[include/raster.h]

  void R_box_abs(int,int,int,int);

[lib/raster/com_proto.c]

  void R_box_abs(int x1, int y1, int x2, int y2)
  {
    trans->box_abs(x1, y1, x2, y2);
  }

[lib/raster/transport.h]

  extern void LOC_box_abs(int x1, int y1, int x2, int y2);
  
  extern void REM_box_abs(int x1, int y1, int x2, int y2);
  
  struct transport
  {
    ...
    void (*box_abs)(int, int, int, int);
    ...
  };

[lib/raster/com_io.c]

  struct transport loc_trans =
  {
    ...
    LOC_box_abs,
    ...
  };
  
  #ifdef HAVE_SOCKET
  
  struct transport rem_trans =
  {
    ...
    REM_box_abs,
    ...
  };
  
  #endif

[lib/raster/loc_proto.c]

  void LOC_box_abs(int x1, int y1, int x2, int y2)
  {
    COM_Box_abs(x1, y1, x2, y2);
  }

[lib/raster/rem_proto.c]

  void REM_box_abs(int x1, int y1, int x2, int y2)
  {
    _send_ident(BOX_ABS);
    _send_int(&x1);
    _send_int(&y1);
    _send_int(&x2);
    _send_int(&y2);
  }

[include/graphics.h]

  #define BOX_ABS 48

[lib/driver/command.c]

      case BOX_ABS:
    REC(&l, sizeof l);
    REC(&t, sizeof t);
    REC(&r, sizeof r);
    REC(&b, sizeof b);
    COM_Box_abs(l, t, r, b);
    break;

[lib/driver/Box.c]

  void COM_Box_abs(int x1, int y1, int x2, int y2)
  {
    int x[4], y[4];
  
    if (driver->Box_abs)
    {
      (*driver->Box_abs)(x1, y1, x2, y2);
      return;
    }
  
    x[0] = x1; y[0] = y1;
    x[1] = x1; y[1] = y2;
    x[2] = x2; y[2] = y2;
    x[3] = x2; y[3] = y1;
  
    COM_Polygon_abs(x, y, 4);
  }

[lib/driver/driver.h]

  struct driver
  {
    void (*Box_abs)(int,int,int,int);
    ...
  }

[lib/pngdriver/pngdriver.h]

  extern void PNG_Box_abs(int,int,int,int);

[display/drivers/PNG/main.c]

  int main(int argc, char **argv)
  {
    static struct driver drv;
  
    drv.Box_abs = PNG_Box_abs;
    ...
  }

[lib/pngdriver/Box.c]

  void PNG_Box_abs(int x1, int y1, int x2, int y2)
  {
    ...
  }

[display/drivers/XDRIVER/XDRIVER.h]

  extern void XD_Box_abs(int,int,int,int);

[display/drivers/XDRIVER/main.c]

  int main(int argc, char **argv)
  {
    struct driver drv;
  
    drv.Box_abs = XD_Box_abs;
    ...
  }

[display/drivers/XDRIVER/Box.c]

  void XD_Box_abs(int x1, int y1, int x2, int y2)
  {
    ...
  }

If you want to add another graphics primitive (or other operation),
you need to add equivalents to all of the above for each one. If you
want to change the prototype (e.g. add another parameter), you have to
change most of the above.

At present, lib/{raster,driver,pngdriver} and display/drivers/*
consist of 135 files, totalling 13066 lines and ~300KB. And between
them, they do very little: rectangle, polyline, polygon, dots, raster,
and text, with the bare minimum of options (it isn't exactly
SVG/OpenGL/PostScript).

And given the "magnification" of effort required to enhance it in any
way, it's likely to stay that way. All of the work I've done recently
has basically been cleaning it up in the hope of making it easier to
migrate away from.

and it
gives us a mostly functional solution now.

* QGIS would be a very big (too big?) new dependancy,
* the two projects have different focus, goals, & target audiences,
* at that point the debate could(should) easily morph into why we need
   our own GUI at all.

But side stepping those questions,

If the v.digit replacement must be some full featured 2D CAD program,
and we don't want to write our own, then we might as well use QGIS.
Qcad is functional, but I wouldn't say I enjoy using it. No idea about
PythonCAD, but it would be interesting to try. If it is simple enough
maybe we could rip out the core and port it to GRASS.

If all we need is something simple, I don't think it is too far beyond
our reach to write a working v.digit replacement, preferably using
Python + SWIG. Maybe Jachym already has a prototype?? I don't see it
being /that/ hard of a chore. Especially if we start out with digitizing
new maps over raster backdrops, but not allow editing of existing data.
(gui creates v.out.ascii standard format or r.in.poly format)

Right. In spite of my comments about limited manpower, if there's one
thing which is bound to be more primitive than something which we have
to maintain ourselves, it's something which we have to maintain
ourselves *and* which uses lib/raster as its GUI toolkit.

[Incidentally, if v.digit goes, we can also abandon lib/form.
d.what.vect uses it, but only because its already there; it wouldn't
be worth maintaining it for d.what.vect alone.]

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