Bug report #14653

topology errors by digitizing

Added by Thomas Nogatz about 8 years ago. Updated almost 8 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Digitising
Affected QGIS version:2.8.8 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:22617

Description

Hello QGIS-Team,

I use QGIS to map biotopes. Usually there is a given region border that has to be filled with biotope polygons gaplessly. So we have to create the following polygon shapefiles:
- border (a rectangle with a hole in the form of the boundary of the study area to be mapped)
- biotopes (polygones gaplessly filling the study area)

Before getting started with digitizing biotopes: In order to prevent exceeding the boundary of the study area and prevent overlapping of biotopes we have to set snapping options:
- Settings > Snapping options...
- Snapping mode: Advanced
- Avoid intersections for biotopes and border

Now we completely fill the study area with biotope polygons.

Once these shapefiles are finished we have to check the topology using at least following rules:
- biotopes must not have gaps
- biotopes must not overlap

In order to check the topology between border and biotopes we can copy the border polygon into the biotopes shapefile (disable snapping option "avoid intersections" before doing that).

Checking the topology now, mostly (not in every case, but likelihood grows with number of biotope polygons and vertices) some topology errors will appear. It is a matter of a few millimeters mostly - some vertices which should lie exactly one above the other do not so.

Ofcourse one can use Grass GIS (v.in.ogr) to repair the topology - but the border shape should not be changed.

So it would be the best solution if digitizing tools would work exactly together with the snapping option "Avoid intersections".

I have attached some sample QGIS projects with shapefiles (relative paths are set):

QGIS 2.08.06 TEST.zip
- created with QGIS 2.8.6
- two projects (geographical (EPSG 4326) / projected (EPSG 5555) coordinate system)
- additional error shapefiles using snapping option "Avoid intersections"

QGIS 2.08.08 TEST.zip
- created with QGIS 2.8.8
- EPSG 5555
- it was not possible to create an error shapefile using snapping option "Avoid intersections" for the biotope shapefile - drawing a polygon a bit smaller than the border rectangle resulted in a large polygon intersecting all biotopes

QGIS 2.14 TEST.zip and QGIS 2.15 TEST.zip
- it is not possible at all to digitize like described above using Versions 2.14 or 2.15: Additional vertices are set (randomly???) and snapping option "Avoid intersections" does not work

Best wishes
Thomas

QGIS_2.08.06_TEST.zip (27.2 KB) Thomas Nogatz, 2016-04-10 02:12 AM

QGIS_2.08.08_TEST.zip (11.3 KB) Thomas Nogatz, 2016-04-10 02:12 AM

QGIS_2.14_TEST.zip (6.52 KB) Thomas Nogatz, 2016-04-10 02:12 AM

QGIS_2.15_TEST.zip (6.73 KB) Thomas Nogatz, 2016-04-10 02:12 AM

QGIS_2.08.08_TEST_20160413.zip (23.8 KB) Thomas Nogatz, 2016-04-13 03:49 AM

QGIS_2_8_8_EPSG3044.zip (19.5 KB) Thomas Nogatz, 2016-04-14 12:26 PM

History

#1 Updated by Giovanni Manghi about 8 years ago

  • Status changed from Open to Feedback

considered the relevance of this report I would suggest to raise this issue in the developers and users mailing lists, thanks.

#2 Updated by Giovanni Manghi about 8 years ago

PS
it also known that the "topology checker" tool returns false positives see #13296

I guess that have you checked if is the case, right?

#3 Updated by Thomas Nogatz about 8 years ago

I have not experienced a false positive by the topology checker tool by now. Importing+exporting a shapefile by GRASS had solved all such topology errors (gaps, overlaps) reported by topology checker. No shapefile exported by GRASS did cause gaps or overlaps listed by topology checker in the past three years - that's what I have experienced.

I have attached a further example project with some layers created with QGIS 2.8.8 - the QGIS_2.08.08_TEST.zip I have posted 3 days ago had different KBS (layer: 4326, project: 5555):
- border_5555.shp
- biotopes_5555.shp (with added border polygon the way described 3 days ago (copied and pasted from border_5555.shp without "avoid intersection"); topology checker reports 2 gaps and 8 overlappings between border and biotopes, biotopes themself are topologically clean)
- gaps_5555.shp (created with "avoid intersection" for biotopes+border)
- biotopes_5555_grass.shp (biotopes_5555.shp imported and exported by GRASS (v.in.ogr.qgis leaving all parameters as they are / v.out.ogr) - no errors reported by topology checker now)

#4 Updated by Giovanni Manghi about 8 years ago

Thomas Nogatz wrote:

