= FDO RFC 38 - Multi-polygon support for SHP= This page contains an change request (RFC) for the FDO Open Source project. More FDO RFCs can be found on the [wiki:FDORfcs RFCs] page. == Status == ||RFC Template Version||(1.0)|| ||Submission Date|| June 08, 2009 || ||Last Modified|| Dan Stoica[[Timestamp]]|| ||Author||Orest Halustchak || ||RFC Status||draft|| ||Implementation Status||draft|| ||Proposed Milestone||3.5.0.0|| ||Assigned PSC guide(s)||Greg Boone|| ||'''Voting History'''|| || ||+1|| || ||+0|| || ||-0|| || ||-1|| || == Overview == This RFC is for adding the FDO SHP provider capability to support multi-polygons geometries. == Motivation == Currently, this provider supports only simple polygons. The SHP specification has only a polygon type, but it accounts for multiple outer polygon loops, which basically are multi-polygons. The SHP provider is not taking advantage of this and is not returning multi-polygons when the polygons are actual multi-polygons. The main processing that is missing with the current provider is on read, it does not check the polygon details to determine whether to generate an FDO polygon or an FDO multi-polygon geometry. == Proposed Solution == Modify the FDO SHP provider: * Change its capability setting to indicate that it supports multi-polygon geometry types.[[BR]] * On input of geometry, there is no further processing needed as the current code will save all input loops without checking whether they are outer or inner.[[BR]] * On read of geometry, the code should check the geometry to see if there are multiple loops. If there are multiple loops, determine if there are more than one outer loops. If so, change the output geometry type to FDO multi-polygon, otherwise, leave it as polygon with interior rings.[[BR]] * If any loops of a geometry are not closed, then the current behavior of not changing the geometry at all is followed. The geometry is returned as-is.[[BR]] == Implications == * The code for this is mostly done, just turned off. We will need to measure the performance impact, but the extra processing would only apply for cases where there are multiple loops. The most common case of a single loop polygon would not be processed any differently and would not have a performance impact. * The FDO geometry type will be corrected automatically on reading. The caller must expect either a polygon or a multi-polygon regardless of original geometry type on insert. == Test Plan == * Enhance the unit test and add roundtripping fidelity tests. * Performance benchmarks on large datasets containing polygons with many interior rings. == Funding/Resources == Autodesk to provide resources / funding.