[GRASS-user] Stranges things after importing a shapefile

NOTICE: This is a second mail, sent because I didn't pay attention to
the size limit of this mailing list. I replaced the attached image by
imagehack links.

Hi all,

While still working on my huge map of Europe, I've noticed many
differences between the original shapefile and the grass vector layer
created after import. To visualize the problem, I took two
Screenshots:
-First one is from gqis 1.01, showing the raw
shapefile:
http://img214.imageshack.us/img214/4884/qgis.png
-Second one from grass 6.4RC5, showing the imported vector
layer:
http://img4.imageshack.us/img4/8462/grassgis.png
Notice how many areas seem broken in the grass layer, and how
entire parts of large rivers (take the rhine, for an example) are
missing.

The initial shapefile was patched together (from a few hundred nasa
swbd tiles) using Markus Neteler's script (Thanks again Markus !), and
seem to produce good results, at least in Qgis. The import command I
used was: v.in.ogr -z -o dsn=/DATA/swbd/shp/tiles/coastlines.shp
output=coastlines I somehow had to override the projection, because
grass doesn't seem to recognize the projection of the shapefile -
although both are of the same WSG84 LAT/LON proj.

My question is: what went wrong ? Perhaps there is an import step I'm
missing, since once the 'clean' command finishes, I get an awful lot
of areas without a centroid; I don't know. But it would be nice, for
sure, if grass could just translate the shapefile, as it is, and allow
me to export a *complete* vector map to inkscape.

Thanks for your help,

Felix

Felix Schalck wrote:

While still working on my huge map of Europe, I've noticed many
differences between the original shapefile and the grass vector layer
created after import.

This (probably) means that grass (i.e. v.clean) did its job and
corrected topological errors in the shapefile (?).

To visualize the problem, I took two
Screenshots:
-First one is from gqis 1.01, showing the raw
shapefile:
http://img214.imageshack.us/img214/4884/qgis.png
-Second one from grass 6.4RC5, showing the imported vector
layer:
http://img4.imageshack.us/img4/8462/grassgis.png
Notice how many areas seem broken in the grass layer, and how
entire parts of large rivers (take the rhine, for an example) are
missing.

Not so easy to see the differences. Maybe you could (next time)
highlight them somehow.

The initial shapefile was patched together (from a few hundred nasa
swbd tiles) using Markus Neteler's script (Thanks again Markus !), and
seem to produce good results, at least in Qgis. The import command I
used was: v.in.ogr -z -o dsn=/DATA/swbd/shp/tiles/coastlines.shp
output=coastlines I somehow had to override the projection, because
grass doesn't seem to recognize the projection of the shapefile -
although both are of the same WSG84 LAT/LON proj.

My question is: what went wrong ?

Maybe nothing went wrong ;-). Check the original shape(s) there where
you can locate differences. Are there open polygons for example?

Perhaps there is an import step I'm
missing, since once the 'clean' command finishes, I get an awful lot
of areas without a centroid; I don't know. But it would be nice, for
sure, if grass could just translate the shapefile, as it is, and allow
me to export a *complete* vector map to inkscape.

If its only for visualisation purposes, I think you can avoid v.clean.
Use: v.in.ogr with the flag "-c Do not clean polygons (not
recommended)".

Or maybe v.external?

Nikos

Hi,

I guess the broken areas in the grass topology have dangles inside.
(zoom a broken area)

use v.clean:
-remove small areas and angles
-delete dangles

Hope it helps,

Achim

Νίκος Αλεξανδρής schrieb:

Felix Schalck wrote:

While still working on my huge map of Europe, I've noticed many
differences between the original shapefile and the grass vector layer
created after import.

This (probably) means that grass (i.e. v.clean) did its job and
corrected topological errors in the shapefile (?).

To visualize the problem, I took two
Screenshots:
-First one is from gqis 1.01, showing the raw
shapefile:
http://img214.imageshack.us/img214/4884/qgis.png
-Second one from grass 6.4RC5, showing the imported vector
layer:
http://img4.imageshack.us/img4/8462/grassgis.png
Notice how many areas seem broken in the grass layer, and how
entire parts of large rivers (take the rhine, for an example) are
missing.

Not so easy to see the differences. Maybe you could (next time)
highlight them somehow.

The initial shapefile was patched together (from a few hundred nasa
swbd tiles) using Markus Neteler's script (Thanks again Markus !), and
seem to produce good results, at least in Qgis. The import command I
used was: v.in.ogr -z -o dsn=/DATA/swbd/shp/tiles/coastlines.shp
output=coastlines I somehow had to override the projection, because
grass doesn't seem to recognize the projection of the shapefile -
although both are of the same WSG84 LAT/LON proj.

My question is: what went wrong ?

Maybe nothing went wrong ;-). Check the original shape(s) there where
you can locate differences. Are there open polygons for example?

Perhaps there is an import step I'm
missing, since once the 'clean' command finishes, I get an awful lot
of areas without a centroid; I don't know. But it would be nice, for
sure, if grass could just translate the shapefile, as it is, and allow
me to export a *complete* vector map to inkscape.

If its only for visualisation purposes, I think you can avoid v.clean.
Use: v.in.ogr with the flag "-c Do not clean polygons (not
recommended)".

