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

Markus Metz markus.metz.giswork at googlemail.com
Wed Oct 19 02:51:35 EDT 2011


On Tue, Oct 18, 2011 at 7:38 PM, Sebastian Schubert
<schubert.seb at googlemail.com> wrote:
> On 18/10/11 17:37, Markus Metz wrote:
>> 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.
>
> 6.4.1
>
>> Are you using GRASS directly or through e.g. the
>> QGIS-GRASS plugin?
>
> Directly.
>
>> And can you post the full output of v.in.ogr --v?
>
> This is the output for the shape filed attached:
>
> GRASS 6.4.1 (WGS84):~/temp/basel > v.in.ogr --v polygon.shp out=polygon
> Projection of input dataset and current location appear to match
> Using temporary vector <polygon_tmp>
> Layer: polygon
> Counting polygons for 1 features...
> Importing map 1 features...
>  100%
> -----------------------------------------------------
> Building topology for vector map <polygon_tmp>...
> Registering primitives...
> 1 primitives registered
> 4 vertices registered
> Topology was built
> Number of nodes: 1
> Number of primitives: 1
> Number of points: 0
> Number of lines: 0
> Number of boundaries: 1
> Number of centroids: 0
> Number of areas: -
> Number of isles: -
> -----------------------------------------------------
> WARNING: Cleaning polygons, result is not guaranteed!
> -----------------------------------------------------
> Break polygons:
>  100%
>  100%
> -----------------------------------------------------
> Remove duplicates:
>  100%
> -----------------------------------------------------
> Break boundaries:
>  100%
> Intersections: 0
> -----------------------------------------------------
> Remove duplicates:
>  100%
> -----------------------------------------------------
> Clean boundaries at nodes:
> -----------------------------------------------------
> Change dangles to lines:
>  100%
> -----------------------------------------------------
> Remove bridges:
>  100%
> -----------------------------------------------------
> Merge boundaries:
>  100%
> 0 boundaries merged
> 0 new boundaries
> -----------------------------------------------------
> Building topology for vector map <polygon_tmp>...
> Building areas...
>  100%
> 1 areas built
> 1 isles built
> Attaching islands...
>  100%
> Topology was built
> Number of nodes: 1
> Number of primitives: 1
> Number of points: 0
> Number of lines: 0
> Number of boundaries: 1
> Number of centroids: 0
> Number of areas: 1
> Number of isles: 1
> Number of areas without centroid: 1
> -----------------------------------------------------
> Find centroids for layer: polygon
> -----------------------------------------------------
> Write centroids:
>  100%
> -----------------------------------------------------
> 1 input polygons
> Total area: 19263.4 (1 areas)
> Overlapping area: 0 (0 areas)
> Area without category: 19263.4 (1 areas)
> -----------------------------------------------------
> Building topology for vector map <polygon>...
> Registering primitives...
> 1 primitives registered
> 4 vertices registered
> Building areas...
>  100%
> 1 areas built
> 1 isles built
> Attaching islands...
>  100%
> Attaching centroids...
>  100%
> Topology was built
> Number of nodes: 1
> Number of primitives: 1
> Number of points: 0
> Number of lines: 0
> Number of boundaries: 1
> Number of centroids: 0
> Number of areas: 1
> Number of isles: 1
> Number of areas without centroid: 1
> WARNING: Input data contains 3D features. Created vector is 2D only, use -z
>         flag to import 3D vector
>
> Similar problem.
>
Thanks for the sample polygon. I could reproduce it, have found the
bug and fixed it in r48850-2 (all branches).

Markus M


More information about the grass-user mailing list