[Qgis-developer] Large scale and rounding issues

Marco Hugentobler marco.hugentobler at sourcepole.ch
Sun May 25 23:59:57 PDT 2014


Hi Leyan

QgsGeometry::lineContainedInLine and QgsGeometry::pointContainedInLine 
are two other places using tolerances that might be a problem at large 
scales.
Sounds resonable to me to restrict the zoom level at a point where it 
cannot be supported anymore. Don't know if there is any application out 
there using scales beyond 1000:1.

Regards,
Marco



On 25.05.2014 05:38, Leyan wrote:
> Hi devs,
>
> QGis allows quite a lot of zooming in: it is easy by playing with the 
> mouse wheel to go to scales like 3,000,000:1. However, this does not 
> mean QGis actually support them and different features will start to 
> fail at different zoom level, some of them quite early. For example, 
> labelling will fail around 1:1 in some cases (linked to geographic 
> coordinate systems?). Node edition, snapping also fail quite early. 
> Later, display starts to become erratic, with some lines or nodes 
> disappearing randomly.
>
> For example, http://hub.qgis.org/issues/10234 is a user doing some 
> large scale mapping of a building in WGS84 (maybe not ideal, but in 
> theory supported by QGis). He has some issues to select nodes for 
> edition.
>
> I looked in the code and found a culprit on qgsvectorlayer.cpp line 
> 2451 : there is a epsilon defined as "crs().geographicFlag() ? 1e-12 : 
> 1e-8" , but this epsilon is later compared to the square of the 
> distance, and the distance considered zero if smaller. This means that 
> all distances below 1e-6 degree, which is around 10 cm, will be 
> considered zero, which prevents selecting the correct node or segment.
>
> Of course, this is not an issue for most use cases, but this can 
> affect some legitimate use.
>
> More important, the limits are not consistant and there is no 
> guarantee for the user about which feature will be available or not at 
> which level of precision.
>
> I would like to restrict more strictly the zoom level (something like 
> 1000:1?), but ensure all features work as expected at these zoom 
> levels (or maybe make two categories of zoom, a "normal" one where 
> everything works and an "extended" one with no guarantee). Then the 
> DEFAULT_SEGMENT_EPSILON and other constants can be derived for both 
> geographic and projected coordinate systems.
>
> What do you think ?
>
> Leyan
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


-- 
Dr. Marco Hugentobler
Sourcepole -  Linux & Open Source Solutions
Weberstrasse 5, CH-8004 Zürich, Switzerland
marco.hugentobler at sourcepole.ch http://www.sourcepole.ch
Technical Advisor QGIS Project Steering Committee



More information about the Qgis-developer mailing list