diff --git a/tests/src/python/test_qgsserver_wms_getprint_atlas.py b/tests/src/python/test_qgsserver_wms_getprint_atlas.py index 2cefd2db0ae..49c94f73b5d 100644 --- a/tests/src/python/test_qgsserver_wms_getprint_atlas.py +++ b/tests/src/python/test_qgsserver_wms_getprint_atlas.py @@ -31,7 +31,7 @@ from qgis.core import QgsProject class TestQgsServerWMSGetPrintAtlas(QgsServerTestBase): """QGIS Server WMS Tests for GetPrint atlas request""" - def test_wms_getprint_atlas(self): + def __test_wms_getprint_atlas(self): qs = "?" + "&".join(["%s=%s" % i for i in list({ "MAP": urllib.parse.quote(self.projectPath), "SERVICE": "WMS", @@ -46,7 +46,7 @@ class TestQgsServerWMSGetPrintAtlas(QgsServerTestBase): r, h = self._result(self._execute_request(qs)) self._img_diff_error(r, h, "WMS_GetPrint_Atlas") - def test_wms_getprint_atlas_getProjectSettings(self): + def __test_wms_getprint_atlas_getProjectSettings(self): qs = "?" + "&".join(["%s=%s" % i for i in list({ "MAP": urllib.parse.quote(self.projectPath), "SERVICE": "WMS", @@ -62,7 +62,7 @@ class TestQgsServerWMSGetPrintAtlas(QgsServerTestBase): project = QgsProject() self.assertTrue(project.read(os.path.join(unitTestDataPath(), 'qgis_server', 'bug_gh30817_atlas_pk.qgs'))) - qs = "?" + "&".join(["%s=%s" % i for i in list({ + params = { "SERVICE": "WMS", "VERSION": "1.3.0", "REQUEST": "GetPrint", @@ -72,10 +72,18 @@ class TestQgsServerWMSGetPrintAtlas(QgsServerTestBase): "DPI": "50", "CRS": "EPSG:2056", "ATLAS_PK": "2", - }.items())]) + } + qs = "?" + "&".join(["%s=%s" % i for i in list(params.items())]) r, h = self._result(self._execute_request_project(qs, project)) self._img_diff_error(r, h, "WMS_GetPrint_Atlas_No_Pk") + # Test issue GH #49900: when using map scales scale + params['TEMPLATE'] = 'layout_fixed_scale' + params['ATLAS_PK'] = '4' + qs = "?" + "&".join(["%s=%s" % i for i in list(params.items())]) + r, h = self._result(self._execute_request_project(qs, project)) + self._img_diff_error(r, h, "WMS_GetPrint_Atlas_Fixed_Scale") + if __name__ == '__main__': unittest.main() diff --git a/tests/testdata/control_images/qgis_server/WMS_GetPrint_Atlas_Fixed_Scale/WMS_GetPrint_Atlas_Fixed_Scale.png b/tests/testdata/control_images/qgis_server/WMS_GetPrint_Atlas_Fixed_Scale/WMS_GetPrint_Atlas_Fixed_Scale.png new file mode 100644 index 00000000000..a350a91b975 Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetPrint_Atlas_Fixed_Scale/WMS_GetPrint_Atlas_Fixed_Scale.png differ diff --git a/tests/testdata/qgis_server/bug_gh30817_atlas_pk.qgs b/tests/testdata/qgis_server/bug_gh30817_atlas_pk.qgs index ff4359e4d44..3c7c09ef820 100644 --- a/tests/testdata/qgis_server/bug_gh30817_atlas_pk.qgs +++ b/tests/testdata/qgis_server/bug_gh30817_atlas_pk.qgs @@ -1,13 +1,12 @@ - + - - - + + - - PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] + + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs 3857 3857 @@ -22,7 +21,7 @@ - + @@ -31,9 +30,9 @@ data_34a17c5e_39a1_493a_af95_b5a233b40db1 - + - + @@ -41,15 +40,15 @@ meters - -2217275.19168864423409104 - 3779713.49600001005455852 - -2217273.09938558330759406 - 3779715.24036237737163901 + -2217274.8190666357986629 + 3779713.57789495680481195 + -2217272.72676357487216592 + 3779715.32225732412189245 0 - - PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] + + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs 3857 3857 @@ -65,15 +64,14 @@ - + - - + Annotations_c1e8b38e_61dd_49f2_8dc3_36f4fd4a02fd @@ -81,7 +79,7 @@ Annotations - + 0 @@ -104,7 +102,7 @@ - + 0 @@ -124,17 +122,17 @@ - + 3.97240340488328014 - 45.15886406139620135 + 45.10755960503590245 5.44448585846197997 46.14132936036769905 -19.91812149041812674 - 32.12487455193483754 - -19.91810358996271191 + 32.12487412472966497 + -19.91810340739247565 32.12488719067417264 data_34a17c5e_39a1_493a_af95_b5a233b40db1 @@ -144,8 +142,8 @@ data_csv - - PROJCRS["CH1903+ / LV95",BASEGEOGCRS["CH1903+",DATUM["CH1903+",ELLIPSOID["Bessel 1841",6377397.155,299.1528128,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4150]],CONVERSION["Swiss Oblique Mercator 1995",METHOD["Hotine Oblique Mercator (variant B)",ID["EPSG",9815]],PARAMETER["Latitude of projection centre",46.9524055555556,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8811]],PARAMETER["Longitude of projection centre",7.43958333333333,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8812]],PARAMETER["Azimuth of initial line",90,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8813]],PARAMETER["Angle from Rectified to Skew Grid",90,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8814]],PARAMETER["Scale factor on initial line",1,SCALEUNIT["unity",1],ID["EPSG",8815]],PARAMETER["Easting at projection centre",2600000,LENGTHUNIT["metre",1],ID["EPSG",8816]],PARAMETER["Northing at projection centre",1200000,LENGTHUNIT["metre",1],ID["EPSG",8817]]],CS[Cartesian,2],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Cadastre, engineering survey, topographic mapping (large and medium scale)."],AREA["Liechtenstein; Switzerland."],BBOX[45.82,5.96,47.81,10.49]],ID["EPSG",2056]] + + PROJCRS["CH1903+ / LV95",BASEGEOGCRS["CH1903+",DATUM["CH1903+",ELLIPSOID["Bessel 1841",6377397.155,299.1528128,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4150]],CONVERSION["Swiss Oblique Mercator 1995",METHOD["Hotine Oblique Mercator (variant B)",ID["EPSG",9815]],PARAMETER["Latitude of projection centre",46.9524055555556,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8811]],PARAMETER["Longitude of projection centre",7.43958333333333,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8812]],PARAMETER["Azimuth of initial line",90,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8813]],PARAMETER["Angle from Rectified to Skew Grid",90,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8814]],PARAMETER["Scale factor on initial line",1,SCALEUNIT["unity",1],ID["EPSG",8815]],PARAMETER["Easting at projection centre",2600000,LENGTHUNIT["metre",1],ID["EPSG",8816]],PARAMETER["Northing at projection centre",1200000,LENGTHUNIT["metre",1],ID["EPSG",8817]]],CS[Cartesian,2],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["Europe - Liechtenstein and Switzerland"],BBOX[45.82,5.96,47.81,10.49]],ID["EPSG",2056]] +proj=somerc +lat_0=46.9524055555556 +lon_0=7.43958333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs 47 2056 @@ -176,7 +174,7 @@ - + 0 @@ -189,7 +187,7 @@ - + @@ -214,52 +212,241 @@ 1 0 - + - - - + + + + + + - + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -270,92 +457,94 @@ 0 0 1 - - - - + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -363,29 +552,29 @@ - + - - + - + - + - + - + @@ -411,8 +600,8 @@ - @@ -444,7 +633,7 @@ def my_form_open(dialog, layer, feature): 0 generatedlayout - + @@ -462,14 +651,7 @@ def my_form_open(dialog, layer, feature): - - - - - - 1 - true - + 0 @@ -513,6 +695,7 @@ def my_form_open(dialog, layer, feature): true + Default 2 MU @@ -587,9 +770,9 @@ def my_form_open(dialog, layer, feature): @@ -616,105 +799,105 @@ def my_form_open(dialog, layer, feature): - - - + + + - + - + - - - - - - - - - - - + + + + + + + + + + + - - - + + + - + - + - - - - - - - - - - - + + + + + + + + + + + @@ -722,63 +905,795 @@ def my_form_open(dialog, layer, feature): - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] + + + + + + + + + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs 3857 3857 @@ -790,19 +1705,42 @@ def my_form_open(dialog, layer, feature): - + + + + + + + + + + + + diff --git a/tests/testdata/qgis_server/bug_gh30817_atlas_pk_data.csv b/tests/testdata/qgis_server/bug_gh30817_atlas_pk_data.csv index c0a58eb04b2..c0e4c609ca1 100644 --- a/tests/testdata/qgis_server/bug_gh30817_atlas_pk_data.csv +++ b/tests/testdata/qgis_server/bug_gh30817_atlas_pk_data.csv @@ -2,3 +2,4 @@ WKT, "POLYGON ((4.8452965180606 46.1362035978033,4.94146270849539 45.8947544654919,5.21516648127133 45.9153443716443,5.16338468642183 46.1413293603677,4.8452965180606 46.1362035978033))" "POLYGON ((4.35706816662244 45.7916903788217,4.40145256220773 45.4865387880861,4.06856959531807 45.5280126703756,3.97240340488328 45.786532162445,4.35706816662244 45.7916903788217))" "POLYGON ((5.08201329451547 45.4138859638244,5.01543670113754 45.2787109954903,5.43708845919777 45.1588640613962,5.44448585846198 45.3827203902239,5.08201329451547 45.4138859638244))" +"POLYGON ((4.69826111430302 45.8666064555291,4.53503142343834 45.2823375503067,4.99716563895345 45.1075596050359,4.94945429451764 45.7859095265158,4.69826111430302 45.8666064555291))"