OGR
ogrpgeogeometry.h
1 /******************************************************************************
2  * $Id: ogrpgeogeometry.h 36883 2016-12-15 13:31:12Z rouault $
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 mines-paris dot org>
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 #define SHPT_NULL 0
37 
38 #ifndef SHPT_POINT
39 #define SHPT_POINT 1
40 #define SHPT_POINTM 21
41 #define SHPT_POINTZM 11
42 #define SHPT_POINTZ 9
43 
44 #define SHPT_MULTIPOINT 8
45 #define SHPT_MULTIPOINTM 28
46 #define SHPT_MULTIPOINTZM 18
47 #define SHPT_MULTIPOINTZ 20
48 
49 #define SHPT_ARC 3
50 #define SHPT_ARCM 23
51 #define SHPT_ARCZM 13
52 #define SHPT_ARCZ 10
53 
54 #define SHPT_POLYGON 5
55 #define SHPT_POLYGONM 25
56 #define SHPT_POLYGONZM 15
57 #define SHPT_POLYGONZ 19
58 
59 #define SHPT_MULTIPATCHM 31
60 #define SHPT_MULTIPATCH 32
61 #endif // SHPT_POINT
62 
63 #define SHPT_GENERALPOLYLINE 50
64 #define SHPT_GENERALPOLYGON 51
65 #define SHPT_GENERALPOINT 52
66 #define SHPT_GENERALMULTIPOINT 53
67 #define SHPT_GENERALMULTIPATCH 54
68 
69 /* The following are layers geometry type */
70 /* They are different from the above shape types */
71 #define ESRI_LAYERGEOMTYPE_NULL 0
72 #define ESRI_LAYERGEOMTYPE_POINT 1
73 #define ESRI_LAYERGEOMTYPE_MULTIPOINT 2
74 #define ESRI_LAYERGEOMTYPE_POLYLINE 3
75 #define ESRI_LAYERGEOMTYPE_POLYGON 4
76 #define ESRI_LAYERGEOMTYPE_MULTIPATCH 9
77 
78 OGRGeometry* OGRCreateFromMultiPatch( int nParts,
79  const GInt32* panPartStart,
80  const GInt32* panPartType,
81  int nPoints,
82  const double* padfX,
83  const double* padfY,
84  const double* padfZ );
85 
86 OGRErr CPL_DLL OGRCreateFromShapeBin( GByte *pabyShape,
87  OGRGeometry **ppoGeom,
88  int nBytes );
89 
90 OGRErr CPL_DLL OGRWriteToShapeBin( OGRGeometry *poGeom,
91  GByte **ppabyShape,
92  int *pnBytes );
93 
94 OGRErr OGRCreateMultiPatch( OGRGeometry *poGeom,
95  int bAllowSHPTTriangle,
96  int& nParts,
97  int*& panPartStart,
98  int*& panPartType,
99  int& nPoints,
100  OGRRawPoint*& poPoints,
101  double*& padfZ );
102 
103 OGRErr CPL_DLL OGRWriteMultiPatchToShapeBin( OGRGeometry *poGeom,
104  GByte **ppabyShape,
105  int *pnBytes );
106 
107 #endif
OGRPolygon::getInteriorRing
virtual OGRLinearRing * getInteriorRing(int)
Fetch reference to indicated internal ring.
Definition: ogrpolygon.cpp:217
OGRSimpleCurve::setPoint
void setPoint(int, OGRPoint *)
Set the location of a vertex in line string.
Definition: ogrlinestring.cpp:506
CPL_LSBWORD32
#define CPL_LSBWORD32(x)
Definition: cpl_port.h:879
OGRGeometry::IsEmpty
virtual OGRBoolean IsEmpty() const =0
Returns TRUE (non-zero) if the object has no points.
OGRCurvePolygon::addRingDirectly
virtual OGRErr addRingDirectly(OGRCurve *)
Add a ring to a polygon.
Definition: ogrcurvepolygon.cpp:397
OGRMultiCurve
Definition: ogr_geometry.h:1650
OGRGeometryCollection::addGeometryDirectly
virtual OGRErr addGeometryDirectly(OGRGeometry *)
Add a geometry directly to the container.
Definition: ogrgeometrycollection.cpp:373
OGRSimpleCurve::getX
double getX(int i) const
Get X at vertex.
Definition: ogr_geometry.h:554
OGRLineString
Definition: ogr_geometry.h:623
OGRSimpleCurve::setNumPoints
void setNumPoints(int nNewPointCount, int bZeroizeNewContent=TRUE)
Set number of points in geometry.
Definition: ogrlinestring.cpp:422
OGRMultiPolygon
Definition: ogr_geometry.h:1435
GByte
unsigned char GByte
Definition: cpl_port.h:207
OGRPolyhedralSurface::addGeometryDirectly
OGRErr addGeometryDirectly(OGRGeometry *poNewGeom)
Add a geometry directly to the container.
Definition: ogrpolyhedralsurface.cpp:872
cpl_error.h
OGRGeometry::closeRings
virtual void closeRings()
Force rings to be closed.
Definition: ogrgeometry.cpp:4970
OGRCompoundCurve
Definition: ogr_geometry.h:909
OGRGeometry::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const =0
Fetch geometry type.
wkbPoint
@ wkbPoint
Definition: ogr_core.h:316
OGRPoint::setM
void setM(double mIn)
Definition: ogr_geometry.h:388
CPL_SWAPDOUBLE
#define CPL_SWAPDOUBLE(p)
Definition: cpl_port.h:860
CPLZLibInflate
void * CPLZLibInflate(const void *ptr, size_t nBytes, void *outptr, size_t nOutAvailableBytes, size_t *pnOutBytes)
Uncompress a buffer compressed with ZLib DEFLATE compression.
Definition: cpl_conv.cpp:2972
OGRGeometryCollection::getNumGeometries
int getNumGeometries() const
Fetch number of geometries in container.
Definition: ogrgeometrycollection.cpp:250
wkbMultiPolygon
@ wkbMultiPolygon
Definition: ogr_core.h:324
OGRSimpleCurve::setMeasured
virtual void setMeasured(OGRBoolean bIsMeasured) CPL_OVERRIDE
Add or remove the M coordinate dimension.
Definition: ogrlinestring.cpp:179
OGR_G_ForceTo
OGRGeometryH OGR_G_ForceTo(OGRGeometryH hGeom, OGRwkbGeometryType eTargetType, char **papszOptions) CPL_WARN_UNUSED_RESULT
Convert to another geometry type.
Definition: ogrgeometryfactory.cpp:4458
wkbNDR
@ wkbNDR
Definition: ogr_core.h:482
OGRGeometryCollection
Definition: ogr_geometry.h:1295
OGRPoint::IsEmpty
virtual OGRBoolean IsEmpty() const CPL_OVERRIDE
Returns TRUE (non-zero) if the object has no points.
Definition: ogr_geometry.h:357
cpl_vsi.h
OGRGeometryCollection::getGeometryRef
OGRGeometry * getGeometryRef(int)
Fetch geometry from container.
Definition: ogrgeometrycollection.cpp:275
OGRGeometry
Definition: ogr_geometry.h:118
OGRSimpleCurve::getM
double getM(int i) const
Get measure at vertex.
Definition: ogrlinestring.cpp:394
OGRLinearRing::reverseWindingOrder
virtual void reverseWindingOrder()
Definition: ogrlinearring.cpp:542
OGRMultiPoint
Definition: ogr_geometry.h:1609
OGRSimpleCurve::IsEmpty
virtual OGRBoolean IsEmpty() const CPL_OVERRIDE
Returns TRUE (non-zero) if the object has no points.
Definition: ogrlinestring.cpp:2453
CPL_LSBPTR64
#define CPL_LSBPTR64(x)
Definition: cpl_port.h:891
OGRPoint
Definition: ogr_geometry.h:322
ogr_geometry.h
OGRGeometryFactory::forceToMultiPolygon
static OGRGeometry * forceToMultiPolygon(OGRGeometry *)
Convert to multipolygon.
Definition: ogrgeometryfactory.cpp:730
OGRSimpleCurve::getY
double getY(int i) const
Get Y at vertex.
Definition: ogr_geometry.h:555
CPLRealloc
void * CPLRealloc(void *, size_t)
Definition: cpl_conv.cpp:215
OGRGeometryCollection::setMeasured
virtual void setMeasured(OGRBoolean bIsMeasured) CPL_OVERRIDE
Add or remove the M coordinate dimension.
Definition: ogrgeometrycollection.cpp:1127
wkbHasZ
#define wkbHasZ(x)
Definition: ogr_core.h:436
OGRRawPoint::x
double x
Definition: ogr_geometry.h:57
OGRPoint::setX
void setX(double xIn)
Assign point X coordinate.
Definition: ogr_geometry.h:375
VSI_MALLOC2_VERBOSE
#define VSI_MALLOC2_VERBOSE(nSize1, nSize2)
Definition: cpl_vsi.h:259
wkbFlatten
#define wkbFlatten(x)
Definition: ogr_core.h:431
CPLAssert
#define CPLAssert(expr)
Definition: cpl_error.h:182
OGRRawPoint
Definition: ogr_geometry.h:47
OGRMultiLineString
Definition: ogr_geometry.h:1692
OGRGeometry::clone
virtual OGRGeometry * clone() const CPL_WARN_UNUSED_RESULT=0
Make a copy of this object.
OGRGeometryCollection::set3D
virtual void set3D(OGRBoolean bIs3D) CPL_OVERRIDE
Add or remove the Z coordinate dimension.
Definition: ogrgeometrycollection.cpp:1117
OGRPolygon::getExteriorRing
OGRLinearRing * getExteriorRing()
Fetch reference to external polygon ring.
Definition: ogrpolygon.cpp:147
OGRCircularString
Definition: ogr_geometry.h:753
OGRERR_UNSUPPORTED_OPERATION
#define OGRERR_UNSUPPORTED_OPERATION
Definition: ogr_core.h:291
OGRGeometryCollection::removeGeometry
virtual OGRErr removeGeometry(int iIndex, int bDelete=TRUE)
Remove a geometry from the container.
Definition: ogrgeometrycollection.cpp:429
OGRCompoundCurve::addCurveDirectly
OGRErr addCurveDirectly(OGRCurve *, double dfToleranceEps=1e-14)
Add a curve directly to the container.
Definition: ogrcompoundcurve.cpp:545
OGRGeometryFactory::organizePolygons
static OGRGeometry * organizePolygons(OGRGeometry **papoPolygons, int nPolygonCount, int *pbResultValidGeometry, const char **papszOptions=NULL)
Organize polygons based on geometries.
Definition: ogrgeometryfactory.cpp:1344
OGRERR_FAILURE
#define OGRERR_FAILURE
Definition: ogr_core.h:293
wkbMultiSurface
@ wkbMultiSurface
Definition: ogr_core.h:335
wkbPolyhedralSurface
@ wkbPolyhedralSurface
Definition: ogr_core.h:338
CPLDebug
void CPLDebug(const char *, const char *,...)
Definition: cpl_error.cpp:492
OGRGeometry::CoordinateDimension
int CoordinateDimension() const
Get the dimension of the coordinates in this object.
Definition: ogrgeometry.cpp:898
CPLMalloc
void * CPLMalloc(size_t)
Definition: cpl_conv.cpp:158
CPL_LSBPTR32
#define CPL_LSBPTR32(x)
Definition: cpl_port.h:887
OGRSimpleCurve::set3D
virtual void set3D(OGRBoolean bIs3D) CPL_OVERRIDE
Add or remove the Z coordinate dimension.
Definition: ogrlinestring.cpp:170
OGRSimpleCurve::getNumPoints
virtual int getNumPoints() const CPL_OVERRIDE
Fetch vertex count.
Definition: ogr_geometry.h:552
OGRSimpleCurve::getPoints
void getPoints(OGRRawPoint *, double *=NULL) const
Returns all points of line string.
Definition: ogrlinestring.cpp:1193
OGRSimpleCurve::addPoint
void addPoint(const OGRPoint *)
Add a point to a line string.
Definition: ogrlinestring.cpp:763
cpl_conv.h
wkbPolygon
@ wkbPolygon
Definition: ogr_core.h:319
cpl_string.h
VSI_CALLOC_VERBOSE
#define VSI_CALLOC_VERBOSE(nCount, nSize)
Definition: cpl_vsi.h:269
OGRLinearRing::isClockwise
virtual int isClockwise() const
Returns TRUE if the ring has clockwise winding (or less than 2 points)
Definition: ogrlinearring.cpp:441
OGRGeometryH
void * OGRGeometryH
Definition: ogr_api.h:56
CPLError
void CPLError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt,...)
Definition: cpl_error.cpp:215
VSIFree
void VSIFree(void *)
Definition: cpl_vsisimple.cpp:817
OGRSimpleCurve::setPoints
void setPoints(int, OGRRawPoint *, double *=NULL)
Assign all points in a line string.
Definition: ogrlinestring.cpp:985
OGRSimpleCurve::getZ
double getZ(int i) const
Get Z at vertex.
Definition: ogrlinestring.cpp:368
OGRErr
int OGRErr
Definition: ogr_core.h:285
M_PI
#define M_PI
Definition: cpl_port.h:470
OGRCurvePolygon::getNumInteriorRings
int getNumInteriorRings() const
Fetch the number of internal rings.
Definition: ogrcurvepolygon.cpp:242
VSI_MALLOC_VERBOSE
#define VSI_MALLOC_VERBOSE(size)
Definition: cpl_vsi.h:254
OGRwkbGeometryType
OGRwkbGeometryType
Definition: ogr_core.h:312
OGRLinearRing::closeRings
virtual void closeRings() CPL_OVERRIDE
Force rings to be closed.
Definition: ogrlinearring.cpp:562
OGRTriangle
Definition: ogr_geometry.h:1247
cpl_port.h
OGRPoint::setY
void setY(double yIn)
Assign point Y coordinate.
Definition: ogr_geometry.h:379
ogr_api.h
OGRPoint::getZ
double getZ() const
Fetch Z coordinate.
Definition: ogr_geometry.h:366
OGRPoint::setZ
void setZ(double zIn)
Assign point Z coordinate. Calling this method will force the geometry coordinate dimension to 3D (wk...
Definition: ogr_geometry.h:383
OGRCurve
Definition: ogr_geometry.h:433
OGRPoint::getY
double getY() const
Fetch Y coordinate.
Definition: ogr_geometry.h:364
wkbGeometryCollection
@ wkbGeometryCollection
Definition: ogr_core.h:325
OGRLinearRing
Definition: ogr_geometry.h:684
OGRERR_NONE
#define OGRERR_NONE
Definition: ogr_core.h:287
OGRRawPoint::y
double y
Definition: ogr_geometry.h:59
wkbTriangle
@ wkbTriangle
Definition: ogr_core.h:342
wkbLineString
@ wkbLineString
Definition: ogr_core.h:317
OGRPolygon
Definition: ogr_geometry.h:1162
OGRTriangulatedSurface
Definition: ogr_geometry.h:1570
wkbMultiLineString
@ wkbMultiLineString
Definition: ogr_core.h:323
OGRCurvePolygon
Definition: ogr_geometry.h:1051
OGRPoint::getM
double getM() const
Definition: ogr_geometry.h:368
OGRGeometry::getEnvelope
virtual void getEnvelope(OGREnvelope *psEnvelope) const =0
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.
wkbHasM
#define wkbHasM(x)
Definition: ogr_core.h:446
ogr_core.h
CPLFree
#define CPLFree
Definition: cpl_conv.h:81
OGRGeometryFactory::approximateArcAngles
static OGRGeometry * approximateArcAngles(double dfX, double dfY, double dfZ, double dfPrimaryRadius, double dfSecondaryAxis, double dfRotation, double dfStartAngle, double dfEndAngle, double dfMaxAngleStepSizeDegrees)
Definition: ogrgeometryfactory.cpp:3769
wkbTIN
@ wkbTIN
Definition: ogr_core.h:340
GInt32
int GInt32
Definition: cpl_port.h:197
OGRCurvePolygon::IsEmpty
virtual OGRBoolean IsEmpty() const CPL_OVERRIDE
Returns TRUE (non-zero) if the object has no points.
Definition: ogrcurvepolygon.cpp:703
wkbMultiPoint
@ wkbMultiPoint
Definition: ogr_core.h:322
OGRPoint::getX
double getX() const
Fetch X coordinate.
Definition: ogr_geometry.h:362
CPLE_AppDefined
#define CPLE_AppDefined
Definition: cpl_error.h:100
GUInt32
unsigned int GUInt32
Definition: cpl_port.h:199

Generated for GDAL by doxygen 1.8.17.