/**********************************************************************
*
* rttopo - topology library
* http://git.osgeo.org/gitea/rttopo/librttopo
*
* rttopo is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* rttopo is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with rttopo. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************
*
* Copyright 2011-2016 Sandro Santilli <strk@kbt.io>
* Copyright 2011 Paul Ramsey <pramsey@cleverelephant.ca>
* Copyright 2007-2008 Mark Cave-Ayland
* Copyright 2001-2006 Refractions Research Inc.
*
**********************************************************************/
#ifndef _LIBRTGEOM_H
#define _LIBRTGEOM_H 1
#define GEOS_USE_ONLY_R_API 1
#include <geos_c.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdint.h>
/**
* @file librttopo_geom.h
*
* This library is the generic geometry handling section of librttopo.
* The geometry objects, constructors, destructors, and a set of spatial
* processing functions, are implemented here.
*
* Programs using this library can install their custom memory managers
* passing them to the rtgeom_init function, and their custom message
* handlers using the appropriate rtgeom_set_*_logger functions.
*/
/**
* Return types for functions with status returns.
*/
#define RT_TRUE 1
#define RT_FALSE 0
#define RT_UNKNOWN 2
#define RT_FAILURE 0
#define RT_SUCCESS 1
/**
* RTRTTYPE numbers
*/
#define RTPOINTTYPE 1
#define RTLINETYPE 2
#define RTPOLYGONTYPE 3
#define RTMULTIPOINTTYPE 4
#define RTMULTILINETYPE 5
#define RTMULTIPOLYGONTYPE 6
#define RTCOLLECTIONTYPE 7
#define RTCIRCSTRINGTYPE 8
#define RTCOMPOUNDTYPE 9
#define RTCURVEPOLYTYPE 10
#define RTMULTICURVETYPE 11
#define RTMULTISURFACETYPE 12
#define RTPOLYHEDRALSURFACETYPE 13
#define RTTRIANGLETYPE 14
#define RTTINTYPE 15
#define RTNUMTYPES 16
/**
* Flags applied in EWKB to indicate Z/M dimensions and
* presence/absence of SRID and bounding boxes
*/
#define RTWKBZOFFSET 0x80000000
#define RTWKBMOFFSET 0x40000000
#define RTWKBSRIDFLAG 0x20000000
#define RTWKBBBOXFLAG 0x10000000
/** Ordinate names */
typedef enum RTORD_T {
RTORD_X = 0,
RTORD_Y = 1,
RTORD_Z = 2,
RTORD_M = 3
} RTORD;
/**
* Macros for manipulating the 'flags' byte. A uint8_t used as follows:
* ---RGBMZ
* Three unused bits, followed by ReadOnly, Geodetic, HasBBox, HasM and HasZ flags.
*/
#define RTFLAGS_GET_Z(flags) ((flags) & 0x01)
#define RTFLAGS_GET_M(flags) (((flags) & 0x02)>>1)
#define RTFLAGS_GET_BBOX(flags) (((flags) & 0x04)>>2)
#define RTFLAGS_GET_GEODETIC(flags) (((flags) & 0x08)>>3)
#define RTFLAGS_GET_READONLY(flags) (((flags) & 0x10)>>4)
#define RTFLAGS_GET_SOLID(flags) (((flags) & 0x20)>>5)
#define RTFLAGS_SET_Z(flags, value) ((flags) = (value) ? ((flags) | 0x01) : ((flags) & 0xFE))
#define RTFLAGS_SET_M(flags, value) ((flags) = (value) ? ((flags) | 0x02) : ((flags) & 0xFD))
#define RTFLAGS_SET_BBOX(flags, value) ((flags) = (value) ? ((flags) | 0x04) : ((flags) & 0xFB))
#define RTFLAGS_SET_GEODETIC(flags, value) ((flags) = (value) ? ((flags) | 0x08) : ((flags) & 0xF7))
#define RTFLAGS_SET_READONLY(flags, value) ((flags) = (value) ? ((flags) | 0x10) : ((flags) & 0xEF))
#define RTFLAGS_SET_SOLID(flags, value) ((flags) = (value) ? ((flags) | 0x20) : ((flags) & 0xDF))
#define RTFLAGS_NDIMS(flags) (2 + RTFLAGS_GET_Z(flags) + RTFLAGS_GET_M(flags))
#define RTFLAGS_GET_ZM(flags) (RTFLAGS_GET_M(flags) + RTFLAGS_GET_Z(flags) * 2)
#define RTFLAGS_NDIMS_BOX(flags) (RTFLAGS_GET_GEODETIC(flags) ? 3 : RTFLAGS_NDIMS(flags))
/**
* Macros for manipulating the 'typemod' int. An int32_t used as follows:
* Plus/minus = Top bit.
* Spare bits = Next 2 bits.
* SRID = Next 21 bits.
* RTTYPE = Next 6 bits.
* ZM Flags = Bottom 2 bits.
*/
#define RTTYPMOD_GET_SRID(typmod) ((((typmod) & 0x1FFFFF00)<<3)>>11)
#define RTTYPMOD_SET_SRID(typmod, srid) ((typmod) = (((typmod) & 0xE00000FF) | ((srid & 0x001FFFFF)<<8)))
#define RTTYPMOD_GET_TYPE(typmod) ((typmod & 0x000000FC)>>2)
#define RTTYPMOD_SET_TYPE(typmod, type) ((typmod) = (typmod & 0xFFFFFF03) | ((type & 0x0000003F)<<2))
#define RTTYPMOD_GET_Z(typmod) ((typmod & 0x00000002)>>1)
#define RTTYPMOD_SET_Z(typmod) ((typmod) = typmod | 0x00000002)
#define RTTYPMOD_GET_M(typmod) (typmod & 0x00000001)
#define RTTYPMOD_SET_M(typmod) ((typmod) = typmod | 0x00000001)
#define RTTYPMOD_GET_NDIMS(typmod) (2+RTTYPMOD_GET_Z(typmod)+RTTYPMOD_GET_M(typmod))
/**
* Maximum allowed SRID value in serialized geometry.
* Currently we are using 21 bits (2097152) of storage for SRID.
*/
#define SRID_MAXIMUM 999999
/**
* Maximum valid SRID value for the user
* We reserve 1000 values for internal use
*/
#define SRID_USER_MAXIMUM 998999
/** Unknown SRID value */
#define SRID_UNKNOWN 0
#define SRID_IS_UNKNOWN(x) ((int)x<=0)
/*
** EPSG WGS84 geographics, OGC standard default SRS, better be in
** the SPATIAL_REF_SYS table!
*/
#define SRID_DEFAULT 4326
#ifndef __GNUC__
# define __attribute__(x)
#endif
/**
* RT library context
*/
typedef struct RTCTX_T RTCTX;
/**
* Global functions for memory/logging handlers.
*/
typedef void* (*rtallocator)(size_t size);
typedef void* (*rtreallocator)(void *mem, size_t size);
typedef void (*rtfreeor)(void* mem);
typedef void (*rtreporter)(const char* fmt, va_list ap, void *arg)
__attribute__ (( format(printf, 1, 0) ));
typedef void (*rtdebuglogger)(int level, const char* fmt, va_list ap, void *arg)
__attribute__ (( format(printf, 2,0) ));
/**
* Initialize the library with custom memory management functions
* you want your application to use.
* @param allocator function for allocating memory,
* or NULL to use the default
* @param reallocator function for reallocating memory,
* or NULL to use the default
* @param freeor function for release memory,
* or NULL to use the default
* @return a context object to use in subsequent calls
* to the library
* @see rtgeom_finish to destroy the created context
* @ingroup system
*/
RTCTX *rtgeom_init(rtallocator allocator,
rtreallocator reallocator,
rtfreeor freeor);
/**
* Deinitialize the library, releasing all context memory
*
* @param ctx a context returned by rtgeom_init
*
*/
void rtgeom_finish(RTCTX *ctx);
/** Return rtgeom version string (not to be freed) */
const char* rtgeom_version(void);
/**
* This functions are called by programs which want to set up
* custom handling for error reporting
*/
extern void rtgeom_set_error_logger(RTCTX *ctx,
rtreporter logger, void *arg);
extern void rtgeom_set_notice_logger(RTCTX *ctx,
rtreporter logger, void *arg);
extern void rtgeom_set_debug_logger(RTCTX *ctx,
rtdebuglogger logger, void *arg);
/**
* Request interruption of any running code
*
* Safe for use from signal handlers
*
* Interrupted code will (as soon as it finds out
* to be interrupted) cleanup and return as soon as possible.
*
* The return value from interrupted code is undefined,
* it is the caller responsibility to not take it in consideration.
*
*/
extern void rtgeom_request_interrupt(const RTCTX *ctx);
/**
* Cancel any interruption request
*/
extern void rtgeom_cancel_interrupt(const RTCTX *ctx);
/**
* Install a callback to be called periodically during
* algorithm execution. Mostly only
没有合适的资源?快使用搜索试试~ 我知道了~
【QGIS跨平台编译】之【librttopo跨平台编译】:Windows环境下编译成果(支撑QGIS跨平台编译,以及二次研发)
共5个文件
lib:2个
h:2个
pdb:1个
0 下载量 59 浏览量
2024-02-05
12:45:09
上传
评论
收藏 996KB ZIP 举报
温馨提示
一、内容概况 QGIS是一个开源的、跨平台的地理信息系统(GIS)软件,用于浏览、编辑和分析地理空间数据,提供了一套丰富的功能,包括地图制作、空间分析、数据管理等。QGIS可以在Windows、Mac OS和Linux等操作系统上运行。 QGIS的跨平台编译需要一系列开源库的支持,本系列提供QGIS相关的编译成果。 本资源的内容为:基于Qt的librttopo跨平台编译成果(Windows版本)。 二、使用人群 QGIS编译、QGIS跨平台编译的人员或研究者。 三、使用场景及目标 在Windows环境下使用。 既可以支撑QGIS在Windows环境下的编译工作,也可以进行librttopo的二次研发。 四、其他说明 在Windows环境下,基于Qt Creator进行编译的librttopo开源库。包含有头文件include、库文件lib、动态库dll等,提供了Debug、Release版本。 当前采用的版本为librttopo-1.1.0,如果下载者,需要其他版本的librttopo,请在评论区留言。
资源推荐
资源详情
资源评论
收起资源包目录
rttopo-Windows.zip (5个子文件)
include
librttopo_geom.h 77KB
librttopo.h 46KB
lib
rttopod.lib 1.64MB
rttopo.lib 1.55MB
rttopod.pdb 204KB
bin
共 5 条
- 1
资源评论
翰墨之道
- 粉丝: 3078
- 资源: 182
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功