34#ifndef _S57_H_INCLUDED
35#define _S57_H_INCLUDED
37#include "gdal/ogr_feature.h"
39#include "S57ClassRegistrar.h"
43char **S57FileCollector(
const char *pszDataset);
45#define EMPTY_NUMBER_MARKER 2147483641
50#define S57O_UPDATES "UPDATES"
51#define S57O_LNAM_REFS "LNAM_REFS"
52#define S57O_SPLIT_MULTIPOINT "SPLIT_MULTIPOINT"
53#define S57O_ADD_SOUNDG_DEPTH "ADD_SOUNDG_DEPTH"
54#define S57O_PRESERVE_EMPTY_NUMBERS "PRESERVE_EMPTY_NUMBERS"
55#define S57O_RETURN_PRIMITIVES "RETURN_PRIMITIVES"
56#define S57O_RETURN_LINKAGES "RETURN_LINKAGES"
58#define S57M_UPDATES 0x01
59#define S57M_LNAM_REFS 0x02
60#define S57M_SPLIT_MULTIPOINT 0x04
61#define S57M_ADD_SOUNDG_DEPTH 0x08
62#define S57M_PRESERVE_EMPTY_NUMBERS 0x10
63#define S57M_RETURN_PRIMITIVES 0x20
64#define S57M_RETURN_LINKAGES 0x40
77#define OGRN_VI "IsolatedNode"
78#define OGRN_VC "ConnectedNode"
94#define MAX_CLASSES 23000
95#define MAX_ATTRIBUTES 25000
125 void AddRecord(
int nKey, DDFRecord *);
126 int RemoveRecord(
int nKey);
128 DDFRecord *FindRecord(
int nKey);
130 DDFRecord *FindRecordByObjl(
135 int GetCount() {
return nRecordCount; }
136 DDFRecord *GetByIndex(
int i);
142typedef bool (*CallBackFunction)(void);
148 OGRFeatureDefn **papoFDefnList;
178 OGRFeature *poMultiPoint;
180 void ClearPendingMultiPoint();
181 OGRFeature *NextPendingMultiPoint();
183 OGRFeature *AssembleFeature(DDFRecord *, OGRFeatureDefn *);
185 void ApplyObjectClassAttributes(DDFRecord *, OGRFeature *);
186 void GenerateLNAMAndRefs(DDFRecord *, OGRFeature *);
187 void GenerateFSPTAttributes(DDFRecord *, OGRFeature *);
189 void AssembleSoundingGeometry(DDFRecord *, OGRFeature *);
190 void AssemblePointGeometry(DDFRecord *, OGRFeature *);
191 void AssembleLineGeometry(DDFRecord *, OGRFeature *);
192 void AssembleAreaGeometry(DDFRecord *, OGRFeature *);
194 OGRFeatureDefn *FindFDefn(DDFRecord *);
195 int ParseName(DDFField *,
int = 0,
int * = NULL);
197 int ApplyRecordUpdate(DDFRecord *, DDFRecord *);
199 int bMissingWarningIssued;
200 int bAttrWarningIssued;
209 int FetchPoint(
int,
int,
double *,
double *,
double * = NULL,
int * = NULL);
212 void SetOptions(
char **);
213 int GetOptionFlags() {
return nOptionFlags; }
215 int Open(
int bTestOpen);
217 DDFModule *GetModule() {
return poModule; }
218 const char *GetDSNM() {
return pszDSNM; }
219 int GetCSCL() {
return nCSCL; }
221 int Ingest(CallBackFunction pcallback = NULL);
222 int ApplyUpdates(DDFModule *,
int);
223 int FindAndApplyUpdates(
const char *pszPath = NULL);
226 OGRFeature *ReadNextFeature(OGRFeatureDefn * = NULL);
227 OGRFeature *ReadFeature(
int nFID, OGRFeatureDefn * = NULL);
228 OGRFeature *ReadVector(
int nFID,
int nRCNM);
230 int GetNextFEIndex(
int nRCNM = 100);
231 void SetNextFEIndex(
int nNewIndex,
int nRCNM = 100);
233 void AddFeatureDefn(OGRFeatureDefn *);
235 int CollectClassList(
int *,
int);
237 OGRErr GetExtent(OGREnvelope *psExtent,
int bForce);
239 int GetNall() {
return Nall; }
240 int GetAall() {
return Aall; }
242 int GetFeatureCount() {
return oFE_Index.GetCount(); }
255 int CreateS57File(
const char *pszFilename);
258 int WriteGeometry(DDFRecord *,
int,
double *,
double *,
double *);
259 int WriteATTF(DDFRecord *, OGRFeature *);
260 int WritePrimitive(OGRFeature *poFeature);
261 int WriteCompleteFeature(OGRFeature *poFeature);
262 int WriteDSID(
const char *pszDSNM = NULL,
const char *pszISDT = NULL,
263 const char *pszSTED = NULL,
int nAGEN = 0,
264 const char *pszCOMT = NULL);
265 int WriteDSPM(
int nScale = 0);
273 DDFRecord *MakeRecord();
282void CPL_DLL S57GenerateStandardAttributes(OGRFeatureDefn *,
int);
283OGRFeatureDefn CPL_DLL *S57GenerateGeomFeatureDefn(OGRwkbGeometryType,
int);
286OGRFeatureDefn CPL_DLL *S57GenerateVectorPrimitiveFeatureDefn(
int,
int);