Skip to content
Permalink
Browse files

QString fixups

  • Loading branch information
nyalldawson committed Feb 8, 2021
1 parent 6f4b32f commit 2f59a3a3c155c7b943c4aa7b9f86c2eeb050553b
@@ -379,7 +379,7 @@ QString QgsGdalProviderBase::encodeGdalUri( const QVariantMap &parts )
QString layerName = parts.value( QStringLiteral( "layerName" ) ).toString();
QString uri;

if ( !layerName.isEmpty() && path.endsWith( QStringLiteral( "gpkg" ) ) )
if ( !layerName.isEmpty() && path.endsWith( QLatin1String( "gpkg" ) ) )
uri = QStringLiteral( "GPKG:%1:%2" ).arg( path, layerName );
else
uri = path + ( !layerName.isEmpty() ? QStringLiteral( "|%1" ).arg( layerName ) : QString() );
@@ -388,7 +388,7 @@ QString QgsGdalProviderBase::encodeGdalUri( const QVariantMap &parts )

for ( const QString &openOption : openOptions )
{
uri += QStringLiteral( "|option:" );
uri += QLatin1String( "|option:" );
uri += openOption;
}

@@ -144,11 +144,11 @@ QgsGeometry QgsOgcUtils::geometryFromGML( const QDomNode &geometryNode, const Co
QString srsName { geometryTypeElement.attribute( QStringLiteral( "srsName" ) ) };

// The logic here follows WFS GeoServer conventions from https://docs.geoserver.org/latest/en/user/services/wfs/axis_order.html
const bool ignoreAxisOrientation { srsName.startsWith( QStringLiteral( "http://www.opengis.net/gml/srs/" ) ) || srsName.startsWith( QStringLiteral( "EPSG:" ) ) };
const bool ignoreAxisOrientation { srsName.startsWith( QLatin1String( "http://www.opengis.net/gml/srs/" ) ) || srsName.startsWith( QLatin1String( "EPSG:" ) ) };

// GDAL does not recognise http://www.opengis.net/gml/srs/epsg.xml#4326 but it does
// http://www.opengis.net/def/crs/EPSG/0/4326 so, let's try that
if ( srsName.startsWith( QStringLiteral( "http://www.opengis.net/gml/srs/" ) ) )
if ( srsName.startsWith( QLatin1String( "http://www.opengis.net/gml/srs/" ) ) )
{
const auto parts { srsName.split( QRegularExpression( QStringLiteral( R"raw(/|#|\.)raw" ) ) ) };
if ( parts.length() == 10 )
@@ -770,7 +770,7 @@ namespace QgsWfs
// See: https://docs.geoserver.org/latest/en/user/services/wfs/axis_order.html#wfs-basics-axis
QgsCoordinateReferenceSystem extentCrs;
extentCrs.createFromUserInput( extentSrsName );
if ( extentCrs.isValid() && extentCrs.hasAxisInverted() && ! extentSrsName.startsWith( QStringLiteral( "EPSG:" ) ) )
if ( extentCrs.isValid() && extentCrs.hasAxisInverted() && ! extentSrsName.startsWith( QLatin1String( "EPSG:" ) ) )
{
QgsGeometry geom { QgsGeometry::fromRect( extent ) };
geom.get()->swapXy();

0 comments on commit 2f59a3a

Please sign in to comment.