[GRASS-dev] v.in.ogr: islands not recognized
Markus Neteler
neteler at osgeo.org
Wed Feb 11 13:18:37 PST 2015
On Wed, Feb 11, 2015 at 9:47 PM, Markus Metz
<markus.metz.giswork at gmail.com> wrote:
> On Wed, Feb 11, 2015 at 9:34 PM, Markus Neteler <neteler at 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 at 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.
Markus
More information about the grass-dev
mailing list