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:217
OGRSimpleCurve::setPoint
void setPoint(int, OGRPoint *)
Set the location of a vertex in line string.
Definition: ogrlinestring.cpp:526
OGRSimpleCurve::setMeasured
virtual void setMeasured(OGRBoolean bIsMeasured) override
Add or remove the M coordinate dimension.
Definition: ogrlinestring.cpp:191
CPL_LSBWORD32
#define CPL_LSBWORD32(x)
Definition: cpl_port.h:816
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:719
OGRCurvePolygon::addRingDirectly
virtual OGRErr addRingDirectly(OGRCurve *)
Add a ring to a polygon.
Definition: ogrcurvepolygon.cpp:422
OGRMultiCurve
Definition: ogr_geometry.h:2664
OGRGeometryCollection::addGeometryDirectly
virtual OGRErr addGeometryDirectly(OGRGeometry *)
Add a geometry directly to the container.
Definition: ogrgeometrycollection.cpp:381
OGRSimpleCurve::getX
double getX(int i) const
Get X at vertex.
Definition: ogr_geometry.h:1160
OGRLineString
Definition: ogr_geometry.h:1241
OGRSimpleCurve::setNumPoints
void setNumPoints(int nNewPointCount, int bZeroizeNewContent=TRUE)
Set number of points in geometry.
Definition: ogrlinestring.cpp:434
OGRMultiPolygon
Definition: ogr_geometry.h:2307
GByte
unsigned char GByte
Definition: cpl_port.h:213
OGRPolyhedralSurface::addGeometryDirectly
OGRErr addGeometryDirectly(OGRGeometry *poNewGeom)
Add a geometry directly to the container.
Definition: ogrpolyhedralsurface.cpp:882
cpl_error.h
OGRGeometry::closeRings
virtual void closeRings()
Force rings to be closed.
Definition: ogrgeometry.cpp:4833
OGRCompoundCurve
Definition: ogr_geometry.h:1579
OGRSimpleCurve::getNumPoints
virtual int getNumPoints() const override
Fetch vertex count.
Definition: ogr_geometry.h:1158
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:1408
OGRSimpleCurve::getPoints
void getPoints(OGRRawPoint *, double *=nullptr) const
Returns all points of line string.
Definition: ogrlinestring.cpp:1224
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:720
OGRPoint::setM
void setM(double mIn)
Definition: ogr_geometry.h:878
CPL_SWAPDOUBLE
#define CPL_SWAPDOUBLE(p)
Definition: cpl_port.h:797
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:3106
OGRGeometryCollection::getNumGeometries
int getNumGeometries() const
Fetch number of geometries in container.
Definition: ogrgeometrycollection.cpp:258
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:4528
wkbNDR
@ wkbNDR
Definition: ogr_core.h:492
OGRGeometryCollection
Definition: ogr_geometry.h:2091
cpl_vsi.h
OGRGeometryCollection::getGeometryRef
OGRGeometry * getGeometryRef(int)
Fetch geometry from container.
Definition: ogrgeometrycollection.cpp:283
OGRLinearRing::clone
virtual OGRGeometry * clone() const override
Make a copy of this object.
Definition: ogrlinearring.cpp:414
OGRGeometry
Definition: ogr_geometry.h:286
OGRSimpleCurve::getM
double getM(int i) const
Get measure at vertex.
Definition: ogrlinestring.cpp:406
OGRLinearRing::reverseWindingOrder
virtual void reverseWindingOrder()
Definition: ogrlinearring.cpp:548
OGRMultiPoint
Definition: ogr_geometry.h:2586
OGRSimpleCurve::IsEmpty
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition: ogrlinestring.cpp:2494
CPL_LSBPTR64
#define CPL_LSBPTR64(x)
Definition: cpl_port.h:828
OGRPoint
Definition: ogr_geometry.h:809
ogr_geometry.h
OGRGeometryFactory::forceToMultiPolygon
static OGRGeometry * forceToMultiPolygon(OGRGeometry *)
Convert to multipolygon.
Definition: ogrgeometryfactory.cpp:814
OGRSimpleCurve::getY
double getY(int i) const
Get Y at vertex.
Definition: ogr_geometry.h:1161
OGRLinearRing::closeRings
virtual void closeRings() override
Force rings to be closed.
Definition: ogrlinearring.cpp:568
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:865
VSI_MALLOC2_VERBOSE
#define VSI_MALLOC2_VERBOSE(nSize1, nSize2)
Definition: cpl_vsi.h:270
wkbFlatten
#define wkbFlatten(x)
Definition: ogr_core.h:440
CPLAssert
#define CPLAssert(expr)
Definition: cpl_error.h:182
OGRRawPoint
Definition: ogr_geometry.h:63
OGRMultiLineString
Definition: ogr_geometry.h:2743
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:1126
OGRPolygon::getExteriorRing
OGRLinearRing * getExteriorRing()
Fetch reference to external polygon ring.
Definition: ogrpolygon.cpp:147
OGRCircularString
Definition: ogr_geometry.h:1394
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:427
OGRCompoundCurve::addCurveDirectly
OGRErr addCurveDirectly(OGRCurve *, double dfToleranceEps=1e-14)
Add a curve directly to the container.
Definition: ogrcompoundcurve.cpp:558
OGRGeometry::toPoint
OGRPoint * toPoint()
Definition: ogr_geometry.h:523
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:544
OGRGeometry::CoordinateDimension
int CoordinateDimension() const
Get the dimension of the coordinates in this object.
Definition: ogrgeometry.cpp:883
CPLMalloc
void * CPLMalloc(size_t)
Definition: cpl_conv.cpp:168
CPL_LSBPTR32
#define CPL_LSBPTR32(x)
Definition: cpl_port.h:824
OGRSimpleCurve::addPoint
void addPoint(const OGRPoint *)
Add a point to a line string.
Definition: ogrlinestring.cpp:783
cpl_conv.h
OGRGeometryCollection::setMeasured
virtual void setMeasured(OGRBoolean bIsMeasured) override
Add or remove the M coordinate dimension.
Definition: ogrgeometrycollection.cpp:1136
wkbPolygon
@ wkbPolygon
Definition: ogr_core.h:324
cpl_string.h
OGRGeometry::toLineString
OGRLineString * toLineString()
Definition: ogr_geometry.h:565
VSI_CALLOC_VERBOSE
#define VSI_CALLOC_VERBOSE(nCount, nSize)
Definition: cpl_vsi.h:280
OGRGeometryH
void * OGRGeometryH
Definition: ogr_api.h:60
CPLError
void CPLError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt,...)
Definition: cpl_error.cpp:232
VSIFree
void VSIFree(void *)
Definition: cpl_vsisimple.cpp:823
OGRPoint::IsEmpty
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition: ogr_geometry.h:847
OGRSimpleCurve::getZ
double getZ(int i) const
Get Z at vertex.
Definition: ogrlinestring.cpp:380
OGRGeometry::toLinearRing
OGRLinearRing * toLinearRing()
Definition: ogr_geometry.h:579
OGRErr
int OGRErr
Definition: ogr_core.h:290
M_PI
#define M_PI
Definition: cpl_port.h:407
OGRGeometry::toPolygon
OGRPolygon * toPolygon()
Definition: ogr_geometry.h:635
OGRCurvePolygon::getNumInteriorRings
int getNumInteriorRings() const
Fetch the number of internal rings.
Definition: ogrcurvepolygon.cpp:241
VSI_MALLOC_VERBOSE
#define VSI_MALLOC_VERBOSE(size)
Definition: cpl_vsi.h:265
OGRwkbGeometryType
OGRwkbGeometryType
Definition: ogr_core.h:317
OGRTriangle
Definition: ogr_geometry.h:2032
cpl_port.h
OGRPoint::setY
void setY(double yIn)
Assign point Y coordinate.
Definition: ogr_geometry.h:869
ogr_api.h
OGRPoint::getZ
double getZ() const
Fetch Z coordinate.
Definition: ogr_geometry.h:856
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:873
OGRCurve
Definition: ogr_geometry.h:925
OGRPoint::getY
double getY() const
Fetch Y coordinate.
Definition: ogr_geometry.h:854
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:1008
OGRLinearRing
Definition: ogr_geometry.h:1312
OGRERR_NONE
#define OGRERR_NONE
Definition: ogr_core.h:292
OGRGeometry::toMultiPoint
OGRMultiPoint * toMultiPoint()
Definition: ogr_geometry.h:691
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:1909
OGRTriangulatedSurface
Definition: ogr_geometry.h:2511
wkbMultiLineString
@ wkbMultiLineString
Definition: ogr_core.h:328
OGRCurvePolygon
Definition: ogr_geometry.h:1759
OGRPoint::getM
double getM() const
Definition: ogr_geometry.h:858
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:705
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:3826
wkbTIN
@ wkbTIN
Definition: ogr_core.h:345
GInt32
int GInt32
Definition: cpl_port.h:203
OGRSimpleCurve::set3D
virtual void set3D(OGRBoolean bIs3D) override
Add or remove the Z coordinate dimension.
Definition: ogrlinestring.cpp:182
wkbMultiPoint
@ wkbMultiPoint
Definition: ogr_core.h:327
OGRPoint::getX
double getX() const
Fetch X coordinate.
Definition: ogr_geometry.h:852
CPLGetConfigOption
const char * CPLGetConfigOption(const char *, const char *)
Definition: cpl_conv.cpp:1690
CPLE_AppDefined
#define CPLE_AppDefined
Definition: cpl_error.h:99
GUInt32
unsigned int GUInt32
Definition: cpl_port.h:205

Generated for GDAL by doxygen 1.8.17.