[GRASS5] GRASS5.1: shapefile import problems

Moritz Lennert mlennert at club.worldonline.be
Mon Jun 2 17:36:33 EDT 2003


Hello,

I'm trying to use / import a shapefile into 5.1.

When I use v.format, The map seems perfect and d.what.vect displays the
correrct information. However, I seem to be limited to the dbf file as
database since when I use v.db.connect to try to connect the file to a
PostgreSQL database I'm told:

WARNING: Shapefile format cannot be updated.
WARNING: Shapefile format cannot be updated.
ERROR: Cannot open old vector cp at mlennert on level 0

When I use v.in.ogr + v.clean (tool=rmdupl,bpol) the file gets imported
incorrectly, areas not being recognized as area and attributes being
linked to the centroids, but not to the areas. I can link this map to the
database, but that doesn't help me with wrong topology.

As info here's v.build output on the v.format shapefile:

v.build cp
WARNING: Topology for shapefile areas is not fully supported.
Registering areas: Topology was built.
Number of nodes     :   2511
Number of primitives:   2538
Number of points    :   0
Number of lines     :   0
Number of boundaries:   1293
Number of centroids :   1245
Number of faces     :   0
Number of kernels   :   0
Number of areas     :   1245
Number of isles     :   46
Map is 3D           :   0


And here v.build output on the v.in.ogr/v.clean tool=rmdupl,bpol file:

v.build cp_clean
Registering lines:
10696 primitives registered
Building areas:  100%
77 areas built
46 isles built
Attaching islands:  100%
Attaching centroids:  100%
Topology was built.
Number of nodes     :   4920
Number of primitives:   10696
Number of points    :   0
Number of lines     :   0
Number of boundaries:   9451
Number of centroids :   1245
Number of faces     :   0
Number of kernels   :   0
Number of areas     :   77
Number of isles     :   46
Map is 3D           :   0

The first one seems correct (I haven't verified for all areas), but the
second is completely wrong.

So, my questions are:

1) can I link a shapefile imported with v.format to a database table ?
2) is there a way I can ensure a more clean import with v.in.ogr
3) knowing that the shape format is very bad, and having access to
ArcView, could I export the file to another format and import it into 5.1
?

Moritz




More information about the grass-dev mailing list