[GRASS-user] v.in.ascii incorrect boundaries

Hamish hamish_nospam at yahoo.com
Wed Jul 25 22:42:10 EDT 2007


Morten Sickel wrote:
> I am trying to define a map using v.in.ascii. The map is basically a
> few squares in the northern atlantic ocean defined in Lat lon, So I
> have made this input file:
[...]
> 
> and then I save it at Havomrder.txt and import it using
> 
> v.in.ascii --o  input=Havomrder.txt output=hav fs=' ' format=standard
> 
> and get the following messages:
> 
> Building topology ...
> 4 primitives registered      
[...]
> Number of incorrect boundaries   :   2
> Number of areas without centroid :   2
> 
> I thought I should have gotten 4 areas build and no isles and I do not
> understand why I get the two last lines. Does it matter if I define
> the areas CW or CCW?

no.

> I have tried to remove the .5 and to save the file both as a dos and
> unix file without any help.

it will accept any floating point numbers and doesn't mind if the input
ascii file is dos, unix, or mac os9 style.

> I am running grass 6.2.2 on a Cygwin / win Xp system.
> 
> When displaying the file (d.vect hav), I get lines that looks
> reasonable, but no vertexes or centroides, when using d.what.vect, I
> get feature type Area but I never get any id when clicking in the
> uppermost largest square and in the other three, I get (seemingly)
> randomly categories 26, 38 and 36 wiht feature type Boundary... 


You need to clean the vector with v.clean.

* there should only be one boundary between each area, your boxes need
   "flattening" (for topology to make sense) right now you have two
   overlapping boundaries in places.

# combine areas and flatten vector map
v.clean in=boxes out=boxes_clean err=boxes_errs tool=break,rmdupl

# add missing centroids
v.centroids in=boxes_clean out=boxes_as_areas


* boundaries usually are without category, the centroid holds that
  (single boundary between two areas, to which area does the cat belong?)

In your ascii input file remove the boundary categories and add some
centroids:

C  1 1
 -4.5 77.25 
 1 26
C  1 1
 -4.5 72.25 
 1 38
C  1 1
 -2 69.5  
 1 36
C  1 1
 -9.5 69.5  
 1 35


You can skip needing the header info with the -n flag.
You can check topology with v.digit (see config menu for meaning of colors)


> I cannot see from the help file for v.in.ascii what may be wrong.

The help page is now slightly improved in 6.3-CVS to explain this better.
It can probably be improved more..


Hamish




More information about the grass-user mailing list