00001 /****************************************************************************** 00002 * $Id: sfcdatasource.h,v 1.11 2006/03/31 17:44:20 fwarmerdam 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, 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 * $Log: sfcdatasource.h,v $ 00032 * Revision 1.11 2006/03/31 17:44:20 fwarmerdam 00033 * header updates 00034 * 00035 * Revision 1.10 2001/11/01 17:07:30 warmerda 00036 * lots of changes, including support for executing commands 00037 * 00038 * Revision 1.9 1999/11/18 19:02:20 warmerda 00039 * expanded tabs 00040 * 00041 * Revision 1.8 1999/06/26 05:27:08 warmerda 00042 * Separate out GetWKTFromSRSId static method for use of SFCTable 00043 * 00044 * Revision 1.7 1999/06/10 19:18:22 warmerda 00045 * added support for the spatial ref schema rowset 00046 * 00047 * Revision 1.6 1999/06/10 14:39:25 warmerda 00048 * Added use of OGIS Features Tables schema rowset 00049 * 00050 * Revision 1.5 1999/06/09 21:09:36 warmerda 00051 * updated docs 00052 * 00053 * Revision 1.4 1999/06/09 21:00:10 warmerda 00054 * added support for spatial table identification 00055 * 00056 * Revision 1.3 1999/06/08 19:05:27 warmerda 00057 * fixed up documentation 00058 * 00059 * Revision 1.2 1999/06/08 16:07:10 warmerda 00060 * Removed short doc for CreateSFCTable. 00061 * 00062 * Revision 1.1 1999/06/08 03:50:25 warmerda 00063 * New 00064 * 00065 */ 00066 00067 #ifndef SFCDATASOURCE_H_INCLUDED 00068 #define SFCDATASOURCE_H_INCLUDED 00069 00070 #include <atldbcli.h> 00071 #include "oledbgis.h" 00072 00073 class OGRGeometry; 00074 class SFCTable; 00075 00076 /************************************************************************/ 00077 /* SFCDataSource */ 00078 /************************************************************************/ 00079 00103 class SFCDataSource : public CDataSource 00104 { 00105 int bSessionEstablished; 00106 CSession oSession; 00107 00108 int nSRInitialized; 00109 char **papszSRName; 00110 00111 int UseOGISFeaturesTables(); 00112 void UseTables(); 00113 00114 void AddSFTable( const char * ); 00115 int EstablishSession(); 00116 00117 public: 00118 00119 SFCDataSource(); 00120 ~SFCDataSource(); 00121 00122 void Reinitialize(); 00123 00124 int GetSFTableCount(); 00125 00126 const char *GetSFTableName( int ); 00127 00128 SFCTable *CreateSFCTable( const char * pszTablename, 00129 OGRGeometry * poFilterGeometry = NULL, 00130 DBPROPOGISENUM eOperator 00131 = DBPROP_OGIS_ENVELOPE_INTERSECTS ); 00132 00133 SFCTable *Execute( const char *pszCommand, 00134 OGRGeometry * poFilterGeometry, 00135 DBPROPOGISENUM eOperator 00136 = DBPROP_OGIS_ENVELOPE_INTERSECTS ); 00137 00138 SFCTable *Execute( const char *pszCommand, 00139 DBPROPSET* pPropSet = NULL, 00140 DBPARAMS *pParams = NULL ); 00141 00142 char *GetWKTFromSRSId( int nSRS_ID ); 00143 static char *GetWKTFromSRSId( CSession *, int nSRS_ID ); 00144 }; 00145 00146 #endif /* ndef SFCDATASOURCE_H_INCLUDED */ 00147 00148 00149