Skip to content

Commit 7840204

Browse files
author
jef
committed
fix for postgis data crossing the dateline
git-svn-id: http://svn.osgeo.org/qgis/trunk@14150 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 619f4d2 commit 7840204

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/providers/postgres/qgspostgresprovider.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -2839,7 +2839,18 @@ QgsRectangle QgsPostgresProvider::extent()
28392839
.arg( quotedValue( geometryColumn ) );
28402840
result = connectionRO->PQexec( sql );
28412841
if ( PQresultStatus( result ) == PGRES_TUPLES_OK && PQntuples( result ) == 1 )
2842+
{
28422843
ext = PQgetvalue( result, 0, 0 );
2844+
2845+
// fix for what might be a postgis bug: when the extent crosses the
2846+
// dateline extent() returns -180 to 180 (which appears right), but
2847+
// estimated_extent() returns eastern bound of data (>-180) and
2848+
// 180 degrees.
2849+
if ( ext.contains( ",180 " ) )
2850+
{
2851+
ext.clear();
2852+
}
2853+
}
28432854
}
28442855
}
28452856
else

0 commit comments

Comments
 (0)