[GRASS-dev] v.voronoi producing wrong output

Hello all,

As it is my first mail on this list, I would like to thank the devs and
the whole team for the great work done in GRASS.

Before filing up a bug report I would like your advice on the following
problem : the output of v.voronoi is wrong (additionnal lines and/or
holes) for a set of around 4600 points in EPSG:27572 (in meters).

These are the steps to reproduce the bug :
v.in.ogr --overwrite input=C:\XXXX\points.shp output=points
g.region -p vect=points n=n+100 s=s-100 e=e+100 w=w-100 res=0.01 -a
v.voronoi --overwrite --verbose input=points output=voronoi_areas

The dataset is linked to the email, it is in EPSG:27572.
You will also find a picture of the (wrong) output.

The output of voronoi command is :
Reading features...
WARNING: La couche vectorielle <voronoi_areas> existe déjà et va être écrasé
Utilisation du format natif
Voronoi triangulation for 4622 points...
Writing edges...
Writing features...
Writing attributes...
Searching for topology errors...
WARNING: Le nombre de centroïdes dépasse le nombre de surfaces : 4622 > 3478
WARNING: Nombre de contours incorrects: 5058
WARNING: Nombre de centroïdes en dehors de surfaces: 308
WARNING: Nombre de centroïdes dupliqués: 881
Cleaning output topology
Reading features...
Accrochage des sommets passe 1 : sélection des points
Accrochage des sommets passe 2 : assignation des ancrages de sommets
Accrochage des sommets passe 3 : accrochage sur les points assignés
Sommets accrochés : 663
Nouveau sommet : 862
Intersections : 54331
Removed duplicates: 491
Modifications: 0
Removing dangles...
Removed lignes : 3
Removed dangles: 3
Removing bridges...
Removed lines: 0
Removed bridges: 0
Construction de la topologie pour la carte vectorielle
<voronoi_areas@Test>...
Enregistrement des primitives ...
72112 primitives registered
139602 vertices registered
Construction des surfaces ...
31830 areas built
One isle built
Attachement des îles ...
Attachement des centroïdes ...
La topologie a bien été construite
Nombre de nœuds: 35661
Nombre de primitives: 72112
Nombre de points: 0
Nombre de lignes :0
Nombre de contours: 67490
Nombre de centroïdes: 4622
Nombre de surfaces: 31830
Nombre d'îles: 1
WARNING: Nombre de centroïdes dupliqués: 114
v.voronoi terminé.

This is the output of g.version -breg :
version=7.0.1
date=2015
revision=65800
build_date=2015-07-31
build_platform=i686-pc-mingw32
    ./configure '--with-libs=/c/OSGeo4W/lib /c/OSGeo4W/apps/msys/lib
/c/osgeo4w/usr/src/grass701/mswindows/osgeo4w/lib'
'--with-includes=/c/OSGeo4W/include /c/OSGeo4W/apps/msys/include'
--libexecdir=/c/OSGeo4W/bin --prefix=/c/OSGeo4W/apps/grass
--bindir=/c/OSGeo4W/bin --includedir=/c/OSGeo4W/include --disable-x
--without-x --with-cxx --enable-shared --enable-largefile
--with-opengl=windows --with-fftw --with-freetype
--with-proj-share=/c/OSGeo4W/share/proj
--with-gdal=/c/osgeo4w/usr/src/grass701/mswindows/osgeo4w/gdal-config
--with-geos=/c/osgeo4w/usr/src/grass701/mswindows/osgeo4w/geos-config
--with-liblas=/c/osgeo4w/usr/src/grass701/mswindows/osgeo4w/liblas-config --with-sqlite
--with-curses --with-regex --with-nls
--with-freetype-includes=/c/OSGeo4W/include/freetype2 --with-odbc
--with-cairo --with-cairo-includes=/c/OSGeo4W/include/cairo --with-postgres
libgis_revision=64733
libgis_date="2015-02-25 01:56:29 +0100 (st, 25 2 2015) "
proj4=4.8.0
gdal=1.11.2
geos=3.4.2
sqlite=3.7.17

