Skip to content

Commit

Permalink
spatialite provider: accept empty tables from spatialite 4 (fixes #7664)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 12, 2013
1 parent c80a1f4 commit cafc367
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/providers/spatialite/qgsspatialiteprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4164,7 +4164,7 @@ bool QgsSpatiaLiteProvider::checkLayerTypeAbstractInterface( gaiaVectorLayerPtr
case GAIA_VECTOR_VIRTUAL:
mVShapeBased = true;
break;
};
}

if ( lyr->AuthInfos )
{
Expand Down Expand Up @@ -4400,7 +4400,8 @@ bool QgsSpatiaLiteProvider::getGeometryDetailsAbstractInterface( gaiaVectorLayer
default:
geomType = QGis::WKBUnknown;
break;
};
}

mSrid = lyr->Srid;
if ( lyr->SpatialIndex == GAIA_SPATIAL_INDEX_RTREE )
{
Expand All @@ -4424,7 +4425,7 @@ bool QgsSpatiaLiteProvider::getGeometryDetailsAbstractInterface( gaiaVectorLayer
case GAIA_XY_Z_M:
nDims = GAIA_XY_Z_M;
break;
};
}

if ( mViewBased && spatialIndexRTree )
getViewSpatialIndexName();
Expand Down Expand Up @@ -4915,9 +4916,14 @@ bool QgsSpatiaLiteProvider::getTableSummaryAbstractInterface( gaiaVectorLayerPtr
layerExtent.set( lyr->ExtentInfos->MinX, lyr->ExtentInfos->MinY,
lyr->ExtentInfos->MaxX, lyr->ExtentInfos->MaxY );
numberFeatures = lyr->ExtentInfos->Count;
return true;
}
return false;
else
{
layerExtent.setMinimal();
numberFeatures = 0;
}

return true;
}
#endif

Expand Down

0 comments on commit cafc367

Please sign in to comment.