OGR
ogrpgeogeometry.h
1 /******************************************************************************
2  * $Id: ogrpgeogeometry.h b787ba3ce13acc93ac3095d4c8a33314e48abe4c 2018-03-28 02:28:45 +0200 Even 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( const OGRGeometry *poGeom,
91  GByte **ppabyShape,
92  int *pnBytes );
93 
94 OGRErr OGRCreateMultiPatch( const 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( const 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:215
OGRSimpleCurve::setPoint
void setPoint(int, OGRPoint *)
Set the location of a vertex in line string.
Definition: ogrlinestring.cpp:536
OGRSimpleCurve::setMeasured
virtual void setMeasured(OGRBoolean bIsMeasured) override
Add or remove the M coordinate dimension.
Definition: ogrlinestring.cpp:192
CPL_LSBWORD32
#define CPL_LSBWORD32(x)
Definition: cpl_port.h:826
OGRGeometry::IsEmpty
virtual OGRBoolean IsEmpty() const =0
Returns TRUE (non-zero) if the object has no points.
OGRGeometry::toMultiPolygon
OGRMultiPolygon * toMultiPolygon()
Definition: ogr_geometry.h:720
OGRCurvePolygon::addRingDirectly
virtual OGRErr addRingDirectly(OGRCurve *)
Add a ring to a polygon.
Definition: ogrcurvepolygon.cpp:419
OGRMultiCurve
Definition: ogr_geometry.h:2670
OGRGeometryCollection::addGeometryDirectly
virtual OGRErr addGeometryDirectly(OGRGeometry *)
Add a geometry directly to the container.
Definition: ogrgeometrycollection.cpp:374
OGRSimpleCurve::getX
double getX(int i) const
Get X at vertex.
Definition: ogr_geometry.h:1161
OGRLineString
Definition: ogr_geometry.h:1243
OGRSimpleCurve::setNumPoints
void setNumPoints(int nNewPointCount, int bZeroizeNewContent=TRUE)
Set number of points in geometry.
Definition: ogrlinestring.cpp:435
OGRMultiPolygon
Definition: ogr_geometry.h:2313
GByte
unsigned char GByte
Definition: cpl_port.h:215
OGRPolyhedralSurface::addGeometryDirectly
OGRErr addGeometryDirectly(OGRGeometry *poNewGeom)
Add a geometry directly to the container.
Definition: ogrpolyhedralsurface.cpp:877
cpl_error.h
OGRGeometry::closeRings
virtual void closeRings()
Force rings to be closed.
Definition: ogrgeometry.cpp:5045
OGRCompoundCurve
Definition: ogr_geometry.h:1582
OGRSimpleCurve::getNumPoints
virtual int getNumPoints() const override
Fetch vertex count.
Definition: ogr_geometry.h:1159
OGRGeometry::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const =0
Fetch geometry type.
OGRGeometryFactory::organizePolygons
static OGRGeometry * organizePolygons(OGRGeometry **papoPolygons, int nPolygonCount, int *pbResultValidGeometry, const char **papszOptions=nullptr)
Organize polygons based on geometries.
Definition: ogrgeometryfactory.cpp:1410
OGRSimpleCurve::getPoints
void getPoints(OGRRawPoint *, double *=nullptr) const
Returns all points of line string.
Definition: ogrlinestring.cpp:1234
wkbPoint
@ wkbPoint
Definition: ogr_core.h:321
OGRCurvePolygon::IsEmpty
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition: ogrcurvepolygon.cpp:717
OGRPoint::setM
void setM(double mIn)
Definition: ogr_geometry.h:879
CPL_SWAPDOUBLE
#define CPL_SWAPDOUBLE(p)
Definition: cpl_port.h:807
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:3116
OGRGeometryCollection::getNumGeometries
int getNumGeometries() const
Fetch number of geometries in container.
Definition: ogrgeometrycollection.cpp:251
wkbMultiPolygon
@ wkbMultiPolygon
Definition: ogr_core.h:329
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:4606
wkbNDR
@ wkbNDR
Definition: ogr_core.h:492
OGRGeometryCollection
Definition: ogr_geometry.h:2097
cpl_vsi.h
OGRGeometryCollection::getGeometryRef
OGRGeometry * getGeometryRef(int)
Fetch geometry from container.
Definition: ogrgeometrycollection.cpp:276
OGRLinearRing::clone
virtual OGRGeometry * clone() const override
Make a copy of this object.
Definition: ogrlinearring.cpp:412
OGRGeometry
Definition: ogr_geometry.h:287
OGRSimpleCurve::getM
double getM(int i) const
Get measure at vertex.
Definition: ogrlinestring.cpp:407
OGRLinearRing::reverseWindingOrder
virtual void reverseWindingOrder()
Definition: ogrlinearring.cpp:546
OGRMultiPoint
Definition: ogr_geometry.h:2592
OGRSimpleCurve::IsEmpty
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition: ogrlinestring.cpp:2526
CPL_LSBPTR64
#define CPL_LSBPTR64(x)
Definition: cpl_port.h:838
OGRPoint
Definition: ogr_geometry.h:811
ogr_geometry.h
OGRGeometryFactory::forceToMultiPolygon
static OGRGeometry * forceToMultiPolygon(OGRGeometry *)
Convert to multipolygon.
Definition: ogrgeometryfactory.cpp:815
OGRSimpleCurve::getY
double getY(int i) const
Get Y at vertex.
Definition: ogr_geometry.h:1162
OGRLinearRing::closeRings
virtual void closeRings() override
Force rings to be closed.
Definition: ogrlinearring.cpp:566
CPLRealloc
void * CPLRealloc(void *, size_t)
Definition: cpl_conv.cpp:225
CPLAtofM
double CPLAtofM(const char *)
Definition: cpl_strtod.cpp:142
wkbHasZ
#define wkbHasZ(x)
Definition: ogr_core.h:446
OGRRawPoint::x
double x
Definition: ogr_geometry.h:73
OGRPoint::setX
void setX(double xIn)
Assign point X coordinate.
Definition: ogr_geometry.h:866
VSI_MALLOC2_VERBOSE
#define VSI_MALLOC2_VERBOSE(nSize1, nSize2)
Definition: cpl_vsi.h:273
wkbFlatten
#define wkbFlatten(x)
Definition: ogr_core.h:440
CPLAssert
#define CPLAssert(expr)
Definition: cpl_error.h:186
OGRRawPoint
Definition: ogr_geometry.h:64
OGRMultiLineString
Definition: ogr_geometry.h:2749
OGRGeometry::clone
virtual OGRGeometry * clone() const CPL_WARN_UNUSED_RESULT=0
Make a copy of this object.
OGRGeometryCollection::set3D
virtual void set3D(OGRBoolean bIs3D) override
Add or remove the Z coordinate dimension.
Definition: ogrgeometrycollection.cpp:1119
OGRCircularString
Definition: ogr_geometry.h:1397
OGRERR_UNSUPPORTED_OPERATION
#define OGRERR_UNSUPPORTED_OPERATION
Definition: ogr_core.h:296
OGRGeometryCollection::removeGeometry
virtual OGRErr removeGeometry(int iIndex, int bDelete=TRUE)
Remove a geometry from the container.
Definition: ogrgeometrycollection.cpp:420
OGRCompoundCurve::addCurveDirectly
OGRErr addCurveDirectly(OGRCurve *, double dfToleranceEps=1e-14)
Add a curve directly to the container.
Definition: ogrcompoundcurve.cpp:555
OGRGeometry::toPoint
OGRPoint * toPoint()
Definition: ogr_geometry.h:524
OGRPolygon::getExteriorRing
OGRLinearRing * getExteriorRing()
Fetch reference to external polygon ring.
Definition: ogrpolygon.cpp:145
OGRERR_FAILURE
#define OGRERR_FAILURE
Definition: ogr_core.h:298
wkbMultiSurface
@ wkbMultiSurface
Definition: ogr_core.h:340
wkbPolyhedralSurface
@ wkbPolyhedralSurface
Definition: ogr_core.h:343
CPLDebug
void CPLDebug(const char *, const char *,...)
Definition: cpl_error.cpp:602
OGRGeometry::CoordinateDimension
int CoordinateDimension() const
Get the dimension of the coordinates in this object.
Definition: ogrgeometry.cpp:878
CPLMalloc
void * CPLMalloc(size_t)
Definition: cpl_conv.cpp:168
CPL_LSBPTR32
#define CPL_LSBPTR32(x)
Definition: cpl_port.h:834
OGRSimpleCurve::addPoint
void addPoint(const OGRPoint *)
Add a point to a line string.
Definition: ogrlinestring.cpp:793
cpl_conv.h
OGRGeometryCollection::setMeasured
virtual void setMeasured(OGRBoolean bIsMeasured) override
Add or remove the M coordinate dimension.
Definition: ogrgeometrycollection.cpp:1129
wkbPolygon
@ wkbPolygon
Definition: ogr_core.h:324
cpl_string.h
OGRGeometry::toLineString
OGRLineString * toLineString()
Definition: ogr_geometry.h:566
VSI_CALLOC_VERBOSE
#define VSI_CALLOC_VERBOSE(nCount, nSize)
Definition: cpl_vsi.h:283
OGRLinearRing::isClockwise
virtual int isClockwise() const
Returns TRUE if the ring has clockwise winding (or less than 2 points)
Definition: ogrlinearring.cpp:445
OGRGeometryH
void * OGRGeometryH
Definition: ogr_api.h:60
CPLError
void CPLError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt,...)
Definition: cpl_error.cpp:308
VSIFree
void VSIFree(void *)
Definition: cpl_vsisimple.cpp:827
OGRPoint::IsEmpty
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition: ogr_geometry.h:848
OGRSimpleCurve::getZ
double getZ(int i) const
Get Z at vertex.
Definition: ogrlinestring.cpp:381
OGRGeometry::toLinearRing
OGRLinearRing * toLinearRing()
Definition: ogr_geometry.h:580
OGRErr
int OGRErr
Definition: ogr_core.h:290
M_PI
#define M_PI
Definition: cpl_port.h:417
OGRGeometry::toPolygon
OGRPolygon * toPolygon()
Definition: ogr_geometry.h:636
OGRCurvePolygon::getNumInteriorRings
int getNumInteriorRings() const
Fetch the number of internal rings.
Definition: ogrcurvepolygon.cpp:238
VSI_MALLOC_VERBOSE
#define VSI_MALLOC_VERBOSE(size)
Definition: cpl_vsi.h:268
OGRwkbGeometryType
OGRwkbGeometryType
Definition: ogr_core.h:318
OGRTriangle
Definition: ogr_geometry.h:2037
cpl_port.h
OGRPoint::setY
void setY(double yIn)
Assign point Y coordinate.
Definition: ogr_geometry.h:870
ogr_api.h
OGRPoint::getZ
double getZ() const
Fetch Z coordinate.
Definition: ogr_geometry.h:857
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:874
OGRCurve
Definition: ogr_geometry.h:927
OGRPoint::getY
double getY() const
Fetch Y coordinate.
Definition: ogr_geometry.h:855
wkbGeometryCollection
@ wkbGeometryCollection
Definition: ogr_core.h:330
OGRSimpleCurve::setPoints
void setPoints(int, const OGRRawPoint *, const double *=nullptr)
Assign all points in a line string.
Definition: ogrlinestring.cpp:1018
OGRLinearRing
Definition: ogr_geometry.h:1315
OGRERR_NONE
#define OGRERR_NONE
Definition: ogr_core.h:292
OGRGeometry::toMultiPoint
OGRMultiPoint * toMultiPoint()
Definition: ogr_geometry.h:692
OGRRawPoint::y
double y
Definition: ogr_geometry.h:75
wkbTriangle
@ wkbTriangle
Definition: ogr_core.h:347
wkbLineString
@ wkbLineString
Definition: ogr_core.h:322
OGRPolygon
Definition: ogr_geometry.h:1914
OGRTriangulatedSurface
Definition: ogr_geometry.h:2517
wkbMultiLineString
@ wkbMultiLineString
Definition: ogr_core.h:328
OGRCurvePolygon
Definition: ogr_geometry.h:1764
OGRPoint::getM
double getM() const
Definition: ogr_geometry.h:859
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:456
ogr_core.h
OGRGeometry::toMultiLineString
OGRMultiLineString * toMultiLineString()
Definition: ogr_geometry.h:706
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:3904
wkbTIN
@ wkbTIN
Definition: ogr_core.h:345
GInt32
int GInt32
Definition: cpl_port.h:205
OGRSimpleCurve::set3D
virtual void set3D(OGRBoolean bIs3D) override
Add or remove the Z coordinate dimension.
Definition: ogrlinestring.cpp:183
wkbMultiPoint
@ wkbMultiPoint
Definition: ogr_core.h:327
OGRPoint::getX
double getX() const
Fetch X coordinate.
Definition: ogr_geometry.h:853
CPLGetConfigOption
const char * CPLGetConfigOption(const char *, const char *)
Definition: cpl_conv.cpp:1692
CPLE_AppDefined
#define CPLE_AppDefined
Definition: cpl_error.h:99
GUInt32
unsigned int GUInt32
Definition: cpl_port.h:207

Generated for GDAL by doxygen 1.8.20.