GDAL
ogrpgeogeometry.h
1 /******************************************************************************
2  * $Id$
3  *
4  * Project: OpenGIS Simple Features Reference Implementation
5  * Purpose: Implements decoder of shapebin geometry for PGeo
6  * Author: Frank Warmerdam, warmerdam@pobox.com
7  *
8  ******************************************************************************
9  * Copyright (c) 2005, Frank Warmerdam <warmerdam@pobox.com>
10  * Copyright (c) 2011-2014, Even Rouault <even dot rouault at spatialys.com>
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_PGEOGEOMETRY_H_INCLUDED
32 #define OGR_PGEOGEOMETRY_H_INCLUDED
33 
34 #include "ogr_geometry.h"
35 
36 #include <vector>
37 
38 #define SHPT_NULL 0
39 
40 #ifndef SHPT_POINT
41 #define SHPT_POINT 1
42 #define SHPT_POINTM 21
43 #define SHPT_POINTZM 11
44 #define SHPT_POINTZ 9
45 
46 #define SHPT_MULTIPOINT 8
47 #define SHPT_MULTIPOINTM 28
48 #define SHPT_MULTIPOINTZM 18
49 #define SHPT_MULTIPOINTZ 20
50 
51 #define SHPT_ARC 3
52 #define SHPT_ARCM 23
53 #define SHPT_ARCZM 13
54 #define SHPT_ARCZ 10
55 
56 #define SHPT_POLYGON 5
57 #define SHPT_POLYGONM 25
58 #define SHPT_POLYGONZM 15
59 #define SHPT_POLYGONZ 19
60 
61 #define SHPT_MULTIPATCHM 31
62 #define SHPT_MULTIPATCH 32
63 #endif // SHPT_POINT
64 
65 #define SHPT_GENERALPOLYLINE 50
66 #define SHPT_GENERALPOLYGON 51
67 #define SHPT_GENERALPOINT 52
68 #define SHPT_GENERALMULTIPOINT 53
69 #define SHPT_GENERALMULTIPATCH 54
70 
71 /* The following are layers geometry type */
72 /* They are different from the above shape types */
73 #define ESRI_LAYERGEOMTYPE_NULL 0
74 #define ESRI_LAYERGEOMTYPE_POINT 1
75 #define ESRI_LAYERGEOMTYPE_MULTIPOINT 2
76 #define ESRI_LAYERGEOMTYPE_POLYLINE 3
77 #define ESRI_LAYERGEOMTYPE_POLYGON 4
78 #define ESRI_LAYERGEOMTYPE_MULTIPATCH 9
79 
80 OGRGeometry CPL_DLL *OGRCreateFromMultiPatch(
81  int nParts, const GInt32 *panPartStart, const GInt32 *panPartType,
82  int nPoints, const double *padfX, const double *padfY, const double *padfZ);
83 
84 OGRErr CPL_DLL OGRCreateFromShapeBin(GByte *pabyShape, OGRGeometry **ppoGeom,
85  int nBytes);
86 
87 OGRErr CPL_DLL OGRWriteToShapeBin(const OGRGeometry *poGeom, GByte **ppabyShape,
88  int *pnBytes);
89 
90 OGRErr CPL_DLL OGRCreateMultiPatch(const OGRGeometry *poGeom,
91  int bAllowSHPTTriangle, int &nParts,
92  std::vector<int> &anPartStart,
93  std::vector<int> &anPartType, int &nPoints,
94  std::vector<OGRRawPoint> &aoPoints,
95  std::vector<double> &adfZ);
96 
97 OGRErr CPL_DLL OGRWriteMultiPatchToShapeBin(const OGRGeometry *poGeom,
98  GByte **ppabyShape, int *pnBytes);
99 
100 #endif
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:377
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:185
int GInt32
Int32 type.
Definition: cpl_port.h:175
int OGRErr
Type for a OGR error.
Definition: ogr_core.h:387
Simple feature geometry classes.