I have not experienced a false positive by the topology checker tool by now. Importing+exporting a shapefile by GRASS had solved all such topology errors (gaps, overlaps) reported by topology checker. No shapefile exported by GRASS did cause gaps or overlaps listed by topology checker in the past three years - that's what I have experienced.

I have attached a further example project with some layers created with QGIS 2.8.8 - the QGIS_2.08.08_TEST.zip I have posted 3 days ago had different KBS (layer: 4326, project: 5555):
- border_5555.shp
- biotopes_5555.shp (with added border polygon the way described 3 days ago (copied and pasted from border_5555.shp without "avoid intersection"); topology checker reports 2 gaps and 8 overlappings between border and biotopes, biotopes themself are topologically clean)
- gaps_5555.shp (created with "avoid intersection" for biotopes+border)
- biotopes_5555_grass.shp (biotopes_5555.shp imported and exported by GRASS (v.in.ogr.qgis leaving all parameters as they are / v.out.ogr) - no errors reported by topology checker now)

just imported your layer biotopes_5555.shp into a GRASS mapset: no gaps, no overlapped areas.

#5 Updated by Thomas Nogatz about 8 years ago

that's right. GRASS does not report any error during import process.

To understand what happens when GRASS imports and exports a shapefile I've just created a very simple polygon layer with a triangle. Then I imported this into GRASS and exported it again as shapefile. Now I exported the attribute tables to excel and compared the coordinates of every vertex. All vertex coordinates had tiny differences! Its about 0,0001mm.

The result of this test: GRASS changes the coordinates a tiny bit (in spite of reporting no errors).
I suppose the following: If the difference between to vertices is big enough to be reported as topology error by topology checker and tiny enough to be considered as equal by GRASS then GRASS does not report an error after shapefile import. That does not mean that there is no topological error - it's just a tiny one, tolerated by the GRASS import procedure.

Back to the project I've provided today. Try to merge the rightmost polygon of the biotopes with the border polygon - there will be a visible merging error in the upper region. So it is not possible to say there is no topological error in spite GRASS does not report one.

#6 Updated by Thomas Nogatz about 8 years ago

v.in.ogr seems to have a built-in tiny snapping tolerance. Topology errors smaller than that tolerance are not reported. But they do exist.

#7 Updated by Giovanni Manghi about 8 years ago

Thomas Nogatz wrote:

v.in.ogr seems to have a built-in tiny snapping tolerance. Topology errors smaller than that tolerance are not reported. But they do exist.

it should not

https://grass.osgeo.org/grass70/manuals/v.in.ogr.html

by default "snap" is -1 = no snap

#8 Updated by Giovanni Manghi about 8 years ago

@ Markus Neteler could you shed some light on this matter?

#9 Updated by Markus Neteler about 8 years ago

Thomas Nogatz wrote:

v.in.ogr seems to have a built-in tiny snapping tolerance. Topology errors smaller than that tolerance are not reported. But they do exist.

This is not the case. v.in.ogr does not snap by default.

#10 Updated by Thomas Nogatz about 8 years ago

The tiny differences between the coordinates originated from changing of the KBS - GRASS changed the KBS from EPSG5555 to EPSG3044 during import (instead of 5555 was choosen for the GRASS region).

Now I've prepared a project with EPSG3044 for QGIS and GRASS. The test with the triangle resulted in no differences between coordinates. Importing and exporting to / from GRASS does not change the KBS and does not change the coordinates.

The topology checker shows two overlappings for biotopes3044.shp - but shows no red marker lines clicking on "show errors". Clicking on the messages shows that feature no 4 is affected. Merging all neighbour features is possible without problems. There seems to be no topological error instead of being reported by the checker.

biotops3044_grass_copy.shp results from importing/exporting biotopes3044.shp to/from GRASS without changing parameters and without snapping (and without reporting errors). The topology checker does not report any error for biotops3044_grass_copy.shp.

So there should exist a little (not visualisable?) difference between both shapefiles. This would mean that the topology checker works exactly and reacts very sensitively.

#11 Updated by Giovanni Manghi almost 8 years ago

So there should exist a little (not visualisable?) difference between both shapefiles. This would mean that the topology checker works exactly and reacts very sensitively.

where do we stand with this ticket?

#12 Updated by Giovanni Manghi almost 8 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

The topology checker shows two overlappings for biotopes3044.shp - but shows no red marker lines clicking on "show errors". Clicking on the messages shows that feature no 4 is affected. Merging all neighbour features is possible without problems. There seems to be no topological error instead of being reported by the checker.

then closing. The issue here seems to be some rounding/precision problem that anyway does not mean that digitizing in qgis is topologically incorrect.

Also available in: Atom PDF