| 1 | = FDO RFC 66 - Support coordinate system transformation when serialize XML = |
| 2 | |
| 3 | This page contains a request for comments document (RFC) for the FDO Open Source project. |
| 4 | More FDO RFCs can be found on the [wiki:FDORfcs RFCs] page. |
| 5 | |
| 6 | == Status == |
| 7 | |
| 8 | ||RFC Template Version||1.1|| |
| 9 | ||Submission Date||April 19, 2013|| |
| 10 | ||Last Modified||Christine Bao - April 19, 2013|| |
| 11 | ||Author||Christine Bao|| |
| 12 | ||RFC Status||Draft|| |
| 13 | ||Implementation Status||Completed|| |
| 14 | ||Proposed Milestone||3.9|| |
| 15 | ||Assigned PSC guide(s)|||| |
| 16 | |
| 17 | == Overview == |
| 18 | |
| 19 | This proposal adds coordinate system transformation support when serialize XML using FdoXmlFeatureSerializer::XmlSerialize(...). |
| 20 | |
| 21 | == Motivation == |
| 22 | |
| 23 | FdoXmlFeatureSerializer is used for serializing FDO features into XML, for example it can serialize FDO features into WFS GML format. |
| 24 | |
| 25 | {{{ |
| 26 | void FdoXmlFeatureSerializer::XmlSerialize( |
| 27 | FdoIFeatureReader* reader, |
| 28 | FdoXmlFeatureWriter* writer, |
| 29 | FdoXmlFeatureFlags* flags) |
| 30 | }}} |
| 31 | |
| 32 | However currently it can only reads the features and write the native data in data source coordinate system, if user request the data in another coordinate system, it fails to return the right value. For example, if the data source SDF's coordinate system is ca83, and published as WFS service. Customer can request this WFS in LL84 coordinate system. Currently the returned WFS GML still ca83, not expected as customer wants. |
| 33 | |
| 34 | == Proposed Solution == |
| 35 | |
| 36 | FDO does not have coordinate system transformation capability. It should provide a way to let the caller to coordinate system transformation. A solution is to define a pseudo method in FDO: |
| 37 | |
| 38 | {{{ |
| 39 | class FdoCoordinateSystemTransform : public FdoDisposable |
| 40 | { |
| 41 | public: |
| 42 | FDO_API virtual FdoIDirectPosition* CoordinateSystemTransform(FdoIDirectPosition* sourceGeometry); |
| 43 | }; |
| 44 | }}} |
| 45 | |
| 46 | And FdoXmlFeatureFlags adopt this if the caller wants to do coordinate system transformation. |
| 47 | |
| 48 | {{{ |
| 49 | FDO_API virtual void SetSrsName(FdoString* srsName); |
| 50 | FDO_API virtual FdoString* GetSrsName(); |
| 51 | FDO_API virtual void SetCoordinateSystemTransform(FdoCoordinateSystemTransform *transform); |
| 52 | FDO_API virtual FdoCoordinateSystemTransform* GetCoordinateSystemTransform(); |
| 53 | }}} |
| 54 | |
| 55 | This srs name and transform is called during FDO serializing XML. The default value is NULL, so if caller does not set it, it's ignored and work as before. |
| 56 | |
| 57 | The caller can make a class inherit from FdoCoordinateSystemTransform and implement real CoordinateSystemTransform(...) function, set the instance to FdoXmlFeatureFlags, and the feature data is transformed. |
| 58 | |
| 59 | == Implications == |
| 60 | |
| 61 | Existing code is not implicated. |
| 62 | |
| 63 | == Test Plan == |
| 64 | |
| 65 | Add unit test in FDO to do pseudo coordinate system transformation. |
| 66 | Test in MapGuide to do real coordinate system transformation. |
| 67 | |
| 68 | == !Funding/Resources == |
| 69 | |
| 70 | Autodesk |