Skip to content

Commit

Permalink
QString fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 8, 2021
1 parent 6f4b32f commit 2f59a3a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/core/providers/gdal/qgsgdalproviderbase.cpp
Expand Up @@ -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() );
Expand All @@ -388,7 +388,7 @@ QString QgsGdalProviderBase::encodeGdalUri( const QVariantMap &parts )

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

Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsogcutils.cpp
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/wfs/qgswfsgetfeature.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 2f59a3a

Please sign in to comment.