/******************************************************************************
* $Id$
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Classes for manipulating simple features that is not specific
* to a particular interface technology.
* Author: Frank Warmerdam, warmerdam@pobox.com
*
******************************************************************************
* Copyright (c) 1999, Frank Warmerdam
* Copyright (c) 2008-2014, Even Rouault <even dot rouault at spatialys.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
#ifndef OGR_GEOMETRY_H_INCLUDED
#define OGR_GEOMETRY_H_INCLUDED
#include "cpl_conv.h"
#include "cpl_json.h"
#include "ogr_core.h"
#include "ogr_spatialref.h"
#include <cmath>
#include <memory>
/**
* \file ogr_geometry.h
*
* Simple feature geometry classes.
*/
/*! @cond Doxygen_Suppress */
#ifndef DEFINEH_OGRGeometryH
#define DEFINEH_OGRGeometryH
#ifdef DEBUG
typedef struct OGRGeometryHS *OGRGeometryH;
#else
typedef void *OGRGeometryH;
#endif
#endif /* DEFINEH_OGRGeometryH */
/*! @endcond */
/// WKT Output formatting options.
enum class OGRWktFormat
{
F, ///< F-type formatting.
G, ///< G-type formatting.
Default ///< Format as F when abs(value) < 1, otherwise as G.
};
/// Options for formatting WKT output
struct CPL_DLL OGRWktOptions
{
public:
/// Type of WKT output to produce.
OGRwkbVariant variant;
/// Precision of output. Interpretation depends on \c format.
int precision;
/// Whether GDAL-special rounding should be applied.
bool round;
/// Formatting type.
OGRWktFormat format;
/// Constructor.
OGRWktOptions()
: variant(wkbVariantOldOgc), precision(15), round(true),
format(OGRWktFormat::Default)
{
static int defPrecision = getDefaultPrecision();
static bool defRound = getDefaultRound();
precision = defPrecision;
round = defRound;
}
/// Copy constructor
OGRWktOptions(const OGRWktOptions &) = default;
private:
static int getDefaultPrecision();
static bool getDefaultRound();
};
/**
* Simple container for a position.
*/
class OGRRawPoint
{
public:
/** Constructor */
OGRRawPoint() : x(0.0), y(0.0)
{
}
/** Constructor */
OGRRawPoint(double xIn, double yIn) : x(xIn), y(yIn)
{
}
/** x */
double x;
/** y */
double y;
};
/** GEOS geometry type */
typedef struct GEOSGeom_t *GEOSGeom;
/** GEOS context handle type */
typedef struct GEOSContextHandle_HS *GEOSContextHandle_t;
/** SFCGAL geometry type */
typedef void sfcgal_geometry_t;
class OGRPoint;
class OGRCurve;
class OGRCompoundCurve;
class OGRSimpleCurve;
class OGRLinearRing;
class OGRLineString;
class OGRCircularString;
class OGRSurface;
class OGRCurvePolygon;
class OGRPolygon;
class OGRMultiPoint;
class OGRMultiSurface;
class OGRMultiPolygon;
class OGRMultiCurve;
class OGRMultiLineString;
class OGRGeometryCollection;
class OGRTriangle;
class OGRPolyhedralSurface;
class OGRTriangulatedSurface;
//! @cond Doxygen_Suppress
typedef OGRLineString *(*OGRCurveCasterToLineString)(OGRCurve *);
typedef OGRLinearRing *(*OGRCurveCasterToLinearRing)(OGRCurve *);
typedef OGRPolygon *(*OGRSurfaceCasterToPolygon)(OGRSurface *);
typedef OGRCurvePolygon *(*OGRSurfaceCasterToCurvePolygon)(OGRSurface *);
typedef OGRMultiPolygon *(*OGRPolyhedralSurfaceCastToMultiPolygon)(
OGRPolyhedralSurface *);
//! @endcond
/** OGRGeometry visitor interface.
* @since GDAL 2.3
*/
class CPL_DLL IOGRGeometryVisitor
{
public:
/** Destructor/ */
virtual ~IOGRGeometryVisitor() = default;
/** Visit OGRPoint. */
virtual void visit(OGRPoint *) = 0;
/** Visit OGRLineString. */
virtual void visit(OGRLineString *) = 0;
/** Visit OGRLinearRing. */
virtual void visit(OGRLinearRing *) = 0;
/** Visit OGRPolygon. */
virtual void visit(OGRPolygon *) = 0;
/** Visit OGRMultiPoint. */
virtual void visit(OGRMultiPoint *) = 0;
/** Visit OGRMultiLineString. */
virtual void visit(OGRMultiLineString *) = 0;
/** Visit OGRMultiPolygon. */
virtual void visit(OGRMultiPolygon *) = 0;
/** Visit OGRGeometryCollection. */
virtual void visit(OGRGeometryCollection *) = 0;
/** Visit OGRCircularString. */
virtual void visit(OGRCircularString *) = 0;
/** Visit OGRCompoundCurve. */
virtual void visit(OGRCompoundCurve *) = 0;
/** Visit OGRCurvePolygon. */
virtual void visit(OGRCurvePolygon *) = 0;
/** Visit OGRMultiCurve. */
virtual void visit(OGRMultiCurve *) = 0;
/** Visit OGRMultiSurface. */
virtual void visit(OGRMultiSurface *) = 0;
/** Visit OGRTriangle. */
virtual void visit(OGRTriangle *) = 0;
/** Visit OGRPolyhedralSurface. */
virtual void visit(OGRPolyhedralSurface *) = 0;
/** Visit OGRTriangulatedSurface. */
virtual void visit(OGRTriangulatedSurface *) = 0;
};
/** OGRGeometry visitor default implementation.
*
* This default implementation will recurse down to calling
* visit(OGRPoint*) on each point.
*
* @since GDAL 2.3
*/
class CPL_DLL OGRDefaultGeometryVisitor : public IOGRGeometryVisitor
{
void _visit(OGRSimpleCurve *poGeom);
public:
void visit(OGRPoint *) override
{
}
void visit(OGRLineString *) override;
void visit(OGRLinearRing *) override;
void visit(OGRPolygon *) override;
void visit(OGRMultiPoint *) override;
void visit(OGRMultiLineString *) override;
void visit(OGRMultiPolygon *) override;
void visit(OGRGeometryCollection *) override;
void visit(OGRCircularString *) override;
void visit(OGRCompoundCurve *) override;
void visit(OGRCurvePolygon *) override;
void visit(OGRMultiCurve *) override;
void visit(OGRMultiSurface *) override;
void visit(OGRTriangle *) override;
void visit(OGRPolyhedralSurface *) override;
void visit(OGRTriangulatedSurface *) override;
};
/** OGRGeometry visitor interface.
* @since GDAL 2.3
*/
class CPL_DLL IOGRConstGeometryVisitor
{
public:
/** Destructor/ */
virtual ~IOGRConstGeometryVisitor() = default;
/** Visit OGRPoint. */
virtual void visit(const OGRPoint *) = 0;
/** Visit OGRLineString. */
virtual void visit(const OGRLineString *) = 0;
/** Visit OGRLinearRing. */
virtual void visit(const OGRLinearRing *) = 0;
/** Visit OGRPolygon. */
virtual void visit(const OGRPolygon *) = 0;
/** Visit OGRMultiPoint. */
virtual void visit(const OGRMultiPoint *) = 0;
/** Visit OGRMultiLineString. */
virtual void visit(const OGRMultiLineString *) = 0;
/** Visit OGRMultiPolygon. */
virtual void visit(const OGRMultiPolygon *) = 0;
/** Visit OGRGeometryCollection. */
virtual void visit(const OGRGeometryCollection *) = 0;
/** Visit OGRCircularString. */
virtual void visit(const
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论










收起资源包目录





































































































共 132 条
- 1
- 2
资源评论

- 2301_792002812023-07-22用不了---Umlla2023-08-08报什么错?

Umlla
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


安全验证
文档复制为VIP权益,开通VIP直接复制
