[Qgis-developer] Large scale and rounding issues

Leyan ouyang.leyan.ml at hotmail.com
Sat May 24 20:38:35 PDT 2014

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 ?


More information about the Qgis-developer mailing list