[fdo-users] Improving performance for NEN1878 provider, howto?
Piet Bibber
piet.bibber at gmail.com
Mon Oct 1 07:46:11 EDT 2007
Hello,
My NEN1878 provider is almost done, but performance is not so fantastic when
reading the geometry; reading the schema is alright.
That is stange, as I cache in the geometry when I read the schema (NEN1878
schema discovery requires a full file scan; no seperate schema header). (The
schema is read within 3 seconds for a 2.3MB file, including the geometry and
attributes (all in memory (using STL)).
The SDF and SHP all seem so fast :-)
Map 3D seem to spend most of his time caching in the geometry (see source
code below)
I based my provider on the SHP provider, the reader seem to use FDO_READER
template, but I can't find where that points to. Maybe there are better
optimized readers.
Thanks.
Piet
Excerpt from the source files:
FdoByteArray * CreateCachedGeometry(FdoByteArray* fgfByteArray_I)
{
FdoByteArray* fgfByteArray = fgfByteArray_I; // it may be
reallocated
int count = mFeature->GetNumPoints();
FdoInt32 numPointOrds = 2;
FdoInt32 numBytesForOrdinates = numPointOrds * sizeof(double)
* count;
FdoInt32 numParts = 0;
FdoGeometryType fdoGeomType = GetFdoGeometryType();
FdoInt32 dimensionality = FdoDimensionality_XY;
FdoInt32 numPositions = mFeature->GetNumPoints();
fgfByteArray->Clear();
fgfByteArray = FdoByteArray::Append(fgfByteArray,
sizeof(fdoGeomType), (FdoByte *) &fdoGeomType);
switch (fdoGeomType)
{
case FdoGeometryType_None:
break;
case FdoGeometryType_Point:
fgfByteArray = FdoByteArray::Append(fgfByteArray,
sizeof(dimensionality), (FdoByte*)&dimensionality);
fgfByteArray = FdoByteArray::Append(fgfByteArray,
numBytesForOrdinates, (FdoByte*)mFeature->GetPoints());
break;
case FdoGeometryType_LineString:
fgfByteArray = FdoByteArray::Append(fgfByteArray,
sizeof(dimensionality), (FdoByte *) &dimensionality);
fgfByteArray = FdoByteArray::Append(fgfByteArray, sizeof(count),
(FdoByte *)&count);
fgfByteArray = FdoByteArray::Append(fgfByteArray,
numBytesForOrdinates, (FdoByte *)mFeature->GetPoints());
break;
default:
throw
FdoException::Create(FdoException::NLSGetMessage(FDO_NLSID(FDO_10_UNSUPPORTEDGEOMETRYTYPE)));
}
return (fgfByteArray);
}
// Returns pointer to vector of DoublePoints
inline DoublePoint* Nen1878Feature::GetPoints()
{
return (&mCoordinates[0]);
}
--
View this message in context: http://www.nabble.com/Improving-performance-for-NEN1878-provider%2C-howto--tf4547817s18162.html#a12977669
Sent from the fdo-users mailing list archive at Nabble.com.
More information about the fdo-users
mailing list