Skip to content

Commit

Permalink
Intendention
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Dec 22, 2015
1 parent ca37d00 commit c806004
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/core/geometry/qgsgeometryutils.cpp
Expand Up @@ -488,7 +488,7 @@ QList<QgsPointV2> QgsGeometryUtils::pointsFromWKT( const QString &wktCoordinateL
//first scan through for extra unexpected dimensions //first scan through for extra unexpected dimensions
bool foundZ = false; bool foundZ = false;
bool foundM = false; bool foundM = false;
Q_FOREACH( const QString& pointCoordinates, coordList ) Q_FOREACH ( const QString& pointCoordinates, coordList )
{ {
QStringList coordinates = pointCoordinates.split( ' ', QString::SkipEmptyParts ); QStringList coordinates = pointCoordinates.split( ' ', QString::SkipEmptyParts );
if ( coordinates.size() == 3 && !foundZ && !foundM && !is3D && !isMeasure ) if ( coordinates.size() == 3 && !foundZ && !foundM && !is3D && !isMeasure )
Expand All @@ -506,7 +506,7 @@ QList<QgsPointV2> QgsGeometryUtils::pointsFromWKT( const QString &wktCoordinateL
} }
} }


Q_FOREACH( const QString& pointCoordinates, coordList ) Q_FOREACH ( const QString& pointCoordinates, coordList )
{ {
QStringList coordinates = pointCoordinates.split( ' ', QString::SkipEmptyParts ); QStringList coordinates = pointCoordinates.split( ' ', QString::SkipEmptyParts );
if ( coordinates.size() < dim ) if ( coordinates.size() < dim )
Expand Down Expand Up @@ -549,7 +549,7 @@ QList<QgsPointV2> QgsGeometryUtils::pointsFromWKT( const QString &wktCoordinateL
void QgsGeometryUtils::pointsToWKB( QgsWkbPtr& wkb, const QList<QgsPointV2> &points, bool is3D, bool isMeasure ) void QgsGeometryUtils::pointsToWKB( QgsWkbPtr& wkb, const QList<QgsPointV2> &points, bool is3D, bool isMeasure )
{ {
wkb << static_cast<quint32>( points.size() ); wkb << static_cast<quint32>( points.size() );
Q_FOREACH( const QgsPointV2& point, points ) Q_FOREACH ( const QgsPointV2& point, points )
{ {
wkb << point.x() << point.y(); wkb << point.x() << point.y();
if ( is3D ) if ( is3D )
Expand All @@ -566,7 +566,7 @@ void QgsGeometryUtils::pointsToWKB( QgsWkbPtr& wkb, const QList<QgsPointV2> &poi
QString QgsGeometryUtils::pointsToWKT( const QList<QgsPointV2>& points, int precision, bool is3D, bool isMeasure ) QString QgsGeometryUtils::pointsToWKT( const QList<QgsPointV2>& points, int precision, bool is3D, bool isMeasure )
{ {
QString wkt = "("; QString wkt = "(";
Q_FOREACH( const QgsPointV2& p, points ) Q_FOREACH ( const QgsPointV2& p, points )
{ {
wkt += qgsDoubleToString( p.x(), precision ); wkt += qgsDoubleToString( p.x(), precision );
wkt += ' ' + qgsDoubleToString( p.y(), precision ); wkt += ' ' + qgsDoubleToString( p.y(), precision );
Expand All @@ -588,8 +588,8 @@ QDomElement QgsGeometryUtils::pointsToGML2( const QList<QgsPointV2>& points, QDo


QString strCoordinates; QString strCoordinates;


Q_FOREACH( const QgsPointV2& p, points ) Q_FOREACH ( const QgsPointV2& p, points )
strCoordinates += qgsDoubleToString( p.x(), precision ) + ',' + qgsDoubleToString( p.y(), precision ) + ' '; strCoordinates += qgsDoubleToString( p.x(), precision ) + ',' + qgsDoubleToString( p.y(), precision ) + ' ';


if ( strCoordinates.endsWith( ' ' ) ) if ( strCoordinates.endsWith( ' ' ) )
strCoordinates.chop( 1 ); // Remove trailing space strCoordinates.chop( 1 ); // Remove trailing space
Expand All @@ -604,7 +604,7 @@ QDomElement QgsGeometryUtils::pointsToGML3( const QList<QgsPointV2>& points, QDo
elemPosList.setAttribute( "srsDimension", is3D ? 3 : 2 ); elemPosList.setAttribute( "srsDimension", is3D ? 3 : 2 );


QString strCoordinates; QString strCoordinates;
Q_FOREACH( const QgsPointV2& p, points ) Q_FOREACH ( const QgsPointV2& p, points )
{ {
strCoordinates += qgsDoubleToString( p.x(), precision ) + ' ' + qgsDoubleToString( p.y(), precision ) + ' '; strCoordinates += qgsDoubleToString( p.x(), precision ) + ' ' + qgsDoubleToString( p.y(), precision ) + ' ';
if ( is3D ) if ( is3D )
Expand All @@ -620,7 +620,7 @@ QDomElement QgsGeometryUtils::pointsToGML3( const QList<QgsPointV2>& points, QDo
QString QgsGeometryUtils::pointsToJSON( const QList<QgsPointV2>& points, int precision ) QString QgsGeometryUtils::pointsToJSON( const QList<QgsPointV2>& points, int precision )
{ {
QString json = "[ "; QString json = "[ ";
Q_FOREACH( const QgsPointV2& p, points ) Q_FOREACH ( const QgsPointV2& p, points )
{ {
json += '[' + qgsDoubleToString( p.x(), precision ) + ", " + qgsDoubleToString( p.y(), precision ) + "], "; json += '[' + qgsDoubleToString( p.x(), precision ) + ", " + qgsDoubleToString( p.y(), precision ) + "], ";
} }
Expand Down

0 comments on commit c806004

Please sign in to comment.