Or maybe v.external?

Nikos

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Ok: you are right, the pictures I uploaded are not very useful; so I
made another 4 screenshots, to show my problem:

First Image: Rhine river, and swiss lakes in qgis (displaying the raw
shapefile): http://img690.imageshack.us/img690/1144/swbdrhineqgis.png

Second Image: (Approximately) Same region, after importation as GRASS
vector, using v.in.ogr:
http://img690.imageshack.us/img690/3850/swbdrhinegrass.png
The middle-rhine just vanished over the process ! Also, notice that no
lake is recognized as closed area (although zooming in shows no
apparent dangles), and doesn't color. This is annoying, since I would
mean a manual rework all lakes to show them properly in the final map.

Third image: Zoom at the middl-Rhine, with Qgis:
http://img442.imageshack.us/img442/1650/swbdrhineqgis2.png

Forth image: (Approximately) Same region, after importation as GRASS
vector: http://img266.imageshack.us/img266/6029/swbdrhinegrass2.png
Obvious question: what happened to the river ?

As explined, the shapefile are meant to serve as vector layer on my
final topographic map; thus I'm using grass as middle-step, between
qgis shapefile and inkscape. Im very interested in nikos'
import-without-clean option: would this work out for me (eg: would it
be possible to export the non-cleaned grass vector layer to svg) ?

Thanks for your help,

Felix

On Tue, 2009-11-10 at 17:50 +0100, Felix Schalck wrote:

Ok: you are right, the pictures I uploaded are not very useful; so I
made another 4 screenshots, to show my problem:

First Image: Rhine river, and swiss lakes in qgis (displaying the raw
shapefile): http://img690.imageshack.us/img690/1144/swbdrhineqgis.png

Second Image: (Approximately) Same region, after importation as GRASS
vector, using v.in.ogr:
http://img690.imageshack.us/img690/3850/swbdrhinegrass.png
The middle-rhine just vanished over the process ! Also, notice that no
lake is recognized as closed area (although zooming in shows no
apparent dangles), and doesn't color. This is annoying, since I would
mean a manual rework all lakes to show them properly in the final map.

Third image: Zoom at the middl-Rhine, with Qgis:
http://img442.imageshack.us/img442/1650/swbdrhineqgis2.png

Forth image: (Approximately) Same region, after importation as GRASS
vector: http://img266.imageshack.us/img266/6029/swbdrhinegrass2.png
Obvious question: what happened to the river ?

Right, very clear. The "problem" is known. I might be missing something
but, in general, I think my previous answer, and Achims suggestion,
covers "it".

As explined, the shapefile are meant to serve as vector layer on my
final topographic map; thus I'm using grass as middle-step, between
qgis shapefile and inkscape. Im very interested in nikos'
import-without-clean option: would this work out for me (eg: would it
be possible to export the non-cleaned grass vector layer to svg) ?

Yes (for a nice map but you won't be good for using this for analysis).
Go ahead and try :wink:

Nikos

It Works ! I used v.in.ogr -c command and now it looks pretty good:
http://img25.imageshack.us/img25/6802/swbdgrass3.png

Thanks you very much, Nikos.

Now I got another problem: export to inkscape produce a way-to-big
file, which I can't rework with my current system config (AMD64, 3Gb
ram). Is it possible to do the job in grass, and produce a
good-looking anti-aliased raster river layer, which I could simply
layer over the topographic layer ? Is this doable with v.to.rast ?

Thanks again for your help,

Felix

2009/11/10 Νίκος Αλεξανδρής <nikos.alexandris@felis.uni-freiburg.de>:

On Tue, 2009-11-10 at 17:50 +0100, Felix Schalck wrote:

Ok: you are right, the pictures I uploaded are not very useful; so I
made another 4 screenshots, to show my problem:

First Image: Rhine river, and swiss lakes in qgis (displaying the raw
shapefile): http://img690.imageshack.us/img690/1144/swbdrhineqgis.png

Second Image: (Approximately) Same region, after importation as GRASS
vector, using v.in.ogr:
http://img690.imageshack.us/img690/3850/swbdrhinegrass.png
The middle-rhine just vanished over the process ! Also, notice that no
lake is recognized as closed area (although zooming in shows no
apparent dangles), and doesn't color. This is annoying, since I would
mean a manual rework all lakes to show them properly in the final map.

Third image: Zoom at the middl-Rhine, with Qgis:
http://img442.imageshack.us/img442/1650/swbdrhineqgis2.png

Forth image: (Approximately) Same region, after importation as GRASS
vector: http://img266.imageshack.us/img266/6029/swbdrhinegrass2.png
Obvious question: what happened to the river ?

Right, very clear. The "problem" is known. I might be missing something
but, in general, I think my previous answer, and Achims suggestion,
covers "it".

As explined, the shapefile are meant to serve as vector layer on my
final topographic map; thus I'm using grass as middle-step, between
qgis shapefile and inkscape. Im very interested in nikos'
import-without-clean option: would this work out for me (eg: would it
be possible to export the non-cleaned grass vector layer to svg) ?

Yes (for a nice map but you won't be good for using this for analysis).
Go ahead and try :wink:

Nikos