Skip to content
Permalink
Browse files

Merge pull request #42292 from elpaso/bugfix-wms-scale-dpi-rounding-e…

…rror

Fix WMS DPI scale rounding error
  • Loading branch information
elpaso authored and github-actions committed Mar 18, 2021
1 parent 50c0728 commit b93a8e45dbe8d317f486efd2fd748a9154495204
Showing with 5 additions and 27 deletions.
  1. +1 −25 .docker/docker-qgis-test.sh
  2. +1 −1 src/server/services/wms/qgswmsrendercontext.cpp
  3. +3 −1 src/server/services/wms/qgswmsrenderer.cpp
  4. BIN ...faultMapUnitsPerMillimeter/WMS_GetLegendGraphic_ScaleSymbol_DefaultMapUnitsPerMillimeter_mask.png
  5. BIN ...ultMapUnitsPerMillimeter/WMS_GetLegendGraphic_ScaleSymbol_DefaultMapUnitsPerMillimeter_result.png
  6. BIN ...Graphic_ScaleSymbol_DefaultScale_2056/WMS_GetLegendGraphic_ScaleSymbol_DefaultScale_2056_mask.png
  7. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Annotations/WMS_GetMap_Annotations_mask.png
  8. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Background/WMS_GetMap_Background_mask.png
  9. BIN .../testdata/control_images/qgis_server/WMS_GetMap_Background_Hex/WMS_GetMap_Background_Hex_mask.png
  10. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Basic/WMS_GetMap_Basic_mask.png
  11. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Basic2/WMS_GetMap_Basic2_mask.png
  12. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Basic3/WMS_GetMap_Basic3_mask.png
  13. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Basic4/WMS_GetMap_Basic4_mask.png
  14. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Basic5/WMS_GetMap_Basic5_mask.png
  15. BIN ...tdata/control_images/qgis_server/WMS_GetMap_ContextRendering/WMS_GetMap_ContextRendering_mask.png
  16. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Diagrams/WMS_GetMap_Diagrams_mask.png
  17. BIN ...rol_images/qgis_server/WMS_GetMap_Dimension_All_NoValue/WMS_GetMap_Dimension_All_NoValue_mask.png
  18. BIN ...server/WMS_GetMap_Dimension_Elevation_MixValues/WMS_GetMap_Dimension_Elevation_MixValues_mask.png
  19. BIN ...er/WMS_GetMap_Dimension_Elevation_MultiValues/WMS_GetMap_Dimension_Elevation_MultiValues_mask.png
  20. BIN ...rver/WMS_GetMap_Dimension_Elevation_RangeValue/WMS_GetMap_Dimension_Elevation_RangeValue_mask.png
  21. BIN ...p_Dimension_Elevation_RangeValue_Filter/WMS_GetMap_Dimension_Elevation_RangeValue_Filter_mask.png
  22. BIN ...es/qgis_server/WMS_GetMap_Dimension_Elevation_Value/WMS_GetMap_Dimension_Elevation_Value_mask.png
  23. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Filter/WMS_GetMap_Filter_mask.png
  24. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Filter2/WMS_GetMap_Filter2_mask.png
  25. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Filter3/WMS_GetMap_Filter3_mask.png
  26. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Filter4/WMS_GetMap_Filter4_mask.png
  27. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Filter_OGC/WMS_GetMap_Filter_OGC_mask.png
  28. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Filter_OGC2/WMS_GetMap_Filter_OGC2_mask.png
  29. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Filter_OGC3/WMS_GetMap_Filter_OGC3_mask.png
  30. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Filter_OGC_V2/WMS_GetMap_Filter_OGC_V2_mask.png
  31. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Highlight/WMS_GetMap_Highlight_mask.png
  32. BIN .../testdata/control_images/qgis_server/WMS_GetMap_Highlight_Line/WMS_GetMap_Highlight_Line_mask.png
  33. BIN ...estdata/control_images/qgis_server/WMS_GetMap_Highlight_Point/WMS_GetMap_Highlight_Point_mask.png
  34. BIN ...s/testdata/control_images/qgis_server/WMS_GetMap_LabelingSettings/WMS_GetMap_LabelingSettings.png
  35. BIN ...tdata/control_images/qgis_server/WMS_GetMap_LabelingSettings/WMS_GetMap_LabelingSettings_mask.png
  36. BIN ...tdata/control_images/qgis_server/WMS_GetMap_Labeling_Complex/WMS_GetMap_Labeling_Complex_mask.png
  37. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_LayerOrder/WMS_GetMap_LayerOrder_mask.png
  38. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Opacities/WMS_GetMap_Opacities_mask.png
  39. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Opacities2/WMS_GetMap_Opacities2_mask.png
  40. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Opacities3/WMS_GetMap_Opacities3_mask.png
  41. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_SLDRestored/WMS_GetMap_SLDRestored_mask.png
  42. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_SRS/WMS_GetMap_SRS_mask.png
  43. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Selection/WMS_GetMap_Selection_mask.png
  44. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_StyleCustom/WMS_GetMap_StyleCustom_mask.png
  45. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_StyleDefault/WMS_GetMap_StyleDefault_mask.png
  46. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_StyleMixed/WMS_GetMap_StyleMixed_mask.png
  47. BIN ...rol_images/qgis_server/WMS_GetMap_StyleMixed_LayerOrder/WMS_GetMap_StyleMixed_LayerOrder_mask.png
  48. BIN tests/testdata/control_images/qgis_server/WMS_GetMap_Transparent/WMS_GetMap_Transparent.png
  49. BIN tests/testdata/control_images/qgis_server_accesscontrol/WMS_GetMap/WMS_GetMap_mask.png
  50. BIN ...images/qgis_server_accesscontrol/WMS_GetMap_projectsubstring/WMS_GetMap_projectsubstring_mask.png
