[fdo-users] Improving performance for NEN1878 provider, howto?

Piet Bibber piet.bibber at gmail.com
Mon Oct 1 10:07:18 EDT 2007


Thanks Gavin, Badreddine for the quick reply.
The provider does implement SelectAggregates (it came with the SHP
provider), but not sure were to implement the SpatialExtents and Count. In
what class is that? (SelectAggregates base class do not implement these)

Piet

On 10/1/07, Gavin Cramer <gavin.cramer at autodesk.com> wrote:
>
> I agree.  The code excerpt does not have appear to have any intrinsic
> performance problem.  Pre-sizing the FdoByteArray would likely make a
> trivial difference, since it uses internal object caching for smaller
> values that are typical for geometries.  The biggest difference would be
> having SpatialExtents and Count implemented.
>
> Gavin
>
>
>
> -----Original Message-----
> From: fdo-users-bounces at lists.osgeo.org
> [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Badreddine
> Karoui
> Sent: Monday, October 01, 2007 9:42 AM
> To: fdo-users at lists.osgeo.org
> Subject: RE: [fdo-users] Improving performance for NEN1878 provider,
> howto?
>
> Hi,
>
> You may want to implement the FdoISelectAggregates command plus the
> SpatialExtents and Count functions. If these two functions are not
> implemented, then Map will scan all the geometries to find the minimum
> bounding rectangle of all the data.
>
> Badreddine
>
> -----Original Message-----
> From: fdo-users-bounces at lists.osgeo.org
> [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Piet Bibber
> Sent: Monday, October 01, 2007 7:46 AM
> To: fdo-users at lists.osgeo.org
> Subject: [fdo-users] Improving performance for NEN1878 provider, howto?
>
>
> 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_UNSUPP
> ORTEDGEOMETRYTYPE)));
>        }
>
>            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-howt
> o--tf4547817s18162.html#a12977669
> Sent from the fdo-users mailing list archive at Nabble.com.
>
> _______________________________________________
> fdo-users mailing list
> fdo-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>
> _______________________________________________
> fdo-users mailing list
> fdo-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>
> _______________________________________________
> fdo-users mailing list
> fdo-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fdo-users/attachments/20071001/3e6ff449/attachment-0001.html


More information about the fdo-users mailing list