diff --git a/tests/src/python/test_qgsserver_wms_getlegendgraphic.py b/tests/src/python/test_qgsserver_wms_getlegendgraphic.py index df033195b16..6488002a8f0 100644 --- a/tests/src/python/test_qgsserver_wms_getlegendgraphic.py +++ b/tests/src/python/test_qgsserver_wms_getlegendgraphic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer WMS GetLegendGraphic. From build dir, run: ctest -R PyQgsServerWMSGetLegendGraphic -V @@ -18,27 +19,31 @@ import os # Needed on Qt 5 so that the serialization of XML is consistent among all executions os.environ['QT_HASH_SEED'] = '1' +import re import json -import urllib.error -import urllib.parse import urllib.request +import urllib.parse +import urllib.error + +from qgis.testing import unittest +from qgis.PyQt.QtCore import QSize import osgeo.gdal # NOQA +from test_qgsserver_wms import TestQgsServerWMSTestBase from qgis.core import ( - QgsMarkerSymbol, QgsProject, + QgsMarkerSymbol, QgsRuleBasedRenderer, QgsVectorLayer, ) -from qgis.PyQt.QtCore import QSize + from qgis.server import ( QgsBufferServerRequest, QgsBufferServerResponse, QgsServer, + QgsServerRequest, ) -from qgis.testing import unittest -from test_qgsserver_wms import TestQgsServerWMSTestBase # Strip path and content length because path may vary RE_STRIP_UNCHECKABLE = br'MAP=[^"]+|Content-Length: \d+' @@ -63,10 +68,10 @@ class TestQgsServerWMSGetLegendGraphic(TestQgsServerWMSTestBase): # 'HEIGHT': '20', # optional 'LAYER': 'testlayer%20èé', } - qs = '?' + '&'.join([f"{k}={v}" for k, v in parms.items()]) + qs = '?' + '&'.join(["%s=%s" % (k, v) for k, v in parms.items()]) h, r = self._execute_request(qs) - self.assertEqual(-1, h.find(b'Content-Type: text/xml; charset=utf-8'), f"Header: {h}\nResponse:\n{r}") - self.assertNotEqual(-1, h.find(b'Content-Type: image/png'), f"Header: {h}\nResponse:\n{r}") + self.assertEqual(-1, h.find(b'Content-Type: text/xml; charset=utf-8'), "Header: %s\nResponse:\n%s" % (h, r)) + self.assertNotEqual(-1, h.find(b'Content-Type: image/png'), "Header: %s\nResponse:\n%s" % (h, r)) def test_wms_GetLegendGraphic_LayerSpace(self): qs = "?" + "&".join(["%s=%s" % i for i in list({ @@ -185,7 +190,7 @@ class TestQgsServerWMSGetLegendGraphic(TestQgsServerWMSTestBase): 'LAYERTITLE': 'TRUE', 'RULELABEL': 'TRUE' } - qs = '?' + '&'.join([f"{k}={v}" for k, v in parms.items()]) + qs = '?' + '&'.join(["%s=%s" % (k, v) for k, v in parms.items()]) r, h = self._result(self._execute_request(qs)) self._img_diff_error(r, h, "WMS_GetLegendGraphic_test", 250, QSize(15, 15)) @@ -206,7 +211,7 @@ class TestQgsServerWMSGetLegendGraphic(TestQgsServerWMSTestBase): 'ITEMFONTFAMILY': self.fontFamily, 'ITEMFONTSIZE': '20' } - qs = '?' + '&'.join([f"{k}={v}" for k, v in parms.items()]) + qs = '?' + '&'.join(["%s=%s" % (k, v) for k, v in parms.items()]) r, h = self._result(self._execute_request(qs)) self._img_diff_error(r, h, "WMS_GetLegendGraphic_test", 250, QSize(15, 15)) @@ -223,7 +228,7 @@ class TestQgsServerWMSGetLegendGraphic(TestQgsServerWMSTestBase): 'LAYERTITLE': 'FALSE', 'RULELABEL': 'FALSE' } - qs = '?' + '&'.join([f"{k}={v}" for k, v in parms.items()]) + qs = '?' + '&'.join(["%s=%s" % (k, v) for k, v in parms.items()]) r, h = self._result(self._execute_request(qs)) self._img_diff_error(r, h, "WMS_GetLegendGraphic_test_layertitle_false", 250, QSize(15, 15)) @@ -244,7 +249,7 @@ class TestQgsServerWMSGetLegendGraphic(TestQgsServerWMSTestBase): 'ITEMFONTFAMILY': self.fontFamily, 'RULELABEL': 'FALSE' } - qs = '?' + '&'.join([f"{k}={v}" for k, v in parms.items()]) + qs = '?' + '&'.join(["%s=%s" % (k, v) for k, v in parms.items()]) r, h = self._result(self._execute_request(qs)) self._img_diff_error(r, h, "WMS_GetLegendGraphic_rulelabel_false", 250, QSize(15, 15)) @@ -264,7 +269,7 @@ class TestQgsServerWMSGetLegendGraphic(TestQgsServerWMSTestBase): 'LAYERTITLE': 'FALSE', 'RULELABEL': 'TRUE' } - qs = '?' + '&'.join([f"{k}={v}" for k, v in parms.items()]) + qs = '?' + '&'.join(["%s=%s" % (k, v) for k, v in parms.items()]) r, h = self._result(self._execute_request(qs)) self._img_diff_error(r, h, "WMS_GetLegendGraphic_rulelabel_true", 250, QSize(15, 15)) @@ -284,7 +289,7 @@ class TestQgsServerWMSGetLegendGraphic(TestQgsServerWMSTestBase): 'ITEMFONTFAMILY': self.fontFamily, 'LAYERTITLE': 'FALSE' } - qs = '?' + '&'.join([f"{k}={v}" for k, v in parms.items()]) + qs = '?' + '&'.join(["%s=%s" % (k, v) for k, v in parms.items()]) r, h = self._result(self._execute_request(qs)) self._img_diff_error(r, h, "WMS_GetLegendGraphic_rulelabel_notset", 250, QSize(15, 15)) @@ -299,7 +304,7 @@ class TestQgsServerWMSGetLegendGraphic(TestQgsServerWMSTestBase): 'LAYERTITLE': 'FALSE', 'RULELABEL': 'AUTO' } - qs = '?' + '&'.join([f"{k}={v}" for k, v in parms.items()]) + qs = '?' + '&'.join(["%s=%s" % (k, v) for k, v in parms.items()]) r, h = self._result(self._execute_request(qs)) self._img_diff_error(r, h, "WMS_GetLegendGraphic_rulelabel_auto", 250, QSize(15, 15)) @@ -316,7 +321,7 @@ class TestQgsServerWMSGetLegendGraphic(TestQgsServerWMSTestBase): 'HEIGHT': '20', 'RULE': 'rule0', } - qs = '?' + '&'.join([f"{k}={v}" for k, v in parms.items()]) + qs = '?' + '&'.join(["%s=%s" % (k, v) for k, v in parms.items()]) r, h = self._result(self._execute_request(qs)) self._img_diff_error(r, h, "WMS_GetLegendGraphic_rule0", 250, QSize(15, 15)) @@ -331,7 +336,7 @@ class TestQgsServerWMSGetLegendGraphic(TestQgsServerWMSTestBase): 'HEIGHT': '20', 'RULE': 'rule1', } - qs = '?' + '&'.join([f"{k}={v}" for k, v in parms.items()]) + qs = '?' + '&'.join(["%s=%s" % (k, v) for k, v in parms.items()]) r, h = self._result(self._execute_request(qs)) self._img_diff_error(r, h, "WMS_GetLegendGraphic_rule1", 250, QSize(15, 15)) @@ -626,8 +631,8 @@ class TestQgsServerWMSGetLegendGraphic(TestQgsServerWMSTestBase): }.items())]) h, r = self._execute_request(qs) - self.assertEqual(-1, h.find(b'Content-Type: text/xml; charset=utf-8'), f"Header: {h}\nResponse:\n{r}") - self.assertNotEqual(-1, h.find(b'Content-Type: image/png'), f"Header: {h}\nResponse:\n{r}") + self.assertEqual(-1, h.find(b'Content-Type: text/xml; charset=utf-8'), "Header: %s\nResponse:\n%s" % (h, r)) + self.assertNotEqual(-1, h.find(b'Content-Type: image/png'), "Header: %s\nResponse:\n%s" % (h, r)) def test_wms_GetLegendGraphic_wmsRootName(self): """Test an unreported issue when a wmsRootName short name is set in the service capabilities""" @@ -648,8 +653,8 @@ class TestQgsServerWMSGetLegendGraphic(TestQgsServerWMSTestBase): }.items())]) h, r = self._execute_request(qs) - self.assertEqual(-1, h.find(b'Content-Type: text/xml; charset=utf-8'), f"Header: {h}\nResponse:\n{r}") - self.assertNotEqual(-1, h.find(b'Content-Type: image/png'), f"Header: {h}\nResponse:\n{r}") + self.assertEqual(-1, h.find(b'Content-Type: text/xml; charset=utf-8'), "Header: %s\nResponse:\n%s" % (h, r)) + self.assertNotEqual(-1, h.find(b'Content-Type: image/png'), "Header: %s\nResponse:\n%s" % (h, r)) # Then test with the wmsRootName short name: qs = "?" + "&".join(["%s=%s" % i for i in list({ @@ -667,8 +672,8 @@ class TestQgsServerWMSGetLegendGraphic(TestQgsServerWMSTestBase): }.items())]) h, r = self._execute_request(qs) - self.assertEqual(-1, h.find(b'Content-Type: text/xml; charset=utf-8'), f"Header: {h}\nResponse:\n{r}") - self.assertNotEqual(-1, h.find(b'Content-Type: image/png'), f"Header: {h}\nResponse:\n{r}") + self.assertEqual(-1, h.find(b'Content-Type: text/xml; charset=utf-8'), "Header: %s\nResponse:\n%s" % (h, r)) + self.assertNotEqual(-1, h.find(b'Content-Type: image/png'), "Header: %s\nResponse:\n%s" % (h, r)) def test_wms_GetLegendGraphic_ScaleSymbol_Min(self): # 1:500000000 min @@ -816,6 +821,102 @@ class TestQgsServerWMSGetLegendGraphic(TestQgsServerWMSTestBase): r, h = self._result(self._execute_request(qs)) self._img_diff_error(r, h, "WMS_GetLegendGraphic_ScaleSymbol_DefaultScale_2056", max_size_diff=QSize(15, 15)) + def test_wms_GetLegendGraphic_MetersAtScaleSymbol_Scaled(self): + # meters at scale symbols on EPSG:4326 calculated with BBOX + qs = "?" + "&".join(["%s=%s" % i for i in list({ + "MAP": self.testdata_path + 'test_project_meters_at_scaledsymbols.qgs', + "SERVICE": "WMS", + "REQUEST": "GetLegendGraphic", + "LAYER": "testlayer", + "FORMAT": "image/png", + "SRCHEIGHT": "2550", + "SRCWIDTH": "3850", + "BBOX": "44.89945254864102964,8.20044117721021948,44.90400902275693085,8.20936038559772285", + "CRS": "EPSG:4326" + }.items())]) + + r, h = self._result(self._execute_request(qs)) + self._img_diff_error(r, h, "WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled", max_size_diff=QSize(15, 15)) + + def test_wms_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale(self): + # meters at scale symbols on EPSG:4326 calculated with Default Scale set in the projects configuration + qs = "?" + "&".join(["%s=%s" % i for i in list({ + "MAP": self.testdata_path + 'test_project_meters_at_scaledsymbols.qgs', + "SERVICE": "WMS", + "REQUEST": "GetLegendGraphic", + "LAYER": "testlayer", + "FORMAT": "image/png", + "CRS": "EPSG:4326" + }.items())]) + + r, h = self._result(self._execute_request(qs)) + self._img_diff_error(r, h, "WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale", max_size_diff=QSize(15, 15)) + + def test_wms_GetLegendGraphic_MetersAtScaleSymbol_Rule(self): + # meters at scale symbols on EPSG:4326 calculated with Default Scale set in the projects configuration and having a rule + qs = "?" + "&".join(["%s=%s" % i for i in list({ + "MAP": self.testdata_path + 'test_project_meters_at_scaledsymbols.qgs', + "SERVICE": "WMS", + "REQUEST": "GetLegendGraphic", + "LAYER": "testlayer", + "FORMAT": "image/png", + "CRS": "EPSG:4326", + "WIDTH": "50", + "HEIGHT": "50", + "RULE": "two" + }.items())]) + + r, h = self._result(self._execute_request(qs)) + self._img_diff_error(r, h, "WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule", max_size_diff=QSize(15, 15)) + + def test_wms_GetLegendGraphic_MetersAtScaleSymbol_Scaled_2056(self): + # meters at scale symbols on EPSG:2056 calculated with BBOX + qs = "?" + "&".join(["%s=%s" % i for i in list({ + "MAP": self.testdata_path + 'test_project_meters_at_scaledsymbols_2056.qgs', + "SERVICE": "WMS", + "REQUEST": "GetLegendGraphic", + "LAYER": "testlayer_2056", + "FORMAT": "image/png", + "SRCHEIGHT": "1100", + "SRCWIDTH": "1700", + "BBOX": "2662610.7,1268841.8,2663010.5,1269000.05", + "CRS": "EPSG:2056" + }.items())]) + + r, h = self._result(self._execute_request(qs)) + self._img_diff_error(r, h, "WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled_2056", max_size_diff=QSize(15, 15)) + + def test_wms_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale_2056(self): + # meters at scale symbols on EPSG:2056 calculated with Default Scale set in the projects configuration + qs = "?" + "&".join(["%s=%s" % i for i in list({ + "MAP": self.testdata_path + 'test_project_meters_at_scaledsymbols_2056.qgs', + "SERVICE": "WMS", + "REQUEST": "GetLegendGraphic", + "LAYER": "testlayer_2056", + "FORMAT": "image/png", + "CRS": "EPSG:2056" + }.items())]) + + r, h = self._result(self._execute_request(qs)) + self._img_diff_error(r, h, "WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale_2056", max_size_diff=QSize(15, 15)) + + def test_wms_GetLegendGraphic_MetersAtScaleSymbol_Rule_2056(self): + # meters at scale symbols on EPSG:2056 calculated with Default Scale set in the projects configuration and having a rule + qs = "?" + "&".join(["%s=%s" % i for i in list({ + "MAP": self.testdata_path + 'test_project_meters_at_scaledsymbols_2056.qgs', + "SERVICE": "WMS", + "REQUEST": "GetLegendGraphic", + "LAYER": "testlayer_2056", + "FORMAT": "image/png", + "CRS": "EPSG:2056", + "WIDTH": "50", + "HEIGHT": "50", + "RULE": "test" + }.items())]) + + r, h = self._result(self._execute_request(qs)) + self._img_diff_error(r, h, "WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule_2056", max_size_diff=QSize(15, 15)) + def test_wms_GetLegendGraphic_LAYERFONTCOLOR(self): qs = "?" + "&".join(["%s=%s" % i for i in list({ "MAP": urllib.parse.quote(self.projectPath), diff --git a/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale.png b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale.png new file mode 100644 index 00000000000..18ad279123c Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale.png b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale.png new file mode 100644 index 00000000000..18ad279123c Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale_2056/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale_2056.png b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale_2056/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale_2056.png new file mode 100644 index 00000000000..f47310169ad Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale_2056/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale_2056.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale_2056/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale_2056.png b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale_2056/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale_2056.png new file mode 100644 index 00000000000..f47310169ad Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale_2056/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_DefaultScale_2056.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule.png b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule.png new file mode 100644 index 00000000000..43dea471164 Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule.png b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule.png new file mode 100644 index 00000000000..43dea471164 Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule_2056/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule_2056.png b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule_2056/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule_2056.png new file mode 100644 index 00000000000..1e726177670 Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule_2056/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule_2056.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule_2056/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule_2056.png b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule_2056/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule_2056.png new file mode 100644 index 00000000000..1e726177670 Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule_2056/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_Rule_2056.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled.png b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled.png new file mode 100644 index 00000000000..835f2b2854b Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled.png b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled.png new file mode 100644 index 00000000000..835f2b2854b Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled_2056/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled_2056.png b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled_2056/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled_2056.png new file mode 100644 index 00000000000..63e9732e56c Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled_2056/variant1/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled_2056.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled_2056/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled_2056.png b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled_2056/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled_2056.png new file mode 100644 index 00000000000..63e9732e56c Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled_2056/variant2/WMS_GetLegendGraphic_MetersAtScaleSymbol_Scaled_2056.png differ diff --git a/tests/testdata/qgis_server/test_project_meters_at_scaledsymbols.qgs b/tests/testdata/qgis_server/test_project_meters_at_scaledsymbols.qgs new file mode 100644 index 00000000000..fc4b84865c0 --- /dev/null +++ b/tests/testdata/qgis_server/test_project_meters_at_scaledsymbols.qgs @@ -0,0 +1,1003 @@ + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + testlayer_91fbc4ae_de21_417e_b7df_7e0e792194fb + + + + + + + + + + + degrees + + 8.20262254434610583 + 44.89945254864102964 + 8.20717901846183651 + 44.90400902275693085 + + 0 + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + 0 + + + + + + + + + + Beschriftungen_655c47a0_4f15_46e2_82b9_1a64b7ece030 + + + + + + + + + + 0 + 0 + + + + + false + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + false + + + + + + + 1 + 1 + 1 + 0 + + + + 1 + 0 + + + + + + 8.20345930703634352 + 44.90139483904469131 + 8.20354699399348775 + 44.90148252600183554 + + + 8.20345930703634352 + 44.90139483904469131 + 8.20354699399348775 + 44.90148252600183554 + + testlayer_91fbc4ae_de21_417e_b7df_7e0e792194fb + ./testlayer.shp + + + + testlayer + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + ogr + + + + + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + + + + + + + "id" + + + + + + + + + + 2 + + + 255 + 255 + 255 + 255 + 0 + 255 + 255 + + + false + + + + + + NONE + + + m2 + meters + + + 50 + 5 + 16 + 30 + 2.5 + false + false + false + 0 + 0 + false + false + true + 0 + 255,0,0,255 + + + false + + + true + 2 + MU + + + + DCIM + + + false + + 1 + + + + + + + + + + + None + false + false + + + + + + 0.0001 + false + conditions unknown + 90 + + + + 1 + + 8 + + false + + false + + 0 + + false + + + + + + + + false + + + + + false + + 5000 + + + + false + + + + + + 10 + + 1024 + singleLayer + 0 + + online + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + David + 2019-02-25T07:28:13 + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + diff --git a/tests/testdata/qgis_server/test_project_meters_at_scaledsymbols_2056.qgs b/tests/testdata/qgis_server/test_project_meters_at_scaledsymbols_2056.qgs new file mode 100644 index 00000000000..0fe4bd7a15e --- /dev/null +++ b/tests/testdata/qgis_server/test_project_meters_at_scaledsymbols_2056.qgs @@ -0,0 +1,890 @@ + + + + + + + + + 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]] + +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 + EPSG:2056 + CH1903+ / LV95 + somerc + EPSG:7004 + false + + + + + + + + + + + + testlayer_2056_0a0d85af_384f_43a8_aafd_ce618f07606c + + + + + + + + + + + meters + + 2662688.59528037672862411 + 1268906.44275068677961826 + 2663017.47236404521390796 + 1269115.71788927260786295 + + 0 + + + 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]] + +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 + EPSG:2056 + CH1903+ / LV95 + somerc + EPSG:7004 + false + + + 0 + + + + + + + + + + Beschriftungen_554a318e_171a_47fd_9858_924d3d726ea6 + + + + + + + + + + 0 + 0 + + + + + false + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + false + + + + + + + 1 + 1 + 1 + 0 + + + + 1 + 0 + + + + + + 2662810.22610628698021173 + 1268958.9145528266672045 + 2662810.22610628698021173 + 1268958.9145528266672045 + + + 8.2733168707200484 + 47.56833412279832629 + 8.2733168707200484 + 47.56833412279832629 + + testlayer_2056_0a0d85af_384f_43a8_aafd_ce618f07606c + ./testlayer_2056.shp + + + + testlayer_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["Cadastre, engineering survey, topographic mapping (large and medium scale)."],AREA["Liechtenstein; 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 + EPSG:2056 + CH1903+ / LV95 + somerc + EPSG:7004 + false + + + + + + + dataset + + + + + + + + + + + + + + + + + + + +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 + 0 + 0 + + + + + false + + + + + + + + + + + + + ogr + + + + + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + + + + "id" + + + + + + + + + + 2 + + + 255 + 255 + 255 + 255 + 0 + 255 + 255 + + + false + + + + + + NONE + + + m2 + meters + + + 50 + 5 + 16 + 30 + 2.5 + false + false + false + 0 + 0 + false + false + true + 0 + 255,0,0,255 + + + false + + + true + 2 + MU + + false + + 1 + + + + + + + + + + + None + false + false + + + + + + 1 + false + conditions unknown + 90 + + + + 1 + + 8 + + false + + false + + 0 + + false + + + + + + + + false + + + + + false + + 5000 + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + David + 2019-04-11T08:52:22 + + + + + + + + + + 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]] + +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 + EPSG:2056 + CH1903+ / LV95 + somerc + EPSG:7004 + false + + + + + + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + +