File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1096,25 +1096,25 @@ QgsRectangle QgsOgrProvider::extent()
1096
1096
}
1097
1097
#endif
1098
1098
1099
+ mExtent ->MinX = std::numeric_limits<double >::max ();
1100
+ mExtent ->MinY = std::numeric_limits<double >::max ();
1101
+ mExtent ->MaxX = -std::numeric_limits<double >::max ();
1102
+ mExtent ->MaxY = -std::numeric_limits<double >::max ();
1103
+
1099
1104
// TODO: This can be expensive, do we really need it!
1100
1105
if ( ogrLayer == ogrOrigLayer )
1101
1106
{
1102
1107
OGR_L_GetExtent ( ogrLayer, mExtent , true );
1103
1108
}
1104
1109
else
1105
1110
{
1106
- mExtent ->MinX = std::numeric_limits<double >::max ();
1107
- mExtent ->MinY = std::numeric_limits<double >::max ();
1108
- mExtent ->MaxX = -std::numeric_limits<double >::max ();
1109
- mExtent ->MaxY = -std::numeric_limits<double >::max ();
1110
-
1111
1111
OGRFeatureH f;
1112
1112
1113
1113
OGR_L_ResetReading ( ogrLayer );
1114
1114
while (( f = OGR_L_GetNextFeature ( ogrLayer ) ) )
1115
1115
{
1116
1116
OGRGeometryH g = OGR_F_GetGeometryRef ( f );
1117
- if ( g )
1117
+ if ( g && ! OGR_G_IsEmpty ( g ) )
1118
1118
{
1119
1119
OGREnvelope env;
1120
1120
OGR_G_GetEnvelope ( g, &env );
You can’t perform that action at this time.
0 commit comments