| 1 | |
| 2 | |
| 3 | = FDO RFC 11 - Adding Geometric Expression Functions = |
| 4 | |
| 5 | This page contains a request for comments document (RFC) for the FDO Open Source project. |
| 6 | More FDO RFCs can be found on the [wiki:FDORfcs RFCs] page. |
| 7 | |
| 8 | == Status == |
| 9 | |
| 10 | ||RFC Template Version||(1.0)|| |
| 11 | ||Submission Date||Aug 03, 2007|| |
| 12 | ||Last Modified||Thomas Knoell [[Timestamp]]|| |
| 13 | ||Author||Thomas Knoell|| |
| 14 | ||RFC Status||Draft|| |
| 15 | ||Implementation Status ||Under Development|| |
| 16 | ||Proposed Milestone||3.3.0.0|| |
| 17 | ||Assigned PSC guide(s)||Greg Boone|| |
| 18 | ||'''Voting History'''|| || |
| 19 | ||+1|||| |
| 20 | ||+0|||| |
| 21 | ||-0|||| |
| 22 | ||-1|||| |
| 23 | |
| 24 | == Overview == |
| 25 | |
| 26 | This RFC follows from RFC 8 by adding two geometric functions. RFC 8 laid the foundation for a common set of functions that providers could support. That RFC left out two commonly used geometric functions, ''Area()'' and ''Length()''. This RFC adds those two functions. A reason for adding these functions in a separate RFC is that there are coordinate system considerations that need to be defined and discussed that do not apply to the list of functions in RFC8. Many providers do not include a coordinate system library internally (e.g. SHP, SDF) while other providers (e.g. Oracle) do include a coordinate system library. ''Area()'' and ''Length()'' calculations on geometry with geodetic coordinate systems require a coordinate system library to do the spheroid-based calculations to provide correct results. While most coordinate system libraries include a distance calculation on the spheroid, most do not include area calculation on the spheroid. It is the proposal of this RFC that providers that do not use coordinate system libraries simply return simple calculations directly against the lat/long data (i.e. using Euclidian geometry based calculations). We would like feedback from the discussion list on the handling of this. |
| 27 | |
| 28 | |
| 29 | == Signatures == |
| 30 | This RFC proposes the following signatures for the geometric functions Area and Length: |
| 31 | |
| 32 | '''!FdoDouble Area (<geometry property>);''' |
| 33 | |
| 34 | '''!FdoDouble Length (<geometry property>);''' |
| 35 | |
| 36 | |
| 37 | Both functions accept a geometry property only. The result of the functions depend on the provided geometry: |
| 38 | |
| 39 | ''AREA()'': |
| 40 | * if the provided geometry is a line or point geometry, the result is 0. |
| 41 | * if the provided geometry is a polygon, area is the result of the area of the exterior loops minus the area of the interior loops. |
| 42 | |
| 43 | ''LENGTH()'': |
| 44 | * if the provided geometry is a point geometry, the result is 0 |
| 45 | * if the provided geometry is a line, the result is the length of the object |
| 46 | * if the provided geometry is a polygon, the result is the length of the perimeter which includes all exterior and interior loops. |
| 47 | |
| 48 | For non-geodetic systems and if the provider is ignoring the handling of geodetic coordinate systems, the function ''Length()'' will return XY units while ''Area()'' will use the square of the length units. If the provider has a coordinate system library for geodetic coordinate systems, the length will be expressed in meters, the area in square meters. |
| 49 | |
| 50 | It should also be noted that the functions execute 2D calculations only. Therefore, if an object is defined in space, the functions should not be used to determine the area or length of such an object. |
| 51 | |
| 52 | 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''). |
| 53 | |
| 54 | |
| 55 | === Example === |
| 56 | |
| 57 | Assuming that a class ''Road'' has a geometry property named ''geom'', a call to ''Length(geom)'' will return the length of a road object. |
| 58 | |
| 59 | |
| 60 | == Affected Providers == |
| 61 | |
| 62 | This enhancement will affect the following providers: ArcSDE, MySQL, SDF and SHP. |
| 63 | |
| 64 | |
| 65 | == Required FDO Enhancements == |
| 66 | |
| 67 | No FDO enhancements are required. |
| 68 | |
| 69 | |
| 70 | == Implications == |
| 71 | |
| 72 | This change will not cause any side-effects. No existing provider needs to change unless the provider wants to expose the new capability. |
| 73 | |
| 74 | == Test Plan == |
| 75 | |
| 76 | Existing unit tests will be enhanced to test those changes. |
| 77 | |
| 78 | == Funding/Resources == |
| 79 | |
| 80 | Autodesk to provide resource / funding to implement the feature for the affected providers. |
| 81 | |