[GIS] Problem with v.in.ogr.qgis in QGIS

grassqgis

I received a shapefile containing data from a topographic survey of a farm. The file has a lot of lines containing elevation data. The person who made the survey did it with a GPS set up on a ATV.

When I load the shapefile in QGIS I have the Metadata :

"Geometry type of the features in this layer: Polygon
The number of features in this layer: 1942"

I want to create a slope map from this topo survey. So I guess one of the first steps is to create a raster layer from the vector layer. However before that, I think I have to create a GRASS map with the module v.in.ogr.qgis. When I use this module, I have this message :

Building topology for vector map …
Registering primitives…
0 primitives registered
0 vertices registered
Nombre de n�uds : 0
Nombre de primitives : 0
Nombre de points : 0
Nombre de lignes :0
Nombre de contours : 0
Nombre de centro�des : 0
Nombre de surfaces : –
Nombre d'�les : –
Building topology for vector map …
Registering primitives…
0 primitives registered
0 vertices registered
Building areas…
0 areas built
0 isles built
Attaching islands…
Attaching centroids…
Nombre de n�uds : 0
Nombre de primitives : 0
Nombre de points : 0
Nombre de lignes :0
Nombre de contours : 0
Nombre de centro�des : 0
Nombre de surfaces : 0
Nombre d'�les : 0
Successfully finished

The module creates a new map name that I can see when I click on "add a GRASS vector layer". However, there is no layer available for this map.

What's wrong? The problem may come from the original shapefile. Bus as I am not a GIS specialist and I am a new QGIS user, I would like to get some help.

I have QGis 1.8.0-Lisboa, Windows 7 and my computer is a French computer (which could explain why there are some French words in the v.in.ogr.qgis message).

Thank you

Best,

Baptiste

Best Answer

Ok, the problem is simple. Your vector is a polygon layer, but it looks like as if it is made of lines, so it means that the "lines" are made of very narrow polygons. When importing vectors into GRASS, v.in.ogr has a "snapping" parameter, that is set by default at a very small value, but that in lat/lon (as your vector is) still is a significant value. So when importing it the polygons borders are snapped and disappear.

To solve the issue just transform your vector to real lines using QGIS "polygon to lines" tool, and then import again into GRASS, it works.

Related Question