[QGIS-Developer] Problems with adopting scaled representation from QGIS
Alessandro Pasotti
apasotti at gmail.com
Wed Mar 17 02:49:28 PDT 2021
Hi Otto,
Here you go:https://github.com/qgis/QGIS/pull/42292
Let's hope that the tests do not fail due to the new rounding logic
(the old implementation was losing precision by taking the DPI from
the integer value of the paint device).
On Wed, Mar 17, 2021 at 8:29 AM Otto Dassau <dassau at gbd-consult.de> wrote:
>
> Hi Alessandro,
>
> sorry, put it also here:
> https://nextcloud.gbd-consult.de/s/QRXAiQdABZGKiXK
>
> Regards,
> Otto
>
> On Wed, 17 Mar 2021 08:14:02 +0100
> Alessandro Pasotti <apasotti at gmail.com> wrote:
>
> > Hi Otto,
> >
> > I would give it a look but credentials are required to download the test data:
> >
> > > The project file and data are in https://gitlab.gbd-consult.de/gws/gws-dev/tree/master/data/shared (poi_scaled.qgs and poi / subfolder).
> >
> >
> >
> >
> > On Wed, Mar 17, 2021 at 6:55 AM Otto Dassau <dassau at gbd-consult.de> wrote:
> > >
> > > Dear Developers,
> > >
> > > i would like to describe a problem using QGIS WMS with defined scale visibility for layers. We already spent quite some time on it and for us it seems to be a wrong scale calculation in QGIS. But since we are not sure we would like to ask, if someone, deeper in the code, can have a look and, if it is the case, can provide a (payed) fix.
> > >
> > > To better describe the problem we provide a sample web project under https://gws-dev.gbd-consult.de/project/scales_qgis/@753753,6661615,100000
> > >
> > > The "Bank" layer has a scale-dependent representation defined in QGIS between 100000 - 80000, but is not rendered by QGIS at the scale 100000.
> > >
> > > QGIS server is called with these parameters:
> > >
> > > http://localhost:4000?
> > > layers=Bank%20100000-80000
> > > &map=%2Fdata%2Fshared%2Fpoi_scaled.qgs
> > > &transparent=True
> > > &bbox=748163.2561805135,6646683.920240255,767707.2561805135,6679247.920240255
> > > &width=698
> > > &height=1163
> > > &srs=EPSG%3A3857
> > > &format=image%2Fpng
> > > &request=GetMap
> > > &version=1.1.1
> > > &service=WMS
> > > &styles=
> > >
> > > The resolution (meter per pixel) results from bbox and width
> > >
> > > (767707.2561805135 - 748163.2561805135) / 698 = 28
> > >
> > > According to OGC specifications, 1px = 0.28 mm x 0.28 mm, i.e. the scale here must be exactly 100000. But QGIS calculates it differently (excerpt from the debug log):
> > >
> > > src/core/geometry/qgsrectangle.cpp:152 : (toString) [0ms] Extents : 748163.2561805135337636,6646683.9202402550727129 : 767707.2561805135337636,6679247.9202402550727129
> > > src/core/qgsmapsettings.cpp:222 : (updateDerived) [0ms] 748163.2561805135337636,6646683.9202402550727129 : 767707.2561805135337636,6679247.9202402550727129
> > > src/core/qgsmapsettings.cpp:223 : (updateDerived) [1ms] Adjusted map units per pixel (x,y) : 28, 28
> > > src/core/qgsmapsettings.cpp:224 : (updateDerived) [0ms] Recalced pixmap dimensions (x,y) : 698, 1163
> > > src/core/qgsmapsettings.cpp:225 : (updateDerived) [0ms] Scale (assuming meters as map units) = 1:100314.96052759999292903
> > >
> > > The scale (with the same bbox / width) is calculated as "1: 100314", and because that is greater than 100,000, the layer is not rendered by QGIS.
> > >
> > > We assume that there is a rounding error somewhere. As said we would be happy if a QGIS dev could have a look. The project file and data are in https://gitlab.gbd-consult.de/gws/gws-dev/tree/master/data/shared (poi_scaled.qgs and poi / subfolder).
> > >
> > > Thanks a lot!
> > > Otto
> > >
> > > --
> > > Geoinformatikbüro Dassau GmbH
> > > Rethelstrasse 153
> > > D - 40237 Düsseldorf
> > > Tel: +49-211-69937750
> > > Mobil: +49-171-4687540
> > > https://www.gbd-consult.de
> > >
> > > Registergericht: Amtsgericht Düsseldorf, HR B 74022
> > > Geschäftsführer: Otto Dassau
> > > _______________________________________________
> > > QGIS-Developer mailing list
> > > QGIS-Developer at lists.osgeo.org
> > > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >
> >
> >
> > --
> > Alessandro Pasotti
> > QCooperative: www.qcooperative.net
> > ItOpen: www.itopen.it
>
>
> --
> Geoinformatikbüro Dassau GmbH
> Rethelstrasse 153
> D - 40237 Düsseldorf
> Tel: +49-211-69937750
> Mobil: +49-171-4687540
> https://www.gbd-consult.de
>
> Registergericht: Amtsgericht Düsseldorf, HR B 74022
> Geschäftsführer: Otto Dassau
--
Alessandro Pasotti
QCooperative: www.qcooperative.net
ItOpen: www.itopen.it
More information about the QGIS-Developer
mailing list