Vect to Ascii

James Darrell McCauley mccauley at ecn.purdue.edu
Thu Oct 13 03:55:37 EDT 1994


Joe Leone (Joe.Leone at per.dwe.csiro.au) writes on 13 Oct 94:
>
>% > Joe Leone (Joe.Leone at per.dwe.csiro.au) writes on 11 Oct 94:
>% > >I am trying to import map layers into a Graphic/Map package. The
>% > >required import format is simialr to that produced by v.out.ascii ,
>% > >but not close enough :-( .  
>% > >The format I require is as follows:- > >
>% > >unique identifier x,y co-ordinate of pt within the polygon # of nodes
>% > >(vertecies)

to which I responded:

>% > it should not be too difficult to modify v.out.ascii to do this.

Joe goes on to add:

> I have discovered that the graphics part of the package that I whant
> to use is a PC based thing called QUICKMAP, apparently used in a
> number of PC packages.  So the question I am really asking is;
> Does/has anybody use QUICKMAP and/or exported files from GRASS to
> QUICKMAP. The file extension it uses is .PGN.

Joe,
 I've hacked v.out.ascii so that it writes areas (polygons)
and not area edges. The hack ignored all other types of
vectors (lines, points, and all dead areas/lines/points).
It creates a new mapset element: dig_export.

I've put it on 
ftp://pasture.ecn.purdue.edu/pub/mccauley/grass/v.out.quickmap.tar.gz
but there's one catch: I've left the determination of
	"x,y co-ordinate of pt within the polygon"
unfinished. Just a quick exercise in geometry. Also see
the function dig_point_in_area() in the Programmers' Manual
(it's in Chapter 13, page 176 in my version). It tells you
whether a point is IN or OUT of an area.

If you are not a programmer and completing this utility is an
impossible task, ask!  I'm sure that someone else on this list could
finish it fairly quickly.  It's only 182 lines of C in two files;
main.c and wrtearea.c.  I've left bread crumbs in wrtearea.c showing
where more needs to be added.

There's also a man page there - whoever finishes be sure to
add your name to the AUTHOR section.

Best wishes and good luck,

--Darrell
James Darrell McCauley, Purdue Univ, West Lafayette, IN 47907-1146, USA
mccauley at ecn.purdue.edu, mccauley%ecn at purccvm.bitnet, pur-ee!mccauley
http://soils.ecn.purdue.edu/~mccauley



More information about the grass-user mailing list