I also tried on a Unix machine on which I built GRASS with the same results.

I tried to get a small subset of points and got down to 8 points
producing a wrong output. Point subset and output image is also linked
to this email.
I searched existing bugs and tried to increase resolution with g.region
with no improvement;

Do you have any ideas ? Should I file in a bug or am I using the tools
in the wrong way ?

Thanks for your thoughts,
Cev.

(attachments)

v.voronoi2.zip (304 KB)

Hello,
I can not reproduce the issue on my ~AMD64 Gentoo system.
GRASS versija: 7.1.svn
GRASS SVN revision: 66489M
Build date: 2015-10-14
Build platform: x86_64-unknown-linux-gnu

Try to install GRASS 7.1 nightly and report back if you still have
problems with it.
I don't see any recent changes to v.voronoi and valgrind also does not
complain - will be hard to trace down if problem has not been solved
in 7.1 by accident.

Māris.

2015-10-14 15:51 GMT+03:00 Cev Hillan <cevhillan@hotmail.com>:

Hello all,

As it is my first mail on this list, I would like to thank the devs and
the whole team for the great work done in GRASS.

Before filing up a bug report I would like your advice on the following
problem : the output of v.voronoi is wrong (additionnal lines and/or
holes) for a set of around 4600 points in EPSG:27572 (in meters).

These are the steps to reproduce the bug :
v.in.ogr --overwrite input=C:\XXXX\points.shp output=points
g.region -p vect=points n=n+100 s=s-100 e=e+100 w=w-100 res=0.01 -a
v.voronoi --overwrite --verbose input=points output=voronoi_areas

The dataset is linked to the email, it is in EPSG:27572.
You will also find a picture of the (wrong) output.

The output of voronoi command is :
Reading features...
WARNING: La couche vectorielle <voronoi_areas> existe déjà et va être écrasé
Utilisation du format natif
Voronoi triangulation for 4622 points...
Writing edges...
Writing features...
Writing attributes...
Searching for topology errors...
WARNING: Le nombre de centroïdes dépasse le nombre de surfaces : 4622 > 3478
WARNING: Nombre de contours incorrects: 5058
WARNING: Nombre de centroïdes en dehors de surfaces: 308
WARNING: Nombre de centroïdes dupliqués: 881
Cleaning output topology
Reading features...
Accrochage des sommets passe 1 : sélection des points
Accrochage des sommets passe 2 : assignation des ancrages de sommets
Accrochage des sommets passe 3 : accrochage sur les points assignés
Sommets accrochés : 663
Nouveau sommet : 862
Intersections : 54331
Removed duplicates: 491
Modifications: 0
Removing dangles...
Removed lignes : 3
Removed dangles: 3
Removing bridges...
Removed lines: 0
Removed bridges: 0
Construction de la topologie pour la carte vectorielle
<voronoi_areas@Test>...
Enregistrement des primitives ...
72112 primitives registered
139602 vertices registered
Construction des surfaces ...
31830 areas built
One isle built
Attachement des îles ...
Attachement des centroïdes ...
La topologie a bien été construite
Nombre de nœuds: 35661
Nombre de primitives: 72112
Nombre de points: 0
Nombre de lignes :0
Nombre de contours: 67490
Nombre de centroïdes: 4622
Nombre de surfaces: 31830
Nombre d'îles: 1
WARNING: Nombre de centroïdes dupliqués: 114
v.voronoi terminé.

This is the output of g.version -breg :
version=7.0.1
date=2015
revision=65800
build_date=2015-07-31
build_platform=i686-pc-mingw32
    ./configure '--with-libs=/c/OSGeo4W/lib /c/OSGeo4W/apps/msys/lib
