Geography Reference
In-Depth Information
> v.in.ascii input=earthquakes_delim.txt output=earthquakes skip=2 \
x=4 y=3 cat=0 columns="event_date date, event_time varchar(10), \
lat double precision, lon double precision, depth double precision, \
magnitude double precision"
Maximum input row length: 57
Maximum number of columns: 6
Minimum number of columns: 6
column: 1
type: string
length: 10
column: 2
type: string
length: 10
column: 3 type: double
column: 4 type: double
column: 5 type: double
column: 6 type: double
Building topology ...
12035 primitives registered
Building areas:
100%
0 areas built
0 isles built
Attaching islands:
Attaching centroids:
100%
Topology was built.
Number of nodes
:
11938
Number of primitives:
12035
Number of points
:
12035
Number of lines
:
0
Number of boundaries:
0
Number of centroids :
0
Number of areas
:
0
Number of isles
:
0
The options to the v.in.ascii command are explained in the GRASS man-
ual, but basically apart from the input and output names, we told the
command to skip the first two lines since they are header lines and
that our x coordinate is in column 4 and the y coordinate is in column
3 of the input file. We also specified cat=0 to indicate we wanted GRASS
to create an ID column for us. If the input file had a suitable ID field,
we would have used it by specifying its column number with the cat
option.
Notice that we didn't specify the | delimiter when using v.in.ascii . That's
because it is the default delimiter. If we had used a different delimiter
when preparing the text file, we would need to use the fs parameter to
specify it.
Once we have our new earthquakes layer imported into GRASS, we can
symbolize it by magnitude to see where in Alaska we shouldn't live. In
Figure 8.3 , on the following page, you can see a portion of southcentral
Alaska with the earthquakes symbolized by magnitude.
 
 
Search WWH ::




Custom Search