GDAL

ogrmitabspatialref.h
1// SPDX-License-Identifier: MIT
2// Copyright 1999-2003, Daniel Morissette
3// Copyright (c) 1999-2001, Frank Warmerdam
4// Implementation translation between MIF CoordSys format, and
5// and OGRSpatialRef format.
6
7#ifndef OGRMITABSPATIALREF_H_INCLUDED
8#define OGRMITABSPATIALREF_H_INCLUDED
9
12#include "cpl_port.h"
13
14 class OGRSpatialReference;
15
16/*---------------------------------------------------------------------
17 * TABProjInfo
18 * struct used to store the projection parameters from the .MAP header
19 *--------------------------------------------------------------------*/
20 typedef struct TABProjInfo_t
21{
22 GByte nProjId; // See MapInfo Ref. Manual, App. F and G
23 GByte nEllipsoidId;
24 GByte nUnitsId;
25 double adProjParams[7]; // params in same order as in .MIF COORDSYS
26
27 GInt16 nDatumId; // Datum Id added in MapInfo 7.8+ (.map V500)
28 double dDatumShiftX; // Before that, we had to always lookup datum
29 double dDatumShiftY; // parameters to establish datum id
30 double dDatumShiftZ;
31 double adDatumParams[5];
32
33 // Affine parameters only in .map version 500 and up
34 GByte nAffineFlag; // 0=No affine param, 1=Affine params
35 GByte nAffineUnits;
36 double dAffineParamA; // Affine params
37 double dAffineParamB;
38 double dAffineParamC;
39 double dAffineParamD;
40 double dAffineParamE;
41 double dAffineParamF;
42} TABProjInfo;
43
44 OGRSpatialReference CPL_DLL *
45TABFileGetSpatialRefFromTABProj(const TABProjInfo &sTABProj);
46
47 int CPL_DLL
48TABFileGetTABProjFromSpatialRef(const OGRSpatialReference *poSpatialRef,
49 TABProjInfo &sTABProj, int &nParamCount);
50
51 OGRSpatialReference CPL_DLL *MITABCoordSys2SpatialRef(const char *pszCoordSys);
52
53 char CPL_DLL *MITABSpatialRef2CoordSys(const OGRSpatialReference *poSR);
54
55 bool CPL_DLL MITABExtractCoordSysBounds(const char *pszCoordSys, double &dXMin,
56 double &dYMin, double &dXMax,
57 double &dYMax);
58
59 int CPL_DLL MITABCoordSys2TABProjInfo(const char *pszCoordSys,
60 TABProjInfo *psProj);
61
62/*---------------------------------------------------------------------
63 * The following are used for coordsys bounds lookup
64 *--------------------------------------------------------------------*/
65
66 bool CPL_DLL MITABLookupCoordSysBounds(TABProjInfo *psCS, double &dXMin,
67 double &dYMin, double &dXMax,
68 double &dYMax,
69 bool bOnlyUserTable = false);
70 int CPL_DLL MITABLoadCoordSysTable(const char *pszFname);
71 void CPL_DLL MITABFreeCoordSysTable();
72
75#endif
OGRSpatialReference
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:152
cpl_port.h
Core portability definitions for CPL.
GInt16
short GInt16
Int16 type.
Definition cpl_port.h:171
GByte
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:175