/c/osgeo4w/usr/src/grass701/mswindows/osgeo4w/lib'
'--with-includes=/c/OSGeo4W/include /c/OSGeo4W/apps/msys/include'
--libexecdir=/c/OSGeo4W/bin --prefix=/c/OSGeo4W/apps/grass
--bindir=/c/OSGeo4W/bin --includedir=/c/OSGeo4W/include --disable-x
--without-x --with-cxx --enable-shared --enable-largefile
--with-opengl=windows --with-fftw --with-freetype
--with-proj-share=/c/OSGeo4W/share/proj
--with-gdal=/c/osgeo4w/usr/src/grass701/mswindows/osgeo4w/gdal-config
--with-geos=/c/osgeo4w/usr/src/grass701/mswindows/osgeo4w/geos-config
--with-liblas=/c/osgeo4w/usr/src/grass701/mswindows/osgeo4w/liblas-config --with-sqlite
--with-curses --with-regex --with-nls
--with-freetype-includes=/c/OSGeo4W/include/freetype2 --with-odbc
--with-cairo --with-cairo-includes=/c/OSGeo4W/include/cairo --with-postgres
libgis_revision=64733
libgis_date="2015-02-25 01:56:29 +0100 (st, 25 2 2015) "
proj4=4.8.0
gdal=1.11.2
geos=3.4.2
sqlite=3.7.17

I also tried on a Unix machine on which I built GRASS with the same results.

I tried to get a small subset of points and got down to 8 points
producing a wrong output. Point subset and output image is also linked
to this email.
I searched existing bugs and tried to increase resolution with g.region
with no improvement;

Do you have any ideas ? Should I file in a bug or am I using the tools
in the wrong way ?

Thanks for your thoughts,
Cev.

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

Thank you Maris for you reply.

I have tried the same with the 7.1svn version revision 66485 from
OSGEO4W with no luck : still the same holes after v.voronoi.

I have managed to find a workaround which gives a hint on the problem :
I can get the correct voronoi output from a WGS84 location.
So it seems the problem comes from the other location in EPSG:27572

Below is the output of g.proj -p of the EPSG:27572 location. It seems ok
to me.
-PROJ_INFO-------------------------------------------------
name : Lambert Conformal Conic
proj : lcc
ellps : clark80IGN
lat_1 : 46.8
lat_0 : 46.8
lon_0 : 0
k_0 : 0.99987742
x_0 : 600000
y_0 : 2200000
towgs84 : -168,-60,320,0,0,0,0
pm : paris
no_defs : defined
-PROJ_EPSG-------------------------------------------------
epsg : 27572
-PROJ_UNITS------------------------------------------------
unit : meter
units : meters
meters : 1

I have the fealing it is related to some floating/precision problem,
that is why I tried to play with the g.region resolution. But I just
read the manual saying vector layers are not affected by this.

So I would like to try to snap all points to a 0.01 precision grid but
do not know how to do this in GRASS. Could you please point me towards
the right direction ? Do you have other ideas ?

Henri.

Le 14/10/2015 19:15, Maris Nartiss a écrit :

Hello,
I can not reproduce the issue on my ~AMD64 Gentoo system.
GRASS versija: 7.1.svn
GRASS SVN revision: 66489M
Build date: 2015-10-14
Build platform: x86_64-unknown-linux-gnu

Try to install GRASS 7.1 nightly and report back if you still have
problems with it.
I don't see any recent changes to v.voronoi and valgrind also does not
complain - will be hard to trace down if problem has not been solved
in 7.1 by accident.

Māris.

2015-10-14 15:51 GMT+03:00 Cev Hillan <cevhillan@hotmail.com>:

Hello all,

As it is my first mail on this list, I would like to thank the devs and
the whole team for the great work done in GRASS.

Before filing up a bug report I would like your advice on the following
problem : the output of v.voronoi is wrong (additionnal lines and/or
holes) for a set of around 4600 points in EPSG:27572 (in meters).

These are the steps to reproduce the bug :
v.in.ogr --overwrite input=C:\XXXX\points.shp output=points
g.region -p vect=points n=n+100 s=s-100 e=e+100 w=w-100 res=0.01 -a
v.voronoi --overwrite --verbose input=points output=voronoi_areas

