Trimble GPS input

I'm in need of some advice in modifying the v.in.ascii code in order to
correctly import some vector ascii files produced by the Trimble Ltd.
Pfinder software.

The format produced by Pfinder has an error; the coordinates come out
easting - northing instead of the northing - easting that v.in.ascii
requires. All other parts of the Pfinder produced ascii vector file
are correct.

I have heard that a simple adjustment of the v.in.ascii code (and
recompilation) can result in a version of v.in.ascii that will correctly
output a binary file from the flip-flopped coordinates. I have a message
in the my NPS counterpart that I heard this from, but am in need of a fast
response, and will GLADLY accept any advise that can be offered.

I have thought of trying an AWK script, but the structure of the ascii
vector file has the columns interrupted by line/area definitions and
number of vertices information, making a `simple' solution difficult.

Thanks!!

Ronald Thomas ront@meeker.cfnr.colostate.edu
Natural Resource Spec. (GIS) ^^^ Phone: 303-586-3565 x285
  Resources Management Division ^^ ^^^^^ FAX: 303-586-4702
   Rocky Mountain National Park ^^^ ^^^^^^^ Estes Park, CO 80517

Ronald Thomas (ront@niwot.CFNR.ColoState.EDU) writes on 22 Oct 93:

The format produced by Pfinder has an error; the coordinates come out
easting - northing instead of the northing - easting that v.in.ascii
requires. All other parts of the Pfinder produced ascii vector file
are correct.

I have heard that a simple adjustment of the v.in.ascii code (and
recompilation) can result in a version of v.in.ascii that will correctly

This may be all that is necessary:

% diff asc_to_bin.c asc_to_bin.c.old
81c81
< sscanf(buff, "%1c%lf%lf", &ctype, x, y) ;
---

                      sscanf(buff, "%1c%lf%lf", &ctype, y, x) ;

I have thought of trying an AWK script, but the structure of the ascii

piece of cake :slight_smile:

% awk '{if (NF == 2 && ($1 != "A" && $1 != "L" && $1 != "MAP" && $1 != "OTHER"
&& $1 != "ZONE:" )) printf " %s %s\n",$2,$1; else print $0}' file

Good luck (usual disclaimers apply - I just cooked these answers up in
2 minutes or so).

--Darrell

James Darrell McCauley, Purdue Univ, West Lafayette, IN 47907-1146, USA
mccauley@ecn.purdue.edu, mccauley%ecn@purccvm.bitnet, pur-ee!mccauley
*** avail. for full time employment 9/94-inquiries welcome (no hh, plz) ***