sfcdatasource.h

00001 /******************************************************************************
00002  * $Id: sfcdatasource.h 10646 2007-01-18 02:38:10Z warmerdam $
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, warmerdam@pobox.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 #ifndef SFCDATASOURCE_H_INCLUDED
00032 #define SFCDATASOURCE_H_INCLUDED
00033 
00034 #include <atldbcli.h>
00035 #include "oledbgis.h"
00036 
00037 class OGRGeometry;
00038 class SFCTable;
00039 
00040 /************************************************************************/
00041 /*                            SFCDataSource                             */
00042 /************************************************************************/
00043 
00067 class SFCDataSource : public CDataSource
00068 {
00069     int         bSessionEstablished;
00070     CSession    oSession;
00071     
00072     int         nSRInitialized;
00073     char        **papszSRName;
00074 
00075     int         UseOGISFeaturesTables();
00076     void        UseTables();
00077 
00078     void        AddSFTable( const char * );
00079     int         EstablishSession();
00080 
00081   public:
00082 
00083                 SFCDataSource();
00084                 ~SFCDataSource();
00085 
00086     void        Reinitialize();
00087 
00088     int         GetSFTableCount();
00089 
00090     const char  *GetSFTableName( int );
00091     
00092     SFCTable    *CreateSFCTable( const char * pszTablename,
00093                                  OGRGeometry * poFilterGeometry = NULL,
00094                                  DBPROPOGISENUM eOperator
00095                                     = DBPROP_OGIS_ENVELOPE_INTERSECTS );
00096 
00097     SFCTable    *Execute( const char *pszCommand,
00098                           OGRGeometry * poFilterGeometry,
00099                           DBPROPOGISENUM eOperator
00100                                 = DBPROP_OGIS_ENVELOPE_INTERSECTS );
00101                           
00102     SFCTable    *Execute( const char *pszCommand,
00103                           DBPROPSET* pPropSet = NULL,
00104                           DBPARAMS *pParams = NULL );
00105 
00106     char        *GetWKTFromSRSId( int nSRS_ID );
00107     static char *GetWKTFromSRSId( CSession *, int nSRS_ID );
00108 };
00109 
00110 #endif /* ndef SFCDATASOURCE_H_INCLUDED */
00111 
00112 
00113 

Generated for GDAL by doxygen 1.5.2.