1
/******************************************************************************
2
* $Id: ogr_segukooa.h 23220 2011-10-11 21:50:55Z rouault $
4
* Project: SEG-P1 / UKOOA P1-90 Translator
5
* Purpose: Definition of classes for OGR SEG-P1 / UKOOA P1-90 driver.
6
* Author: Even Rouault, even dot rouault at mines dash paris dot org
8
******************************************************************************
9
* Copyright (c) 2011, Even Rouault <even dot rouault at mines dash paris dot org>
11
* Permission is hereby granted, free of charge, to any person obtaining a
12
* copy of this software and associated documentation files (the "Software"),
13
* to deal in the Software without restriction, including without limitation
14
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
* and/or sell copies of the Software, and to permit persons to whom the
16
* Software is furnished to do so, subject to the following conditions:
18
* The above copyright notice and this permission notice shall be included
19
* in all copies or substantial portions of the Software.
21
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMSEGUKOOAS OR OTHER
25
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27
* DEALINGS IN THE SOFTWARE.
28
****************************************************************************/
30
#ifndef _OGR_SEGUKOOA_H_INCLUDED
31
#define _OGR_SEGUKOOA_H_INCLUDED
33
#include "ogrsf_frmts.h"
35
/************************************************************************/
36
/* OGRSEGUKOOABaseLayer */
37
/************************************************************************/
39
class OGRSEGUKOOABaseLayer : public OGRLayer
42
OGRFeatureDefn* poFeatureDefn;
46
virtual OGRFeature * GetNextRawFeature() = 0;
49
virtual OGRFeature * GetNextFeature();
51
virtual OGRFeatureDefn * GetLayerDefn() { return poFeatureDefn; }
53
virtual int TestCapability( const char * ) { return FALSE; }
56
/************************************************************************/
57
/* OGRUKOOAP190Layer */
58
/************************************************************************/
60
class OGRUKOOAP190Layer : public OGRSEGUKOOABaseLayer
62
OGRSpatialReference* poSRS;
66
int bUseEastingNorthingAsGeometry;
71
OGRFeature * GetNextRawFeature();
74
OGRUKOOAP190Layer(const char* pszFilename,
79
virtual void ResetReading();
81
virtual OGRSpatialReference *GetSpatialRef() { return poSRS; }
85
/************************************************************************/
86
/* OGRSEGUKOOALineLayer */
87
/************************************************************************/
89
class OGRSEGUKOOALineLayer : public OGRSEGUKOOABaseLayer
91
OGRLayer *poBaseLayer;
92
OGRFeature *poNextBaseFeature;
95
OGRFeature * GetNextRawFeature();
98
OGRSEGUKOOALineLayer(const char* pszFilename,
99
OGRLayer *poBaseLayer);
100
~OGRSEGUKOOALineLayer();
102
virtual void ResetReading();
104
virtual OGRSpatialReference *GetSpatialRef() { return poBaseLayer->GetSpatialRef(); }
108
/************************************************************************/
110
/************************************************************************/
112
class OGRSEGP1Layer: public OGRSEGUKOOABaseLayer
114
OGRSpatialReference* poSRS;
119
int bUseEastingNorthingAsGeometry;
122
OGRFeature * GetNextRawFeature();
125
OGRSEGP1Layer(const char* pszFilename,
130
virtual void ResetReading();
132
virtual OGRSpatialReference *GetSpatialRef() { return poSRS; }
135
static char* ExpandTabs(const char* pszLine);
136
static int DetectLatitudeColumn(const char* pzLine);
139
/************************************************************************/
140
/* OGRSEGUKOOADataSource */
141
/************************************************************************/
143
class OGRSEGUKOOADataSource : public OGRDataSource
147
OGRLayer** papoLayers;
151
OGRSEGUKOOADataSource();
152
~OGRSEGUKOOADataSource();
154
int Open( const char * pszFilename,
157
virtual const char* GetName() { return pszName; }
159
virtual int GetLayerCount() { return nLayers; }
160
virtual OGRLayer* GetLayer( int );
162
virtual int TestCapability( const char * );
165
/************************************************************************/
166
/* OGRSEGUKOOADriver */
167
/************************************************************************/
169
class OGRSEGUKOOADriver : public OGRSFDriver
172
~OGRSEGUKOOADriver();
174
virtual const char* GetName();
175
virtual OGRDataSource* Open( const char *, int );
176
virtual int TestCapability( const char * );
180
#endif /* ndef _OGR_SEGUKOOA_H_INCLUDED */