[GRASS-dev] Extracting a subset from a set of (vector) points

Hamish hamish_nospam at yahoo.com
Thu Jan 25 17:42:56 EST 2007


Damiano Triglione wrote:
> Hi,
> I need to extract, from a vector points file, a subset of points,
> according  to the IDs listed (after a sort) in another ASCII files,
> "indexes". I thought it was a good idea to create a proper ASCII file
> containing ID east north
> of the entire data set (using v.out.ascii, awk and sort) and then use
> the  coreutils "join" to find the matches.

Did you try "sort -n"?

> Unfortunately, join works in a weird ways when the join field is
> numerically and the numbers, even if sorted (!), have different
> lengths. What I mean is this:
> if all the IDs have the same length (example: 2 digits), then join
> works  perfectly; while if I have the following indexes list:
> 1
> 2
> 8
> 10
> 12
> then join passes to analyze 10 and 12 only after having analyzed 8!
> I tried a different sorting, for example
> 1
> 10
> 12
> 2
> 8


Hamish




More information about the grass-dev mailing list