trouble with s.in.ascii

LWA Albuquerque abq at lwasf.com
Mon Sep 18 12:29:31 EDT 2000



On Mon, 18 Sep 2000 mlennert at club.worldonline.be wrote:

> Hello,
>
> I have trouble trying to import a simple ascii site file (X Y) into Grass5b8.
> Using s.in.ascii I always get the error message: "WARNING: error scanning
> floating point attribute".
>
> What am I doing wrong ?

I'm new to Grass, and had the same problem the first time I tried using
s.in.ascii (Grass 5beta7 compiled with EGCS 2.91.60 using glibc2).  If
your problem has the same cause as mine, then there's a simple fix.  The
manual page for s.in.ascii omits a fairly important detail of the ascii
sites file format.  I think the format may be more completely documented
elsewhere in the manual pages.  What follows I got from the source code.

Each line of the ascii input file should contain either two or three
coordinates (x,y and optionally z) separated by a user-selectable
field-delimiting character.  After the coordinates there are optional
attribute fields separated from the coordinates and from each other with
the same user-selectable field delimiter.

The attribute field may be a category number, a decimal value or a string.
Category numbers must be preceded by the "#" character and string values
must be preceded by the "@" character.  Floating point values may be
preceded by the "%" character but if there is no "#" or "@" preceding the
attribute then it is assumed to be a floating point value.  Also, string
values that contain blanks must be quoted or the part of the string
following the first blank will be parsed as a separate field, which may
cause an error.

I received the error you describe by 1) not using the "@" symbol before a
string attribute (causing it to be parsed as a floating point value) and
2) not quoting the string, causing the second and later words of the
string to be parsed as separate fields.

I think the best way to avoid further problems with this would be to
either include more complete description of the format in the manual page
for s.in.ascii or to provide a reference in the s.in.ascii man page to the
page that does contain the complete description.

As I said, I'm quite new at Grass so please correct me if I'm wrong.


Roger Miller




More information about the grass-user mailing list