Bug report #11243
Data corruption with feature 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|
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
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
#2 Updated by Alvaro Huarte about 7 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.
#4 Updated by Alvaro Huarte about 7 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.