[GRASS5] g51: v.surf.rst

Hi,

I updated rst library and v.surf.rst (should replace [sv].surf.rst).
I have done some simple tests only, it would be nice if somebody could
try and compare results to rasters created in g50 - should be identical.

Note that point (sites) vector may be created by v.in.ascii by
piping points as 'x|y[|z][|cat]' to v.in.ascii without 'input=' option.

Z values may be read from:
1) z coordinates in 3D file ('field=0')
2) from category value
3) from db table ('zcol=name'), smooth may be specified by 'scol'

Radim

Radim Blazek wrote:

Hi,

I updated rst library and v.surf.rst (should replace [sv].surf.rst).
I have done some simple tests only, it would be nice if somebody could
try and compare results to rasters created in g50 - should be identical.

Note that point (sites) vector may be created by v.in.ascii by
piping points as 'x|y[|z][|cat]' to v.in.ascii without 'input=' option.

Z values may be read from:
1) z coordinates in 3D file ('field=0')
2) from category value
3) from db table ('zcol=name'), smooth may be specified by 'scol'

We have most of our site files as
705788.570298|10445.067053|#1 %-0.94

so I assume that we should run it through awk to get x y z and then use
v.in.ascii
Option 3 is good for any new data that I may have as they often come in
db tables.

If I want to run it with contour data in vector format, do I just run
v.convert ?

Writing new man pages will be a lot of work but to get others started
maybe
if you could just link the command description (just to see the flags
and options)
to the table at
http://freegis.org/cgi-bin/viewcvs.cgi/~checkout~/grass51/doc/vector/v.modules.html
or add a "mini manual" to the GRASS man page
http://grass.itc.it/gdp/html_grass5/index.html
so that people get some idea what is available before they download
GRASS5.1

In that table, you can put SG3d vector update as irrelevant -, that
module should be retired
for 5.1 (I used it for about than 10 years and loved it, but it runs
only on old SGI).

We have both 5.1 and GRASS5.0 experimental - should we just get an
update
to get the new v.surf.rst?

sorry for so many questions,

thank you

Helena

Radim

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

On Tuesday 01 October 2002 03:13 am, Helena wrote:
...

If I want to run it with contour data in vector format, do I just run
v.convert ?

Yes, then let v.surf.rst read z values from category. (v.convert doesn't
use spatial index yet, so it may take a long time for large files.)

Writing new man pages will be a lot of work but to get others started
maybe
if you could just link the command description (just to see the flags
and options)
to the table at
http://freegis.org/cgi-bin/viewcvs.cgi/~checkout~/grass51/doc/vector/v.modu
les.html or add a "mini manual" to the GRASS man page
http://grass.itc.it/gdp/html_grass5/index.html
so that people get some idea what is available before they download
GRASS5.1

Usually, it is obvious from otions (help) how module works. I don't have time
to write manuals. I hope that some user will do that (do not need to be
programmer).

In that table, you can put SG3d vector update as irrelevant -, that
module should be retired
for 5.1 (I used it for about than 10 years and loved it, but it runs
only on old SGI).

Updated.

We have both 5.1 and GRASS5.0 experimental - should we just get an
update
to get the new v.surf.rst?

cvs update + make

Radim

Radim,

Jaro got the v.surf.rst running and results look good, but for more complete
testing we need a little bit more info.
On the grass51 web site you have a list of modules that need to be updated, do
you also have a list
of modules that are already done and that you are currently working on (so that
we are not asking you too many questions?)
So far I have found the following

      v.ascii v.category v.convert v.surf.rst v.build v.clean
v.mapcalc

and I am writing draft man pages for them (you may expect more questions from
me).

Now, what command should I use to find the names of zcol and scol? With
v.category report I get only field 1
which is category, how do I get the info about elevation? Do you plan to write
something like v.info that would
give a comprehensive information about what is in the vector file? (something
like s.info?)

Any chance for v.surf.rst to read directly shape files (not really important,
but if it is easy to do it would be great,
most of the data that we get are either nasty mixed-up CAD data or shape files).

It is still kind of adventure to use grass51 because there is so little info
about it
and we still haven't figured out how to call grass5 commands from grass51, but
we will get there eventually.

thank you,

Helena

Hi all,

On Fri, Oct 04, 2002 at 09:32:31AM -0400, Helena Mitasova wrote:

