Skip to content

Commit

Permalink
fix for postgis data crossing the dateline
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14150 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 26, 2010
1 parent 65ae081 commit a97fbec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -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
Expand Down

0 comments on commit a97fbec

Please sign in to comment.