Bug report #11243

Data corruption with feature simplification.

Added by Chris Crook about 10 years ago. Updated about 10 years ago.

Status:Closed
Priority:Normal
Assignee:Alvaro Huarte
Category:Simplification
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:19546

Description

QGIS can corrupt data badly during feature simplification. This is demonstrated by the attached files which render a coastline of New Zealand. Depending upon the extents of the view the coastline can be rendered perfectly, or can be completely corrupted, as shown in the attached images.

Perhaps a better behaviour would be to render the unsimplified version if errors are encountered doing the simplification?

The log shows multiple errors along the lines of:

2014-09-22T11:21:59 1 Simplify transform error caught: forward transform of
(0.000000, -0.707565)
PROJ.4: +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs +to +proj=tmerc +lat_0=0 +lon_0=173 +k=0.9996 +x_0=1600000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
Error: latitude or longitude exceeded limits

rendering_bug.png - Bad rendering of coastline - the problem (81.3 KB) Chris Crook, 2014-09-21 04:43 PM

after_panning.png - Demonstrates effect of panning to not include dateline in view (82.7 KB) Chris Crook, 2014-09-21 04:43 PM

simplification_issue.zip - Project and data files (957 KB) Chris Crook, 2014-09-21 04:43 PM

Associated revisions

Revision 697ebffe
Added by Jürgen Fischer about 10 years ago

Merge pull request #1616 from ahuarte47/Issue_11243

Fix #11243: Data corruption with feature simplification

History

#1 Updated by Giovanni Manghi about 10 years ago

  • Assignee set to Alvaro Huarte
  • Operating System deleted (multiple)

#2 Updated by Alvaro Huarte about 10 years ago

  • Pull Request or Patch supplied changed from No to Yes

Hi, the pull request 1616 ( https://github.com/qgis/QGIS/pull/1616 ) fixes this issue.

It disables the simplification when the reverse transform to calculate the center of current visible extent fails.

The QgsCoordinateTransform::transformBoundingBox() method swap the sign of the maximum longitude value when it is greater than 180.0 as in attached map-data of the issue. Maybe this method needs a fix in order to preserve the sign of the minimun and maximum longitude values of the visible extent.

#3 Updated by Chris Crook about 10 years ago

I can confirm that this patch solves the display issue (still get the warning messages - probably useful)
Thanks for looking at this

#4 Updated by Alvaro Huarte about 10 years ago

Chris Crook wrote:

I can confirm that this patch solves the display issue (still get the warning messages - probably useful)
Thanks for looking at this

Thanks Chris, the error comes of other issue, maybe extra modifications are needed to avoid the incorrect visible extent calculation when the OTFR is enabled.

#5 Updated by Paolo Cavallini about 10 years ago

  • Subject changed from Data corruption with with feature simplification. to Data corruption with feature simplification.

#6 Updated by Jürgen Fischer about 10 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF