Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
tudorbarascu committed Jan 28, 2021
1 parent 0b19545 commit db422ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -869,19 +869,18 @@ namespace QgsWms
QgsRectangle mapExtent = mWmsParameters.bboxAsRectangle();

QString crs = mWmsParameters.crs();
if ( crs.compare( "CRS:84", Qt::CaseInsensitive ) == 0 )
if ( crs.compare( QStringLiteral( "CRS:84" ), Qt::CaseInsensitive ) == 0 )
{
crs = QString( "EPSG:4326" );
crs = QStringLiteral( "EPSG:4326" );
mapExtent.invert();
}
else if ( crs.isEmpty() )
{
crs = QString( "EPSG:4326" );
crs = QStringLiteral( "EPSG:4326" );
}

QgsCoordinateReferenceSystem outputCRS;
QgsCoordinateReferenceSystem outputCRS = QgsCoordinateReferenceSystem::fromOgcWmsCrs( crs );

outputCRS = QgsCoordinateReferenceSystem::fromOgcWmsCrs( crs );
if ( !outputCRS.isValid() )
{
QgsServiceException::ExceptionCode code;
Expand Down
9 changes: 6 additions & 3 deletions tests/src/python/test_qgsserver_wms_dxf.py
Expand Up @@ -24,6 +24,8 @@

from qgis.core import (QgsVectorLayer)

from qgis.PyQt import QtCore

# Needed on Qt 5 so that the serialization of XML is consistent among all executions
os.environ['QT_HASH_SEED'] = '1'

Expand All @@ -48,16 +50,17 @@ def test_dxf_export_works_with_reverse_axis_epsg(self):

r, h = self._result(self._execute_request(qs))

dxf = '/tmp/test_dxf_export.dxf'
tempDir = QtCore.QTemporaryDir()
dxf = os.path.join(tempDir.path(), 'test_dxf_export.dxf')
f = open(dxf, 'wb')
f.write(r)
f.close()

vl = QgsVectorLayer(dxf, "lyr", "ogr")
myMessage = ('Expected downloaded: %s dxf contains 1 line\nGot: %s\n' %
myMessage = ('Expected downloaded dxf contains: %s line\nGot: %s\n' %
(1, vl.featureCount()))

assert vl.featureCount() == 1, myMessage
self.assertEqual(vl.featureCount(), 1, myMessage)

line_from_dxf = next(vl.getFeatures()).geometry().asWkt()
line = 'LineString (450000 400000, 450100 400000)'
Expand Down

0 comments on commit db422ac

Please sign in to comment.