I tried to import the NUTS3 map(s) from EU which leads to some obscur
warnings (see below). While most can be solved with a "mild" snapping,
still four islands are reported as an error. They are Andorra, etc and
apparently really valid. The error message though suggests that the
import was not successful. Could this be fixed?
# create new location from SHP file
grass70 -c NUTS_BN_03M_2010.shp ~/grassdata/eu_etrs89
g.proj -w
# import NUTS3 polygons (performs topology check)
v.in.ogr input=NUTS_RG_03M_2010.shp output=NUTS_RG_03M_00
...
Cleaning polygons
-----------------------------------------------------
Breaking polygons...
...
-----------------------------------------------------
Building areas...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
100%
16926 areas built
1325 isles built
Number of nodes: 113763
Number of primitives: 355557
Number of points: 0
Number of lines: 0
Number of boundaries: 355557
Number of centroids: 0
Number of areas: 16926
Number of isles: 1325
WARNING: Number of incorrect boundaries: 157
-----------------------------------------------------
Removing bridges...
100%
-----------------------------------------------------
Registering primitives...
48083 primitives registered
343316 vertices registered
Building areas...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
100%
16925 areas built
1335 isles built
Attaching islands...
100%
Number of nodes: 32451
Number of primitives: 48083
Number of points: 0
Number of lines: 0
Number of boundaries: 48083
Number of centroids: 0
Number of areas: 16925
Number of isles: 1335
WARNING: Number of incorrect boundaries: 36
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
...
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
-----------------------------------------------------
Finding centroids for OGR layer <NUTS_RG_03M_2010>...
100%
-----------------------------------------------------
Writing centroids...
100%
WARNING: 9912 areas represent more (overlapping) features, because polygons
overlap in input layer(s). Such areas are linked to more than 1
row in attribute table. The number of features for those areas is
stored as category in layer 2
-----------------------------------------------------
7007 input polygons
Total area: 5.75852E+12 (16925 areas)
Overlapping area: 5.74784E+12 (9912 areas)
Area without category: 5.32057E+08 (19 areas)
-----------------------------------------------------
Copying features...
100%
Building topology for vector map <NUTS_RG_03M_2010@PERMANENT>...
Registering primitives...
59076 primitives registered
354309 vertices registered
Building areas...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
100%
16925 areas built
1335 isles built
Attaching islands...
100%
Attaching centroids...
100%
Number of nodes: 32451
Number of primitives: 59076
Number of points: 0
Number of lines: 0
Number of boundaries: 48083
Number of centroids: 10993
Number of areas: 16925
Number of isles: 1335
WARNING: Number of incorrect boundaries: 36
-----------------------------------------------------
WARNING: Errors were encountered during the import
Estimated range of snapping threshold: [1e-13, 1e-05]
Try to import again, snapping with at least 1e-13: 'snap=1e-13'
# --> the "WARNING: Vect_get_point_in_poly_isl(): collapsed area"
looks like a debug message to an average user.
# NEW ATTEMPT WITH SNAPPING
GRASS 7.0.0svn (eu_etrs89): > v.in.ogr input=NUTS_RG_03M_2010.shp
output=NUTS_RG_03M_2010 snap=1e-8 --o
...
Writing centroids...
100%
WARNING: 2748 areas represent more (overlapping) features, because polygons
overlap in input layer(s). Such areas are linked to more than 1
row in attribute table. The number of features for those areas is
stored as category in layer 2
-----------------------------------------------------
7007 input polygons
Total area: 5.75852E+12 (2759 areas)
Overlapping area: 5.74784E+12 (2748 areas)
Area without category: 5.32057E+08 (4 areas)
-----------------------------------------------------
Copying features...
100%
Building topology for vector map <NUTS_RG_03M_2010@PERMANENT>...
Registering primitives...
8419 primitives registered
217332 vertices registered
Building areas...
100%
2759 areas built
1315 isles built
Attaching islands...
100%
Attaching centroids...
100%
Number of nodes: 4220
Number of primitives: 8419
Number of points: 0
Number of lines: 0
Number of boundaries: 5664
Number of centroids: 2755
Number of areas: 2759
Number of isles: 1315
-----------------------------------------------------
WARNING: Errors were encountered during the import
Estimated range of snapping threshold: [1e-13, 1e-05]
Try to import again, snapping with 1e-07: 'snap=1e-07'
v.build NUTS_RG_03M_2010 error=NUTS_RG_03M_2010_errors
...
Number of nodes: 4
Number of primitives: 4
Number of points: 0
Number of lines: 0
Number of boundaries: 4
Number of centroids: 0
Number of areas: 4
Number of isles: 4
The "WARNING: Errors were encountered during the import" is scary
while it seems to be valid islands (Andorra, San Marino, two islands
near Rome).
On Wed, Feb 11, 2015 at 9:34 PM, Markus Neteler <neteler@osgeo.org> wrote:
HI,
I tried to import the NUTS3 map(s) from EU which leads to some obscur
warnings (see below). While most can be solved with a "mild" snapping,
still four islands are reported as an error. They are Andorra, etc and
apparently really valid. The error message though suggests that the
import was not successful. Could this be fixed?
This might have been fixed already in trunk, please test!
# create new location from SHP file
grass70 -c NUTS_BN_03M_2010.shp ~/grassdata/eu_etrs89
g.proj -w
# import NUTS3 polygons (performs topology check)
v.in.ogr input=NUTS_RG_03M_2010.shp output=NUTS_RG_03M_00
...
Cleaning polygons
-----------------------------------------------------
Breaking polygons...
...
-----------------------------------------------------
Building areas...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
100%
16926 areas built
1325 isles built
Number of nodes: 113763
Number of primitives: 355557
Number of points: 0
Number of lines: 0
Number of boundaries: 355557
Number of centroids: 0
Number of areas: 16926
Number of isles: 1325
WARNING: Number of incorrect boundaries: 157
-----------------------------------------------------
Removing bridges...
100%
-----------------------------------------------------
Registering primitives...
48083 primitives registered
343316 vertices registered
Building areas...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
100%
16925 areas built
1335 isles built
Attaching islands...
100%
Number of nodes: 32451
Number of primitives: 48083
Number of points: 0
Number of lines: 0
Number of boundaries: 48083
Number of centroids: 0
Number of areas: 16925
Number of isles: 1335
WARNING: Number of incorrect boundaries: 36
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
...
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
-----------------------------------------------------
Finding centroids for OGR layer <NUTS_RG_03M_2010>...
100%
-----------------------------------------------------
Writing centroids...
100%
WARNING: 9912 areas represent more (overlapping) features, because polygons
overlap in input layer(s). Such areas are linked to more than 1
row in attribute table. The number of features for those areas is
stored as category in layer 2
-----------------------------------------------------
7007 input polygons
Total area: 5.75852E+12 (16925 areas)
Overlapping area: 5.74784E+12 (9912 areas)
Area without category: 5.32057E+08 (19 areas)
-----------------------------------------------------
Copying features...
100%
Building topology for vector map <NUTS_RG_03M_2010@PERMANENT>...
Registering primitives...
59076 primitives registered
354309 vertices registered
Building areas...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
100%
16925 areas built
1335 isles built
Attaching islands...
100%
Attaching centroids...
100%
Number of nodes: 32451
Number of primitives: 59076
Number of points: 0
Number of lines: 0
Number of boundaries: 48083
Number of centroids: 10993
Number of areas: 16925
Number of isles: 1335
WARNING: Number of incorrect boundaries: 36
-----------------------------------------------------
WARNING: Errors were encountered during the import
Estimated range of snapping threshold: [1e-13, 1e-05]
Try to import again, snapping with at least 1e-13: 'snap=1e-13'
# --> the "WARNING: Vect_get_point_in_poly_isl(): collapsed area"
looks like a debug message to an average user.
# NEW ATTEMPT WITH SNAPPING
GRASS 7.0.0svn (eu_etrs89): > v.in.ogr input=NUTS_RG_03M_2010.shp
output=NUTS_RG_03M_2010 snap=1e-8 --o
...
Writing centroids...
100%
WARNING: 2748 areas represent more (overlapping) features, because polygons
overlap in input layer(s). Such areas are linked to more than 1
row in attribute table. The number of features for those areas is
stored as category in layer 2
-----------------------------------------------------
7007 input polygons
Total area: 5.75852E+12 (2759 areas)
Overlapping area: 5.74784E+12 (2748 areas)
Area without category: 5.32057E+08 (4 areas)
-----------------------------------------------------
Copying features...
100%
Building topology for vector map <NUTS_RG_03M_2010@PERMANENT>...
Registering primitives...
8419 primitives registered
217332 vertices registered
Building areas...
100%
2759 areas built
1315 isles built
Attaching islands...
100%
Attaching centroids...
100%
Number of nodes: 4220
Number of primitives: 8419
Number of points: 0
Number of lines: 0
Number of boundaries: 5664
Number of centroids: 2755
Number of areas: 2759
Number of isles: 1315
-----------------------------------------------------
WARNING: Errors were encountered during the import
Estimated range of snapping threshold: [1e-13, 1e-05]
Try to import again, snapping with 1e-07: 'snap=1e-07'
v.build NUTS_RG_03M_2010 error=NUTS_RG_03M_2010_errors
...
Number of nodes: 4
Number of primitives: 4
Number of points: 0
Number of lines: 0
Number of boundaries: 4
Number of centroids: 0
Number of areas: 4
Number of isles: 4
The "WARNING: Errors were encountered during the import" is scary
while it seems to be valid islands (Andorra, San Marino, two islands
near Rome).
On Wed, Feb 11, 2015 at 9:47 PM, Markus Metz
<markus.metz.giswork@gmail.com> wrote:
On Wed, Feb 11, 2015 at 9:34 PM, Markus Neteler <neteler@osgeo.org> wrote:
HI,
I tried to import the NUTS3 map(s) from EU which leads to some obscur
warnings (see below). While most can be solved with a "mild" snapping,
still four islands are reported as an error. They are Andorra, etc and
apparently really valid. The error message though suggests that the
import was not successful. Could this be fixed?
This might have been fixed already in trunk, please test!
Unfortunately not:
GRASS 7.1.svn (eu_etrs89):~ > g.version -g
version=7.1.svn
date=2015
revision=64567
build_date=2015-01-11
build_platform=x86_64-unknown-linux-gnu
GRASS 7.1.svn (eu_etrs89):~ > v.in.ogr
/data/maps/nuts3/NUTS_2010_03M_SH/Data/NUTS_RG_03M_2010.shp
output=NUTS_RG_03M_2010 --o
...
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Unable to calculate area centroid
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
...
Attaching centroids...
100%
Number of nodes: 32451
Number of primitives: 59076
Number of points: 0
Number of lines: 0
Number of boundaries: 48083
Number of centroids: 10993
Number of areas: 16925
Number of isles: 1335
WARNING: Number of incorrect boundaries: 36
-----------------------------------------------------
Some input polygons are overlapping each other.
If overlapping is not desired, the data need to be cleaned.
The input could be cleaned by snapping vertices to each other.
Estimated range of snapping threshold: [1e-13, 1e-05]
Try to import again, snapping with at least 1e-13: 'snap=1e-13'
--> the messages are the same. But...
# snapping
GRASS 7.1.svn (eu_etrs89):~ > v.in.ogr
/data/maps/nuts3/NUTS_2010_03M_SH/Data/NUTS_RG_03M_2010.shp
output=NUTS_RG_03M_2010 snap=1e-08 --o
Note: In latitude-longitude coordinate system specify threshold in degree
unit
Check if OGR layer <NUTS_RG_03M_2010> contains polygons...
100%
WARNING: Vector map <NUTS_RG_03M_2010> already exists and will be
overwritten
Importing 1920 features (OGR layer <NUTS_RG_03M_2010>)...
100%
-----------------------------------------------------
Registering primitives...
24361 primitives registered
844894 vertices registered
Number of nodes: 15122
Number of primitives: 24361
Number of points: 0
Number of lines: 0
Number of boundaries: 24361
Number of centroids: 0
Number of areas: -
Number of isles: -
-----------------------------------------------------
Cleaning polygons
-----------------------------------------------------
Snapping boundaries (threshold = 1.000e-08)...
Reading features...
Snap vertices Pass 1: select points
100%
Snap vertices Pass 2: assign anchor vertices
100%
Snap vertices Pass 3: snap to assigned points
100%
-----------------------------------------------------
Breaking polygons...
Breaking polygons (pass 1: select break points)...
100%
Breaking polygons (pass 2: break at selected points)...
100%
-----------------------------------------------------
Removing duplicates...
100%
-----------------------------------------------------
Breaking boundaries...
100%
-----------------------------------------------------
Removing duplicates...
100%
-----------------------------------------------------
Cleaning boundaries at nodes...
100%
-----------------------------------------------------
Merging boundaries...
100%
-----------------------------------------------------
Removing dangles...
100%
-----------------------------------------------------
Building areas...
100%
2759 areas built
1315 isles built
Number of nodes: 20120
Number of primitives: 94462
Number of points: 0
Number of lines: 0
Number of boundaries: 94462
Number of centroids: 0
Number of areas: 2759
Number of isles: 1315
-----------------------------------------------------
Removing bridges...
100%
-----------------------------------------------------
Registering primitives...
5664 primitives registered
214577 vertices registered
Building areas...
100%
2759 areas built
1315 isles built
Attaching islands...
100%
Number of nodes: 4220
Number of primitives: 5664
Number of points: 0
Number of lines: 0
Number of boundaries: 5664
Number of centroids: 0
Number of areas: 2759
Number of isles: 1315
-----------------------------------------------------
Finding centroids for OGR layer <NUTS_RG_03M_2010>...
100%
-----------------------------------------------------
Writing centroids...
100%
WARNING: 2748 areas represent more (overlapping) features, because polygons
overlap in input layer(s). Such areas are linked to more than 1
row in attribute table. The number of features for those areas is
stored as category in layer 2
-----------------------------------------------------
7007 input polygons
Total area: 5.75852E+12 (2759 areas)
Overlapping area: 5.74784E+12 (2748 areas)
Area without category: 5.32057E+08 (4 areas)
-----------------------------------------------------
Copying features...
100%
Building topology for vector map <NUTS_RG_03M_2010@PERMANENT>...
Registering primitives...
8419 primitives registered
217332 vertices registered
Building areas...
100%
2759 areas built
1315 isles built
Attaching islands...
100%
Attaching centroids...
100%
Number of nodes: 4220
Number of primitives: 8419
Number of points: 0
Number of lines: 0
Number of boundaries: 5664
Number of centroids: 2755
Number of areas: 2759
Number of isles: 1315
-----------------------------------------------------
Some input polygons are overlapping each other.
If overlapping is not desired, the data need to be cleaned.
The input could be cleaned by snapping vertices to each other.
Estimated range of snapping threshold: [1e-13, 1e-05]
Try to import again, snapping with 1e-07: 'snap=1e-07'
GRASS 7.1.svn (eu_etrs89):~ >
--> no scary messages. Yet to understand what the optimal snapping
threshold is but that's a different question.
On Wed, Feb 11, 2015 at 9:34 PM, Markus Neteler <neteler@osgeo.org> wrote:
HI,
I tried to import the NUTS3 map(s) from EU which leads to some obscur
warnings (see below). While most can be solved with a "mild" snapping,
still four islands are reported as an error.
The islands are not reported as an error. The error is that 9912 areas
(2748 areas with snap=1e-8) overlap. It is up to the user to decide if
overlapping areas are ok or not. The G7.1 message reports that areas
are overlapping, this might be an error or not. The G7.0 message says
that overlapping areas are errors, which is wrong because overlapping
areas can indeed occur.
With regard to the test data, I think I know this Europe NUTS3
dataset. Some areas are double labeled, snapping will not help here.
You need to look at the overlapping areas (layer=2) and you need to
decide which label in layer=1 (the area has several labels in layer 1)
is most probably correct (hint: search for other areas with the same
label in layer 1).
Markus M
They are Andorra, etc and
apparently really valid. The error message though suggests that the
import was not successful. Could this be fixed?
# create new location from SHP file
grass70 -c NUTS_BN_03M_2010.shp ~/grassdata/eu_etrs89
g.proj -w
# import NUTS3 polygons (performs topology check)
v.in.ogr input=NUTS_RG_03M_2010.shp output=NUTS_RG_03M_00
...
Cleaning polygons
-----------------------------------------------------
Breaking polygons...
...
-----------------------------------------------------
Building areas...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
100%
16926 areas built
1325 isles built
Number of nodes: 113763
Number of primitives: 355557
Number of points: 0
Number of lines: 0
Number of boundaries: 355557
Number of centroids: 0
Number of areas: 16926
Number of isles: 1325
WARNING: Number of incorrect boundaries: 157
-----------------------------------------------------
Removing bridges...
100%
-----------------------------------------------------
Registering primitives...
48083 primitives registered
343316 vertices registered
Building areas...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
100%
16925 areas built
1335 isles built
Attaching islands...
100%
Number of nodes: 32451
Number of primitives: 48083
Number of points: 0
Number of lines: 0
Number of boundaries: 48083
Number of centroids: 0
Number of areas: 16925
Number of isles: 1335
WARNING: Number of incorrect boundaries: 36
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
...
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
-----------------------------------------------------
Finding centroids for OGR layer <NUTS_RG_03M_2010>...
100%
-----------------------------------------------------
Writing centroids...
100%
WARNING: 9912 areas represent more (overlapping) features, because polygons
overlap in input layer(s). Such areas are linked to more than 1
row in attribute table. The number of features for those areas is
stored as category in layer 2
-----------------------------------------------------
7007 input polygons
Total area: 5.75852E+12 (16925 areas)
Overlapping area: 5.74784E+12 (9912 areas)
Area without category: 5.32057E+08 (19 areas)
-----------------------------------------------------
Copying features...
100%
Building topology for vector map <NUTS_RG_03M_2010@PERMANENT>...
Registering primitives...
59076 primitives registered
354309 vertices registered
Building areas...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
100%
16925 areas built
1335 isles built
Attaching islands...
100%
Attaching centroids...
100%
Number of nodes: 32451
Number of primitives: 59076
Number of points: 0
Number of lines: 0
Number of boundaries: 48083
Number of centroids: 10993
Number of areas: 16925
Number of isles: 1335
WARNING: Number of incorrect boundaries: 36
-----------------------------------------------------
WARNING: Errors were encountered during the import
Estimated range of snapping threshold: [1e-13, 1e-05]
Try to import again, snapping with at least 1e-13: 'snap=1e-13'
# --> the "WARNING: Vect_get_point_in_poly_isl(): collapsed area"
looks like a debug message to an average user.
# NEW ATTEMPT WITH SNAPPING
GRASS 7.0.0svn (eu_etrs89): > v.in.ogr input=NUTS_RG_03M_2010.shp
output=NUTS_RG_03M_2010 snap=1e-8 --o
...
Writing centroids...
100%
WARNING: 2748 areas represent more (overlapping) features, because polygons
overlap in input layer(s). Such areas are linked to more than 1
row in attribute table. The number of features for those areas is
stored as category in layer 2
-----------------------------------------------------
7007 input polygons
Total area: 5.75852E+12 (2759 areas)
Overlapping area: 5.74784E+12 (2748 areas)
Area without category: 5.32057E+08 (4 areas)
-----------------------------------------------------
Copying features...
100%
Building topology for vector map <NUTS_RG_03M_2010@PERMANENT>...
Registering primitives...
8419 primitives registered
217332 vertices registered
Building areas...
100%
2759 areas built
1315 isles built
Attaching islands...
100%
Attaching centroids...
100%
Number of nodes: 4220
Number of primitives: 8419
Number of points: 0
Number of lines: 0
Number of boundaries: 5664
Number of centroids: 2755
Number of areas: 2759
Number of isles: 1315
-----------------------------------------------------
WARNING: Errors were encountered during the import
Estimated range of snapping threshold: [1e-13, 1e-05]
Try to import again, snapping with 1e-07: 'snap=1e-07'
v.build NUTS_RG_03M_2010 error=NUTS_RG_03M_2010_errors
...
Number of nodes: 4
Number of primitives: 4
Number of points: 0
Number of lines: 0
Number of boundaries: 4
Number of centroids: 0
Number of areas: 4
Number of isles: 4
The "WARNING: Errors were encountered during the import" is scary
while it seems to be valid islands (Andorra, San Marino, two islands
near Rome).
On Thu, Feb 12, 2015 at 11:16 PM, Markus Metz
<markus.metz.giswork@gmail.com> wrote:
On Wed, Feb 11, 2015 at 9:34 PM, Markus Neteler <neteler@osgeo.org> wrote:
...
The G7.1 message reports that areas
are overlapping, this might be an error or not. The G7.0 message says
that overlapping areas are errors, which is wrong because overlapping
areas can indeed occur.
Do you plan to sync the two versions of v.in.ogr?
There are differences in geom.c, main.c and the manual.
On Fri, Feb 13, 2015 at 10:42 AM, Markus Neteler <neteler@osgeo.org> wrote:
On Thu, Feb 12, 2015 at 11:16 PM, Markus Metz
<markus.metz.giswork@gmail.com> wrote:
On Wed, Feb 11, 2015 at 9:34 PM, Markus Neteler <neteler@osgeo.org> wrote:
...
The G7.1 message reports that areas
are overlapping, this might be an error or not. The G7.0 message says
that overlapping areas are errors, which is wrong because overlapping
areas can indeed occur.
Do you plan to sync the two versions of v.in.ogr?
There are differences in geom.c, main.c and the manual.
Yes, for G 7.0.1. For G 7.0.0 it is too late, only serious bug fixes
should go in.
On Thu, Feb 12, 2015 at 11:16 PM, Markus Metz
<markus.metz.giswork@gmail.com> wrote:
On Wed, Feb 11, 2015 at 9:34 PM, Markus Neteler <neteler@osgeo.org> wrote:
HI,
I tried to import the NUTS3 map(s) from EU which leads to some obscur
warnings (see below). While most can be solved with a "mild" snapping,
still four islands are reported as an error.
The islands are not reported as an error. The error is that 9912 areas
(2748 areas with snap=1e-8) overlap. It is up to the user to decide if
overlapping areas are ok or not. The G7.1 message reports that areas
are overlapping, this might be an error or not. The G7.0 message says
that overlapping areas are errors, which is wrong because overlapping
areas can indeed occur.
In this case, overlapping areas are ok because NUTS_RG_03M_2010.shp
contains several different administrative levels which obviously
overlap. If you want to import only one level, use v.in.ogr
where="STAT_LEVL_ = X" with X in [0, 3]. Now there should be no more
overlapping areas.
Markus M
With regard to the test data, I think I know this Europe NUTS3
dataset. Some areas are double labeled, snapping will not help here.
You need to look at the overlapping areas (layer=2) and you need to
decide which label in layer=1 (the area has several labels in layer 1)
is most probably correct (hint: search for other areas with the same
label in layer 1).
Markus M
They are Andorra, etc and
apparently really valid. The error message though suggests that the
import was not successful. Could this be fixed?
# create new location from SHP file
grass70 -c NUTS_BN_03M_2010.shp ~/grassdata/eu_etrs89
g.proj -w
# import NUTS3 polygons (performs topology check)
v.in.ogr input=NUTS_RG_03M_2010.shp output=NUTS_RG_03M_00
...
Cleaning polygons
-----------------------------------------------------
Breaking polygons...
...
-----------------------------------------------------
Building areas...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
100%
16926 areas built
1325 isles built
Number of nodes: 113763
Number of primitives: 355557
Number of points: 0
Number of lines: 0
Number of boundaries: 355557
Number of centroids: 0
Number of areas: 16926
Number of isles: 1325
WARNING: Number of incorrect boundaries: 157
-----------------------------------------------------
Removing bridges...
100%
-----------------------------------------------------
Registering primitives...
48083 primitives registered
343316 vertices registered
Building areas...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
100%
16925 areas built
1335 isles built
Attaching islands...
100%
Number of nodes: 32451
Number of primitives: 48083
Number of points: 0
Number of lines: 0
Number of boundaries: 48083
Number of centroids: 0
Number of areas: 16925
Number of isles: 1335
WARNING: Number of incorrect boundaries: 36
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
...
WARNING: Unable to calculate area centroid
WARNING: Vect_get_point_in_poly_isl(): collapsed area
WARNING: Unable to calculate area centroid
-----------------------------------------------------
Finding centroids for OGR layer <NUTS_RG_03M_2010>...
100%
-----------------------------------------------------
Writing centroids...
100%
WARNING: 9912 areas represent more (overlapping) features, because polygons
overlap in input layer(s). Such areas are linked to more than 1
row in attribute table. The number of features for those areas is
stored as category in layer 2
-----------------------------------------------------
7007 input polygons
Total area: 5.75852E+12 (16925 areas)
Overlapping area: 5.74784E+12 (9912 areas)
Area without category: 5.32057E+08 (19 areas)
-----------------------------------------------------
Copying features...
100%
Building topology for vector map <NUTS_RG_03M_2010@PERMANENT>...
Registering primitives...
59076 primitives registered
354309 vertices registered
Building areas...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
100%
16925 areas built
1335 isles built
Attaching islands...
100%
Attaching centroids...
100%
Number of nodes: 32451
Number of primitives: 59076
Number of points: 0
Number of lines: 0
Number of boundaries: 48083
Number of centroids: 10993
Number of areas: 16925
Number of isles: 1335
WARNING: Number of incorrect boundaries: 36
-----------------------------------------------------
WARNING: Errors were encountered during the import
Estimated range of snapping threshold: [1e-13, 1e-05]
Try to import again, snapping with at least 1e-13: 'snap=1e-13'
# --> the "WARNING: Vect_get_point_in_poly_isl(): collapsed area"
looks like a debug message to an average user.
# NEW ATTEMPT WITH SNAPPING
GRASS 7.0.0svn (eu_etrs89): > v.in.ogr input=NUTS_RG_03M_2010.shp
output=NUTS_RG_03M_2010 snap=1e-8 --o
...
Writing centroids...
100%
WARNING: 2748 areas represent more (overlapping) features, because polygons
overlap in input layer(s). Such areas are linked to more than 1
row in attribute table. The number of features for those areas is
stored as category in layer 2
-----------------------------------------------------
7007 input polygons
Total area: 5.75852E+12 (2759 areas)
Overlapping area: 5.74784E+12 (2748 areas)
Area without category: 5.32057E+08 (4 areas)
-----------------------------------------------------
Copying features...
100%
Building topology for vector map <NUTS_RG_03M_2010@PERMANENT>...
Registering primitives...
8419 primitives registered
217332 vertices registered
Building areas...
100%
2759 areas built
1315 isles built
Attaching islands...
100%
Attaching centroids...
100%
Number of nodes: 4220
Number of primitives: 8419
Number of points: 0
Number of lines: 0
Number of boundaries: 5664
Number of centroids: 2755
Number of areas: 2759
Number of isles: 1315
-----------------------------------------------------
WARNING: Errors were encountered during the import
Estimated range of snapping threshold: [1e-13, 1e-05]
Try to import again, snapping with 1e-07: 'snap=1e-07'
v.build NUTS_RG_03M_2010 error=NUTS_RG_03M_2010_errors
...
Number of nodes: 4
Number of primitives: 4
Number of points: 0
Number of lines: 0
Number of boundaries: 4
Number of centroids: 0
Number of areas: 4
Number of isles: 4
The "WARNING: Errors were encountered during the import" is scary
while it seems to be valid islands (Andorra, San Marino, two islands
near Rome).