The dataset is linked to the email, it is in EPSG:27572.
You will also find a picture of the (wrong) output.

The output of voronoi command is :
Reading features...
WARNING: La couche vectorielle <voronoi_areas> existe déjà et va être écrasé
Utilisation du format natif
Voronoi triangulation for 4622 points...
Writing edges...
Writing features...
Writing attributes...
Searching for topology errors...
WARNING: Le nombre de centroïdes dépasse le nombre de surfaces : 4622 > 3478
WARNING: Nombre de contours incorrects: 5058
WARNING: Nombre de centroïdes en dehors de surfaces: 308
WARNING: Nombre de centroïdes dupliqués: 881
Cleaning output topology
Reading features...
Accrochage des sommets passe 1 : sélection des points
Accrochage des sommets passe 2 : assignation des ancrages de sommets
Accrochage des sommets passe 3 : accrochage sur les points assignés
Sommets accrochés : 663
Nouveau sommet : 862
Intersections : 54331
Removed duplicates: 491
Modifications: 0
Removing dangles...
Removed lignes : 3
Removed dangles: 3
Removing bridges...
Removed lines: 0
Removed bridges: 0
Construction de la topologie pour la carte vectorielle
<voronoi_areas@Test>...
Enregistrement des primitives ...
72112 primitives registered
139602 vertices registered
Construction des surfaces ...
31830 areas built
One isle built
Attachement des îles ...
Attachement des centroïdes ...
La topologie a bien été construite
Nombre de nœuds: 35661
Nombre de primitives: 72112
Nombre de points: 0
Nombre de lignes :0
Nombre de contours: 67490
Nombre de centroïdes: 4622
Nombre de surfaces: 31830
Nombre d'îles: 1
WARNING: Nombre de centroïdes dupliqués: 114
v.voronoi terminé.

This is the output of g.version -breg :
version=7.0.1
date=2015
revision=65800
build_date=2015-07-31
build_platform=i686-pc-mingw32
     ./configure '--with-libs=/c/OSGeo4W/lib /c/OSGeo4W/apps/msys/lib
/c/osgeo4w/usr/src/grass701/mswindows/osgeo4w/lib'
'--with-includes=/c/OSGeo4W/include /c/OSGeo4W/apps/msys/include'
--libexecdir=/c/OSGeo4W/bin --prefix=/c/OSGeo4W/apps/grass
--bindir=/c/OSGeo4W/bin --includedir=/c/OSGeo4W/include --disable-x
--without-x --with-cxx --enable-shared --enable-largefile
--with-opengl=windows --with-fftw --with-freetype
--with-proj-share=/c/OSGeo4W/share/proj
--with-gdal=/c/osgeo4w/usr/src/grass701/mswindows/osgeo4w/gdal-config
--with-geos=/c/osgeo4w/usr/src/grass701/mswindows/osgeo4w/geos-config
--with-liblas=/c/osgeo4w/usr/src/grass701/mswindows/osgeo4w/liblas-config --with-sqlite
--with-curses --with-regex --with-nls
--with-freetype-includes=/c/OSGeo4W/include/freetype2 --with-odbc
--with-cairo --with-cairo-includes=/c/OSGeo4W/include/cairo --with-postgres
libgis_revision=64733
libgis_date="2015-02-25 01:56:29 +0100 (st, 25 2 2015) "
proj4=4.8.0
gdal=1.11.2
geos=3.4.2
sqlite=3.7.17

I also tried on a Unix machine on which I built GRASS with the same results.

I tried to get a small subset of points and got down to 8 points
producing a wrong output. Point subset and output image is also linked
to this email.
I searched existing bugs and tried to increase resolution with g.region
with no improvement;

Do you have any ideas ? Should I file in a bug or am I using the tools
in the wrong way ?

Thanks for your thoughts,
Cev.

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