[GRASS-dev] v.in.ogr: islands not recognized
Markus Metz
markus.metz.giswork at gmail.com
Thu Feb 12 14:16:29 PST 2015
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.
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?
>
> # Download NUTS3 2010, 3M and 10M
> # http://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units
>
> # 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 at 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 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
> -----------------------------------------------------
> 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).
>
> thanks
> Markus
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
More information about the grass-dev
mailing list