[GRASSLIST:8787] v.in.ascii help

Hi all, i would like to import in GRASS the following ascii file with
v.in.ascii and then convert it with v.to.rast

What is the correct syntax of the commands in order to import correctly?

UTMEast UTMNorth LandUse Soil texture Soil moisture NDVI
       582200. 3.93700e+006 10 4 0.284077 0.522864
       582200. 3.93680e+006 10 3 0.288844 0.468007
       582200. 3.93660e+006 10 3 0.283344 0.335329
       582200. 3.93640e+006 10 4 0.275129 0.295116
       582200. 3.93620e+006 6 3 0.253937 0.273246
       582200. 3.93600e+006 4 3 0.261889 0.270069
       582200. 3.93580e+006 10 4 0.302256 0.130456
       582200. 3.93560e+006 10 3 0.291805 0.208106
       582200. 3.93540e+006 10 3 0.287783 0.310229
       582200. 3.93520e+006 10 3 0.283377 0.224217
       582200. 3.93500e+006 6 3 0.271582 0.164878
       582200. 3.93480e+006 6 4 0.311506 0.174538

Thanks a lot

Giacomo

************************************************
   Giacomo Bertoldi
   Dept. of Civil and Environmental Engineering
   Duke University
   E-MAIL: bertoldi@duke.edu
************************************************
*

Hi all, i would like to import in GRASS the following ascii file with
v.in.ascii and then convert it with v.to.rast

What is the correct syntax of the commands in order to import
correctly?

UTMEast UTMNorth LandUse Soil texture Soil moisture NDVI
       582200. 3.93700e+006 10 4 0.284077 0.522864
       582200. 3.93680e+006 10 3 0.288844 0.468007
       582200. 3.93660e+006 10 3 0.283344 0.335329
       582200. 3.93640e+006 10 4 0.275129 0.295116
       582200. 3.93620e+006 6 3 0.253937 0.273246
       582200. 3.93600e+006 4 3 0.261889 0.270069
       582200. 3.93580e+006 10 4 0.302256 0.130456
       582200. 3.93560e+006 10 3 0.291805 0.208106
       582200. 3.93540e+006 10 3 0.287783 0.310229
       582200. 3.93520e+006 10 3 0.283377 0.224217
       582200. 3.93500e+006 6 3 0.271582 0.164878
       582200. 3.93480e+006 6 4 0.311506 0.174538

GRASS 6.0 you have to get rid of the first line, GRASS 6.1 you can use
"skip=1" to save the column titles to the map history, or start the
line with a '#' to skip past it.

v.in.ascii in=your_points.txt out=new_map x=1 y=2 skip=1 \
  columns='UTMEast double, UTMNorth double, LandUse int, Soil_textr int, Soil_moist double, NDVI double'

"columns" names are optional, but useful. DBF DB only lets you set
column names as 10 characters long, no spaces. Each point will be
assigned its own category.

query with d.what.vect to check

Hamish

Thanks for your help.

The importation command works:

  v.in.ascii in=/Users/giacomo/John/Kustas/LES/200july2_1.dat out=sm200july2 x=1 y=2 columns='UTMEast double, UTMNorth double, LandUse int, Soil_textr int, Soil_moist double, NDVI double' fs=' '

db.describe -c table=sm200july2

ncols:7
Column 1: cat
Column 2: UTMEast
Column 3: UTMNorth
Column 4: LandUse
Column 5: Soil_textr
Column 6: Soil_moist
Column 7: NDVI

Then I have still problems to make a raster at 200m resolution (sites are on a regular grid) I tried:

v.to.rast input=sm200july2 output=sm200july2_lu use=attr column=LandUse rows=4096

or:

v.to.rast in=sm200july2 out=sm200july2_lu col=LandUse

But I do have the error:

"Key column type is not integer"

Thanks, Giacomo

On 27 Oct 2005, at 21:11, Hamish wrote:

Hi all, i would like to import in GRASS the following ascii file with
v.in.ascii and then convert it with v.to.rast

What is the correct syntax of the commands in order to import
correctly?

UTMEast UTMNorth LandUse Soil texture Soil moisture NDVI
       582200. 3.93700e+006 10 4 0.284077 0.522864
       582200. 3.93680e+006 10 3 0.288844 0.468007
       582200. 3.93660e+006 10 3 0.283344 0.335329
       582200. 3.93640e+006 10 4 0.275129 0.295116
       582200. 3.93620e+006 6 3 0.253937 0.273246
       582200. 3.93600e+006 4 3 0.261889 0.270069
       582200. 3.93580e+006 10 4 0.302256 0.130456
       582200. 3.93560e+006 10 3 0.291805 0.208106
       582200. 3.93540e+006 10 3 0.287783 0.310229
       582200. 3.93520e+006 10 3 0.283377 0.224217
       582200. 3.93500e+006 6 3 0.271582 0.164878
       582200. 3.93480e+006 6 4 0.311506 0.174538

GRASS 6.0 you have to get rid of the first line, GRASS 6.1 you can use
"skip=1" to save the column titles to the map history, or start the
line with a '#' to skip past it.

v.in.ascii in=your_points.txt out=new_map x=1 y=2 skip=1 \
  columns='UTMEast double, UTMNorth double, LandUse int, Soil_textr int, Soil_moist double, NDVI double'

"columns" names are optional, but useful. DBF DB only lets you set
column names as 10 characters long, no spaces. Each point will be
assigned its own category.

query with d.what.vect to check

Hamish

************************************************
   Giacomo Bertoldi, Ph.D.
   Dept. of Civil and Environmental Engineering
   Duke University
   E-MAIL: bertoldi@duke.edu
************************************************