Version 12 (modified by gregboone, 5 years ago)

--

# FDO RFC 28 - Add Start/End? Expression Functions

This page contains a request for comments document (RFC) for the FDO Open Source project. More FDO RFCs can be found on the RFCs page.

## Status

 RFC Template Version (1.0) Submission Date October 20, 2008 Last Modified Greg BooneError: Failed to load processor `Timestamp``No macro or processor named 'Timestamp' found` Author Greg Boone RFC Status Draft Implementation Status Pending Proposed Milestone 3.4.0.0 Assigned PSC guide(s) Greg Boone Voting History +1 +0 -0 -1

## Overview

This RFC follows from RFC 8 by adding geometric functions for StartX, StartY, StartZ, EndX, EndY and EndZ.

## Signatures

This RFC proposes the following signatures for the new functions:

```double StartX(<geometry property>);
double StartY(<geometry property>);
double StartZ(<geometry property>);

double EndX(<geometry property>);
double EndY(<geometry property>);
double EndZ(<geometry property>);
```

All of the above functions accept a geometry property only. The result of the functions depend on the provided geometry:

If the provided geometry is a point geometry, the result of the Start/End? functions is the x, y, z values of the point.
If the provided geometry is a multi-point geometry, the result of the Start/End? functions is the x, y, z values of the first point.

If the provided geometry is a line, the result of the Start/End? functions is the x, y, z values of the start and end points of the first line.
If the provided geometry is a multi-line, the result of the Start/End? functions is the x, y, z values of the start and end points of the first line.

If the provided geometry is a polygon, the result of the Start/End? functions is the x, y, z values of the start and end points of the exterior ring of the polygon.
If the provided geometry is a multi-polygon, the result of the Start/End? functions is the x, y, z values of the start and end points of the exterior ring of the first-polygon.

Like the standard functions listed in RFC 8, the user can get access to the geometric function definitions via the FDO interface GetWellKnownFunctions. The new functions will be categorized as geometry functions (FdoFunctionCategoryType_Geometry).

### Example

```FdoPtr<FdoISelectAggregates> selectAggregates = (FdoISelectAggregates*)mConnection->CreateCommand (FdoCommandType_SelectAggregates);
selectAggregates->SetFeatureClassName (L"POLE");
FdoPtr<FdoIdentifierCollection> idColl = selectAggregates->GetPropertyNames();

FdoPtr<FdoExpressionCollection> functionArgs = FdoExpressionCollection::Create();
FdoPtr<FdoIdentifier> arg1 = FdoIdentifier::Create(L"GEOMETRY");
FdoPtr<FdoFunction> computedExpr = FdoFunction::Create(L"STARTX", functionArgs);
FdoPtr<FdoComputedIdentifier> computedId = FdoComputedIdentifier::Create(L"POLE_X", computedExpr);

```

## Affected Providers

This enhancement will affect the following providers: SDF.

## Required FDO Enhancements

No FDO enhancements are required.

## Implications

This change will not cause any side-effects. No existing provider needs to change unless the provider wants to expose the new capability.

## Test Plan

Existing unit tests will be enhanced to test those changes.

## Funding/Resources?

Autodesk to provide resource / funding to implement the feature for the affected providers.