Skip to content

Commit

Permalink
Stablise transform for test
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 6, 2024
1 parent f271cbb commit a489384
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/src/python/test_qgsrasterlabeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ def test_render_int(self):
mapsettings.setOutputSize(QSize(400, 400))
mapsettings.setOutputDpi(96)
mapsettings.setDestinationCrs(QgsCoordinateReferenceSystem("EPSG:3857"))
transform_context = mapsettings.transformContext()
transform_context.addCoordinateOperation(
raster_layer.crs(),
QgsCoordinateReferenceSystem("EPSG:3857"),
"+proj=pipeline +step +inv +proj=utm +zone=11 +ellps=clrk66 +step +proj=push +v_3 +step +proj=cart +ellps=clrk66 +step +proj=helmert +x=-10 +y=158 +z=187 +step +inv +proj=cart +ellps=WGS84 +step +proj=pop +v_3 +step +proj=webmerc +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84",
)
mapsettings.setTransformContext(transform_context)
mapsettings.setExtent(
QgsRectangle(-13095009.8, 4014898.9, -13094808.4, 4015061.7)
)
Expand Down Expand Up @@ -209,6 +216,13 @@ def test_render_rotated_map(self):
mapsettings.setOutputDpi(96)
mapsettings.setRotation(45)
mapsettings.setDestinationCrs(QgsCoordinateReferenceSystem("EPSG:3857"))
transform_context = mapsettings.transformContext()
transform_context.addCoordinateOperation(
raster_layer.crs(),
QgsCoordinateReferenceSystem("EPSG:3857"),
"+proj=pipeline +step +inv +proj=utm +zone=11 +ellps=clrk66 +step +proj=push +v_3 +step +proj=cart +ellps=clrk66 +step +proj=helmert +x=-10 +y=158 +z=187 +step +inv +proj=cart +ellps=WGS84 +step +proj=pop +v_3 +step +proj=webmerc +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84",
)
mapsettings.setTransformContext(transform_context)
mapsettings.setExtent(
QgsRectangle(-13095009.8, 4014898.9, -13094808.4, 4015061.7)
)
Expand Down Expand Up @@ -240,6 +254,13 @@ def test_render_numeric_format(self):
raster_layer.setLabelsEnabled(True)

mapsettings = QgsMapSettings()
transform_context = mapsettings.transformContext()
transform_context.addCoordinateOperation(
raster_layer.crs(),
QgsCoordinateReferenceSystem("EPSG:3857"),
"+proj=pipeline +step +inv +proj=utm +zone=11 +ellps=clrk66 +step +proj=push +v_3 +step +proj=cart +ellps=clrk66 +step +proj=helmert +x=-10 +y=158 +z=187 +step +inv +proj=cart +ellps=WGS84 +step +proj=pop +v_3 +step +proj=webmerc +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84",
)
mapsettings.setTransformContext(transform_context)
mapsettings.setOutputSize(QSize(400, 400))
mapsettings.setOutputDpi(96)
mapsettings.setDestinationCrs(QgsCoordinateReferenceSystem("EPSG:3857"))
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a489384

Please sign in to comment.