This page is an FDO Code Snippet. Visit the CodeSnippets page to view more!
Calculating Dynamic Extents
The easiest and most efficient way of determining extents from a provider that supports dynamic extents is to use the GetSpatialContext command.
C# Example
using OSGeo.FDO.Connections; using OSGeo.FDO.Commands.SpatialContext; using OSGeo.FDO.Geometry; IGetSpatialContexts getSpatialContexts = connection.CreateCommand(CommandType.CommandType_GetSpatialContexts) as IGetSpatialContexts; ISpatialContextReader reader = getSpatialContexts.Execute(); IGeometry geom = null; byte[] extentAsByteArr = null; string extentAsText = null; FgfGeometryFactory geomFactory = new FgfGeometryFactory(); while (reader.ReadNext()) { extentAsByteArr = reader.GetExtent(); // if extent type is dynamic and no geometries have been added // the extent can be null if (extentAsByteArr != null) { geom = geomFactory.CreateGeometryFromFgf(extentAsByteArr); extentAsText = geom.Text; } else { extentAsText = "No extent found"; } }
C++ Example
Please add here!
Contributors
- Donald Cameron
Last modified
16 years ago
Last modified on 10/15/08 10:01:17
Note:
See TracWiki
for help on using the wiki.