osr_wrap.cpp
来自「支持各种栅格图像和矢量图像读取的库」· C++ 代码 · 共 2,264 行 · 第 1/5 页
CPP
2,264 行
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 1.3.31 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make * changes to this file unless you know what you are doing--modify the SWIG * interface file instead. * ----------------------------------------------------------------------------- */#ifdef __cplusplustemplate<class T> class SwigValueWrapper { T *tt;public: SwigValueWrapper() : tt(0) { } SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { } SwigValueWrapper(const T& t) : tt(new T(t)) { } ~SwigValueWrapper() { delete tt; } SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } operator T&() const { return *tt; } T *operator&() { return tt; }private: SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);};#endif/* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. * ----------------------------------------------------------------------------- *//* template workaround for compilers that cannot correctly implement the C++ standard */#ifndef SWIGTEMPLATEDISAMBIGUATOR# if defined(__SUNPRO_CC)# if (__SUNPRO_CC <= 0x560)# define SWIGTEMPLATEDISAMBIGUATOR template# else# define SWIGTEMPLATEDISAMBIGUATOR # endif# else# define SWIGTEMPLATEDISAMBIGUATOR # endif#endif/* inline attribute */#ifndef SWIGINLINE# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))# define SWIGINLINE inline# else# define SWIGINLINE# endif#endif/* attribute recognised by some compilers to avoid 'unused' warnings */#ifndef SWIGUNUSED# if defined(__GNUC__)# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))# define SWIGUNUSED __attribute__ ((__unused__)) # else# define SWIGUNUSED# endif# elif defined(__ICC)# define SWIGUNUSED __attribute__ ((__unused__)) # else# define SWIGUNUSED # endif#endif#ifndef SWIGUNUSEDPARM# ifdef __cplusplus# define SWIGUNUSEDPARM(p)# else# define SWIGUNUSEDPARM(p) p SWIGUNUSED # endif#endif/* internal SWIG method */#ifndef SWIGINTERN# define SWIGINTERN static SWIGUNUSED#endif/* internal inline SWIG method */#ifndef SWIGINTERNINLINE# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE#endif/* exporting methods */#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)# ifndef GCC_HASCLASSVISIBILITY# define GCC_HASCLASSVISIBILITY# endif#endif#ifndef SWIGEXPORT# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)# if defined(STATIC_LINKED)# define SWIGEXPORT# else# define SWIGEXPORT __declspec(dllexport)# endif# else# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)# define SWIGEXPORT __attribute__ ((visibility("default")))# else# define SWIGEXPORT# endif# endif#endif/* calling conventions for Windows */#ifndef SWIGSTDCALL# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)# define SWIGSTDCALL __stdcall# else# define SWIGSTDCALL# endif #endif/* Deal with Microsoft's attempt at deprecating C standard runtime functions */#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)# define _CRT_SECURE_NO_DEPRECATE#endif#include <stdlib.h>#include <string.h>#include <stdio.h>/* Support for throwing C# exceptions from C/C++. There are two types: * Exceptions that take a message and ArgumentExceptions that take a message and a parameter name. */typedef enum { SWIG_CSharpApplicationException, SWIG_CSharpArithmeticException, SWIG_CSharpDivideByZeroException, SWIG_CSharpIndexOutOfRangeException, SWIG_CSharpInvalidCastException, SWIG_CSharpInvalidOperationException, SWIG_CSharpIOException, SWIG_CSharpNullReferenceException, SWIG_CSharpOutOfMemoryException, SWIG_CSharpOverflowException, SWIG_CSharpSystemException} SWIG_CSharpExceptionCodes;typedef enum { SWIG_CSharpArgumentException, SWIG_CSharpArgumentNullException, SWIG_CSharpArgumentOutOfRangeException} SWIG_CSharpExceptionArgumentCodes;typedef void (SWIGSTDCALL* SWIG_CSharpExceptionCallback_t)(const char *);typedef void (SWIGSTDCALL* SWIG_CSharpExceptionArgumentCallback_t)(const char *, const char *);typedef struct { SWIG_CSharpExceptionCodes code; SWIG_CSharpExceptionCallback_t callback;} SWIG_CSharpException_t;typedef struct { SWIG_CSharpExceptionArgumentCodes code; SWIG_CSharpExceptionArgumentCallback_t callback;} SWIG_CSharpExceptionArgument_t;static SWIG_CSharpException_t SWIG_csharp_exceptions[] = { { SWIG_CSharpApplicationException, NULL }, { SWIG_CSharpArithmeticException, NULL }, { SWIG_CSharpDivideByZeroException, NULL }, { SWIG_CSharpIndexOutOfRangeException, NULL }, { SWIG_CSharpInvalidCastException, NULL }, { SWIG_CSharpInvalidOperationException, NULL }, { SWIG_CSharpIOException, NULL }, { SWIG_CSharpNullReferenceException, NULL }, { SWIG_CSharpOutOfMemoryException, NULL }, { SWIG_CSharpOverflowException, NULL }, { SWIG_CSharpSystemException, NULL }};static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = { { SWIG_CSharpArgumentException, NULL }, { SWIG_CSharpArgumentNullException, NULL }, { SWIG_CSharpArgumentOutOfRangeException, NULL },};static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) { SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback; if (code >=0 && (size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) { callback = SWIG_csharp_exceptions[code].callback; } callback(msg);}static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) { SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback; if (code >=0 && (size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) { callback = SWIG_csharp_exceptions_argument[code].callback; } callback(msg, param_name);}#ifdef __cplusplusextern "C" #endifSWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionCallbacks_osr( SWIG_CSharpExceptionCallback_t applicationCallback, SWIG_CSharpExceptionCallback_t arithmeticCallback, SWIG_CSharpExceptionCallback_t divideByZeroCallback, SWIG_CSharpExceptionCallback_t indexOutOfRangeCallback, SWIG_CSharpExceptionCallback_t invalidCastCallback, SWIG_CSharpExceptionCallback_t invalidOperationCallback, SWIG_CSharpExceptionCallback_t ioCallback, SWIG_CSharpExceptionCallback_t nullReferenceCallback, SWIG_CSharpExceptionCallback_t outOfMemoryCallback, SWIG_CSharpExceptionCallback_t overflowCallback, SWIG_CSharpExceptionCallback_t systemCallback) { SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback = applicationCallback; SWIG_csharp_exceptions[SWIG_CSharpArithmeticException].callback = arithmeticCallback; SWIG_csharp_exceptions[SWIG_CSharpDivideByZeroException].callback = divideByZeroCallback; SWIG_csharp_exceptions[SWIG_CSharpIndexOutOfRangeException].callback = indexOutOfRangeCallback; SWIG_csharp_exceptions[SWIG_CSharpInvalidCastException].callback = invalidCastCallback; SWIG_csharp_exceptions[SWIG_CSharpInvalidOperationException].callback = invalidOperationCallback; SWIG_csharp_exceptions[SWIG_CSharpIOException].callback = ioCallback; SWIG_csharp_exceptions[SWIG_CSharpNullReferenceException].callback = nullReferenceCallback; SWIG_csharp_exceptions[SWIG_CSharpOutOfMemoryException].callback = outOfMemoryCallback; SWIG_csharp_exceptions[SWIG_CSharpOverflowException].callback = overflowCallback; SWIG_csharp_exceptions[SWIG_CSharpSystemException].callback = systemCallback;}#ifdef __cplusplusextern "C" #endifSWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_osr( SWIG_CSharpExceptionArgumentCallback_t argumentCallback, SWIG_CSharpExceptionArgumentCallback_t argumentNullCallback, SWIG_CSharpExceptionArgumentCallback_t argumentOutOfRangeCallback) { SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback = argumentCallback; SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentNullException].callback = argumentNullCallback; SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentOutOfRangeException].callback = argumentOutOfRangeCallback;}/* Callback for returning strings to C# without leaking memory */typedef char * (SWIGSTDCALL* SWIG_CSharpStringHelperCallback)(const char *);static SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback = NULL;#ifdef __cplusplusextern "C" #endifSWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_osr(SWIG_CSharpStringHelperCallback callback) { SWIG_csharp_string_callback = callback;}/* Contract support */#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, msg, ""); return nullreturn; } else#include <iostream>using namespace std;#include "cpl_string.h"#include "cpl_conv.h"#include "ogr_srs_api.h"typedef void OSRSpatialReferenceShadow;typedef void OSRCoordinateTransformationShadow;OGRErr GetWellKnownGeogCSAsWKT( const char *name, char **argout ) { OGRSpatialReferenceH srs = OSRNewSpatialReference(""); OGRErr rcode = OSRSetWellKnownGeogCS( srs, name ); if( rcode == OGRERR_NONE ) rcode = OSRExportToWkt ( srs, argout ); OSRDestroySpatialReference( srs ); return rcode;}static char const *OGRErrMessages( int rc ) { switch( rc ) { case 0: return "OGR Error %d: None"; case 1: return "OGR Error %d: Not enough data"; case 2: return "OGR Error %d: Unsupported geometry type"; case 3: return "OGR Error %d: Unsupported operation"; case 4: return "OGR Error %d: Corrupt data"; case 5: return "OGR Error %d: General Error"; case 6: return "OGR Error %d: Unsupported SRS"; default: return "OGR Error %d: Unknown"; }}OGRErr GetUserInputAsWKT( const char *name, char **argout ) { OGRSpatialReferenceH srs = OSRNewSpatialReference(""); OGRErr rcode = OSRSetFromUserInput( srs, name ); if( rcode == OGRERR_NONE ) rcode = OSRExportToWkt ( srs, argout ); OSRDestroySpatialReference( srs ); return rcode;}SWIGINTERN OSRSpatialReferenceShadow *new_OSRSpatialReferenceShadow(char const *wkt=""){ OSRSpatialReferenceShadow *sr = (OSRSpatialReferenceShadow*) OSRNewSpatialReference(wkt); if (sr) { OSRReference( sr ); } return sr; }SWIGINTERN void delete_OSRSpatialReferenceShadow(OSRSpatialReferenceShadow *self){ if (OSRDereference( self ) == 0 ) { OSRDestroySpatialReference( self ); } }SWIGINTERN char *OSRSpatialReferenceShadow___str__(OSRSpatialReferenceShadow *self){ char *buf = 0; OSRExportToPrettyWkt( self, &buf, 0 ); return buf; }SWIGINTERN int OSRSpatialReferenceShadow_IsSame(OSRSpatialReferenceShadow *self,OSRSpatialReferenceShadow *rhs){ return OSRIsSame( self, rhs ); }SWIGINTERN int OSRSpatialReferenceShadow_IsSameGeogCS(OSRSpatialReferenceShadow *self,OSRSpatialReferenceShadow *rhs){ return OSRIsSameGeogCS( self, rhs ); }SWIGINTERN int OSRSpatialReferenceShadow_IsGeographic(OSRSpatialReferenceShadow *self){ return OSRIsGeographic(self); }SWIGINTERN int OSRSpatialReferenceShadow_IsProjected(OSRSpatialReferenceShadow *self){ return OSRIsProjected(self); }SWIGINTERN int OSRSpatialReferenceShadow_IsLocal(OSRSpatialReferenceShadow *self){ return OSRIsLocal(self); }SWIGINTERN char const *OSRSpatialReferenceShadow_GetAttrValue(OSRSpatialReferenceShadow *self,char const *name,int child=0){ return OSRGetAttrValue( self, name, child ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetAttrValue(OSRSpatialReferenceShadow *self,char const *name,char const *value){ return OSRSetAttrValue( self, name, value ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetAngularUnits(OSRSpatialReferenceShadow *self,char const *name,double to_radians){ return OSRSetAngularUnits( self, name, to_radians ); }SWIGINTERN double OSRSpatialReferenceShadow_GetAngularUnits(OSRSpatialReferenceShadow *self){ // Return code ignored. return OSRGetAngularUnits( self, 0 ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetLinearUnits(OSRSpatialReferenceShadow *self,char const *name,double to_meters){ return OSRSetLinearUnits( self, name, to_meters ); }SWIGINTERN double OSRSpatialReferenceShadow_GetLinearUnits(OSRSpatialReferenceShadow *self){ // Return code ignored. return OSRGetLinearUnits( self, 0 ); }SWIGINTERN char const *OSRSpatialReferenceShadow_GetLinearUnitsName(OSRSpatialReferenceShadow *self){ const char *name = 0; if ( OSRIsProjected( self ) ) { name = OSRGetAttrValue( self, "PROJCS|UNIT", 0 ); } else if ( OSRIsLocal( self ) ) { name = OSRGetAttrValue( self, "LOCAL_CS|UNIT", 0 ); } if (name != 0) return name; return "Meter"; }SWIGINTERN char const *OSRSpatialReferenceShadow_GetAuthorityCode(OSRSpatialReferenceShadow *self,char const *target_key){ return OSRGetAuthorityCode( self, target_key ); }SWIGINTERN char const *OSRSpatialReferenceShadow_GetAuthorityName(OSRSpatialReferenceShadow *self,char const *target_key){ return OSRGetAuthorityName( self, target_key ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetUTM(OSRSpatialReferenceShadow *self,int zone,int north=1){ return OSRSetUTM( self, zone, north ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetStatePlane(OSRSpatialReferenceShadow *self,int zone,int is_nad83=1,char const *unitsname="",double units=0.0){ return OSRSetStatePlaneWithUnits( self, zone, is_nad83, unitsname, units ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_AutoIdentifyEPSG(OSRSpatialReferenceShadow *self){ return OSRAutoIdentifyEPSG( self ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetProjection(OSRSpatialReferenceShadow *self,char const *arg){ return OSRSetProjection( self, arg ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetProjParm(OSRSpatialReferenceShadow *self,char const *name,double val){ return OSRSetProjParm( self, name, val ); }SWIGINTERN double OSRSpatialReferenceShadow_GetProjParm(OSRSpatialReferenceShadow *self,char const *name,double default_val=0.0){ // Return code ignored. return OSRGetProjParm( self, name, default_val, 0 ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetNormProjParm(OSRSpatialReferenceShadow *self,char const *name,double val){ return OSRSetNormProjParm( self, name, val ); }SWIGINTERN double OSRSpatialReferenceShadow_GetNormProjParm(OSRSpatialReferenceShadow *self,char const *name,double default_val=0.0){ // Return code ignored. return OSRGetNormProjParm( self, name, default_val, 0 ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetACEA(OSRSpatialReferenceShadow *self,double stdp1,double stdp2,double clat,double clong,double fe,double fn){ return OSRSetACEA( self, stdp1, stdp2, clat, clong, fe, fn ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetAE(OSRSpatialReferenceShadow *self,double clat,double clon,double fe,double fn){ return OSRSetAE( self, clat, clon, fe, fn ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetCS(OSRSpatialReferenceShadow *self,double clat,double clong,double fe,double fn){ return OSRSetCS( self, clat, clong, fe, fn ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetBonne(OSRSpatialReferenceShadow *self,double clat,double clong,double fe,double fn){ return OSRSetBonne( self, clat, clong, fe, fn ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetEC(OSRSpatialReferenceShadow *self,double stdp1,double stdp2,double clat,double clong,double fe,double fn){ return OSRSetEC( self, stdp1, stdp2, clat, clong, fe, fn ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetEckertIV(OSRSpatialReferenceShadow *self,double cm,double fe,double fn){ return OSRSetEckertIV( self, cm, fe, fn ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetEckertVI(OSRSpatialReferenceShadow *self,double cm,double fe,double fn){ return OSRSetEckertVI( self, cm, fe, fn ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetEquirectangular(OSRSpatialReferenceShadow *self,double clat,double clong,double fe,double fn){ return OSRSetEquirectangular( self, clat, clong, fe, fn ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetGS(OSRSpatialReferenceShadow *self,double cm,double fe,double fn){ return OSRSetGS( self, cm, fe, fn ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetWellKnownGeogCS(OSRSpatialReferenceShadow *self,char const *name){ return OSRSetWellKnownGeogCS( self, name ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetFromUserInput(OSRSpatialReferenceShadow *self,char const *name){ return OSRSetFromUserInput( self, name ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_CopyGeogCSFrom(OSRSpatialReferenceShadow *self,OSRSpatialReferenceShadow *rhs){ return OSRCopyGeogCSFrom( self, rhs ); }SWIGINTERN OGRErr OSRSpatialReferenceShadow_SetTOWGS84(OSRSpatialReferenceShadow *self,double p1,double p2,double p3,double p4=0.0,double p5=0.0,double p6=0.0,double p7=0.0){ return OSRSetTOWGS84( self, p1, p2, p3, p4, p5, p6, p7 ); }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?