@@ -57,30 +57,6 @@ popd > /dev/null # /root/QGIS
# Restore Oracle test data
##############################

echo "${bold}Load Oracle database...🙏${endbold}"

export ORACLE_HOST="oracle"
export QGIS_ORACLETEST_DBNAME="${ORACLE_HOST}/XEPDB1"
export QGIS_ORACLETEST_DB="host=${QGIS_ORACLETEST_DBNAME} port=1521 user='QGIS' password='qgis'"

echo "Wait a moment while loading Oracle database."
COUNT=0
while ! echo exit | sqlplus -L SYSTEM/adminpass@$QGIS_ORACLETEST_DBNAME &> /dev/null
do
printf "🙏"
sleep 5
if [[ $(( COUNT++ )) -eq 200 ]]; then
break
fi
done
if [[ ${COUNT} -eq 201 ]]; then
echo "timeout, no oracle, no 🙏"
else
echo " done 👀"
pushd /root/QGIS > /dev/null
/root/QGIS/tests/testdata/provider/testdata_oracle.sh $ORACLE_HOST
popd > /dev/null # /root/QGIS
fi

##############################
# Restore SQL Server test data
@@ -123,5 +99,5 @@ else
echo "Flaky tests are run!"
fi
echo "List of skipped tests: $EXCLUDE_TESTS"
python3 /root/QGIS/.ci/ctest2ci.py xvfb-run ctest -V -E "${EXCLUDE_TESTS}" -S /root/QGIS/.ci/config.ctest --output-on-failure
python3 /root/QGIS/.ci/ctest2ci.py xvfb-run ctest -R 'PyQgsServerWMSGetMap$' -V -E "${EXCLUDE_TESTS}" -S /root/QGIS/.ci/config.ctest --output-on-failure

@@ -172,7 +172,7 @@ qreal QgsWmsRenderContext::dotsPerMm() const
// Apply DPI parameter if present. This is an extension of QGIS Server
// compared to WMS 1.3.
// Because of backwards compatibility, this parameter is optional
int dpm = 1 / OGC_PX_M;
qreal dpm = 1 / OGC_PX_M;

if ( !mParameters.dpi().isEmpty() )
{
@@ -1096,7 +1096,9 @@ namespace QgsWms
}

mapSettings.setOutputSize( QSize( paintDevice->width(), paintDevice->height() ) );
mapSettings.setOutputDpi( paintDevice->logicalDpiX() );
// Recalculate from input DPI: do not take the (integer) value from paint device
// because it loose precision!
mapSettings.setOutputDpi( mContext.dotsPerMm() * 25.4 );

//map extent
QgsRectangle mapExtent = mWmsParameters.bboxAsRectangle();
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.

0 comments on commit b93a8e4

Please sign in to comment.