[GRASSLIST:4102] Re: dynamic modeling advice? II

Alex Thorn amthorn1979 at yahoo.com
Thu Jul 18 15:30:29 EDT 2002


> > The idea of fast vector manipulation is
> interesting to
> > me, but I'm wondering how easy it would be to
> export
> > the results in an ascii format, so that it could
> be
> > read by the C program that is currently the core
> of
> > my model.
> 
> Why should be ascii export problem? 

I don't know.  I haven't messed with vector
representations much.  I thought I'd read something
about v.out.ascii not working the same way as
r.out.ascii.  Perhaps I misread something.

> But it isn't
> necessary.
> If you want to use GRASS only as GIS part of your
> model
> (and do not need GIS-independent intermediate
> format), 
> you can write it as GRASS module and read/write
> directly
> GRASS files.

I had posted on GRASSLIST a while back asking for
advice on writing dynamic models using GRASS and
several people responded indicating that the easiest
way to do this is to write a script that will pass
data back and forth between GRASS and another program
that does the work of the model.  Because it seemed
to be the recommended technique, it has been the
approach that I have been using so far.  I would 
probably need to learn a lot more about the guts of
GRASS work before attempting the approach that you
suggest, but perhaps I will give it a try once I've
gotten a working version of the model using the 
scripting technique.


> > > (i run test now: 8s/340000 lines; i think, it
> was
> > > about 3h in grass50)
> >
> > What were you testing?  Are these lines of a GRASS
> > script?
> 
> No, it is number of lines in vector file and time of
> v.build
> (v.support).

I see.  You're saying that what takes 3 hours in
GRASS50 takes just 8 seconds in GRASS51?  When I first
read your description of the test I thought you were
talking about a multi-step model taking 3 hours at a 
rate of 8 seconds per step.  Wasn't thinking about 
things from the right perspective, I guess.

> >  Would this
> > code need to be added to the actual GRASS source
> code?
> 
> This code may be your custom GRASS module. For
> compilation 
> you need GRASS sources.

Ok.

> 
> > I haven't actually figured out how to compile
> GRASS
> > from the source, and have been using precompiled
> > binaries.  Should I try to work on learning how to
> > compile from source, or is that more trouble than
> it
> > is worth (I note that I would also have to compile
> > from source if I was going to use GRASS51 at all:
> the
> > binaries are evidently not yet available).
> 
> Compilation should be easy (./configure, make) but
> you need to learn
> how to write grass module - easy way is to copy and
> modify existing
> module. 

I do not remember the steps that I took the first time
that I tried to compile GRASS from source.  I remember
that the compiler was having a lot of trouble finding
important files, and I think that I eventually got
frustrated and gave up.  Perhaps it would be easier
for me now that I am more accustomed to the Linux
environment.  I'll give it another try one of these 
days...

Thanks for your help.  I will definitely take your
suggestions into consideration.  I'd be interested 
though, to hear what others might have to say about 
your suggestion of writing a new module for my 
purposes, since it did not seem to be the 
recommendation that I was getting before.

Cheers,
Alex

__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com



More information about the grass-user mailing list