Radim,

Jaro got the v.surf.rst running and results look good, but for more
complete testing we need a little bit more info. On the grass51 web site
you have a list of modules that need to be updated, do you also have a
list of modules that are already done and that you are currently working
on (so that we are not asking you too many questions?) So far I have found
the following

      v.ascii v.category v.convert v.surf.rst v.build v.clean
v.mapcalc

and I am writing draft man pages for them (you may expect more questions from
me).

To make things easier, is there a (simple) way to convert the XML output
from (e.g.)

v.category --interface-description

to HTML? Then writing pages would be somewhat more 'fun' as all this
parameter/flags formatting got automated. Probably this could be
added to the local Makefile, so that the HTML man pages consisted of

- part 1: autogenerated after (successful) compilation with
           --interface-description
- part 2: a manually written description with is attached to part 1

So all the extra work of changing part 1 (params/flags) weren't required.

Just an incomplete idea,

Markus

On Friday 04 October 2002 03:32 pm, Helena Mitasova wrote:

Radim,

Jaro got the v.surf.rst running and results look good, but for more
complete testing we need a little bit more info.
On the grass51 web site you have a list of modules that need to be updated,
do you also have a list
of modules that are already done and that you are currently working on (so
that we are not asking you too many questions?)

It is the same site:
http://freegis.org/cgi-bin/viewcvs.cgi/~checkout~/grass51/doc/vector/v.modules.html
Y = yes = updated, "Working on" = working on. May be is not clear from that
page, let me know what is confusing?

So far I have found the following

      v.ascii v.category v.convert v.surf.rst v.build v.clean
v.mapcalc

Just a note: I have here some other modules not yet commited:
v.distance, v.salesman, v.net, v.steiner

and I am writing draft man pages for them (you may expect more questions
from me).

Thank you a lot.

Now, what command should I use to find the names of zcol and scol? With
v.category report I get only field 1
which is category, how do I get the info about elevation?

'zcol' and 'scol' are names of columns in the database table, so you need
first some table with at least 2 columns like:
  cat(int) - some identifier used as link beteen vector and DB table
  zcol(double) - z values
then the connection must be defined in 'DB' file, see:
http://freegis.org/cgi-bin/viewcvs.cgi/~checkout~/grass51/doc/vector/vector.html#attr

Do you plan to
write something like v.info that would
give a comprehensive information about what is in the vector file?
(something like s.info?)

v.info must be updated, but it is not on the top of my list.

Any chance for v.surf.rst to read directly shape files (not really
important, but if it is easy to do it would be great,
most of the data that we get are either nasty mixed-up CAD data or shape
files).

