110 likes | 344 Views
Using the FDO API in C#.NET. Scott McFarlane Woolpert, Inc. Agenda. FDO Overview FDO API Key Concepts Code Examples. FDO Overview. Your Application. FDO API (C++ & .NET). SDF. GDAL. Oracle. WMS. ArcSDE. SHP. SQL Server. WFS. OGR. MySQL. ODBC. Vector Files. Raster Files. RDMS.
E N D
Using the FDO API in C#.NET Scott McFarlane Woolpert, Inc.
Agenda • FDO Overview • FDO API Key Concepts • Code Examples
FDO Overview Your Application FDO API (C++ & .NET) SDF GDAL Oracle WMS ArcSDE SHP SQL Server WFS OGR MySQL ODBC Vector Files Raster Files RDMS Web Services Other
FDO Overview • FDO Hierarchy Provider Connection Data Store Schema Class Property
FDO API Key Concepts • Download the FDO Distribution (http://fdo.osgeo.org) • FDO API distribution in PATH (or in app folder) • .NET References • OSGeo.FDO • OSGeo.FDO.Common • OSGeo.FDO.Geometry • Root object: FeatureAccessManager
FDO API Key Concepts Command Interfaces(Partial Listing) OSGeo.FDO.Commands.DataStore ICreateDataStore IDestroyDataStore IListDataStores OSGeo.FDO.Commands.Feature IDelete IInsert ISelect IUpdate OSGeo.FDO.Commands.Schema IApplySchema IDescribeSchema IGetClassNames IGetSchemaNames OSGeo.FDO.Commands.SpatialContext IActivateSpatialContext ICreateSpatialContext IDestroySpatialContext IGetSpatialContexts • Use of “Command” Design Pattern • Virtually all operations are performed through command objects • Base interface: ICommand • Steps to use: • Obtain command object through IConnection.CreateCommand(CommandType) • Set command parameters • Call Execute() • Do something with result (if applicable)
FDO API Key Concepts • .NET API is a managed wrapper for a C++ (unmanaged) API • Use of IDispose interface • In C#, call Dispose() or use using statement
FDO API Key Concepts • Provider Capabilities API (examples) • Command Capabilities • Types of commands that are supported • Filter Capabilities • Types of filter conditions • Supported spatial operations • Geometry Capabilities • Supported geometry types • Schema Capabilities • Supported class types and data types • Auto-number support • Constraints
FDO API Key Concepts • Identifying a feature class in the API • Schema name and Class name • Some commands and methods take them as separate arguments • Others take the “fully qualified” feature class name as: “SchemName:ClassName”
Code Examples • List providers • Get provider connection properties • Inspect the schema • Select features from an FDO data source • Create a new feature class and insert features