Skip to content
Permalink
Browse files
fix for postgis data crossing the dateline
git-svn-id: http://svn.osgeo.org/qgis/trunk@14150 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 26, 2010
1 parent 619f4d2 commit 7840204ac89698d8a1d73a78b4d8b1c6b9428a3d
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/providers/postgres/qgspostgresprovider.cpp
@@ -2839,7 +2839,18 @@ QgsRectangle QgsPostgresProvider::extent()
.arg( quotedValue( geometryColumn ) );
result = connectionRO->PQexec( sql );
if ( PQresultStatus( result ) == PGRES_TUPLES_OK && PQntuples( result ) == 1 )
{
ext = PQgetvalue( result, 0, 0 );

// fix for what might be a postgis bug: when the extent crosses the
// dateline extent() returns -180 to 180 (which appears right), but
// estimated_extent() returns eastern bound of data (>-180) and
// 180 degrees.
if ( ext.contains( ",180 " ) )
{
ext.clear();
}
}
}
}
else

0 comments on commit 7840204

Please sign in to comment.