1 : /******************************************************************************
2 : * $Id: ogr_sdts.h 15583 2008-10-23 00:04:33Z warmerdam $
3 : *
4 : * Project: STS Translator
5 : * Purpose: Definition of classes finding SDTS support into OGRDriver
6 : * framework.
7 : * Author: Frank Warmerdam, warmerdam@pobox.com
8 : *
9 : ******************************************************************************
10 : * Copyright (c) 1999, Frank Warmerdam
11 : *
12 : * Permission is hereby granted, free of charge, to any person obtaining a
13 : * copy of this software and associated documentation files (the "Software"),
14 : * to deal in the Software without restriction, including without limitation
15 : * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 : * and/or sell copies of the Software, and to permit persons to whom the
17 : * Software is furnished to do so, subject to the following conditions:
18 : *
19 : * The above copyright notice and this permission notice shall be included
20 : * in all copies or substantial portions of the Software.
21 : *
22 : * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 : * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 : * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 : * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 : * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 : * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28 : * DEALINGS IN THE SOFTWARE.
29 : ****************************************************************************/
30 :
31 : #ifndef _OGR_SDTS_H_INCLUDED
32 : #define _OGR_SDTS_H_INCLUDED
33 :
34 : #include "sdts_al.h"
35 : #include "ogrsf_frmts.h"
36 :
37 : class OGRSDTSDataSource;
38 :
39 : /************************************************************************/
40 : /* OGRSDTSLayer */
41 : /************************************************************************/
42 :
43 : class OGRSDTSLayer : public OGRLayer
44 : {
45 : OGRFeatureDefn *poFeatureDefn;
46 :
47 : SDTSTransfer *poTransfer;
48 : int iLayer;
49 : SDTSIndexedReader *poReader;
50 :
51 : OGRSDTSDataSource *poDS;
52 :
53 : OGRFeature *GetNextUnfilteredFeature();
54 :
55 : void BuildPolygons();
56 : int bPolygonsBuilt;
57 :
58 : public:
59 : OGRSDTSLayer( SDTSTransfer *, int, OGRSDTSDataSource*);
60 : ~OGRSDTSLayer();
61 :
62 : void ResetReading();
63 : OGRFeature * GetNextFeature();
64 :
65 : // OGRFeature *GetFeature( long nFeatureId );
66 :
67 88 : OGRFeatureDefn * GetLayerDefn() { return poFeatureDefn; }
68 :
69 : // int GetFeatureCount( int );
70 :
71 : OGRSpatialReference *GetSpatialRef();
72 :
73 : int TestCapability( const char * );
74 : };
75 :
76 : /************************************************************************/
77 : /* OGRSDTSDataSource */
78 : /************************************************************************/
79 :
80 : class OGRSDTSDataSource : public OGRDataSource
81 : {
82 : SDTSTransfer *poTransfer;
83 : char *pszName;
84 :
85 : int nLayers;
86 : OGRSDTSLayer **papoLayers;
87 :
88 : OGRSpatialReference *poSRS;
89 :
90 : public:
91 : OGRSDTSDataSource();
92 : ~OGRSDTSDataSource();
93 :
94 : int Open( const char * pszFilename, int bTestOpen );
95 :
96 2 : const char *GetName() { return pszName; }
97 72 : int GetLayerCount() { return nLayers; }
98 : OGRLayer *GetLayer( int );
99 : int TestCapability( const char * );
100 :
101 386 : OGRSpatialReference *GetSpatialRef() { return poSRS; }
102 : };
103 :
104 : /************************************************************************/
105 : /* OGRSDTSDriver */
106 : /************************************************************************/
107 :
108 : class OGRSDTSDriver : public OGRSFDriver
109 389 : {
110 : public:
111 : ~OGRSDTSDriver();
112 :
113 : const char *GetName();
114 : OGRDataSource *Open( const char *, int );
115 : int TestCapability( const char * );
116 : };
117 :
118 :
119 : #endif /* ndef _OGR_SDTS_H_INCLUDED */
|