[GRASS-user] v.in.ogr of shp file: no centroids but data in table

Markus Metz markus.metz.giswork at googlemail.com
Tue Oct 18 11:37:10 EDT 2011


Sebastian Schubert wrote:
> Hi all,
>
> I imported a shape file into grass
>
> v.in.ogr --o basel_gelaende.shp out=basel_gelaende
>
> resulting in:
> Number of nodes: 38602
> Number of primitives: 115042
> Number of points: 0
> Number of lines: 0
> Number of boundaries: 115042
> Number of centroids: 0
> Number of areas: 76441
> Number of isles: 1
> Number of areas without centroid: 76441
>
What version of GRASS are you using? There are slight differences in
v.in.ogr between 6.4.0, 6.4.1, 6.4.2, although these should not affect
centroid creation. Are you using GRASS directly or through e.g. the
QGIS-GRASS plugin? And can you post the full output of v.in.ogr --v?
At some stage, centroids are calculated for input polygons, and the
corresponding messages would be helpful.

>
> I could do a v.centroids to calculate the centroids and then also v.what
> gives information from the table, but the data is not correct. I guess
> grass put the cat values without really knowing the right connection.
>
Yes, this must be determined during import.

> It might be important that the map is actually a 3d one, but in "2d
> mode" so I got the following warning:
>
> WARNING: Input data contains 3D features. Created vector is 2D only, use
> -z flag to import 3D vector

No, this should not affect the output. Unless the input shapefile is
real 3D with vertical polygons that have zero area size when projected
onto the x,y plane. 2.5D polygons are fine.

Markus M


More information about the grass-user mailing list