sfcdatasource.h

00001 /******************************************************************************
00002  * $Id: sfcdatasource.h,v 1.10 2001/11/01 17:07:30 warmerda Exp $
00003  *
00004  * Project:  OpenGIS Simple Features Reference Implementation
00005  * Purpose:  SFCDatasource class, client side abstraction for OLE DB
00006  *           SFCOM datasource based on OLE DB CDataSource template. 
00007  * Author:   Frank Warmerdam, warmerda@home.com
00008  *
00009  ******************************************************************************
00010  * Copyright (c) 1999, Les Technologies SoftMap Inc.
00011  *
00012  * Permission is hereby granted, free of charge, to any person obtaining a
00013  * copy of this software and associated documentation files (the "Software"),
00014  * to deal in the Software without restriction, including without limitation
00015  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00016  * and/or sell copies of the Software, and to permit persons to whom the
00017  * Software is furnished to do so, subject to the following conditions:
00018  *
00019  * The above copyright notice and this permission notice shall be included
00020  * in all copies or substantial portions of the Software.
00021  *
00022  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00023  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00024  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00025  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00026  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00027  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00028  * DEALINGS IN THE SOFTWARE.
00029  ******************************************************************************
00030  *
00031  * $Log: sfcdatasource.h,v $
00032  * Revision 1.10  2001/11/01 17:07:30  warmerda
00033  * lots of changes, including support for executing commands
00034  *
00035  * Revision 1.9  1999/11/18 19:02:20  warmerda
00036  * expanded tabs
00037  *
00038  * Revision 1.8  1999/06/26 05:27:08  warmerda
00039  * Separate out GetWKTFromSRSId static method for use of SFCTable
00040  *
00041  * Revision 1.7  1999/06/10 19:18:22  warmerda
00042  * added support for the spatial ref schema rowset
00043  *
00044  * Revision 1.6  1999/06/10 14:39:25  warmerda
00045  * Added use of OGIS Features Tables schema rowset
00046  *
00047  * Revision 1.5  1999/06/09 21:09:36  warmerda
00048  * updated docs
00049  *
00050  * Revision 1.4  1999/06/09 21:00:10  warmerda
00051  * added support for spatial table identification
00052  *
00053  * Revision 1.3  1999/06/08 19:05:27  warmerda
00054  * fixed up documentation
00055  *
00056  * Revision 1.2  1999/06/08 16:07:10  warmerda
00057  * Removed short doc for CreateSFCTable.
00058  *
00059  * Revision 1.1  1999/06/08 03:50:25  warmerda
00060  * New
00061  *
00062  */
00063 
00064 #ifndef SFCDATASOURCE_H_INCLUDED
00065 #define SFCDATASOURCE_H_INCLUDED
00066 
00067 #include <atldbcli.h>
00068 #include "oledbgis.h"
00069 
00070 class OGRGeometry;
00071 class SFCTable;
00072 
00073 /************************************************************************/
00074 /*                            SFCDataSource                             */
00075 /************************************************************************/
00076 
00100 class SFCDataSource : public CDataSource
00101 {
00102     int         bSessionEstablished;
00103     CSession    oSession;
00104     
00105     int         nSRInitialized;
00106     char        **papszSRName;
00107 
00108     int         UseOGISFeaturesTables();
00109     void        UseTables();
00110 
00111     void        AddSFTable( const char * );
00112     int         EstablishSession();
00113 
00114   public:
00115 
00116                 SFCDataSource();
00117                 ~SFCDataSource();
00118 
00119     void        Reinitialize();
00120 
00121     int         GetSFTableCount();
00122 
00123     const char  *GetSFTableName( int );
00124     
00125     SFCTable    *CreateSFCTable( const char * pszTablename,
00126                                  OGRGeometry * poFilterGeometry = NULL,
00127                                  DBPROPOGISENUM eOperator
00128                                     = DBPROP_OGIS_ENVELOPE_INTERSECTS );
00129 
00130     SFCTable    *Execute( const char *pszCommand,
00131                           OGRGeometry * poFilterGeometry,
00132                           DBPROPOGISENUM eOperator
00133                                 = DBPROP_OGIS_ENVELOPE_INTERSECTS );
00134                           
00135     SFCTable    *Execute( const char *pszCommand,
00136                           DBPROPSET* pPropSet = NULL,
00137                           DBPARAMS *pParams = NULL );
00138 
00139     char        *GetWKTFromSRSId( int nSRS_ID );
00140     static char *GetWKTFromSRSId( CSession *, int nSRS_ID );
00141 };
00142 
00143 #endif /* ndef SFCDATASOURCE_H_INCLUDED */
00144 
00145 
00146 

Generated on Mon Jan 9 18:03:31 2006 for OGR by  doxygen 1.4.6