Of course, you need just to define the vector as shapefile, see
g51test/test/vector/lake.shp/frmt in thr demo package. 3D shapefiles are not
yet supported, but it will be trivial as such files are supported by shapelib.
(BTW: may be, that there is some bug in shapefile support (v.build), but
currently I don't have time to fix it.)

It is still kind of adventure to use grass51 because there is so little
info about it
and we still haven't figured out how to call grass5 commands from grass51,
but we will get there eventually.

I don't know what is the correct way if any exists, you can run grass51 and
grass50 at the same time (carefully) or I use the script g50 which just sets
some variables and runs the command:
export PATH=/amd/ssi0/ssi/blazek/grass/dist.i686-pc-linux-gnu/bin:$PATH;
export GISBASE=/amd/ssi0/ssi/blazek/grass/dist.i686-pc-linux-gnu;
$*

so that I can run in g51 shell g50 commands, for example:
g50 d.sites

Radim

On Fri, Oct 04, 2002 at 04:27:09PM +0200, Radim Blazek wrote:

On Friday 04 October 2002 03:32 pm, Helena Mitasova wrote:

[...]

> Do you plan to write something like v.info that would give a
> comprehensive information about what is in the vector file? (something
> like s.info?)

v.info must be updated, but it is not on the top of my list.

Find it now in grass51/ CVS, I have updated it (to some extend, I did not
test with level1 data, but for level2 = topology it works more or less).

Cheers

Markus

PS: GRASS 5.1 vector programming is really much easier than for 5.0!
    Most relevant functions are there:
    lib/vector/Vlib/level_two.c
    Use doxygen to get a HTML representation:
    doxygen Doxyfile
    

On Sat, Oct 12, 2002 at 10:34:51AM +0200, Markus Neteler wrote:

PS: GRASS 5.1 vector programming is really much easier than for 5.0!
    Most relevant functions are there:
    lib/vector/Vlib/level_two.c
    Use doxygen to get a HTML representation:
    doxygen Doxyfile

I have started to add some doxygen-style function descriptions to
lib/vector/Vlib/level_two.c
and some other files. We should document all Vect_*() and
db_*() functions like that. Later on I'll implement a cronjob
to extract these docs onto the web site.

The (minimum) style of writing such docs is:

/*!
\fn int Vect_get_num_nodes (struct Map_info *map)
\brief get number of nodes
\return number of nodes
\param Map_info structure
*/

...pretty easy. Note the exclamation mark to "notify" doxygen to
interpret this comment. doxygen is available here (GPL):

or find it on your Linux distro.

Markus

Markus Neteler wrote:

> Jaro got the v.surf.rst running and results look good, but for more
> complete testing we need a little bit more info. On the grass51 web site
> you have a list of modules that need to be updated, do you also have a
> list of modules that are already done and that you are currently working
> on (so that we are not asking you too many questions?) So far I have found
> the following
>
> v.ascii v.category v.convert v.surf.rst v.build v.clean
> v.mapcalc
>
> and I am writing draft man pages for them (you may expect more questions from
> me).

To make things easier, is there a (simple) way to convert the XML output
from (e.g.)

v.category --interface-description

to HTML?

I can supply a converter, but it requires a Haskell compiler and
HaXml. No doubt, suitable libraries are available for other languages,
but HaXml is the only one with which I'm remotely familiar.

At present, a few of the generated HTML files would need to be edited
manually. E.g. "d.area --interface-description" produces:

  <description>
    Draws selected polygons to the GRASS display.
Colors may be:
  *) An X11 color name from rgb.txt
  *) A hexadecimal value -- "FFDF60")
  *) An RGB triplet -- "rgb(127 242 93)"

  </description>

This ends up as:

  <P> Draws selected polygons to the GRASS display. Colors may
      be: *) An X11 color name from rgb.txt *) A hexadecimal
      value -- "FFDF60") *) An RGB triplet -- "rgb(127 242 93)"
  </P>

Possible options include:

1. Changing the converter to insert <BR> tags; this assumes that line
breaks should always be preserved, which might not be right.

2. Changing the relevant modules to not rely upon formatting being
preserved.

3. Just manually editing the relevant HTML files.

Also, this exercise has pointed out a few modules which don't function
correctly in the presence of the --interface-description flag.

E.g. g.table.pg and m.in.stf1.tape just ignore the flag, but do write
stuff to stdout (programs which ignore the flag but don't write
anything to stdout result in an empty XML file, which is easy to
detect).

s.surf.rst almost works, but it writes the attribution message along
with the XML, which confuses the parser.

--
Glynn Clements <glynn.clements@virgin.net>

On Tue, Oct 15, 2002 at 10:42:40PM +0100, Glynn Clements wrote:

Markus Neteler wrote:

> > Jaro got the v.surf.rst running and results look good, but for more
> > complete testing we need a little bit more info. On the grass51 web site
> > you have a list of modules that need to be updated, do you also have a
> > list of modules that are already done and that you are currently working
> > on (so that we are not asking you too many questions?) So far I have found
> > the following
> >
> > v.ascii v.category v.convert v.surf.rst v.build v.clean
> > v.mapcalc
> >
> > and I am writing draft man pages for them (you may expect more questions from
> > me).
>
> To make things easier, is there a (simple) way to convert the XML output
> from (e.g.)
>
> v.category --interface-description
>
> to HTML?

I can supply a converter, but it requires a Haskell compiler and
HaXml. No doubt, suitable libraries are available for other languages,
but HaXml is the only one with which I'm remotely familiar.

Or write an XSL style sheet and use xsltproc... See for instance:

http://pweb.jps.net/~egm2/grass/xml/index.html

(Specifically, grass-task.xsl)

I think those do a fair job with the conversion, though some commands
are a bit uncooperative in the matter... :wink:

--
static const char signature =
  "Copyright (c) 2002 Eric G. Miller <egm2@jps.net>";