mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 20:50:59 -05:00
Merged master into atmosphere's branch.
This commit is contained in:
@@ -236,7 +236,7 @@ if (OPENSPACE_MODULE_GLOBEBROWSING_USE_GDAL)
|
||||
openspace-module-globebrowsing
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal_i.lib
|
||||
)
|
||||
set(EXTERNAL_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal201.dll" PARENT_SCOPE)
|
||||
set(EXTERNAL_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal202.dll" PARENT_SCOPE)
|
||||
else (WIN32)
|
||||
find_package(GDAL REQUIRED)
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2017 *
|
||||
* *
|
||||
* 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 __OPENSPACE_MODULE_GLOBEBROWSING___GDAL___H__
|
||||
#define __OPENSPACE_MODULE_GLOBEBROWSING___GDAL___H__
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning(push, 0)
|
||||
#endif // WIN32
|
||||
|
||||
#include <gdal_priv.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning(pop)
|
||||
#endif // WIN32
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_atomic_ops.h 33666 2016-03-07 05:21:07Z goatbar $
|
||||
* $Id: cpl_atomic_ops.h 35921 2016-10-25 02:28:29Z goatbar $
|
||||
*
|
||||
* Name: cpl_atomic_ops.h
|
||||
* Project: CPL - Common Portability Library
|
||||
@@ -51,7 +51,7 @@ CPL_C_START
|
||||
* supported by GCC 4.1 or higher. For other platforms supporting
|
||||
* the pthread library, and when GDAL is configured with thread-support,
|
||||
* the atomicity will be done with a mutex, but with
|
||||
* reduced efficiently. For the remaining platforms, a simple addition
|
||||
* reduced efficiency. For the remaining platforms, a simple addition
|
||||
* with no locking will be done...
|
||||
*
|
||||
* @param ptr a pointer to an integer to increment
|
||||
@@ -82,7 +82,6 @@ int CPL_DLL CPLAtomicAdd(volatile int* ptr, int increment);
|
||||
*/
|
||||
#define CPLAtomicDec(ptr) CPLAtomicAdd(ptr, -1)
|
||||
|
||||
|
||||
/** Compares *ptr with oldval. If *ptr == oldval, then *ptr is assigned
|
||||
* newval and TRUE is returned. Otherwise nothing is done, and FALSE is returned.
|
||||
*
|
||||
@@ -91,8 +90,8 @@ int CPL_DLL CPLAtomicAdd(volatile int* ptr, int increment);
|
||||
* supported by GCC 4.1 or higher. For other platforms supporting
|
||||
* the pthread library, and when GDAL is configured with thread-support,
|
||||
* the atomicity will be done with a mutex, but with
|
||||
* reduced efficiently. For the remaining platforms, a simple addition
|
||||
* with no locking will be done...
|
||||
* reduced efficiency. For the remaining platforms, a simple compare and
|
||||
* exchange with no locking will be done...
|
||||
*
|
||||
* @param ptr a pointer to an integer (aligned on 32bit boundary).
|
||||
* @param oldval old value
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_aws.h 33758 2016-03-21 09:06:22Z rouault $
|
||||
* $Id: cpl_aws.h 37174 2017-01-18 20:00:36Z rouault $
|
||||
*
|
||||
* Name: cpl_aws.h
|
||||
* Project: CPL - Common Portability Library
|
||||
@@ -31,12 +31,17 @@
|
||||
#ifndef CPL_AWS_INCLUDED_H
|
||||
#define CPL_AWS_INCLUDED_H
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include "cpl_string.h"
|
||||
|
||||
CPLString CPLGetAWS_SIGN4_Authorization(const CPLString& osSecretAccessKey,
|
||||
const CPLString& osAccessKeyId,
|
||||
const CPLString& osAccessToken,
|
||||
const CPLString& osAWSRegion,
|
||||
const CPLString& osRequestPayer,
|
||||
const CPLString& osService,
|
||||
const CPLString& osVerb,
|
||||
const CPLString& osHost,
|
||||
@@ -65,6 +70,7 @@ class VSIS3HandleHelper
|
||||
CPLString m_osSessionToken;
|
||||
CPLString m_osAWSS3Endpoint;
|
||||
CPLString m_osAWSRegion;
|
||||
CPLString m_osRequestPayer;
|
||||
CPLString m_osBucket;
|
||||
CPLString m_osObjectKey;
|
||||
bool m_bUseHTTPS;
|
||||
@@ -84,6 +90,7 @@ class VSIS3HandleHelper
|
||||
const CPLString& osSessionToken,
|
||||
const CPLString& osAWSS3Endpoint,
|
||||
const CPLString& osAWSRegion,
|
||||
const CPLString& osRequestPayer,
|
||||
const CPLString& osBucket,
|
||||
const CPLString& osObjectKey,
|
||||
bool bUseHTTPS, bool bUseVirtualHosting);
|
||||
@@ -109,9 +116,11 @@ class VSIS3HandleHelper
|
||||
const CPLString& GetObjectKey() const { return m_osObjectKey; }
|
||||
const CPLString& GetAWSS3Endpoint()const { return m_osAWSS3Endpoint; }
|
||||
const CPLString& GetAWSRegion() const { return m_osAWSRegion; }
|
||||
const CPLString& GetRequestPayer() const { return m_osRequestPayer; }
|
||||
bool GetVirtualHosting() const { return m_bUseVirtualHosting; }
|
||||
void SetAWSS3Endpoint(const CPLString &osStr);
|
||||
void SetAWSRegion(const CPLString &osStr);
|
||||
void SetRequestPayer(const CPLString &osStr);
|
||||
void SetVirtualHosting(bool b);
|
||||
void SetObjectKey(const CPLString &osStr);
|
||||
};
|
||||
@@ -121,16 +130,21 @@ class VSIS3UpdateParams
|
||||
public:
|
||||
CPLString m_osAWSRegion;
|
||||
CPLString m_osAWSS3Endpoint;
|
||||
CPLString m_osRequestPayer;
|
||||
bool m_bUseVirtualHosting;
|
||||
|
||||
VSIS3UpdateParams(const CPLString& osAWSRegion = "",
|
||||
const CPLString& osAWSS3Endpoint = "",
|
||||
const CPLString& osRequestPayer = "",
|
||||
bool bUseVirtualHosting = false) :
|
||||
m_osAWSRegion(osAWSRegion),
|
||||
m_osAWSS3Endpoint(osAWSS3Endpoint),
|
||||
m_osRequestPayer(osRequestPayer),
|
||||
m_bUseVirtualHosting(bUseVirtualHosting) {}
|
||||
};
|
||||
|
||||
#endif /* HAVE_CURL */
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* CPL_AWS_INCLUDED_H */
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
#undef HAVE_LIBDL
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#define HAVE_LOCALE_H 1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $Id: cpl_config_extras.h 37003 2016-12-23 14:54:07Z goatbar $ */
|
||||
|
||||
#ifndef INCLUDED_CPL_CONFIG_EXTRAS
|
||||
#define INCLUDED_CPL_CONFIG_EXTRAS
|
||||
@@ -10,7 +11,6 @@
|
||||
#define HOST_FILLORDER FILLORDER_LSB2MSB
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __LP64__
|
||||
#define SIZEOF_UNSIGNED_LONG 8
|
||||
#else
|
||||
@@ -37,4 +37,4 @@
|
||||
|
||||
#endif // APPLE
|
||||
|
||||
#endif //INCLUDED_CPL_CONFIG_EXTRAS
|
||||
#endif // INCLUDED_CPL_CONFIG_EXTRAS
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_conv.h 33666 2016-03-07 05:21:07Z goatbar $
|
||||
* $Id: cpl_conv.h 37866 2017-03-30 20:16:05Z rouault $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: Convenience functions declarations.
|
||||
@@ -48,7 +48,9 @@
|
||||
/* -------------------------------------------------------------------- */
|
||||
CPL_C_START
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
void CPL_DLL CPLVerifyConfiguration(void);
|
||||
/*! @endcond */
|
||||
|
||||
const char CPL_DLL * CPL_STDCALL
|
||||
CPLGetConfigOption( const char *, const char * ) CPL_WARN_UNUSED_RESULT;
|
||||
@@ -57,7 +59,13 @@ CPLGetThreadLocalConfigOption( const char *, const char * ) CPL_WARN_UNUSED_RESU
|
||||
void CPL_DLL CPL_STDCALL CPLSetConfigOption( const char *, const char * );
|
||||
void CPL_DLL CPL_STDCALL CPLSetThreadLocalConfigOption( const char *pszKey,
|
||||
const char *pszValue );
|
||||
/*! @cond Doxygen_Suppress */
|
||||
void CPL_DLL CPL_STDCALL CPLFreeConfig(void);
|
||||
/*! @endcond */
|
||||
char CPL_DLL** CPLGetConfigOptions(void);
|
||||
void CPL_DLL CPLSetConfigOptions(const char* const * papszConfigOptions);
|
||||
char CPL_DLL** CPLGetThreadLocalConfigOptions(void);
|
||||
void CPL_DLL CPLSetThreadLocalConfigOptions(const char* const * papszConfigOptions);
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Safe malloc() API. Thin cover over VSI functions with fatal */
|
||||
@@ -69,6 +77,7 @@ void CPL_DLL *CPLRealloc( void *, size_t ) CPL_WARN_UNUSED_RESULT;
|
||||
char CPL_DLL *CPLStrdup( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
|
||||
char CPL_DLL *CPLStrlwr( char *);
|
||||
|
||||
/** Alias of VSIFree() */
|
||||
#define CPLFree VSIFree
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
@@ -77,7 +86,13 @@ char CPL_DLL *CPLStrlwr( char *);
|
||||
char CPL_DLL *CPLFGets( char *, int, FILE *);
|
||||
const char CPL_DLL *CPLReadLine( FILE * );
|
||||
const char CPL_DLL *CPLReadLineL( VSILFILE * );
|
||||
const char CPL_DLL *CPLReadLine2L( VSILFILE * , int nMaxCols, char** papszOptions);
|
||||
#ifdef __cplusplus
|
||||
const char CPL_DLL *CPLReadLine2L( VSILFILE * , int nMaxCols,
|
||||
const char * const * papszOptions );
|
||||
#else
|
||||
const char CPL_DLL *CPLReadLine2L( VSILFILE * , int nMaxCols,
|
||||
char** papszOptions );
|
||||
#endif
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Convert ASCII string to floating point number */
|
||||
@@ -158,10 +173,13 @@ char CPL_DLL **CPLCorrespondingPaths( const char *pszOldFilename,
|
||||
int CPL_DLL CPLCheckForFile( char *pszFilename, char **papszSiblingList );
|
||||
|
||||
const char CPL_DLL *CPLGenerateTempFilename( const char *pszStem ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
|
||||
const char CPL_DLL *CPLExpandTilde( const char *pszFilename ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Find File Function */
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
/** Callback for CPLPushFileFinder */
|
||||
typedef const char *(*CPLFileFinder)(const char *, const char *);
|
||||
|
||||
const char CPL_DLL *CPLFindFile(const char *pszClass,
|
||||
@@ -183,19 +201,23 @@ int CPL_DLL CPLStat( const char *, VSIStatBuf * ) CPL_WARN_UNUSED_RESULT;
|
||||
/* Reference counted file handle manager. Makes sharing file */
|
||||
/* handles more practical. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
/** Information on a shared file */
|
||||
typedef struct {
|
||||
FILE *fp;
|
||||
int nRefCount;
|
||||
int bLarge;
|
||||
char *pszFilename;
|
||||
char *pszAccess;
|
||||
FILE *fp; /**< File pointer */
|
||||
int nRefCount; /**< Reference counter */
|
||||
int bLarge; /**< Whether fp must be interpreted as VSIFILE* */
|
||||
char *pszFilename; /**< Filename */
|
||||
char *pszAccess; /**< Access mode */
|
||||
} CPLSharedFileInfo;
|
||||
|
||||
FILE CPL_DLL *CPLOpenShared( const char *, const char *, int );
|
||||
void CPL_DLL CPLCloseShared( FILE * );
|
||||
CPLSharedFileInfo CPL_DLL *CPLGetSharedList( int * );
|
||||
void CPL_DLL CPLDumpSharedList( FILE * );
|
||||
/*! @cond Doxygen_Suppress */
|
||||
void CPL_DLL CPLCleanupSharedFileMutex( void );
|
||||
/*! @endcond */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* DMS to Dec to DMS conversion. */
|
||||
@@ -221,7 +243,10 @@ int CPL_DLL CPLSymlink( const char* pszOldPath, const char* pszNewPath, char** p
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* ZIP Creation. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#define CPL_ZIP_API_OFFERED
|
||||
/*! @endcond */
|
||||
void CPL_DLL *CPLCreateZip( const char *pszZipFilename, char **papszOptions );
|
||||
CPLErr CPL_DLL CPLCreateFileInZip( void *hZip, const char *pszFilename,
|
||||
char **papszOptions );
|
||||
@@ -251,7 +276,9 @@ int CPL_DLL CPLValidateXML(const char* pszXMLFilename,
|
||||
/* Locale handling. Prevents parallel executions of setlocale(). */
|
||||
/* -------------------------------------------------------------------- */
|
||||
char* CPLsetlocale (int category, const char* locale);
|
||||
/*! @cond Doxygen_Suppress */
|
||||
void CPLCleanupSetlocaleMutex(void);
|
||||
/*! @endcond */
|
||||
|
||||
CPL_C_END
|
||||
|
||||
@@ -259,6 +286,7 @@ CPL_C_END
|
||||
/* C++ object for temporarily forcing a LC_NUMERIC locale to "C". */
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
|
||||
class CPL_DLL CPLLocaleC
|
||||
@@ -302,6 +330,6 @@ private:
|
||||
};
|
||||
|
||||
#endif /* def __cplusplus */
|
||||
|
||||
//! @endcond
|
||||
|
||||
#endif /* ndef CPL_CONV_H_INCLUDED */
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: Prototypes, and definitions for of CPU features detection
|
||||
* Author: Even Rouault, <even dot rouault at spatialys dot com>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2016, Even Rouault <even dot rouault at spatialys dot 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 CPL_CPU_FEATURES_H
|
||||
#define CPL_CPU_FEATURES_H
|
||||
|
||||
#include "cpl_port.h"
|
||||
#include "cpl_string.h"
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
|
||||
#ifdef HAVE_SSE_AT_COMPILE_TIME
|
||||
#if (defined(_M_X64) || defined(__x86_64))
|
||||
#define HAVE_INLINE_SSE
|
||||
static bool inline CPLHaveRuntimeSSE() { return true; }
|
||||
#else
|
||||
bool CPLHaveRuntimeSSE();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SSSE3_AT_COMPILE_TIME
|
||||
#if __SSSE3__
|
||||
#define HAVE_INLINE_SSSE3
|
||||
static bool inline CPLHaveRuntimeSSSE3()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if( !CPLTestBool(CPLGetConfigOption("GDAL_USE_SSSE3", "YES")) )
|
||||
return false;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
bool CPLHaveRuntimeSSSE3();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX_AT_COMPILE_TIME
|
||||
#if __AVX__
|
||||
#define HAVE_INLINE_AVX
|
||||
static bool inline CPLHaveRuntimeAVX() { return true; }
|
||||
#else
|
||||
bool CPLHaveRuntimeAVX();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//! @endcond
|
||||
|
||||
#endif // CPL_CPU_FEATURES_H
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_csv.h 33844 2016-04-01 08:42:13Z rouault $
|
||||
* $Id: cpl_csv.h 36376 2016-11-21 06:54:04Z goatbar $
|
||||
*
|
||||
* Project: Common Portability Library
|
||||
* Purpose: Functions for reading and scanning CSV (comma separated,
|
||||
@@ -31,6 +31,8 @@
|
||||
#ifndef CPL_CSV_H_INCLUDED
|
||||
#define CPL_CSV_H_INCLUDED
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "cpl_conv.h"
|
||||
#include "cpl_string.h"
|
||||
#include "cpl_vsi.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_error.h 33842 2016-04-01 08:37:32Z rouault $
|
||||
* $Id: cpl_error.h 36675 2016-12-04 11:10:10Z rouault $
|
||||
*
|
||||
* Name: cpl_error.h
|
||||
* Project: CPL - Common Portability Library
|
||||
@@ -33,6 +33,9 @@
|
||||
|
||||
#include "cpl_port.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/*=====================================================================
|
||||
Error handling functions (cpl_error.c)
|
||||
=====================================================================*/
|
||||
@@ -45,6 +48,7 @@
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/** Error category */
|
||||
typedef enum
|
||||
{
|
||||
CE_None = 0,
|
||||
@@ -87,35 +91,53 @@ typedef enum
|
||||
|
||||
#else
|
||||
|
||||
/** Error number */
|
||||
typedef int CPLErrorNum;
|
||||
|
||||
/** No error */
|
||||
#define CPLE_None 0
|
||||
/** Application defined error */
|
||||
#define CPLE_AppDefined 1
|
||||
/** Out of memory error */
|
||||
#define CPLE_OutOfMemory 2
|
||||
/** File I/O error */
|
||||
#define CPLE_FileIO 3
|
||||
/** Open failed */
|
||||
#define CPLE_OpenFailed 4
|
||||
/** Illegal argument */
|
||||
#define CPLE_IllegalArg 5
|
||||
/** Not supported */
|
||||
#define CPLE_NotSupported 6
|
||||
/** Assertion failed */
|
||||
#define CPLE_AssertionFailed 7
|
||||
/** No write access */
|
||||
#define CPLE_NoWriteAccess 8
|
||||
/** User interrupted */
|
||||
#define CPLE_UserInterrupt 9
|
||||
/** NULL object */
|
||||
#define CPLE_ObjectNull 10
|
||||
|
||||
/*
|
||||
* Filesystem-specific errors
|
||||
*/
|
||||
/** HTTP response */
|
||||
#define CPLE_HttpResponse 11
|
||||
/** AWSBucketNotFound */
|
||||
#define CPLE_AWSBucketNotFound 12
|
||||
/** AWSObjectNotFound */
|
||||
#define CPLE_AWSObjectNotFound 13
|
||||
/** AWSAccessDenied */
|
||||
#define CPLE_AWSAccessDenied 14
|
||||
/** AWSInvalidCredentials */
|
||||
#define CPLE_AWSInvalidCredentials 15
|
||||
/** AWSSignatureDoesNotMatch */
|
||||
#define CPLE_AWSSignatureDoesNotMatch 16
|
||||
|
||||
/* 100 - 299 reserved for GDAL */
|
||||
|
||||
#endif
|
||||
|
||||
void CPL_DLL CPLError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (3, 4);
|
||||
void CPL_DLL CPLError(CPLErr eErrClass, CPLErrorNum err_no, CPL_FORMAT_STRING(const char *fmt), ...) CPL_PRINT_FUNC_FORMAT (3, 4);
|
||||
void CPL_DLL CPLErrorV(CPLErr, CPLErrorNum, const char *, va_list );
|
||||
void CPL_DLL CPLEmergencyError( const char * ) CPL_NO_RETURN;
|
||||
void CPL_DLL CPL_STDCALL CPLErrorReset( void );
|
||||
@@ -124,33 +146,45 @@ CPLErr CPL_DLL CPL_STDCALL CPLGetLastErrorType( void );
|
||||
const char CPL_DLL * CPL_STDCALL CPLGetLastErrorMsg( void );
|
||||
void CPL_DLL * CPL_STDCALL CPLGetErrorHandlerUserData(void);
|
||||
void CPL_DLL CPLErrorSetState( CPLErr eErrClass, CPLErrorNum err_no, const char* pszMsg );
|
||||
/*! @cond Doxygen_Suppress */
|
||||
void CPL_DLL CPLCleanupErrorMutex( void );
|
||||
/*! @endcond */
|
||||
|
||||
/** Callback for a custom error handler */
|
||||
typedef void (CPL_STDCALL *CPLErrorHandler)(CPLErr, CPLErrorNum, const char*);
|
||||
|
||||
void CPL_DLL CPL_STDCALL CPLLoggingErrorHandler( CPLErr, CPLErrorNum, const char * );
|
||||
void CPL_DLL CPL_STDCALL CPLDefaultErrorHandler( CPLErr, CPLErrorNum, const char * );
|
||||
void CPL_DLL CPL_STDCALL CPLQuietErrorHandler( CPLErr, CPLErrorNum, const char * );
|
||||
void CPLTurnFailureIntoWarning(int bOn );
|
||||
void CPLTurnFailureIntoWarning( int bOn );
|
||||
|
||||
CPLErrorHandler CPL_DLL CPL_STDCALL CPLSetErrorHandler(CPLErrorHandler);
|
||||
CPLErrorHandler CPL_DLL CPL_STDCALL CPLSetErrorHandlerEx(CPLErrorHandler, void*);
|
||||
CPLErrorHandler CPL_DLL CPL_STDCALL CPLSetErrorHandler( CPLErrorHandler );
|
||||
CPLErrorHandler CPL_DLL CPL_STDCALL CPLSetErrorHandlerEx( CPLErrorHandler, void* );
|
||||
void CPL_DLL CPL_STDCALL CPLPushErrorHandler( CPLErrorHandler );
|
||||
void CPL_DLL CPL_STDCALL CPLPushErrorHandlerEx( CPLErrorHandler, void* );
|
||||
void CPL_DLL CPL_STDCALL CPLSetCurrentErrorHandlerCatchDebug( int bCatchDebug );
|
||||
void CPL_DLL CPL_STDCALL CPLPopErrorHandler(void);
|
||||
|
||||
void CPL_DLL CPL_STDCALL CPLDebug( const char *, const char *, ... ) CPL_PRINT_FUNC_FORMAT (2, 3);
|
||||
#ifdef WITHOUT_CPLDEBUG
|
||||
#define CPLDebug(...) /* Eat all CPLDebug calls. */
|
||||
#else
|
||||
void CPL_DLL CPL_STDCALL CPLDebug(const char *, CPL_FORMAT_STRING(const char *), ...)
|
||||
CPL_PRINT_FUNC_FORMAT(2, 3);
|
||||
#endif
|
||||
|
||||
void CPL_DLL CPL_STDCALL _CPLAssert( const char *, const char *, int ) CPL_NO_RETURN;
|
||||
|
||||
#ifdef DEBUG
|
||||
/** Assert on an expression. Only enabled in DEBUG mode */
|
||||
# define CPLAssert(expr) ((expr) ? (void)(0) : _CPLAssert(#expr,__FILE__,__LINE__))
|
||||
#else
|
||||
/** Assert on an expression. Only enabled in DEBUG mode */
|
||||
# define CPLAssert(expr)
|
||||
#endif
|
||||
|
||||
CPL_C_END
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/*
|
||||
* Helper macros used for input parameters validation.
|
||||
*/
|
||||
@@ -159,7 +193,9 @@ CPL_C_END
|
||||
#else
|
||||
# define VALIDATE_POINTER_ERR CE_Failure
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
/** Validate that a pointer is not NULL */
|
||||
#define VALIDATE_POINTER0(ptr, func) \
|
||||
do { if( NULL == ptr ) \
|
||||
{ \
|
||||
@@ -168,6 +204,7 @@ CPL_C_END
|
||||
"Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func)); \
|
||||
return; }} while(0)
|
||||
|
||||
/** Validate that a pointer is not NULL, and return rc if it is NULL */
|
||||
#define VALIDATE_POINTER1(ptr, func, rc) \
|
||||
do { if( NULL == ptr ) \
|
||||
{ \
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
/**********************************************************************
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: Google Cloud Storage routines
|
||||
* Author: Even Rouault <even.rouault at spatialys.com>
|
||||
*
|
||||
**********************************************************************
|
||||
* Copyright (c) 2017, Even Rouault <even.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 CPL_GOOGLE_CLOUD_INCLUDED_H
|
||||
#define CPL_GOOGLE_CLOUD_INCLUDED_H
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include "cpl_string.h"
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
class VSIGSHandleHelper
|
||||
{
|
||||
CPLString m_osURL;
|
||||
CPLString m_osEndpoint;
|
||||
CPLString m_osBucketObjectKey;
|
||||
CPLString m_osSecretAccessKey;
|
||||
CPLString m_osAccessKeyId;
|
||||
bool m_bUseHeaderFile;
|
||||
|
||||
public:
|
||||
VSIGSHandleHelper(const CPLString& osEndpoint,
|
||||
const CPLString& osBucketObjectKey,
|
||||
const CPLString& osSecretAccessKey,
|
||||
const CPLString& osAccessKeyId,
|
||||
bool bUseHeaderFile);
|
||||
~VSIGSHandleHelper();
|
||||
|
||||
static VSIGSHandleHelper* BuildFromURI(const char* pszURI,
|
||||
const char* pszFSPrefix);
|
||||
|
||||
struct curl_slist* GetCurlHeaders(const CPLString& osVerb) const;
|
||||
|
||||
const CPLString& GetURL() const { return m_osURL; }
|
||||
};
|
||||
|
||||
#endif /* HAVE_CURL */
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* CPL_GOOGLE_CLOUD_INCLUDED_H */
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_hash_set.h 33666 2016-03-07 05:21:07Z goatbar $
|
||||
* $Id: cpl_hash_set.h 34931 2016-08-05 17:13:05Z rouault $
|
||||
*
|
||||
* Name: cpl_hash_set.h
|
||||
* Project: CPL - Common Portability Library
|
||||
@@ -48,14 +48,19 @@ CPL_C_START
|
||||
|
||||
/* Types */
|
||||
|
||||
/** Opaque type for a hash set */
|
||||
typedef struct _CPLHashSet CPLHashSet;
|
||||
|
||||
/** CPLHashSetHashFunc */
|
||||
typedef unsigned long (*CPLHashSetHashFunc)(const void* elt);
|
||||
|
||||
/** CPLHashSetEqualFunc */
|
||||
typedef int (*CPLHashSetEqualFunc)(const void* elt1, const void* elt2);
|
||||
|
||||
/** CPLHashSetFreeEltFunc */
|
||||
typedef void (*CPLHashSetFreeEltFunc)(void* elt);
|
||||
|
||||
/** CPLHashSetIterEltFunc */
|
||||
typedef int (*CPLHashSetIterEltFunc)(void* elt, void* user_data);
|
||||
|
||||
/* Functions */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_http.h 33666 2016-03-07 05:21:07Z goatbar $
|
||||
* $Id: cpl_http.h 37645 2017-03-08 00:15:33Z rouault $
|
||||
*
|
||||
* Project: Common Portability Library
|
||||
* Purpose: Function wrapper for libcurl HTTP access.
|
||||
@@ -64,6 +64,7 @@ typedef struct {
|
||||
|
||||
/*! Length of the pabyData buffer */
|
||||
int nDataLen;
|
||||
/*! Allocated size of the pabyData buffer */
|
||||
int nDataAlloc;
|
||||
|
||||
/*! Buffer with downloaded data */
|
||||
@@ -102,4 +103,12 @@ char CPL_DLL *GOA2GetAccessToken( const char *pszRefreshToken,
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#ifdef __cplusplus
|
||||
/*! @cond Doxygen_Suppress */
|
||||
// Not sure if this belong here, used in cpl_http.cpp, cpl_vsil_curl.cpp and frmts/wms/gdalhttp.cpp
|
||||
void* CPLHTTPSetOptions(void *pcurl, const char * const* papszOptions);
|
||||
char** CPLHTTPGetOptionsFromEnv();
|
||||
/*! @endcond */
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif /* ndef CPL_HTTP_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_list.h 33671 2016-03-07 18:39:06Z goatbar $
|
||||
* $Id: cpl_list.h 37825 2017-03-21 20:14:08Z rouault $
|
||||
*
|
||||
* Name: cpl_list.h
|
||||
* Project: CPL - Common Portability Library
|
||||
@@ -45,7 +45,10 @@
|
||||
CPL_C_START
|
||||
|
||||
/** List element structure. */
|
||||
typedef struct _CPLList
|
||||
typedef struct _CPLList CPLList;
|
||||
|
||||
/** List element structure. */
|
||||
struct _CPLList
|
||||
{
|
||||
/*! Pointer to the data object. Should be allocated and freed by the
|
||||
* caller.
|
||||
@@ -55,7 +58,7 @@ typedef struct _CPLList
|
||||
* last one.
|
||||
*/
|
||||
struct _CPLList *psNext;
|
||||
} CPLList;
|
||||
};
|
||||
|
||||
CPLList CPL_DLL *CPLListAppend( CPLList *psList, void * pData );
|
||||
CPLList CPL_DLL *CPLListInsert( CPLList *psList, void * pData, int nPosition );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_minixml.h 33666 2016-03-07 05:21:07Z goatbar $
|
||||
* $Id: cpl_minixml.h 35921 2016-10-25 02:28:29Z goatbar $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: Declarations for MiniXML Handler.
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/** XML node type */
|
||||
typedef enum
|
||||
{
|
||||
/*! Node is an element */ CXT_Element = 0,
|
||||
@@ -117,7 +118,6 @@ typedef struct CPLXMLNode
|
||||
struct CPLXMLNode *psChild;
|
||||
} CPLXMLNode;
|
||||
|
||||
|
||||
CPLXMLNode CPL_DLL *CPLParseXMLString( const char * );
|
||||
void CPL_DLL CPLDestroyXMLNode( CPLXMLNode * );
|
||||
CPLXMLNode CPL_DLL *CPLGetXMLNode( CPLXMLNode *poRoot,
|
||||
@@ -158,19 +158,27 @@ int CPL_DLL CPLSerializeXMLTreeToFile( const CPLXMLNode *psTree,
|
||||
CPL_C_END
|
||||
|
||||
#ifdef __cplusplus
|
||||
// Manage a tree of XML nodes so that all nodes are freed when the instance goes
|
||||
// out of scope. Only the top level node should be in a CPLXMLTreeCloser.
|
||||
/** Manage a tree of XML nodes so that all nodes are freed when the instance goes
|
||||
* out of scope. Only the top level node should be in a CPLXMLTreeCloser.
|
||||
*/
|
||||
class CPLXMLTreeCloser {
|
||||
public:
|
||||
/** Constructor */
|
||||
explicit CPLXMLTreeCloser(CPLXMLNode* data) { the_data_ = data; }
|
||||
|
||||
/** Destructor */
|
||||
~CPLXMLTreeCloser() {
|
||||
if (the_data_) CPLDestroyXMLNode(the_data_);
|
||||
}
|
||||
|
||||
// Modifying the contents pointed to by the return is allowed.
|
||||
/** Returns the node pointer/
|
||||
* Modifying the contents pointed to by the return is allowed.
|
||||
* @return the node pointer */
|
||||
CPLXMLNode* get() const { return the_data_; }
|
||||
|
||||
/** Returns the node pointer/
|
||||
* Modifying the contents pointed to by the return is allowed.
|
||||
* @return the node pointer */
|
||||
CPLXMLNode* operator->() const { return get(); }
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* $Id: cpl_minizip_ioapi.h 36484 2016-11-24 06:35:54Z goatbar $ */
|
||||
|
||||
/* Modified version by Even Rouault. :
|
||||
- change fill_fopen_filefunc to cpl_fill_fopen_filefunc
|
||||
- Add support for ZIP64
|
||||
@@ -18,7 +20,11 @@
|
||||
#ifndef CPL_MINIZIP_IOAPI_H_INCLUDED
|
||||
#define CPL_MINIZIP_IOAPI_H_INCLUDED
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#include "cpl_vsi.h"
|
||||
#include "zlib.h"
|
||||
|
||||
#define uLong64 vsi_l_offset
|
||||
|
||||
#define ZLIB_FILEFUNC_SEEK_CUR (1)
|
||||
@@ -74,9 +80,10 @@ void cpl_fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def);
|
||||
#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
|
||||
#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* CPL_MINIZIP_IOAPI_H_INCLUDED */
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $Id: cpl_minizip_unzip.h 35921 2016-10-25 02:28:29Z goatbar $ */
|
||||
/* Modified version by Even Rouault. :
|
||||
- Addition of cpl_unzGetCurrentFileZStreamPos
|
||||
- Decoration of symbol names unz* -> cpl_unz*
|
||||
@@ -21,7 +22,6 @@
|
||||
Encryption compatible with pkzip 2.04g only supported
|
||||
Old compressions used by old PKZip 1.x are not supported
|
||||
|
||||
|
||||
I WAIT FEEDBACK at mail info@winimage.com
|
||||
Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/* for more info about .ZIP format, see
|
||||
@@ -56,6 +54,8 @@
|
||||
#ifndef CPL_MINIZIP_UNZIP_H_INCLUDED
|
||||
#define CPL_MINIZIP_UNZIP_H_INCLUDED
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#include "cpl_vsi.h"
|
||||
#define uLong64 vsi_l_offset
|
||||
|
||||
@@ -85,7 +85,6 @@ typedef unzFile__ *unzFile;
|
||||
typedef voidp unzFile;
|
||||
#endif
|
||||
|
||||
|
||||
#define UNZ_OK (0)
|
||||
#define UNZ_END_OF_LIST_OF_FILE (-100)
|
||||
#define UNZ_ERRNO (Z_ERRNO)
|
||||
@@ -115,7 +114,6 @@ typedef struct unz_global_info_s
|
||||
uLong size_comment; /* size of the global comment of the zipfile */
|
||||
} unz_global_info;
|
||||
|
||||
|
||||
/* unz_file_info contain information about a file in the zipfile */
|
||||
typedef struct unz_file_info_s
|
||||
{
|
||||
@@ -150,7 +148,6 @@ extern int ZEXPORT cpl_unzStringFileNameCompare (const char* fileName1,
|
||||
(like 1 on Unix, 2 on Windows)
|
||||
*/
|
||||
|
||||
|
||||
extern unzFile ZEXPORT cpl_unzOpen (const char *path);
|
||||
/*
|
||||
Open a Zip file. path contain the full pathname (by example,
|
||||
@@ -183,7 +180,6 @@ extern int ZEXPORT cpl_unzGetGlobalInfo (unzFile file,
|
||||
No preparation of the structure is needed
|
||||
return UNZ_OK if there is no problem. */
|
||||
|
||||
|
||||
extern int ZEXPORT cpl_unzGetGlobalComment (unzFile file,
|
||||
char *szComment,
|
||||
uLong uSizeBuf);
|
||||
@@ -193,7 +189,6 @@ extern int ZEXPORT cpl_unzGetGlobalComment (unzFile file,
|
||||
return the number of byte copied or an error code <0
|
||||
*/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* Unzip package allow you browse the directory of the zipfile */
|
||||
|
||||
@@ -222,7 +217,6 @@ extern int ZEXPORT cpl_unzLocateFile (unzFile file,
|
||||
UNZ_END_OF_LIST_OF_FILE if the file is not found
|
||||
*/
|
||||
|
||||
|
||||
/* ****************************************** */
|
||||
/* Ryan supplied functions */
|
||||
/* unz_file_info contain information about a file in the zipfile */
|
||||
@@ -263,14 +257,12 @@ extern int ZEXPORT cpl_unzGetCurrentFileInfo (unzFile file,
|
||||
(commentBufferSize is the size of the buffer)
|
||||
*/
|
||||
|
||||
|
||||
/** Addition for GDAL : START */
|
||||
|
||||
extern uLong64 ZEXPORT cpl_unzGetCurrentFileZStreamPos (unzFile file);
|
||||
|
||||
/** Addition for GDAL : END */
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* for reading the content of the current zipfile, you can open it, read data
|
||||
from it, and close it (you can close it before reading all the file)
|
||||
@@ -317,7 +309,6 @@ extern int ZEXPORT cpl_unzOpenCurrentFile3 (unzFile file,
|
||||
but you CANNOT set method parameter as NULL
|
||||
*/
|
||||
|
||||
|
||||
extern int ZEXPORT cpl_unzCloseCurrentFile (unzFile file);
|
||||
/*
|
||||
Close the file in zip opened with unzOpenCurrentFile
|
||||
@@ -372,10 +363,10 @@ extern uLong64 ZEXPORT cpl_unzGetOffset (unzFile file);
|
||||
/* Set the current file offset */
|
||||
extern int ZEXPORT cpl_unzSetOffset (unzFile file, uLong64 pos);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* CPL_MINIZIP_UNZIP_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_minizip_zip.h 31826 2015-11-29 15:39:57Z goatbar $
|
||||
* $Id: cpl_minizip_zip.h 35921 2016-10-25 02:28:29Z goatbar $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
For uncompress .zip file, look at unzip.h
|
||||
|
||||
|
||||
I WAIT FEEDBACK at mail info@winimage.com
|
||||
Visit also http://www.winimage.com/zLibDll/unzip.html for evolution
|
||||
|
||||
@@ -49,8 +48,6 @@
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/* for more info about .ZIP format, see
|
||||
@@ -63,6 +60,8 @@
|
||||
#ifndef CPL_MINIZIP_ZIP_H_INCLUDED
|
||||
#define CPL_MINIZIP_ZIP_H_INCLUDED
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#include "cpl_vsi.h"
|
||||
#define uLong64 vsi_l_offset
|
||||
|
||||
@@ -130,7 +129,6 @@ typedef struct
|
||||
|
||||
typedef const char* zipcharpc;
|
||||
|
||||
|
||||
#define APPEND_STATUS_CREATE (0)
|
||||
#define APPEND_STATUS_CREATEAFTER (1)
|
||||
#define APPEND_STATUS_ADDINZIP (2)
|
||||
@@ -183,7 +181,6 @@ extern int ZEXPORT cpl_zipOpenNewFileInZip (zipFile file,
|
||||
level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
|
||||
*/
|
||||
|
||||
|
||||
extern int ZEXPORT cpl_zipOpenNewFileInZip2 (zipFile file,
|
||||
const char* filename,
|
||||
const zip_fileinfo* zipfi,
|
||||
@@ -224,7 +221,6 @@ extern int ZEXPORT cpl_zipOpenNewFileInZip3 (zipFile file,
|
||||
crcForCtypting : crc of file to compress (needed for crypting)
|
||||
*/
|
||||
|
||||
|
||||
extern int ZEXPORT cpl_zipWriteInFileInZip (zipFile file,
|
||||
const void* buf,
|
||||
unsigned len);
|
||||
@@ -256,4 +252,6 @@ extern int ZEXPORT cpl_zipClose (zipFile file,
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* _zip_H */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_multiproc.h 33817 2016-03-30 17:35:37Z rouault $
|
||||
* $Id: cpl_multiproc.h 35921 2016-10-25 02:28:29Z goatbar $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: CPL Multi-Threading, and process handling portability functions.
|
||||
@@ -101,7 +101,6 @@ const char CPL_DLL *CPLGetThreadingModel( void );
|
||||
|
||||
int CPL_DLL CPLGetNumCPUs( void );
|
||||
|
||||
|
||||
typedef struct _CPLLock CPLLock;
|
||||
|
||||
/* Currently LOCK_ADAPTIVE_MUTEX is Linux-only and LOCK_SPIN only available */
|
||||
@@ -121,7 +120,6 @@ void CPL_DLL CPLReleaseLock( CPLLock* );
|
||||
void CPL_DLL CPLDestroyLock( CPLLock* );
|
||||
void CPL_DLL CPLLockSetDebugPerf( CPLLock*, int bEnableIn ); /* only available on x86/x86_64 with GCC for now */
|
||||
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -137,23 +135,25 @@ CPL_C_END
|
||||
/* be a no-op. The parameter x should be a (void*) */
|
||||
#define CPLMutexHolderOptionalLockD(x) CPLMutexHolder oHolder(x,1000.0,__FILE__,__LINE__);
|
||||
|
||||
/** Object to hold a mutex */
|
||||
class CPL_DLL CPLMutexHolder
|
||||
{
|
||||
private:
|
||||
CPLMutex *hMutex;
|
||||
// Only used for debugging.
|
||||
const char *pszFile;
|
||||
int nLine;
|
||||
|
||||
public:
|
||||
|
||||
/* Instantiates the mutex if not already done. */
|
||||
/** Instantiates the mutex if not already done. */
|
||||
CPLMutexHolder( CPLMutex **phMutex, double dfWaitInSeconds = 1000.0,
|
||||
const char *pszFile = __FILE__,
|
||||
int nLine = __LINE__,
|
||||
int nOptions = CPL_MUTEX_RECURSIVE);
|
||||
|
||||
/* This variant assumes the mutex has already been created. If not, it will */
|
||||
/* be a no-op */
|
||||
/** This variant assumes the mutex has already been created. If not, it will
|
||||
* be a no-op */
|
||||
CPLMutexHolder( CPLMutex* hMutex, double dfWaitInSeconds = 1000.0,
|
||||
const char *pszFile = __FILE__,
|
||||
int nLine = __LINE__ );
|
||||
@@ -168,6 +168,7 @@ class CPL_DLL CPLMutexHolder
|
||||
/* be a no-op. The parameter should be (CPLLock*) */
|
||||
#define CPLLockHolderOptionalLockD(x) CPLLockHolder oHolder(x,__FILE__,__LINE__);
|
||||
|
||||
/** Object to hold a lock */
|
||||
class CPL_DLL CPLLockHolder
|
||||
{
|
||||
private:
|
||||
@@ -177,13 +178,13 @@ class CPL_DLL CPLLockHolder
|
||||
|
||||
public:
|
||||
|
||||
/* Instantiates the lock if not already done. */
|
||||
/** Instantiates the lock if not already done. */
|
||||
CPLLockHolder( CPLLock **phSpin, CPLLockType eType,
|
||||
const char *pszFile = __FILE__,
|
||||
int nLine = __LINE__);
|
||||
|
||||
/* This variant assumes the lock has already been created. If not, it will */
|
||||
/* be a no-op */
|
||||
/** This variant assumes the lock has already been created. If not, it will
|
||||
* be a no-op */
|
||||
CPLLockHolder( CPLLock* hSpin,
|
||||
const char *pszFile = __FILE__,
|
||||
int nLine = __LINE__ );
|
||||
@@ -191,7 +192,6 @@ class CPL_DLL CPLLockHolder
|
||||
~CPLLockHolder();
|
||||
};
|
||||
|
||||
|
||||
#endif /* def __cplusplus */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_odbc.h 33666 2016-03-07 05:21:07Z goatbar $
|
||||
* $Id: cpl_odbc.h 36675 2016-12-04 11:10:10Z rouault $
|
||||
*
|
||||
* Project: OGR ODBC Driver
|
||||
* Purpose: Declarations for ODBC Access Cover API.
|
||||
@@ -41,12 +41,13 @@
|
||||
#include <odbcinst.h>
|
||||
#include "cpl_string.h"
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#ifdef PATH_MAX
|
||||
# define ODBC_FILENAME_MAX PATH_MAX
|
||||
#else
|
||||
# define ODBC_FILENAME_MAX (255 + 1) /* Max path length */
|
||||
#endif
|
||||
|
||||
/*! @endcond */
|
||||
|
||||
/**
|
||||
* \file cpl_odbc.h
|
||||
@@ -69,7 +70,6 @@ class CPL_DLL CPLODBCDriverInstaller
|
||||
// Default constructor.
|
||||
CPLODBCDriverInstaller();
|
||||
|
||||
|
||||
/**
|
||||
* Installs ODBC driver or updates definition of already installed driver.
|
||||
* Interanally, it calls ODBC's SQLInstallDriverEx function.
|
||||
@@ -108,26 +108,26 @@ class CPL_DLL CPLODBCDriverInstaller
|
||||
*/
|
||||
int RemoveDriver( const char* pszDriverName, int fRemoveDSN = FALSE );
|
||||
|
||||
|
||||
// The usage count of the driver after this function has been called
|
||||
/** The usage count of the driver after this function has been called */
|
||||
int GetUsageCount() const { return m_nUsageCount; }
|
||||
|
||||
|
||||
// Path of the target directory where the driver should be installed.
|
||||
// For details, see ODBC API Reference and lpszPathOut
|
||||
// parameter of SQLInstallDriverEx
|
||||
/** Path of the target directory where the driver should be installed.
|
||||
* For details, see ODBC API Reference and lpszPathOut
|
||||
* parameter of SQLInstallDriverEx
|
||||
*/
|
||||
const char* GetPathOut() const { return m_szPathOut; }
|
||||
|
||||
|
||||
// If InstallDriver returns FALSE, then GetLastError then
|
||||
// error message can be obtained by calling this function.
|
||||
// Internally, it calls ODBC's SQLInstallerError function.
|
||||
/** If InstallDriver returns FALSE, then GetLastError then
|
||||
* error message can be obtained by calling this function.
|
||||
* Internally, it calls ODBC's SQLInstallerError function.
|
||||
*/
|
||||
const char* GetLastError() const { return m_szError; }
|
||||
|
||||
// If InstallDriver returns FALSE, then GetLastErrorCode then
|
||||
// error code can be obtained by calling this function.
|
||||
// Internally, it calls ODBC's SQLInstallerError function.
|
||||
// See ODBC API Reference for possible error flags.
|
||||
/** If InstallDriver returns FALSE, then GetLastErrorCode then
|
||||
* error code can be obtained by calling this function.
|
||||
* Internally, it calls ODBC's SQLInstallerError function.
|
||||
* See ODBC API Reference for possible error flags.
|
||||
*/
|
||||
DWORD GetLastErrorCode() const { return m_nErrorCode; }
|
||||
};
|
||||
|
||||
@@ -141,6 +141,7 @@ class CPLODBCStatement;
|
||||
# define MISSING_SQLULEN
|
||||
#endif
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#if !defined(MISSING_SQLULEN)
|
||||
/* ODBC types to support 64 bit compilation */
|
||||
# define CPL_SQLULEN SQLULEN
|
||||
@@ -148,8 +149,8 @@ class CPLODBCStatement;
|
||||
#else
|
||||
# define CPL_SQLULEN SQLUINTEGER
|
||||
# define CPL_SQLLEN SQLINTEGER
|
||||
#endif /* ifdef SQLULEN */
|
||||
|
||||
#endif /* ifdef SQLULEN */
|
||||
/*! @endcond */
|
||||
|
||||
/**
|
||||
* A class representing an ODBC database session.
|
||||
@@ -179,6 +180,7 @@ class CPL_DLL CPLODBCSession {
|
||||
int BeginTransaction();
|
||||
int CommitTransaction();
|
||||
int RollbackTransaction();
|
||||
/** Returns whether a transaction is active */
|
||||
int IsInTransaction() { return m_bInTransaction; }
|
||||
|
||||
// Essentially internal.
|
||||
@@ -186,7 +188,9 @@ class CPL_DLL CPLODBCSession {
|
||||
int CloseSession();
|
||||
|
||||
int Failed( int, HSTMT = NULL );
|
||||
/** Return connection handle */
|
||||
HDBC GetConnection() { return m_hDBC; }
|
||||
/** Return GetEnvironment handle */
|
||||
HENV GetEnvironment() { return m_hEnv; }
|
||||
};
|
||||
|
||||
@@ -223,9 +227,10 @@ class CPL_DLL CPLODBCStatement {
|
||||
size_t m_nStatementLen;
|
||||
|
||||
public:
|
||||
CPLODBCStatement( CPLODBCSession * );
|
||||
explicit CPLODBCStatement( CPLODBCSession * );
|
||||
~CPLODBCStatement();
|
||||
|
||||
/** Return statement handle */
|
||||
HSTMT GetStatement() { return m_hStmt; }
|
||||
|
||||
// Command buffer related.
|
||||
@@ -234,7 +239,8 @@ class CPL_DLL CPLODBCStatement {
|
||||
void Append( const char * );
|
||||
void Append( int );
|
||||
void Append( double );
|
||||
int Appendf( const char *, ... ) CPL_PRINT_FUNC_FORMAT (2, 3);
|
||||
int Appendf( CPL_FORMAT_STRING(const char *), ... ) CPL_PRINT_FUNC_FORMAT (2, 3);
|
||||
/** Return statement string */
|
||||
const char *GetCommand() { return m_pszStatement; }
|
||||
|
||||
int ExecuteSQL( const char * = NULL );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_port.h 33907 2016-04-07 00:37:06Z goatbar $
|
||||
* $Id: cpl_port.h 37456 2017-02-25 18:35:03Z rouault $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
@@ -82,7 +82,6 @@
|
||||
#error "Unexpected value for SIZEOF_VOIDP"
|
||||
#endif
|
||||
|
||||
|
||||
/* ==================================================================== */
|
||||
/* This will disable most WIN32 stuff in a Cygnus build which */
|
||||
/* defines unix to 1. */
|
||||
@@ -92,6 +91,7 @@
|
||||
# undef WIN32
|
||||
#endif
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#if defined(VSI_NEED_LARGEFILE64_SOURCE) && !defined(_LARGEFILE64_SOURCE)
|
||||
# define _LARGEFILE64_SOURCE 1
|
||||
#endif
|
||||
@@ -107,20 +107,29 @@
|
||||
#endif
|
||||
|
||||
#define CPL_RECODE_STUB
|
||||
/*! @endcond */
|
||||
|
||||
/* ==================================================================== */
|
||||
/* MinGW stuff */
|
||||
/* ==================================================================== */
|
||||
|
||||
/* We need __MSVCRT_VERSION__ >= 0x0601 to have "struct __stat64" */
|
||||
/* We need __MSVCRT_VERSION__ >= 0x0700 to have "_aligned_malloc" */
|
||||
/* Latest versions of mingw32 define it, but with older ones, */
|
||||
/* we need to define it manually */
|
||||
#if defined(__MINGW32__)
|
||||
#ifndef __MSVCRT_VERSION__
|
||||
#define __MSVCRT_VERSION__ 0x0601
|
||||
#define __MSVCRT_VERSION__ 0x0700
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Needed for std=c11 on Solaris to have strcasecmp() */
|
||||
#if defined(GDAL_COMPILATION) && defined(__sun__) && __STDC_VERSION__ >= 201112L && _XOPEN_SOURCE < 600
|
||||
#ifdef _XOPEN_SOURCE
|
||||
#undef _XOPEN_SOURCE
|
||||
#endif
|
||||
#define _XOPEN_SOURCE 600
|
||||
#endif
|
||||
|
||||
/* ==================================================================== */
|
||||
/* Standard include files. */
|
||||
/* ==================================================================== */
|
||||
@@ -175,7 +184,7 @@
|
||||
# define HAVE_CXX11 1
|
||||
# endif
|
||||
/* TODO(schwehr): What are the correct tests for C++ 14 and 17? */
|
||||
#endif /* __cpluscplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*---------------------------------------------------------------------
|
||||
* types for 16 and 32 bits integers, etc...
|
||||
@@ -184,17 +193,25 @@
|
||||
typedef long GInt32;
|
||||
typedef unsigned long GUInt32;
|
||||
#else
|
||||
/** Int32 type */
|
||||
typedef int GInt32;
|
||||
/** Unsigned int32 type */
|
||||
typedef unsigned int GUInt32;
|
||||
#endif
|
||||
|
||||
/** Int16 type */
|
||||
typedef short GInt16;
|
||||
/** Unsigned int16 type */
|
||||
typedef unsigned short GUInt16;
|
||||
/** Unsigned byte type */
|
||||
typedef unsigned char GByte;
|
||||
/* hack for PDF driver and poppler >= 0.15.0 that defines incompatible "typedef bool GBool" */
|
||||
/* in include/poppler/goo/gtypes.h */
|
||||
#ifndef CPL_GBOOL_DEFINED
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#define CPL_GBOOL_DEFINED
|
||||
/*! @endcond */
|
||||
/** Type for boolean values (alias to int) */
|
||||
typedef int GBool;
|
||||
#endif
|
||||
|
||||
@@ -208,21 +225,62 @@ typedef int GBool;
|
||||
typedef __int64 GIntBig;
|
||||
typedef unsigned __int64 GUIntBig;
|
||||
|
||||
/** Minimum GIntBig value */
|
||||
#define GINTBIG_MIN ((GIntBig)(0x80000000) << 32)
|
||||
/** Maximum GIntBig value */
|
||||
#define GINTBIG_MAX (((GIntBig)(0x7FFFFFFF) << 32) | 0xFFFFFFFFU)
|
||||
/** Maximum GUIntBig value */
|
||||
#define GUINTBIG_MAX (((GUIntBig)(0xFFFFFFFFU) << 32) | 0xFFFFFFFFU)
|
||||
|
||||
#define CPL_HAS_GINT64 1
|
||||
|
||||
/** Signed 64 bit integer type */
|
||||
typedef GIntBig GInt64;
|
||||
/** Unsigned 64 bit integer type */
|
||||
typedef GUIntBig GUInt64;
|
||||
|
||||
#define GINT64_MIN GINTBIG_MIN
|
||||
#define GINT64_MAX GINTBIG_MAX
|
||||
#define GUINT64_MAX GUINTBIG_MAX
|
||||
|
||||
#elif HAVE_LONG_LONG
|
||||
|
||||
/** Large signed integer type (generally 64-bit integer type).
|
||||
* Use GInt64 when exactly 64 bit is needed */
|
||||
typedef long long GIntBig;
|
||||
/** Large unsigned integer type (generally 64-bit unsigned integer type).
|
||||
* Use GUInt64 when exactly 64 bit is needed */
|
||||
typedef unsigned long long GUIntBig;
|
||||
|
||||
/** Minimum GIntBig value */
|
||||
#define GINTBIG_MIN ((GIntBig)(0x80000000) << 32)
|
||||
/** Maximum GIntBig value */
|
||||
#define GINTBIG_MAX (((GIntBig)(0x7FFFFFFF) << 32) | 0xFFFFFFFFU)
|
||||
/** Maximum GUIntBig value */
|
||||
#define GUINTBIG_MAX (((GUIntBig)(0xFFFFFFFFU) << 32) | 0xFFFFFFFFU)
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#define CPL_HAS_GINT64 1
|
||||
/*! @endcond */
|
||||
|
||||
/* Note: we might want to use instead int64_t / uint64_t if they are available */
|
||||
|
||||
/** Signed 64 bit integer type */
|
||||
typedef GIntBig GInt64;
|
||||
/** Unsigned 64 bit integer type */
|
||||
typedef GUIntBig GUInt64;
|
||||
|
||||
/** Minimum GInt64 value */
|
||||
#define GINT64_MIN GINTBIG_MIN
|
||||
/** Maximum GInt64 value */
|
||||
#define GINT64_MAX GINTBIG_MAX
|
||||
/** Minimum GUInt64 value */
|
||||
#define GUINT64_MAX GUINTBIG_MAX
|
||||
|
||||
#else
|
||||
|
||||
// NOTE: we don't really support such platforms ! Many things might break
|
||||
|
||||
typedef long GIntBig;
|
||||
typedef unsigned long GUIntBig;
|
||||
|
||||
@@ -232,40 +290,67 @@ typedef unsigned long GUIntBig;
|
||||
#endif
|
||||
|
||||
#if SIZEOF_VOIDP == 8
|
||||
/** Integer type large enough to hold the difference between 2 addresses */
|
||||
typedef GIntBig GPtrDiff_t;
|
||||
#else
|
||||
/** Integer type large enough to hold the difference between 2 addresses */
|
||||
typedef int GPtrDiff_t;
|
||||
#endif
|
||||
|
||||
#ifdef GDAL_COMPILATION
|
||||
#if HAVE_UINTPTR_T
|
||||
#if !defined(_MSC_VER) || _MSC_VER > 1500
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
typedef uintptr_t GUIntptr_t;
|
||||
#elif SIZEOF_VOIDP == 8
|
||||
typedef GUIntBig GUIntptr_t;
|
||||
#else
|
||||
typedef unsigned int GUIntptr_t;
|
||||
#endif
|
||||
|
||||
#define CPL_IS_ALIGNED(ptr, quant) (((GUIntptr_t)(ptr) % (quant)) == 0)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__MSVCRT__) || (defined(WIN32) && defined(_MSC_VER))
|
||||
#define CPL_FRMT_GB_WITHOUT_PREFIX "I64"
|
||||
#elif HAVE_LONG_LONG
|
||||
/** Printf formatting suffix for GIntBig */
|
||||
#define CPL_FRMT_GB_WITHOUT_PREFIX "ll"
|
||||
#else
|
||||
#define CPL_FRMT_GB_WITHOUT_PREFIX "l"
|
||||
#endif
|
||||
|
||||
/** Printf formatting for GIntBig */
|
||||
#define CPL_FRMT_GIB "%" CPL_FRMT_GB_WITHOUT_PREFIX "d"
|
||||
/** Printf formatting for GUIntBig */
|
||||
#define CPL_FRMT_GUIB "%" CPL_FRMT_GB_WITHOUT_PREFIX "u"
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/* Workaround VC6 bug */
|
||||
#if defined(_MSC_VER) && (_MSC_VER <= 1200)
|
||||
#define GUINTBIG_TO_DOUBLE(x) (double)(GIntBig)(x)
|
||||
#else
|
||||
#define GUINTBIG_TO_DOUBLE(x) (double)(x)
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#ifdef COMPAT_WITH_ICC_CONVERSION_CHECK
|
||||
#define CPL_INT64_FITS_ON_INT32(x) ((x) >= INT_MIN && (x) <= INT_MAX)
|
||||
#else
|
||||
#define CPL_INT64_FITS_ON_INT32(x) (((GIntBig)(int)(x)) == (x))
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
/* ==================================================================== */
|
||||
/* Other standard services. */
|
||||
/* ==================================================================== */
|
||||
#ifdef __cplusplus
|
||||
/** Macro to start a block of C symbols */
|
||||
# define CPL_C_START extern "C" {
|
||||
/** Macro to end a block of C symbols */
|
||||
# define CPL_C_END }
|
||||
#else
|
||||
# define CPL_C_START
|
||||
@@ -284,12 +369,14 @@ typedef int GPtrDiff_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/* Should optional (normally private) interfaces be exported? */
|
||||
#ifdef CPL_OPTIONAL_APIS
|
||||
# define CPL_ODLL CPL_DLL
|
||||
#else
|
||||
# define CPL_ODLL
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
#ifndef CPL_STDCALL
|
||||
#if defined(_MSC_VER) && !defined(CPL_DISABLE_STDCALL)
|
||||
@@ -299,12 +386,15 @@ typedef int GPtrDiff_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#ifdef _MSC_VER
|
||||
# define FORCE_CDECL __cdecl
|
||||
#else
|
||||
# define FORCE_CDECL
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/* TODO : support for other compilers needed */
|
||||
#if (defined(__GNUC__) && !defined(__NO_INLINE__)) || defined(_MSC_VER)
|
||||
#define HAS_CPL_INLINE 1
|
||||
@@ -315,7 +405,9 @@ typedef int GPtrDiff_t;
|
||||
#else
|
||||
#define CPL_INLINE
|
||||
#endif
|
||||
/*! @endcond*/
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
// Define NULL_AS_NULLPTR together with -std=c++11 -Wzero-as-null-pointer-constant with GCC
|
||||
// to detect misuses of NULL
|
||||
#if defined(NULL_AS_NULLPTR) && HAVE_CXX11
|
||||
@@ -359,19 +451,23 @@ extern "C++" {
|
||||
# define NULL 0
|
||||
#endif
|
||||
#endif /* defined(NULL_AS_NULLPTR) && HAVE_CXX11 */
|
||||
|
||||
/*! @endcond */
|
||||
|
||||
#ifndef MAX
|
||||
# define MIN(a,b) ((a<b) ? a : b)
|
||||
# define MAX(a,b) ((a>b) ? a : b)
|
||||
/** Macro to compute the minimum of 2 values */
|
||||
# define MIN(a,b) (((a)<(b)) ? (a) : (b))
|
||||
/** Macro to compute the maximum of 2 values */
|
||||
# define MAX(a,b) (((a)>(b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef ABS
|
||||
# define ABS(x) ((x<0) ? (-1*(x)) : x)
|
||||
/** Macro to compute the absolute value */
|
||||
# define ABS(x) (((x)<0) ? (-1*(x)) : (x))
|
||||
#endif
|
||||
|
||||
#ifndef M_PI
|
||||
# define M_PI 3.14159265358979323846
|
||||
/** PI definition */
|
||||
# define M_PI 3.14159265358979323846
|
||||
/* 3.1415926535897932384626433832795 */
|
||||
#endif
|
||||
|
||||
@@ -380,9 +476,11 @@ extern "C++" {
|
||||
/* We use fabs() function instead of ABS() macro to avoid side */
|
||||
/* effects. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#ifndef CPLIsEqual
|
||||
# define CPLIsEqual(x,y) (fabs((x) - (y)) < 0.0000000000001)
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Provide macros for case insensitive string comparisons. */
|
||||
@@ -513,10 +611,14 @@ static inline char* CPL_afl_friendly_strstr(const char* haystack, const char* ne
|
||||
# define STRCASECMP(a,b) (stricmp(a,b))
|
||||
# define STRNCASECMP(a,b,n) (strnicmp(a,b,n))
|
||||
# else
|
||||
/** Alias for strcasecmp() */
|
||||
# define STRCASECMP(a,b) (strcasecmp(a,b))
|
||||
/** Alias for strncasecmp() */
|
||||
# define STRNCASECMP(a,b,n) (strncasecmp(a,b,n))
|
||||
# endif
|
||||
/** Alias for strncasecmp() == 0 */
|
||||
# define EQUALN(a,b,n) (STRNCASECMP(a,b,n)==0)
|
||||
/** Alias for strcasecmp() == 0 */
|
||||
# define EQUAL(a,b) (STRCASECMP(a,b)==0)
|
||||
#endif
|
||||
|
||||
@@ -525,13 +627,17 @@ static inline char* CPL_afl_friendly_strstr(const char* haystack, const char* ne
|
||||
* with CI, it is a case-insensitive comparison.
|
||||
*--------------------------------------------------------------------- */
|
||||
#ifndef STARTS_WITH_CI
|
||||
/** Returns whether a starts with b */
|
||||
#define STARTS_WITH(a,b) (strncmp(a,b,strlen(b)) == 0)
|
||||
/** Returns whether a starts with b (case insensitive comparison) */
|
||||
#define STARTS_WITH_CI(a,b) EQUALN(a,b,strlen(b))
|
||||
#endif
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#ifndef CPL_THREADLOCAL
|
||||
# define CPL_THREADLOCAL
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Handle isnan() and isinf(). Note that isinf() and isnan() */
|
||||
@@ -547,10 +653,42 @@ static inline char* CPL_afl_friendly_strstr(const char* haystack, const char* ne
|
||||
# define CPLIsNan(x) _isnan(x)
|
||||
# define CPLIsInf(x) (!_isnan(x) && !_finite(x))
|
||||
# define CPLIsFinite(x) _finite(x)
|
||||
#elif defined(__cplusplus) && defined(__MINGW32__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2
|
||||
/* Hack for compatibility with ancient i586-mingw32msvc toolchain */
|
||||
extern "C++" {
|
||||
#include <cmath>
|
||||
static inline int CPLIsNan(float f) { return std::isnan(f); }
|
||||
static inline int CPLIsNan(double f) { return std::isnan(f); }
|
||||
static inline int CPLIsInf(float f) { return std::isinf(f); }
|
||||
static inline int CPLIsInf(double f) { return std::isinf(f); }
|
||||
static inline int CPLIsFinite(float f) { return std::isfinite(f); }
|
||||
static inline int CPLIsFinite(double f) { return std::isfinite(f); }
|
||||
}
|
||||
#elif defined(__GNUC__) && ( __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 4 ) )
|
||||
/* When including <cmath> in C++11 the isnan() macro is undefined, so that */
|
||||
/* std::isnan() can work (#6489). This is a GCC specific workaround for now. */
|
||||
# define CPLIsNan(x) __builtin_isnan(x)
|
||||
# define CPLIsInf(x) __builtin_isinf(x)
|
||||
# define CPLIsFinite(x) __builtin_isfinite(x)
|
||||
#else
|
||||
/** Return whether a floating-pointer number is NaN */
|
||||
#if defined(__cplusplus) && defined(__GNUC__) && defined(__linux) && !defined(__ANDROID__)
|
||||
/* so to not get warning about conversion from double to float with */
|
||||
/* gcc -Wfloat-conversion when using isnan()/isinf() macros */
|
||||
extern "C++" {
|
||||
static inline int CPLIsNan(float f) { return __isnanf(f); }
|
||||
static inline int CPLIsNan(double f) { return __isnan(f); }
|
||||
static inline int CPLIsInf(float f) { return __isinff(f); }
|
||||
static inline int CPLIsInf(double f) { return __isinf(f); }
|
||||
static inline int CPLIsFinite(float f) { return !__isnanf(f) && !__isinff(f); }
|
||||
static inline int CPLIsFinite(double f) { return !__isnan(f) && !__isinf(f); }
|
||||
}
|
||||
#else
|
||||
# define CPLIsNan(x) isnan(x)
|
||||
# ifdef isinf
|
||||
# if defined(isinf) || defined(__FreeBSD__)
|
||||
/** Return whether a floating-pointer number is +/- infinty */
|
||||
# define CPLIsInf(x) isinf(x)
|
||||
/** Return whether a floating-pointer number is finite */
|
||||
# define CPLIsFinite(x) (!isnan(x) && !isinf(x))
|
||||
# elif defined(__sun__)
|
||||
# include <ieeefp.h>
|
||||
@@ -561,7 +699,9 @@ static inline char* CPL_afl_friendly_strstr(const char* haystack, const char* ne
|
||||
# define CPLIsFinite(x) (!isnan(x))
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/*---------------------------------------------------------------------
|
||||
* CPL_LSB and CPL_MSB
|
||||
* Only one of these 2 macros should be defined and specifies the byte
|
||||
@@ -582,9 +722,11 @@ static inline char* CPL_afl_friendly_strstr(const char* haystack, const char* ne
|
||||
#else
|
||||
# define CPL_IS_LSB 0
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
extern "C++" {
|
||||
|
||||
template <bool b> struct CPLStaticAssert {};
|
||||
@@ -603,16 +745,44 @@ template<> struct CPLStaticAssert<true>
|
||||
#define CPL_STATIC_ASSERT_IF_AVAILABLE(x)
|
||||
|
||||
#endif /* __cplusplus */
|
||||
/*! @endcond */
|
||||
|
||||
/*---------------------------------------------------------------------
|
||||
* Little endian <==> big endian byte swap macros.
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#define CPL_SWAP16(x) \
|
||||
((GUInt16)( \
|
||||
(((GUInt16)(x) & 0x00ffU) << 8) | \
|
||||
(((GUInt16)(x) & 0xff00U) >> 8) ))
|
||||
/** Byte-swap a 16bit unsigned integer */
|
||||
#define CPL_SWAP16(x) ((GUInt16)( ((GUInt16)(x) << 8) | ((GUInt16)(x) >> 8) ))
|
||||
|
||||
#if defined(HAVE_GCC_BSWAP) && (defined(__i386__) || defined(__x86_64__))
|
||||
/* Could potentially be extended to other architectures but must be checked */
|
||||
/* that the intrinsic is indeed efficient */
|
||||
/* GCC (at least 4.6 or above) need that include */
|
||||
#include <x86intrin.h>
|
||||
/** Byte-swap a 32bit unsigned integer */
|
||||
#define CPL_SWAP32(x) ((GUInt32)(__builtin_bswap32((GUInt32)(x))))
|
||||
/** Byte-swap a 64bit unsigned integer */
|
||||
#define CPL_SWAP64(x) ((GUInt64)(__builtin_bswap64((GUInt64)(x))))
|
||||
#elif defined(_MSC_VER)
|
||||
#define CPL_SWAP32(x) ((GUInt32)(_byteswap_ulong((GUInt32)(x))))
|
||||
#define CPL_SWAP64(x) ((GUInt64)(_byteswap_uint64((GUInt64)(x))))
|
||||
#else
|
||||
/** Byte-swap a 32bit unsigned integer */
|
||||
#define CPL_SWAP32(x) \
|
||||
((GUInt32)( \
|
||||
(((GUInt32)(x) & (GUInt32)0x000000ffUL) << 24) | \
|
||||
(((GUInt32)(x) & (GUInt32)0x0000ff00UL) << 8) | \
|
||||
(((GUInt32)(x) & (GUInt32)0x00ff0000UL) >> 8) | \
|
||||
(((GUInt32)(x) & (GUInt32)0xff000000UL) >> 24) ))
|
||||
|
||||
/** Byte-swap a 64bit unsigned integer */
|
||||
#define CPL_SWAP64(x) \
|
||||
(((GUInt64)(CPL_SWAP32((GUInt32)(x))) << 32) | \
|
||||
(GUInt64)(CPL_SWAP32((GUInt32)((GUInt64)(x) >> 32))))
|
||||
|
||||
#endif
|
||||
|
||||
/** Byte-swap a 16 bit pointer */
|
||||
#define CPL_SWAP16PTR(x) \
|
||||
{ \
|
||||
GByte byTemp, *_pabyDataT = (GByte *) (x); \
|
||||
@@ -623,13 +793,9 @@ template<> struct CPLStaticAssert<true>
|
||||
_pabyDataT[1] = byTemp; \
|
||||
}
|
||||
|
||||
#define CPL_SWAP32(x) \
|
||||
((GUInt32)( \
|
||||
(((GUInt32)(x) & (GUInt32)0x000000ffUL) << 24) | \
|
||||
(((GUInt32)(x) & (GUInt32)0x0000ff00UL) << 8) | \
|
||||
(((GUInt32)(x) & (GUInt32)0x00ff0000UL) >> 8) | \
|
||||
(((GUInt32)(x) & (GUInt32)0xff000000UL) >> 24) ))
|
||||
#if defined(MAKE_SANITIZE_HAPPY) || !(defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64))
|
||||
|
||||
/** Byte-swap a 32 bit pointer */
|
||||
#define CPL_SWAP32PTR(x) \
|
||||
{ \
|
||||
GByte byTemp, *_pabyDataT = (GByte *) (x); \
|
||||
@@ -643,6 +809,7 @@ template<> struct CPLStaticAssert<true>
|
||||
_pabyDataT[2] = byTemp; \
|
||||
}
|
||||
|
||||
/** Byte-swap a 64 bit pointer */
|
||||
#define CPL_SWAP64PTR(x) \
|
||||
{ \
|
||||
GByte byTemp, *_pabyDataT = (GByte *) (x); \
|
||||
@@ -662,23 +829,33 @@ template<> struct CPLStaticAssert<true>
|
||||
_pabyDataT[4] = byTemp; \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/* Until we have a safe 64 bits integer data type defined, we'll replace
|
||||
* this version of the CPL_SWAP64() macro with a less efficient one.
|
||||
*/
|
||||
/*
|
||||
#define CPL_SWAP64(x) \
|
||||
((uint64)( \
|
||||
(uint64)(((uint64)(x) & (uint64)0x00000000000000ffULL) << 56) | \
|
||||
(uint64)(((uint64)(x) & (uint64)0x000000000000ff00ULL) << 40) | \
|
||||
(uint64)(((uint64)(x) & (uint64)0x0000000000ff0000ULL) << 24) | \
|
||||
(uint64)(((uint64)(x) & (uint64)0x00000000ff000000ULL) << 8) | \
|
||||
(uint64)(((uint64)(x) & (uint64)0x000000ff00000000ULL) >> 8) | \
|
||||
(uint64)(((uint64)(x) & (uint64)0x0000ff0000000000ULL) >> 24) | \
|
||||
(uint64)(((uint64)(x) & (uint64)0x00ff000000000000ULL) >> 40) | \
|
||||
(uint64)(((uint64)(x) & (uint64)0xff00000000000000ULL) >> 56) ))
|
||||
*/
|
||||
/** Byte-swap a 32 bit pointer */
|
||||
#define CPL_SWAP32PTR(x) \
|
||||
{ \
|
||||
GUInt32 _n32; \
|
||||
void* _lx = x; \
|
||||
memcpy(&_n32, _lx, 4); \
|
||||
CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 4); \
|
||||
_n32 = CPL_SWAP32(_n32); \
|
||||
memcpy(_lx, &_n32, 4); \
|
||||
}
|
||||
|
||||
/** Byte-swap a 64 bit pointer */
|
||||
#define CPL_SWAP64PTR(x) \
|
||||
{ \
|
||||
GUInt64 _n64; \
|
||||
void* _lx = x; \
|
||||
memcpy(&_n64, _lx, 8); \
|
||||
CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 8); \
|
||||
_n64 = CPL_SWAP64(_n64); \
|
||||
memcpy(_lx, &_n64, 8); \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/** Byte-swap a 64 bit pointer */
|
||||
#define CPL_SWAPDOUBLE(p) CPL_SWAP64PTR(p)
|
||||
|
||||
#ifdef CPL_MSB
|
||||
@@ -693,22 +870,36 @@ template<> struct CPLStaticAssert<true>
|
||||
# define CPL_MSBPTR64(x) CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 8)
|
||||
# define CPL_LSBPTR64(x) CPL_SWAP64PTR(x)
|
||||
#else
|
||||
/** Return a 16bit word from a originally LSB ordered word */
|
||||
# define CPL_LSBWORD16(x) (x)
|
||||
/** Return a 16bit word from a originally MSB ordered word */
|
||||
# define CPL_MSBWORD16(x) CPL_SWAP16(x)
|
||||
/** Return a 32bit word from a originally LSB ordered word */
|
||||
# define CPL_LSBWORD32(x) (x)
|
||||
/** Return a 32bit word from a originally MSB ordered word */
|
||||
# define CPL_MSBWORD32(x) CPL_SWAP32(x)
|
||||
/** Byte-swap if necessary a 16bit word at the location pointed from a originally LSB ordered pointer */
|
||||
# define CPL_LSBPTR16(x) CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 2)
|
||||
/** Byte-swap if necessary a 16bit word at the location pointed from a originally MSB ordered pointer */
|
||||
# define CPL_MSBPTR16(x) CPL_SWAP16PTR(x)
|
||||
/** Byte-swap if necessary a 32bit word at the location pointed from a originally LSB ordered pointer */
|
||||
# define CPL_LSBPTR32(x) CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 4)
|
||||
/** Byte-swap if necessary a 32bit word at the location pointed from a originally MSB ordered pointer */
|
||||
# define CPL_MSBPTR32(x) CPL_SWAP32PTR(x)
|
||||
/** Byte-swap if necessary a 64bit word at the location pointed from a originally LSB ordered pointer */
|
||||
# define CPL_LSBPTR64(x) CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 8)
|
||||
/** Byte-swap if necessary a 64bit word at the location pointed from a originally MSB ordered pointer */
|
||||
# define CPL_MSBPTR64(x) CPL_SWAP64PTR(x)
|
||||
#endif
|
||||
|
||||
/** Return a Int16 from the 2 bytes ordered in LSB order at address x */
|
||||
/** Return a Int16 from the 2 bytes ordered in LSB order at address x.
|
||||
* @deprecated Use rather CPL_LSBSINT16PTR or CPL_LSBUINT16PTR for explicit
|
||||
* signedness. */
|
||||
#define CPL_LSBINT16PTR(x) ((*(GByte*)(x)) | (*(((GByte*)(x))+1) << 8))
|
||||
|
||||
/** Return a Int32 from the 4 bytes ordered in LSB order at address x */
|
||||
/** Return a Int32 from the 4 bytes ordered in LSB order at address x.
|
||||
* @deprecated Use rather CPL_LSBSINT32PTR or CPL_LSBUINT32PTR for explicit
|
||||
* signedness. */
|
||||
#define CPL_LSBINT32PTR(x) ((*(GByte*)(x)) | (*(((GByte*)(x))+1) << 8) | \
|
||||
(*(((GByte*)(x))+2) << 16) | (*(((GByte*)(x))+3) << 24))
|
||||
|
||||
@@ -724,7 +915,7 @@ template<> struct CPLStaticAssert<true>
|
||||
/** Return a unsigned Int32 from the 4 bytes ordered in LSB order at address x */
|
||||
#define CPL_LSBUINT32PTR(x) ((GUInt32)CPL_LSBINT32PTR(x))
|
||||
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/* Utility macro to explicitly mark intentionally unreferenced parameters. */
|
||||
#ifndef UNREFERENCED_PARAM
|
||||
# ifdef UNREFERENCED_PARAMETER /* May be defined by Windows API */
|
||||
@@ -733,6 +924,7 @@ template<> struct CPLStaticAssert<true>
|
||||
# define UNREFERENCED_PARAM(param) ((void)param)
|
||||
# endif /* UNREFERENCED_PARAMETER */
|
||||
#endif /* UNREFERENCED_PARAM */
|
||||
/*! @endcond */
|
||||
|
||||
/***********************************************************************
|
||||
* Define CPL_CVSID() macro. It can be disabled during a build by
|
||||
@@ -742,6 +934,7 @@ template<> struct CPLStaticAssert<true>
|
||||
* being unused.
|
||||
*/
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#ifndef DISABLE_CVSID
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
# define CPL_CVSID(string) static const char cpl_cvsid[] __attribute__((used)) = string;
|
||||
@@ -752,74 +945,142 @@ static const char *cvsid_aw() { return( cvsid_aw() ? NULL : cpl_cvsid ); }
|
||||
#else
|
||||
# define CPL_CVSID(string)
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
/* Null terminated variadic */
|
||||
/* We exclude mingw64 4.6 which seems to be broken regarding this */
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4 && !defined(DOXYGEN_SKIP) && !(defined(__MINGW64__) && __GNUC__ == 4 && __GNUC_MINOR__ == 6)
|
||||
/** Null terminated variadic */
|
||||
# define CPL_NULL_TERMINATED __attribute__((__sentinel__))
|
||||
#else
|
||||
/** Null terminated variadic */
|
||||
# define CPL_NULL_TERMINATED
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(DOXYGEN_SKIP)
|
||||
/** Tag a function to have printf() formatting */
|
||||
#define CPL_PRINT_FUNC_FORMAT( format_idx, arg_idx ) __attribute__((__format__ (__printf__, format_idx, arg_idx)))
|
||||
/** Tag a function to have scanf() formatting */
|
||||
#define CPL_SCAN_FUNC_FORMAT( format_idx, arg_idx ) __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
|
||||
#else
|
||||
/** Tag a function to have printf() formatting */
|
||||
#define CPL_PRINT_FUNC_FORMAT( format_idx, arg_idx )
|
||||
/** Tag a function to have scanf() formatting */
|
||||
#define CPL_SCAN_FUNC_FORMAT( format_idx, arg_idx )
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1400 && (defined(GDAL_COMPILATION) || defined(CPL_ENABLE_MSVC_ANNOTATIONS))
|
||||
#include <sal.h>
|
||||
# if _MSC_VER > 1400
|
||||
/** Macro into which to wrap the format argument of a printf-like function.
|
||||
* Only used if ANALYZE=1 is specified to nmake */
|
||||
# define CPL_FORMAT_STRING(arg) _Printf_format_string_ arg
|
||||
/** Macro into which to wrap the format argument of a sscanf-like function.
|
||||
* Only used if ANALYZE=1 is specified to nmake */
|
||||
# define CPL_SCANF_FORMAT_STRING(arg) _Scanf_format_string_ arg
|
||||
# else
|
||||
/** Macro into which to wrap the format argument of a printf-like function */
|
||||
# define CPL_FORMAT_STRING(arg) __format_string arg
|
||||
/** Macro into which to wrap the format argument of a sscanf-like function. */
|
||||
# define CPL_SCANF_FORMAT_STRING(arg) arg
|
||||
# endif
|
||||
#else
|
||||
/** Macro into which to wrap the format argument of a printf-like function */
|
||||
# define CPL_FORMAT_STRING(arg) arg
|
||||
/** Macro into which to wrap the format argument of a sscanf-like function. */
|
||||
# define CPL_SCANF_FORMAT_STRING(arg) arg
|
||||
#endif /* defined(_MSC_VER) && _MSC_VER >= 1400 && defined(GDAL_COMPILATION) */
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4 && !defined(DOXYGEN_SKIP)
|
||||
/** Qualifier to warn when the return value of a function is not used */
|
||||
#define CPL_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
/** Qualifier to warn when the return value of a function is not used */
|
||||
#define CPL_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
/** Qualifier for an argument that is unused */
|
||||
# define CPL_UNUSED __attribute((__unused__))
|
||||
#else
|
||||
/* TODO: add cases for other compilers */
|
||||
/** Qualifier for an argument that is unused */
|
||||
# define CPL_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(DOXYGEN_SKIP)
|
||||
/** Qualifier for a function that does not return at all (terminates the process) */
|
||||
#define CPL_NO_RETURN __attribute__((noreturn))
|
||||
#else
|
||||
/** Qualifier for a function that does not return at all (terminates the process) */
|
||||
#define CPL_NO_RETURN
|
||||
#endif
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/* Clang __has_attribute */
|
||||
#ifndef __has_attribute
|
||||
#define __has_attribute(x) 0 // Compatibility with non-clang compilers.
|
||||
#endif
|
||||
|
||||
#if ((defined(__GNUC__) && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9))) || __has_attribute(returns_nonnull)) && !defined(DOXYGEN_SKIP)
|
||||
/*! @endcond */
|
||||
|
||||
#if ((defined(__GNUC__) && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9))) || __has_attribute(returns_nonnull)) && !defined(DOXYGEN_SKIP) && !defined(__INTEL_COMPILER)
|
||||
/** Qualifier for a function that does not return NULL */
|
||||
# define CPL_RETURNS_NONNULL __attribute__((returns_nonnull))
|
||||
#else
|
||||
/** Qualifier for a function that does not return NULL */
|
||||
# define CPL_RETURNS_NONNULL
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4 && !defined(DOXYGEN_SKIP)
|
||||
/** restrict keyword to declare that pointers do not alias */
|
||||
#define CPL_RESTRICT __restrict__
|
||||
#else
|
||||
/** restrict keyword to declare that pointers do not alias */
|
||||
#define CPL_RESTRICT
|
||||
#endif
|
||||
|
||||
/* Helper to remove the copy and assignment constructors so that the compiler
|
||||
#ifdef __cplusplus
|
||||
|
||||
#if HAVE_CXX11 || _MSC_VER >= 1500
|
||||
|
||||
/** To be used in public headers only. For non-public headers or .cpp files,
|
||||
* use override directly. */
|
||||
# define CPL_OVERRIDE override
|
||||
|
||||
#else
|
||||
|
||||
/** To be used in public headers only. For non-public headers or .cpp files,
|
||||
* use override directly. */
|
||||
# define CPL_OVERRIDE
|
||||
|
||||
/* For GDAL source compilation only, ignore override if non C++11 compiler */
|
||||
#ifdef GDAL_COMPILATION
|
||||
# define override
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_CXX11 || _MSC_VER >= 1500 */
|
||||
|
||||
#if HAVE_CXX11
|
||||
/** C++11 final qualifier */
|
||||
# define CPL_FINAL final
|
||||
|
||||
/** Helper to remove the copy and assignment constructors so that the compiler
|
||||
will not generate the default versions.
|
||||
|
||||
Must be placed in the private section of a class and should be at the end.
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
|
||||
#if HAVE_CXX11
|
||||
# define CPL_FINAL final
|
||||
# define CPL_DISALLOW_COPY_ASSIGN(ClassName) \
|
||||
ClassName( const ClassName & ) = delete; \
|
||||
ClassName &operator=( const ClassName & ) = delete;
|
||||
#else
|
||||
/** C++11 final qualifier */
|
||||
# define CPL_FINAL
|
||||
|
||||
/** Helper to remove the copy and assignment constructors so that the compiler
|
||||
will not generate the default versions.
|
||||
|
||||
Must be placed in the private section of a class and should be at the end.
|
||||
*/
|
||||
# define CPL_DISALLOW_COPY_ASSIGN(ClassName) \
|
||||
ClassName( const ClassName & ); \
|
||||
ClassName &operator=( const ClassName & );
|
||||
@@ -842,28 +1103,33 @@ static const char *cvsid_aw() { return( cvsid_aw() ? NULL : cpl_cvsid ); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) && !defined(__APPLE__)
|
||||
#if !defined(_MSC_VER) && !defined(__APPLE__) && !defined(_FORTIFY_SOURCE)
|
||||
CPL_C_START
|
||||
#ifdef WARN_STANDARD_PRINTF
|
||||
int vsnprintf(char *str, size_t size, const char* fmt, va_list args) CPL_WARN_DEPRECATED("Use CPLvsnprintf() instead");
|
||||
int snprintf(char *str, size_t size, const char* fmt, ...) CPL_PRINT_FUNC_FORMAT(3,4) CPL_WARN_DEPRECATED("Use CPLsnprintf() instead");
|
||||
int sprintf(char *str, const char* fmt, ...) CPL_PRINT_FUNC_FORMAT(2, 3) CPL_WARN_DEPRECATED("Use CPLsnprintf() instead");
|
||||
#elif defined(GDAL_COMPILATION) && !defined(DONT_DEPRECATE_SPRINTF)
|
||||
int sprintf(char *str, const char* fmt, ...) CPL_PRINT_FUNC_FORMAT(2, 3) CPL_WARN_DEPRECATED("Use snprintf() or CPLsnprintf() instead");
|
||||
#endif
|
||||
# if defined(GDAL_COMPILATION) && defined(WARN_STANDARD_PRINTF)
|
||||
int vsnprintf(char *str, size_t size, const char* fmt, va_list args)
|
||||
CPL_WARN_DEPRECATED("Use CPLvsnprintf() instead");
|
||||
int snprintf(char *str, size_t size, const char* fmt, ...)
|
||||
CPL_PRINT_FUNC_FORMAT(3,4)
|
||||
CPL_WARN_DEPRECATED("Use CPLsnprintf() instead");
|
||||
int sprintf(char *str, const char* fmt, ...)
|
||||
CPL_PRINT_FUNC_FORMAT(2, 3)
|
||||
CPL_WARN_DEPRECATED("Use CPLsnprintf() instead");
|
||||
# elif defined(GDAL_COMPILATION) && !defined(DONT_DEPRECATE_SPRINTF)
|
||||
int sprintf(char *str, const char* fmt, ...)
|
||||
CPL_PRINT_FUNC_FORMAT(2, 3)
|
||||
CPL_WARN_DEPRECATED("Use snprintf() or CPLsnprintf() instead");
|
||||
# endif /* defined(GDAL_COMPILATION) && defined(WARN_STANDARD_PRINTF) */
|
||||
CPL_C_END
|
||||
#endif /* !defined(_MSC_VER) && !defined(__APPLE__) */
|
||||
|
||||
#if defined(MAKE_SANITIZE_HAPPY) || !(defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64))
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#define CPL_CPU_REQUIRES_ALIGNED_ACCESS
|
||||
#define CPL_IS_DOUBLE_A_INT(d) ( (d) >= INT_MIN && (d) <= INT_MAX && (double)(int)(d) == (d) )
|
||||
#else
|
||||
/* This is technically unspecified behaviour if the double is out of range, but works OK on x86 */
|
||||
#define CPL_IS_DOUBLE_A_INT(d) ( (double)(int)(d) == (d) )
|
||||
/*! @endcond */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* The size of C style arrays. */
|
||||
/** Returns the size of C style arrays. */
|
||||
#define CPL_ARRAYSIZE(array) \
|
||||
((sizeof(array) / sizeof(*(array))) / \
|
||||
static_cast<size_t>(!(sizeof(array) % sizeof(*(array)))))
|
||||
@@ -883,12 +1149,15 @@ inline static bool CPL_TO_BOOL(int x) { return x != 0; }
|
||||
#define HAVE_GCC_SYSTEM_HEADER
|
||||
#endif
|
||||
|
||||
#if defined(__clang__)
|
||||
#if ((defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >=7))) || __GNUC__ >= 7) && HAVE_CXX11
|
||||
/** Macro for fallthrough in a switch case construct */
|
||||
# define CPL_FALLTHROUGH [[clang::fallthrough]];
|
||||
#else
|
||||
/** Macro for fallthrough in a switch case construct */
|
||||
# define CPL_FALLTHROUGH
|
||||
#endif
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
// Define DEBUG_BOOL to compile in "MSVC mode", ie error out when
|
||||
// a integer is assigned to a bool
|
||||
// WARNING: use only at compilation time, since it is know to not work
|
||||
@@ -970,5 +1239,6 @@ inline bool operator!= (const bool& one, const MSVCPedanticBool& other) { return
|
||||
#define VOLATILE_BOOL volatile bool
|
||||
|
||||
#endif /* defined(__cplusplus) && defined(DEBUG_BOOL) */
|
||||
/*! @endcond */
|
||||
|
||||
#endif /* ndef CPL_BASE_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id$
|
||||
* $Id: cpl_progress.h 34518 2016-07-02 21:01:34Z goatbar $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_quad_tree.h 33666 2016-03-07 05:21:07Z goatbar $
|
||||
* $Id: cpl_quad_tree.h 34931 2016-08-05 17:13:05Z rouault $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: Implementation of quadtree building and searching functions.
|
||||
@@ -50,14 +50,22 @@ CPL_C_START
|
||||
|
||||
/* Types */
|
||||
|
||||
/** Describe a rectangle */
|
||||
typedef struct {
|
||||
double minx, miny, maxx, maxy;
|
||||
double minx; /**< Minimum x */
|
||||
double miny; /**< Minimum y */
|
||||
double maxx; /**< Maximum x */
|
||||
double maxy; /**< Maximum y */
|
||||
} CPLRectObj;
|
||||
|
||||
/** Opaque type for a quad tree */
|
||||
typedef struct _CPLQuadTree CPLQuadTree;
|
||||
|
||||
/** CPLQuadTreeGetBoundsFunc */
|
||||
typedef void (*CPLQuadTreeGetBoundsFunc)(const void* hFeature, CPLRectObj* pBounds);
|
||||
/** CPLQuadTreeForeachFunc */
|
||||
typedef int (*CPLQuadTreeForeachFunc)(void* pElt, void* pUserData);
|
||||
/** CPLQuadTreeDumpFeatureFunc */
|
||||
typedef void (*CPLQuadTreeDumpFeatureFunc)(const void* hFeature, int nIndentLevel, void* pUserData);
|
||||
|
||||
/* Functions */
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: Implement SHA1
|
||||
* Author: Even Rouault, even.rouault at spatialys.com
|
||||
*
|
||||
* SHA1 computation coming from Public Domain code at:
|
||||
* https://github.com/B-Con/crypto-algorithms/blob/master/sha1.c
|
||||
* by Brad Conte (brad AT bradconte.com)
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2017, Even Rouault <even.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 CPL_SHA1_INCLUDED_H
|
||||
#define CPL_SHA1_INCLUDED_H
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#include "cpl_port.h"
|
||||
|
||||
#define CPL_SHA1_HASH_SIZE 20 // SHA1 outputs a 20 byte digest
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/* Not CPL_DLL exported */
|
||||
void CPL_HMAC_SHA1(const void *pKey, size_t nKeyLen,
|
||||
const void *pabyMessage, size_t nMessageLen,
|
||||
GByte abyDigest[CPL_SHA1_HASH_SIZE]);
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* CPL_SHA1_INCLUDED_H */
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: cpl_sha256.h 31777 2015-11-26 14:14:41Z rouault $ */
|
||||
/* $Id: cpl_sha256.h 34921 2016-08-04 22:26:31Z rouault $ */
|
||||
|
||||
/* The MIT License
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#ifndef CPL_SHA256_INCLUDED_H
|
||||
#define CPL_SHA256_INCLUDED_H
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#include "cpl_port.h"
|
||||
|
||||
#define CPL_SHA256_HASH_SIZE 32 /* 256 bit */
|
||||
@@ -65,4 +67,6 @@ void CPL_DLL CPL_HMAC_SHA256(const void *pKey, size_t nKeyLen,
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* CPL_SHA256_INCLUDED_H */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_string.h 33788 2016-03-26 00:45:58Z goatbar $
|
||||
* $Id: cpl_string.h 38064 2017-04-19 08:58:09Z rouault $
|
||||
*
|
||||
* Name: cpl_string.h
|
||||
* Project: CPL - Common Portability Library
|
||||
@@ -83,17 +83,30 @@ char CPL_DLL **CSLTokenizeString2( const char *pszString,
|
||||
const char *pszDelimiter,
|
||||
int nCSLTFlags ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
/** Flag for CSLTokenizeString2() to honour strings */
|
||||
#define CSLT_HONOURSTRINGS 0x0001
|
||||
/** Flag for CSLTokenizeString2() to allow empty tokens */
|
||||
#define CSLT_ALLOWEMPTYTOKENS 0x0002
|
||||
/** Flag for CSLTokenizeString2() to preserve quotes */
|
||||
#define CSLT_PRESERVEQUOTES 0x0004
|
||||
/** Flag for CSLTokenizeString2() to preserve escape characters */
|
||||
#define CSLT_PRESERVEESCAPES 0x0008
|
||||
/** Flag for CSLTokenizeString2() to strip leading spaces */
|
||||
#define CSLT_STRIPLEADSPACES 0x0010
|
||||
/** Flag for CSLTokenizeString2() to strip trailaing spaces */
|
||||
#define CSLT_STRIPENDSPACES 0x0020
|
||||
|
||||
int CPL_DLL CSLPrint(char **papszStrList, FILE *fpOut);
|
||||
char CPL_DLL **CSLLoad(const char *pszFname) CPL_WARN_UNUSED_RESULT;
|
||||
char CPL_DLL **CSLLoad2(const char *pszFname, int nMaxLines, int nMaxCols,
|
||||
char** papszOptions) CPL_WARN_UNUSED_RESULT;
|
||||
#ifdef __cplusplus
|
||||
char CPL_DLL **CSLLoad2(
|
||||
const char *pszFname, int nMaxLines, int nMaxCols,
|
||||
const char * const * papszOptions) CPL_WARN_UNUSED_RESULT;
|
||||
#else
|
||||
char CPL_DLL **CSLLoad2(
|
||||
const char *pszFname, int nMaxLines, int nMaxCols,
|
||||
char **papszOptions) CPL_WARN_UNUSED_RESULT;
|
||||
#endif
|
||||
int CPL_DLL CSLSave(char **papszStrList, const char *pszFname);
|
||||
|
||||
char CPL_DLL **CSLInsertStrings(char **papszStrList, int nInsertAtLineNo,
|
||||
@@ -103,42 +116,69 @@ char CPL_DLL **CSLInsertString(char **papszStrList, int nInsertAtLineNo,
|
||||
char CPL_DLL **CSLRemoveStrings(
|
||||
char **papszStrList, int nFirstLineToDelete,
|
||||
int nNumToRemove, char ***ppapszRetStrings) CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL CSLFindString( char **, const char * );
|
||||
int CPL_DLL CSLFindStringCaseSensitive( char **, const char * );
|
||||
int CPL_DLL CSLPartialFindString( char **papszHaystack,
|
||||
const char * pszNeedle );
|
||||
#ifdef __cplusplus
|
||||
int CPL_DLL CSLFindString( const char * const *papszList,
|
||||
const char *pszTarget );
|
||||
int CPL_DLL CSLFindStringCaseSensitive( const char * const *papszList,
|
||||
const char *pszTarget );
|
||||
int CPL_DLL CSLPartialFindString( const char * const *papszHaystack,
|
||||
const char *pszNeedle );
|
||||
#else
|
||||
// Present non-const to C code that does not like passing non-const to const.
|
||||
// Should be ABI compatible with the const versions.
|
||||
int CPL_DLL CSLFindString( char **papszList, const char *pszTarget );
|
||||
int CPL_DLL CSLFindStringCaseSensitive( char * const *papszList,
|
||||
const char *pszTarget );
|
||||
int CPL_DLL CSLPartialFindString( char * const *papszHaystack,
|
||||
const char *pszNeedle );
|
||||
#endif
|
||||
int CPL_DLL CSLFindName(char **papszStrList, const char *pszName);
|
||||
int CPL_DLL CSLFetchBoolean( char **papszStrList, const char *pszKey,
|
||||
int bDefault );
|
||||
|
||||
/* TODO: Deprecate CSLTestBoolean. Remove in GDAL 3.x. */
|
||||
int CPL_DLL CSLTestBoolean( const char *pszValue );
|
||||
/* Do not use CPLTestBoolean in C++ code. Use CPLTestBool. */
|
||||
int CPL_DLL CPLTestBoolean( const char *pszValue );
|
||||
|
||||
#ifdef __cplusplus
|
||||
#ifdef DO_NOT_USE_DEBUG_BOOL
|
||||
#define CPLTestBool(x) CPL_TO_BOOL(CPLTestBoolean(x))
|
||||
#else
|
||||
#define CPLFetchBool(list,key,default) \
|
||||
CPL_TO_BOOL(CSLFetchBoolean(list,key,default))
|
||||
#else /* DO_NOT_USE_DEBUG_BOOL */
|
||||
/* Prefer these for C++ code. */
|
||||
#ifdef DEBUG_BOOL
|
||||
extern "C++" {
|
||||
#endif
|
||||
bool CPL_DLL CPLTestBool( const char *pszValue );
|
||||
bool CPL_DLL CPLFetchBool( const char * const *papszStrList, const char *pszKey,
|
||||
bool bDefault );
|
||||
#ifdef DEBUG_BOOL
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
bool CPL_DLL CPLFetchBool( const char **papszStrList, const char *pszKey,
|
||||
bool bDefault );
|
||||
#endif /* __cplusplus */
|
||||
|
||||
const char CPL_DLL *
|
||||
CPLParseNameValue(const char *pszNameValue, char **ppszKey );
|
||||
CPLParseNameValue( const char *pszNameValue, char **ppszKey );
|
||||
|
||||
#ifdef __cplusplus
|
||||
const char CPL_DLL *
|
||||
CSLFetchNameValue(char **papszStrList, const char *pszName);
|
||||
CSLFetchNameValue( const char * const *papszStrList, const char *pszName);
|
||||
const char CPL_DLL *
|
||||
CSLFetchNameValueDef(char **papszStrList, const char *pszName,
|
||||
const char *pszDefault );
|
||||
CSLFetchNameValueDef( const char * const *papszStrList,
|
||||
const char *pszName,
|
||||
const char *pszDefault );
|
||||
#else
|
||||
const char CPL_DLL *
|
||||
CSLFetchNameValue( char **papszStrList, const char *pszName);
|
||||
const char CPL_DLL *
|
||||
CSLFetchNameValueDef( char **papszStrList,
|
||||
const char *pszName,
|
||||
const char *pszDefault );
|
||||
#endif
|
||||
|
||||
char CPL_DLL **
|
||||
CSLFetchNameValueMultiple(char **papszStrList, const char *pszName);
|
||||
char CPL_DLL **
|
||||
@@ -154,11 +194,17 @@ void CPL_DLL CSLSetNameValueSeparator( char ** papszStrList,
|
||||
|
||||
char CPL_DLL ** CSLParseCommandLine(const char* pszCommandLine);
|
||||
|
||||
/** Scheme for CPLEscapeString()/CPLUnescapeString() for backlash quoting */
|
||||
#define CPLES_BackslashQuotable 0
|
||||
/** Scheme for CPLEscapeString()/CPLUnescapeString() for XML */
|
||||
#define CPLES_XML 1
|
||||
/** Scheme for CPLEscapeString()/CPLUnescapeString() for URL */
|
||||
#define CPLES_URL 2
|
||||
/** Scheme for CPLEscapeString()/CPLUnescapeString() for SQL */
|
||||
#define CPLES_SQL 3
|
||||
/** Scheme for CPLEscapeString()/CPLUnescapeString() for CSV */
|
||||
#define CPLES_CSV 4
|
||||
/** Scheme for CPLEscapeString()/CPLUnescapeString() for XML (preserves quotes) */
|
||||
#define CPLES_XML_BUT_QUOTES 5
|
||||
|
||||
char CPL_DLL *CPLEscapeString( const char *pszString, int nLength,
|
||||
@@ -175,11 +221,12 @@ char CPL_DLL *CPLBase64Encode( int nBytes,
|
||||
const GByte *pabyData ) CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL CPLBase64DecodeInPlace( GByte* pszBase64 );
|
||||
|
||||
/** Type of value */
|
||||
typedef enum
|
||||
{
|
||||
CPL_VALUE_STRING,
|
||||
CPL_VALUE_REAL,
|
||||
CPL_VALUE_INTEGER
|
||||
CPL_VALUE_STRING, /**< String */
|
||||
CPL_VALUE_REAL, /**< Real number */
|
||||
CPL_VALUE_INTEGER /**< Integer */
|
||||
} CPLValueType;
|
||||
|
||||
CPLValueType CPL_DLL CPLGetValueType(const char* pszValue);
|
||||
@@ -191,42 +238,73 @@ size_t CPL_DLL CPLStrnlen(const char *pszStr, size_t nMaxLen);
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Locale independent formatting functions. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
int CPL_DLL CPLvsnprintf(char *str, size_t size, const char* fmt,
|
||||
va_list args) CPL_PRINT_FUNC_FORMAT (3, 0);
|
||||
int CPL_DLL CPLsnprintf(char *str, size_t size,
|
||||
const char* fmt, ...) CPL_PRINT_FUNC_FORMAT(3,4);
|
||||
#if defined(GDAL_COMPILATION) && !defined(DONT_DEPRECATE_SPRINTF)
|
||||
int CPL_DLL CPLsprintf(char *str, const char* fmt, ...)
|
||||
CPL_PRINT_FUNC_FORMAT(2, 3) CPL_WARN_DEPRECATED("Use CPLsnprintf instead");
|
||||
int CPL_DLL CPLvsnprintf( char *str, size_t size,
|
||||
CPL_FORMAT_STRING(const char* fmt),
|
||||
va_list args )
|
||||
CPL_PRINT_FUNC_FORMAT(3, 0 );
|
||||
|
||||
/* ALIAS_CPLSNPRINTF_AS_SNPRINTF might be defined to enable GCC 7 */
|
||||
/* -Wformat-truncation= warnings, but shouldn't be set for normal use */
|
||||
#if defined(ALIAS_CPLSNPRINTF_AS_SNPRINTF)
|
||||
#define CPLsnprintf snprintf
|
||||
#else
|
||||
int CPL_DLL CPLsprintf(char *str, const char* fmt, ...)
|
||||
int CPL_DLL CPLsnprintf( char *str, size_t size,
|
||||
CPL_FORMAT_STRING(const char* fmt), ... )
|
||||
CPL_PRINT_FUNC_FORMAT(3, 4);
|
||||
#endif
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#if defined(GDAL_COMPILATION) && !defined(DONT_DEPRECATE_SPRINTF)
|
||||
int CPL_DLL CPLsprintf( char *str, CPL_FORMAT_STRING(const char* fmt), ... )
|
||||
CPL_PRINT_FUNC_FORMAT(2, 3)
|
||||
CPL_WARN_DEPRECATED("Use CPLsnprintf instead");
|
||||
#else
|
||||
int CPL_DLL CPLsprintf( char *str, CPL_FORMAT_STRING(const char* fmt), ... )
|
||||
CPL_PRINT_FUNC_FORMAT(2, 3);
|
||||
#endif
|
||||
int CPL_DLL CPLprintf(const char* fmt, ...) CPL_PRINT_FUNC_FORMAT(1, 2);
|
||||
/* caution: only works with limited number of formats */
|
||||
int CPL_DLL CPLsscanf(const char* str, const char* fmt, ...)
|
||||
CPL_SCAN_FUNC_FORMAT(2, 3);
|
||||
/*! @endcond */
|
||||
int CPL_DLL CPLprintf( CPL_FORMAT_STRING(const char* fmt), ... )
|
||||
CPL_PRINT_FUNC_FORMAT(1, 2);
|
||||
|
||||
const char CPL_DLL *CPLSPrintf(const char *fmt, ...)
|
||||
/* For some reason Doxygen_Suppress is needed to avoid warning. Not sure why */
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/* caution: only works with limited number of formats */
|
||||
int CPL_DLL CPLsscanf( const char* str,
|
||||
CPL_SCANF_FORMAT_STRING(const char* fmt), ... )
|
||||
CPL_SCAN_FUNC_FORMAT(2, 3);
|
||||
/*! @endcond */
|
||||
|
||||
const char CPL_DLL *CPLSPrintf( CPL_FORMAT_STRING(const char *fmt), ... )
|
||||
CPL_PRINT_FUNC_FORMAT(1, 2) CPL_WARN_UNUSED_RESULT;
|
||||
char CPL_DLL **CSLAppendPrintf(char **papszStrList, const char *fmt, ...)
|
||||
char CPL_DLL **CSLAppendPrintf( char **papszStrList,
|
||||
CPL_FORMAT_STRING(const char *fmt), ... )
|
||||
CPL_PRINT_FUNC_FORMAT(2, 3) CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL CPLVASPrintf(char **buf, const char *fmt, va_list args )
|
||||
int CPL_DLL CPLVASPrintf( char **buf,
|
||||
CPL_FORMAT_STRING(const char *fmt), va_list args )
|
||||
CPL_PRINT_FUNC_FORMAT(2, 0);
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* RFC 23 character set conversion/recoding API (cpl_recode.cpp). */
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** Encoding of the current locale */
|
||||
#define CPL_ENC_LOCALE ""
|
||||
/** UTF-8 encoding */
|
||||
#define CPL_ENC_UTF8 "UTF-8"
|
||||
/** UTF-16 encoding */
|
||||
#define CPL_ENC_UTF16 "UTF-16"
|
||||
/** UCS-2 encoding */
|
||||
#define CPL_ENC_UCS2 "UCS-2"
|
||||
/** UCS-4 encoding */
|
||||
#define CPL_ENC_UCS4 "UCS-4"
|
||||
/** ASCII encoding */
|
||||
#define CPL_ENC_ASCII "ASCII"
|
||||
/** ISO-8859-1 (LATIN1) encoding */
|
||||
#define CPL_ENC_ISO8859_1 "ISO-8859-1"
|
||||
|
||||
int CPL_DLL CPLEncodingCharSize( const char *pszEncoding );
|
||||
/*! @cond Doxygen_Suppress */
|
||||
void CPL_DLL CPLClearRecodeWarningFlags( void );
|
||||
/*! @endcond */
|
||||
char CPL_DLL *CPLRecode(
|
||||
const char *pszSource, const char *pszSrcEncoding,
|
||||
const char *pszDstEncoding ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
|
||||
@@ -236,11 +314,11 @@ char CPL_DLL *CPLRecodeFromWChar(
|
||||
wchar_t CPL_DLL *CPLRecodeToWChar(
|
||||
const char *pszSource, const char *pszSrcEncoding,
|
||||
const char *pszDstEncoding ) CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL CPLIsUTF8(const char* pabyData, int nLen);
|
||||
int CPL_DLL CPLIsUTF8( const char* pabyData, int nLen );
|
||||
char CPL_DLL *CPLForceToASCII(
|
||||
const char* pabyData, int nLen,
|
||||
char chReplacementChar) CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL CPLStrlenUTF8(const char *pszUTF8Str);
|
||||
char chReplacementChar ) CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL CPLStrlenUTF8( const char *pszUTF8Str );
|
||||
|
||||
CPL_C_END
|
||||
|
||||
@@ -250,72 +328,72 @@ CPL_C_END
|
||||
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
|
||||
extern "C++"
|
||||
{
|
||||
#ifndef DOXYGEN_SKIP
|
||||
#include <string>
|
||||
|
||||
/*
|
||||
* Simple trick to avoid "using" declaration in header for new compilers
|
||||
* but make it still working with old compilers which throw C2614 errors.
|
||||
*
|
||||
* Define MSVC_OLD_STUPID_BEHAVIOUR
|
||||
* for old compilers: VC++ 5 and 6 as well as eVC++ 3 and 4.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Detect old MSVC++ compiler <= 6.0
|
||||
* 1200 - VC++ 6.0
|
||||
* 1200-1202 - eVC++ 4.0
|
||||
*/
|
||||
#if defined(_MSC_VER)
|
||||
# if (_MSC_VER <= 1202)
|
||||
# define MSVC_OLD_STUPID_BEHAVIOUR
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Avoid C2614 errors */
|
||||
#ifdef MSVC_OLD_STUPID_BEHAVIOUR
|
||||
using std::string;
|
||||
# define gdal_std_string string
|
||||
#else
|
||||
# define gdal_std_string std::string
|
||||
#endif
|
||||
|
||||
//! Convenient string class based on std::string.
|
||||
class CPL_DLL CPLString : public gdal_std_string
|
||||
class CPL_DLL CPLString : public std::string
|
||||
{
|
||||
public:
|
||||
|
||||
/** Constructor */
|
||||
CPLString(void) {}
|
||||
CPLString( const std::string &oStr ) : gdal_std_string( oStr ) {}
|
||||
CPLString( const char *pszStr ) : gdal_std_string( pszStr ) {}
|
||||
/** Constructor */
|
||||
// cppcheck-suppress noExplicitConstructor
|
||||
CPLString( const std::string &oStr ) : std::string( oStr ) {}
|
||||
/** Constructor */
|
||||
// cppcheck-suppress noExplicitConstructor
|
||||
CPLString( const char *pszStr ) : std::string( pszStr ) {}
|
||||
/** Constructor */
|
||||
CPLString( const char *pszStr, size_t n ) : std::string( pszStr, n ) {}
|
||||
|
||||
/** Return string as zero terminated character array */
|
||||
operator const char* (void) const { return c_str(); }
|
||||
|
||||
/** Return character at specified index */
|
||||
char& operator[](std::string::size_type i)
|
||||
{
|
||||
return gdal_std_string::operator[](i);
|
||||
return std::string::operator[](i);
|
||||
}
|
||||
|
||||
/** Return character at specified index */
|
||||
const char& operator[](std::string::size_type i) const
|
||||
{
|
||||
return gdal_std_string::operator[](i);
|
||||
return std::string::operator[](i);
|
||||
}
|
||||
|
||||
/** Return character at specified index */
|
||||
char& operator[](int i)
|
||||
{
|
||||
return gdal_std_string::operator[](
|
||||
return std::string::operator[](
|
||||
static_cast<std::string::size_type>(i));
|
||||
}
|
||||
|
||||
/** Return character at specified index */
|
||||
const char& operator[](int i) const
|
||||
{
|
||||
return gdal_std_string::operator[](
|
||||
return std::string::operator[](
|
||||
static_cast<std::string::size_type>(i));
|
||||
}
|
||||
|
||||
// Note: This is standard in C++11.
|
||||
#ifndef HAVE_CXX11
|
||||
/** Return last character (undefined behaviour if string is empty) */
|
||||
const char& back() const { return operator[](size()-1); }
|
||||
/** Return last character (undefined behaviour if string is empty) */
|
||||
char& back() { return operator[](size()-1); }
|
||||
#endif
|
||||
|
||||
/** Clear the string */
|
||||
void Clear() { resize(0); }
|
||||
|
||||
// NULL safe assign and free.
|
||||
void Seize(char *pszValue)
|
||||
/** Assign specified string and take ownership of it (assumed to be
|
||||
* allocated with CPLMalloc()). NULL can be safely passed to clear the
|
||||
* string. */
|
||||
void Seize( char *pszValue )
|
||||
{
|
||||
if (pszValue == NULL )
|
||||
Clear();
|
||||
@@ -329,12 +407,19 @@ public:
|
||||
/* There seems to be a bug in the way the compiler count indices...
|
||||
* Should be CPL_PRINT_FUNC_FORMAT (1, 2) */
|
||||
CPLString &Printf(
|
||||
const char *pszFormat, ... ) CPL_PRINT_FUNC_FORMAT (2, 3);
|
||||
CPL_FORMAT_STRING(const char *pszFormat), ... )
|
||||
CPL_PRINT_FUNC_FORMAT (2, 3);
|
||||
CPLString &vPrintf(
|
||||
const char *pszFormat, va_list args ) CPL_PRINT_FUNC_FORMAT(2, 0);
|
||||
CPL_FORMAT_STRING(const char *pszFormat), va_list args )
|
||||
CPL_PRINT_FUNC_FORMAT(2, 0);
|
||||
CPLString &FormatC( double dfValue, const char *pszFormat = NULL );
|
||||
CPLString &Trim();
|
||||
CPLString &Recode( const char *pszSrcEncoding, const char *pszDstEncoding );
|
||||
CPLString &replaceAll(
|
||||
const std::string &osBefore, const std::string& osAfter );
|
||||
CPLString &replaceAll( const std::string &osBefore, char chAfter );
|
||||
CPLString &replaceAll( char chBefore, const std::string &osAfter );
|
||||
CPLString &replaceAll( char chBefore, char chAfter );
|
||||
|
||||
/* case insensitive find alternates */
|
||||
size_t ifind( const std::string & str, size_t pos = 0 ) const;
|
||||
@@ -343,9 +428,11 @@ public:
|
||||
CPLString &tolower( void );
|
||||
};
|
||||
|
||||
CPLString CPLOPrintf(const char *pszFormat, ... ) CPL_PRINT_FUNC_FORMAT (1, 2);
|
||||
CPLString CPLOvPrintf(
|
||||
const char *pszFormat, va_list args) CPL_PRINT_FUNC_FORMAT (1, 0);
|
||||
CPLString CPL_DLL CPLOPrintf(CPL_FORMAT_STRING(const char *pszFormat), ... )
|
||||
CPL_PRINT_FUNC_FORMAT (1, 2);
|
||||
CPLString CPL_DLL CPLOvPrintf(
|
||||
CPL_FORMAT_STRING(const char *pszFormat), va_list args)
|
||||
CPL_PRINT_FUNC_FORMAT (1, 0);
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* URL processing functions, here since they depend on CPLString. */
|
||||
@@ -380,9 +467,13 @@ class CPL_DLL CPLStringList
|
||||
|
||||
CPLStringList &Clear();
|
||||
|
||||
/** Return size of list */
|
||||
int size() const { return Count(); }
|
||||
int Count() const;
|
||||
|
||||
/** Return whether the list is empty. */
|
||||
bool empty() const { return Count() == 0; }
|
||||
|
||||
CPLStringList &AddString( const char *pszNewString );
|
||||
CPLStringList &AddStringDirectly( char *pszNewString );
|
||||
|
||||
@@ -393,8 +484,10 @@ class CPL_DLL CPLStringList
|
||||
// CPLStringList &InsertStrings( int nInsertAtLineNo, char **papszNewLines );
|
||||
// CPLStringList &RemoveStrings( int nFirstLineToDelete, int nNumToRemove=1 );
|
||||
|
||||
/** Return index of pszTarget in the list, or -1 */
|
||||
int FindString( const char *pszTarget ) const
|
||||
{ return CSLFindString( papszList, pszTarget ); }
|
||||
/** Return index of pszTarget in the list (using partial search), or -1 */
|
||||
int PartialFindString( const char *pszNeedle ) const
|
||||
{ return CSLPartialFindString( papszList, pszNeedle ); }
|
||||
|
||||
@@ -409,25 +502,36 @@ class CPL_DLL CPLStringList
|
||||
CPLStringList &SetNameValue( const char *pszKey, const char *pszValue );
|
||||
|
||||
CPLStringList &Assign( char **papszListIn, int bTakeOwnership=TRUE );
|
||||
/** Assignment operator */
|
||||
CPLStringList &operator=(char **papszListIn) {
|
||||
return Assign( papszListIn, TRUE ); }
|
||||
/** Assignment operator */
|
||||
CPLStringList &operator=(const CPLStringList& oOther);
|
||||
|
||||
/** Return string at specified index */
|
||||
char * operator[](int i);
|
||||
/** Return string at specified index */
|
||||
char * operator[](size_t i) { return (*this)[static_cast<int>(i)]; }
|
||||
/** Return string at specified index */
|
||||
const char * operator[](int i) const;
|
||||
/** Return string at specified index */
|
||||
const char * operator[](size_t i) const {
|
||||
return (*this)[static_cast<int>(i)]; }
|
||||
|
||||
/** Return list. Ownership remains to the object */
|
||||
char **List() { return papszList; }
|
||||
char **StealList();
|
||||
|
||||
CPLStringList &Sort();
|
||||
/** Returns whether the list is sorted */
|
||||
int IsSorted() const { return bIsSorted; }
|
||||
|
||||
/** Return lists */
|
||||
operator char**(void) { return List(); }
|
||||
};
|
||||
|
||||
} // extern "C++"
|
||||
|
||||
#endif /* def __cplusplus && !CPL_SUPRESS_CPLUSPLUS */
|
||||
|
||||
#endif /* CPL_STRING_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_time.h 33783 2016-03-24 13:45:22Z goatbar $
|
||||
* $Id: cpl_time.h 34518 2016-07-02 21:01:34Z goatbar $
|
||||
*
|
||||
* Name: cpl_time.h
|
||||
* Project: CPL - Common Portability Library
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_virtualmem.h 33666 2016-03-07 05:21:07Z goatbar $
|
||||
* $Id: cpl_virtualmem.h 36485 2016-11-24 07:54:20Z goatbar $
|
||||
*
|
||||
* Name: cpl_virtualmem.h
|
||||
* Project: CPL - Common Portability Library
|
||||
@@ -31,6 +31,8 @@
|
||||
#ifndef CPL_VIRTUAL_MEM_INCLUDED
|
||||
#define CPL_VIRTUAL_MEM_INCLUDED
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "cpl_port.h"
|
||||
#include "cpl_vsi.h"
|
||||
|
||||
@@ -110,7 +112,6 @@ typedef enum
|
||||
VIRTUALMEM_READWRITE
|
||||
} CPLVirtualMemAccessMode;
|
||||
|
||||
|
||||
/** Return the size of a page of virtual memory.
|
||||
*
|
||||
* @return the page size.
|
||||
@@ -173,7 +174,6 @@ CPLVirtualMem CPL_DLL *CPLVirtualMemNew(size_t nSize,
|
||||
CPLVirtualMemFreeUserData pfnFreeUserData,
|
||||
void *pCbkUserData);
|
||||
|
||||
|
||||
/** Return if virtual memory mapping of a file is available.
|
||||
*
|
||||
* @return TRUE if virtual memory mapping of a file is available.
|
||||
@@ -384,7 +384,6 @@ void CPL_DLL CPLVirtualMemPin(CPLVirtualMem* ctxt,
|
||||
*/
|
||||
void CPL_DLL CPLVirtualMemManagerTerminate(void);
|
||||
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif /* CPL_VIRTUAL_MEM_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_vsi.h 33758 2016-03-21 09:06:22Z rouault $
|
||||
* $Id: cpl_vsi.h 37640 2017-03-07 15:20:35Z rouault $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
@@ -65,18 +65,21 @@
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#ifdef ENABLE_EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
|
||||
#define EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_WARN_UNUSED_RESULT
|
||||
#else
|
||||
#define EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
/* ==================================================================== */
|
||||
/* stdio file access functions. These may not support large */
|
||||
/* files, and don't necessarily go through the virtualization */
|
||||
/* API. */
|
||||
/* stdio file access functions. These do not support large */
|
||||
/* files, and do not go through the virtualization API. */
|
||||
/* ==================================================================== */
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
|
||||
FILE CPL_DLL * VSIFOpen( const char *, const char * ) CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL VSIFClose( FILE * );
|
||||
int CPL_DLL VSIFSeek( FILE *, long, int ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
|
||||
@@ -88,19 +91,23 @@ size_t CPL_DLL VSIFRead( void *, size_t, size_t, FILE * ) EXPERIMENTAL_CPL_WARN
|
||||
size_t CPL_DLL VSIFWrite( const void *, size_t, size_t, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
|
||||
char CPL_DLL *VSIFGets( char *, int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL VSIFPuts( const char *, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL VSIFPrintf( FILE *, const char *, ... ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_PRINT_FUNC_FORMAT(2, 3);
|
||||
int CPL_DLL VSIFPrintf( FILE *, CPL_FORMAT_STRING(const char *), ... ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_PRINT_FUNC_FORMAT(2, 3);
|
||||
|
||||
int CPL_DLL VSIFGetc( FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL VSIFPutc( int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL VSIUngetc( int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL VSIFEof( FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
/*! @endcond */
|
||||
|
||||
/* ==================================================================== */
|
||||
/* VSIStat() related. */
|
||||
/* ==================================================================== */
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
typedef struct stat VSIStatBuf;
|
||||
int CPL_DLL VSIStat( const char *, VSIStatBuf * ) CPL_WARN_UNUSED_RESULT;
|
||||
/*! @endcond */
|
||||
|
||||
#ifdef _WIN32
|
||||
# define VSI_ISLNK(x) ( 0 ) /* N/A on Windows */
|
||||
@@ -109,11 +116,16 @@ int CPL_DLL VSIStat( const char *, VSIStatBuf * ) CPL_WARN_UNUSED_RESULT;
|
||||
# define VSI_ISCHR(x) ((x) & S_IFCHR)
|
||||
# define VSI_ISBLK(x) ( 0 ) /* N/A on Windows */
|
||||
#else
|
||||
/** Test if the file is a symbolic link */
|
||||
# define VSI_ISLNK(x) S_ISLNK(x)
|
||||
/** Test if the file is a regular file */
|
||||
# define VSI_ISREG(x) S_ISREG(x)
|
||||
/** Test if the file is a directory */
|
||||
# define VSI_ISDIR(x) S_ISDIR(x)
|
||||
/*! @cond Doxygen_Suppress */
|
||||
# define VSI_ISCHR(x) S_ISCHR(x)
|
||||
# define VSI_ISBLK(x) S_ISBLK(x)
|
||||
/*! @endcond */
|
||||
#endif
|
||||
|
||||
/* ==================================================================== */
|
||||
@@ -121,17 +133,24 @@ int CPL_DLL VSIStat( const char *, VSIStatBuf * ) CPL_WARN_UNUSED_RESULT;
|
||||
/* defined, then provide prototypes for the large file API, */
|
||||
/* otherwise redefine to use the regular api. */
|
||||
/* ==================================================================== */
|
||||
|
||||
/** Type for a file offset */
|
||||
typedef GUIntBig vsi_l_offset;
|
||||
/** Maximum value for a file offset */
|
||||
#define VSI_L_OFFSET_MAX GUINTBIG_MAX
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/* Make VSIL_STRICT_ENFORCE active in DEBUG builds */
|
||||
#ifdef DEBUG
|
||||
#define VSIL_STRICT_ENFORCE
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
#ifdef VSIL_STRICT_ENFORCE
|
||||
/** Opaque type for a FILE that implements the VSIVirtualHandle API */
|
||||
typedef struct _VSILFILE VSILFILE;
|
||||
#else
|
||||
/** Opaque type for a FILE that implements the VSIVirtualHandle API */
|
||||
typedef FILE VSILFILE;
|
||||
#endif
|
||||
|
||||
@@ -147,9 +166,19 @@ size_t CPL_DLL VSIFWriteL( const void *, size_t, size_t, VSILFILE * ) EXPERIMEN
|
||||
int CPL_DLL VSIFEofL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL VSIFTruncateL( VSILFILE *, vsi_l_offset ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL VSIFFlushL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL VSIFPrintfL( VSILFILE *, const char *, ... ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_PRINT_FUNC_FORMAT(2, 3);
|
||||
int CPL_DLL VSIFPrintfL( VSILFILE *, CPL_FORMAT_STRING(const char *), ... ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_PRINT_FUNC_FORMAT(2, 3);
|
||||
int CPL_DLL VSIFPutcL( int, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
/** Range status */
|
||||
typedef enum
|
||||
{
|
||||
VSI_RANGE_STATUS_UNKNOWN, /**< Unknown */
|
||||
VSI_RANGE_STATUS_DATA, /**< Data present */
|
||||
VSI_RANGE_STATUS_HOLE /**< Hole */
|
||||
} VSIRangeStatus;
|
||||
|
||||
VSIRangeStatus CPL_DLL VSIFGetRangeStatusL( VSILFILE * fp, vsi_l_offset nStart, vsi_l_offset nLength );
|
||||
|
||||
int CPL_DLL VSIIngestFile( VSILFILE* fp,
|
||||
const char* pszFilename,
|
||||
GByte** ppabyRet,
|
||||
@@ -157,22 +186,30 @@ int CPL_DLL VSIIngestFile( VSILFILE* fp,
|
||||
GIntBig nMaxSize ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
#if defined(VSI_STAT64_T)
|
||||
/** Type for VSIStatL() */
|
||||
typedef struct VSI_STAT64_T VSIStatBufL;
|
||||
#else
|
||||
/** Type for VSIStatL() */
|
||||
#define VSIStatBufL VSIStatBuf
|
||||
#endif
|
||||
|
||||
int CPL_DLL VSIStatL( const char *, VSIStatBufL * ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
/** Flag provided to VSIStatExL() to test if the file exists */
|
||||
#define VSI_STAT_EXISTS_FLAG 0x1
|
||||
/** Flag provided to VSIStatExL() to query the nature (file/dir) of the file */
|
||||
#define VSI_STAT_NATURE_FLAG 0x2
|
||||
/** Flag provided to VSIStatExL() to query the file size */
|
||||
#define VSI_STAT_SIZE_FLAG 0x4
|
||||
/** Flag provided to VSIStatExL() to issue a VSIError in case of failure */
|
||||
#define VSI_STAT_SET_ERROR_FLAG 0x8
|
||||
|
||||
int CPL_DLL VSIStatExL( const char * pszFilename, VSIStatBufL * psStatBuf, int nFlags ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
int CPL_DLL VSIIsCaseSensitiveFS( const char * pszFilename );
|
||||
|
||||
int CPL_DLL VSISupportsSparseFiles( const char* pszPath );
|
||||
|
||||
void CPL_DLL *VSIFGetNativeFileDescriptorL( VSILFILE* );
|
||||
|
||||
/* ==================================================================== */
|
||||
@@ -185,6 +222,14 @@ void CPL_DLL VSIFree( void * );
|
||||
void CPL_DLL *VSIRealloc( void *, size_t ) CPL_WARN_UNUSED_RESULT;
|
||||
char CPL_DLL *VSIStrdup( const char * ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
void CPL_DLL *VSIMallocAligned( size_t nAlignment, size_t nSize ) CPL_WARN_UNUSED_RESULT;
|
||||
void CPL_DLL *VSIMallocAlignedAuto( size_t nSize ) CPL_WARN_UNUSED_RESULT;
|
||||
void CPL_DLL VSIFreeAligned( void* ptr );
|
||||
|
||||
void CPL_DLL *VSIMallocAlignedAutoVerbose( size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
|
||||
/** VSIMallocAlignedAutoVerbose() with FILE and LINE reporting */
|
||||
#define VSI_MALLOC_ALIGNED_AUTO_VERBOSE( size ) VSIMallocAlignedAutoVerbose(size,__FILE__,__LINE__)
|
||||
|
||||
/**
|
||||
VSIMalloc2 allocates (nSize1 * nSize2) bytes.
|
||||
In case of overflow of the multiplication, or if memory allocation fails, a
|
||||
@@ -203,26 +248,36 @@ void CPL_DLL *VSIMalloc2( size_t nSize1, size_t nSize2 ) CPL_WARN_UNUSED_RESULT;
|
||||
*/
|
||||
void CPL_DLL *VSIMalloc3( size_t nSize1, size_t nSize2, size_t nSize3 ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
|
||||
/** VSIMallocVerbose */
|
||||
void CPL_DLL *VSIMallocVerbose( size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
|
||||
/** VSI_MALLOC_VERBOSE */
|
||||
#define VSI_MALLOC_VERBOSE( size ) VSIMallocVerbose(size,__FILE__,__LINE__)
|
||||
|
||||
/** VSIMalloc2Verbose */
|
||||
void CPL_DLL *VSIMalloc2Verbose( size_t nSize1, size_t nSize2, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
|
||||
/** VSI_MALLOC2_VERBOSE */
|
||||
#define VSI_MALLOC2_VERBOSE( nSize1, nSize2 ) VSIMalloc2Verbose(nSize1,nSize2,__FILE__,__LINE__)
|
||||
|
||||
/** VSIMalloc3Verbose */
|
||||
void CPL_DLL *VSIMalloc3Verbose( size_t nSize1, size_t nSize2, size_t nSize3, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
|
||||
/** VSI_MALLOC3_VERBOSE */
|
||||
#define VSI_MALLOC3_VERBOSE( nSize1, nSize2, nSize3 ) VSIMalloc3Verbose(nSize1,nSize2,nSize3,__FILE__,__LINE__)
|
||||
|
||||
/** VSICallocVerbose */
|
||||
void CPL_DLL *VSICallocVerbose( size_t nCount, size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
|
||||
/** VSI_CALLOC_VERBOSE */
|
||||
#define VSI_CALLOC_VERBOSE( nCount, nSize ) VSICallocVerbose(nCount,nSize,__FILE__,__LINE__)
|
||||
|
||||
/** VSIReallocVerbose */
|
||||
void CPL_DLL *VSIReallocVerbose( void* pOldPtr, size_t nNewSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
|
||||
/** VSI_REALLOC_VERBOSE */
|
||||
#define VSI_REALLOC_VERBOSE( pOldPtr, nNewSize ) VSIReallocVerbose(pOldPtr,nNewSize,__FILE__,__LINE__)
|
||||
|
||||
/** VSIStrdupVerbose */
|
||||
char CPL_DLL *VSIStrdupVerbose( const char* pszStr, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
|
||||
/** VSI_STRDUP_VERBOSE */
|
||||
#define VSI_STRDUP_VERBOSE( pszStr ) VSIStrdupVerbose(pszStr,__FILE__,__LINE__)
|
||||
|
||||
|
||||
GIntBig CPL_DLL CPLGetPhysicalRAM(void);
|
||||
GIntBig CPL_DLL CPLGetUsablePhysicalRAM(void);
|
||||
|
||||
@@ -230,6 +285,7 @@ GIntBig CPL_DLL CPLGetUsablePhysicalRAM(void);
|
||||
/* Other... */
|
||||
/* ==================================================================== */
|
||||
|
||||
/** Alias of VSIReadDir() */
|
||||
#define CPLReadDir VSIReadDir
|
||||
char CPL_DLL **VSIReadDir( const char * );
|
||||
char CPL_DLL **VSIReadDirRecursive( const char *pszPath );
|
||||
@@ -245,12 +301,16 @@ GIntBig CPL_DLL VSIGetDiskFreeSpace(const char *pszDirname);
|
||||
/* Install special file access handlers. */
|
||||
/* ==================================================================== */
|
||||
void CPL_DLL VSIInstallMemFileHandler(void);
|
||||
/*! @cond Doxygen_Suppress */
|
||||
void CPL_DLL VSIInstallLargeFileHandler(void);
|
||||
/*! @endcond */
|
||||
void CPL_DLL VSIInstallSubFileHandler(void);
|
||||
void VSIInstallCurlFileHandler(void);
|
||||
void VSIInstallCurlStreamingFileHandler(void);
|
||||
void VSIInstallS3FileHandler(void);
|
||||
void VSIInstallS3StreamingFileHandler(void);
|
||||
void VSIInstallGSFileHandler(void);
|
||||
void VSIInstallGSStreamingFileHandler(void);
|
||||
void VSIInstallGZipFileHandler(void); /* No reason to export that */
|
||||
void VSIInstallZipFileHandler(void); /* No reason to export that */
|
||||
void VSIInstallStdinHandler(void); /* No reason to export that */
|
||||
@@ -259,7 +319,9 @@ void CPL_DLL VSIInstallSparseFileHandler(void);
|
||||
void VSIInstallTarFileHandler(void); /* No reason to export that */
|
||||
void CPL_DLL VSIInstallCryptFileHandler(void);
|
||||
void CPL_DLL VSISetCryptKey(const GByte* pabyKey, int nKeySize);
|
||||
/*! @cond Doxygen_Suppress */
|
||||
void CPL_DLL VSICleanupFileManager(void);
|
||||
/*! @endcond */
|
||||
|
||||
VSILFILE CPL_DLL *VSIFileFromMemBuffer( const char *pszFilename,
|
||||
GByte *pabyData,
|
||||
@@ -269,6 +331,7 @@ GByte CPL_DLL *VSIGetMemFileBuffer( const char *pszFilename,
|
||||
vsi_l_offset *pnDataLength,
|
||||
int bUnlinkAndSeize );
|
||||
|
||||
/** Callback used by VSIStdoutSetRedirection() */
|
||||
typedef size_t (*VSIWriteFunction)(const void* ptr, size_t size, size_t nmemb, FILE* stream);
|
||||
void CPL_DLL VSIStdoutSetRedirection( VSIWriteFunction pFct, FILE* stream );
|
||||
|
||||
@@ -276,13 +339,16 @@ void CPL_DLL VSIStdoutSetRedirection( VSIWriteFunction pFct, FILE* stream );
|
||||
/* Time querying. */
|
||||
/* ==================================================================== */
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
unsigned long CPL_DLL VSITime( unsigned long * );
|
||||
const char CPL_DLL *VSICTime( unsigned long );
|
||||
struct tm CPL_DLL *VSIGMTime( const time_t *pnTime,
|
||||
struct tm *poBrokenTime );
|
||||
struct tm CPL_DLL *VSILocalTime( const time_t *pnTime,
|
||||
struct tm *poBrokenTime );
|
||||
/*! @endcond */
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* the following can be turned on for detailed logging of */
|
||||
/* almost all IO calls. */
|
||||
@@ -305,6 +371,7 @@ struct tm CPL_DLL *VSILocalTime( const time_t *pnTime,
|
||||
#define VSIDebug2( f, a1, a2 ) {}
|
||||
#define VSIDebug1( f, a1 ) {}
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
CPL_C_END
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_vsi_error.h 33758 2016-03-21 09:06:22Z rouault $
|
||||
* $Id: cpl_vsi_error.h 36769 2016-12-10 01:44:43Z goatbar $
|
||||
*
|
||||
* Project: VSI Virtual File System
|
||||
* Purpose: Implement an error system for reporting file system errors.
|
||||
@@ -54,13 +54,16 @@ typedef int VSIErrorNum;
|
||||
#define VSIE_AWSInvalidCredentials 9
|
||||
#define VSIE_AWSSignatureDoesNotMatch 10
|
||||
|
||||
void CPL_DLL VSIError(VSIErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (2, 3);
|
||||
void CPL_DLL VSIError( VSIErrorNum err_no,
|
||||
CPL_FORMAT_STRING(const char *fmt), ... )
|
||||
CPL_PRINT_FUNC_FORMAT (2, 3);
|
||||
|
||||
void CPL_DLL CPL_STDCALL VSIErrorReset( void );
|
||||
VSIErrorNum CPL_DLL CPL_STDCALL VSIGetLastErrorNo( void );
|
||||
const char CPL_DLL * CPL_STDCALL VSIGetLastErrorMsg( void );
|
||||
|
||||
int CPL_DLL CPL_STDCALL VSIToCPLError(CPLErr eErrClass, CPLErrorNum eDefaultErrorNo);
|
||||
int CPL_DLL CPL_STDCALL VSIToCPLError( CPLErr eErrClass,
|
||||
CPLErrorNum eDefaultErrorNo );
|
||||
|
||||
CPL_C_END
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_vsi_virtual.h 33759 2016-03-21 09:33:06Z rouault $
|
||||
* $Id: cpl_vsi_virtual.h 36501 2016-11-25 14:09:24Z rouault $
|
||||
*
|
||||
* Project: VSI Virtual File System
|
||||
* Purpose: Declarations for classes related to the virtual filesystem.
|
||||
@@ -43,22 +43,35 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
// To avoid aliasing to GetDiskFreeSpace to GetDiskFreeSpaceA on Windows
|
||||
#ifdef GetDiskFreeSpace
|
||||
#undef GetDiskFreeSpace
|
||||
#endif
|
||||
|
||||
/************************************************************************/
|
||||
/* VSIVirtualHandle */
|
||||
/************************************************************************/
|
||||
|
||||
/** Virtual file handle */
|
||||
class CPL_DLL VSIVirtualHandle {
|
||||
public:
|
||||
virtual int Seek( vsi_l_offset nOffset, int nWhence ) = 0;
|
||||
virtual vsi_l_offset Tell() = 0;
|
||||
virtual size_t Read( void *pBuffer, size_t nSize, size_t nMemb ) = 0;
|
||||
virtual int ReadMultiRange( int nRanges, void ** ppData, const vsi_l_offset* panOffsets, const size_t* panSizes );
|
||||
virtual size_t Write( const void *pBuffer, size_t nSize,size_t nMemb)=0;
|
||||
virtual size_t Read( void *pBuffer, size_t nSize, size_t nCount ) = 0;
|
||||
virtual int ReadMultiRange( int nRanges, void ** ppData,
|
||||
const vsi_l_offset* panOffsets,
|
||||
const size_t* panSizes );
|
||||
virtual size_t Write( const void *pBuffer, size_t nSize,size_t nCount)=0;
|
||||
virtual int Eof() = 0;
|
||||
virtual int Flush() {return 0;}
|
||||
virtual int Close() = 0;
|
||||
virtual int Truncate( CPL_UNUSED vsi_l_offset nNewSize ) { return -1; }
|
||||
// Base implementation that only supports file extension.
|
||||
virtual int Truncate( vsi_l_offset nNewSize );
|
||||
virtual void *GetNativeFileDescriptor() { return NULL; }
|
||||
virtual VSIRangeStatus GetRangeStatus( CPL_UNUSED vsi_l_offset nOffset,
|
||||
CPL_UNUSED vsi_l_offset nLength )
|
||||
{ return VSI_RANGE_STATUS_UNKNOWN; }
|
||||
|
||||
virtual ~VSIVirtualHandle() { }
|
||||
};
|
||||
|
||||
@@ -66,6 +79,7 @@ class CPL_DLL VSIVirtualHandle {
|
||||
/* VSIFilesystemHandler */
|
||||
/************************************************************************/
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
class CPL_DLL VSIFilesystemHandler {
|
||||
|
||||
public:
|
||||
@@ -94,12 +108,15 @@ public:
|
||||
virtual int IsCaseSensitive( const char* pszFilename )
|
||||
{ (void) pszFilename; return TRUE; }
|
||||
virtual GIntBig GetDiskFreeSpace( const char* /* pszDirname */ ) { return -1; }
|
||||
virtual int SupportsSparseFiles( const char* /* pszPath */ ) { return FALSE; }
|
||||
};
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
/************************************************************************/
|
||||
/* VSIFileManager */
|
||||
/************************************************************************/
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
class CPL_DLL VSIFileManager
|
||||
{
|
||||
private:
|
||||
@@ -119,7 +136,7 @@ public:
|
||||
/* RemoveHandler is never defined. */
|
||||
/* static void RemoveHandler( const std::string& osPrefix ); */
|
||||
};
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
/************************************************************************/
|
||||
/* ==================================================================== */
|
||||
@@ -127,6 +144,8 @@ public:
|
||||
/* ==================================================================== */
|
||||
/************************************************************************/
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
class VSIArchiveEntryFileOffset
|
||||
{
|
||||
public:
|
||||
@@ -185,12 +204,12 @@ public:
|
||||
VSIArchiveFilesystemHandler();
|
||||
virtual ~VSIArchiveFilesystemHandler();
|
||||
|
||||
virtual int Stat( const char *pszFilename, VSIStatBufL *pStatBuf, int nFlags );
|
||||
virtual int Unlink( const char *pszFilename );
|
||||
virtual int Rename( const char *oldpath, const char *newpath );
|
||||
virtual int Mkdir( const char *pszDirname, long nMode );
|
||||
virtual int Rmdir( const char *pszDirname );
|
||||
virtual char **ReadDirEx( const char *pszDirname, int nMaxFiles );
|
||||
virtual int Stat( const char *pszFilename, VSIStatBufL *pStatBuf, int nFlags ) CPL_OVERRIDE;
|
||||
virtual int Unlink( const char *pszFilename ) CPL_OVERRIDE;
|
||||
virtual int Rename( const char *oldpath, const char *newpath ) CPL_OVERRIDE;
|
||||
virtual int Mkdir( const char *pszDirname, long nMode ) CPL_OVERRIDE;
|
||||
virtual int Rmdir( const char *pszDirname ) CPL_OVERRIDE;
|
||||
virtual char **ReadDirEx( const char *pszDirname, int nMaxFiles ) CPL_OVERRIDE;
|
||||
|
||||
virtual const VSIArchiveContent* GetContentOfArchive(const char* archiveFilename, VSIArchiveReader* poReader = NULL);
|
||||
virtual char* SplitFilename(const char *pszFilename, CPLString &osFileInArchive, int bCheckMainFileExists);
|
||||
@@ -198,11 +217,13 @@ public:
|
||||
virtual int FindFileInArchive(const char* archiveFilename, const char* fileInArchiveName, const VSIArchiveEntry** archiveEntry);
|
||||
};
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
VSIVirtualHandle CPL_DLL *VSICreateBufferedReaderHandle(VSIVirtualHandle* poBaseHandle);
|
||||
VSIVirtualHandle* VSICreateBufferedReaderHandle(VSIVirtualHandle* poBaseHandle,
|
||||
const GByte* pabyBeginningContent,
|
||||
vsi_l_offset nCheatFileSize);
|
||||
VSIVirtualHandle* VSICreateCachedFile( VSIVirtualHandle* poBaseHandle, size_t nChunkSize = 32768, size_t nCacheSize = 0 );
|
||||
VSIVirtualHandle CPL_DLL *VSICreateCachedFile( VSIVirtualHandle* poBaseHandle, size_t nChunkSize = 32768, size_t nCacheSize = 0 );
|
||||
VSIVirtualHandle CPL_DLL *VSICreateGZipWritable( VSIVirtualHandle* poBaseHandle, int bRegularZLibIn, int bAutoCloseBaseHandle );
|
||||
|
||||
#endif /* ndef CPL_VSI_VIRTUAL_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_vsil_curl_priv.h 31749 2015-11-25 02:32:55Z goatbar $
|
||||
* $Id: cpl_vsil_curl_priv.h 36772 2016-12-10 06:29:22Z goatbar $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: Private API for VSICurl
|
||||
@@ -32,18 +32,22 @@
|
||||
|
||||
#include "cpl_vsi_virtual.h"
|
||||
|
||||
/* NOTE: this is private API for GDAL internal use. May change without notice. */
|
||||
/* Used by the MBTiles driver for now */
|
||||
/* NOTE: this is private API for GDAL internal use. */
|
||||
/* May change without notice. */
|
||||
/* Used by the MBTiles driver for now. */
|
||||
|
||||
/* Return TRUE to go on downloading, FALSE to stop */
|
||||
typedef int (*VSICurlReadCbkFunc) (VSILFILE* fp, void *pabyBuffer, size_t nBufferSize, void* pfnUserData);
|
||||
/* Return TRUE to go on downloading, FALSE to stop. */
|
||||
typedef int (*VSICurlReadCbkFunc) (VSILFILE* fp, void *pabyBuffer,
|
||||
size_t nBufferSize, void* pfnUserData);
|
||||
|
||||
/* fp must be a VSICurl file handle, otherwise bad things will happen ! */
|
||||
/* bStopOnInterrruptUntilUninstall must be set to TRUE if all downloads */
|
||||
/* must be canceled after a first one has been stopped by the callback function. */
|
||||
/* In that case, downloads will restart after uninstalling the callback. */
|
||||
int VSICurlInstallReadCbk(VSILFILE* fp, VSICurlReadCbkFunc pfnReadCbk, void* pfnUserData,
|
||||
int bStopOnInterrruptUntilUninstall);
|
||||
int VSICurlUninstallReadCbk(VSILFILE* fp);
|
||||
/* fp must be a VSICurl file handle, otherwise bad things will happen. */
|
||||
/* bStopOnInterruptUntilUninstall must be set to TRUE if all downloads */
|
||||
/* must be canceled after a first one has been stopped by the callback */
|
||||
/* function. In that case, downloads will restart after uninstalling the */
|
||||
/* callback. */
|
||||
int VSICurlInstallReadCbk( VSILFILE* fp, VSICurlReadCbkFunc pfnReadCbk,
|
||||
void* pfnUserData,
|
||||
int bStopOnInterruptUntilUninstall );
|
||||
int VSICurlUninstallReadCbk( VSILFILE* fp );
|
||||
|
||||
#endif // CPL_VSIL_CURL_PRIV_H_INCLUDED
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_worker_thread_pool.h 33666 2016-03-07 05:21:07Z goatbar $
|
||||
* $Id: cpl_worker_thread_pool.h 37003 2016-12-23 14:54:07Z goatbar $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: CPL worker thread pool
|
||||
@@ -41,6 +41,7 @@
|
||||
* @since GDAL 2.1
|
||||
*/
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
class CPLWorkerThreadPool;
|
||||
|
||||
typedef struct
|
||||
@@ -56,7 +57,7 @@ typedef struct
|
||||
CPLWorkerThreadPool *poTP;
|
||||
CPLJoinableThread *hThread;
|
||||
int bMarkedAsWaiting;
|
||||
//CPLWorkerThreadJob *psNextJob;
|
||||
// CPLWorkerThreadJob *psNextJob;
|
||||
|
||||
CPLMutex *hMutex;
|
||||
CPLCond *hCond;
|
||||
@@ -68,7 +69,9 @@ typedef enum
|
||||
CPLWTS_STOP,
|
||||
CPLWTS_ERROR
|
||||
} CPLWorkerThreadState;
|
||||
#endif // ndef DOXYGEN_SKIP
|
||||
|
||||
/** Pool of worker threads */
|
||||
class CPL_DLL CPLWorkerThreadPool
|
||||
{
|
||||
std::vector<CPLWorkerThread> aWT;
|
||||
@@ -97,6 +100,7 @@ class CPL_DLL CPLWorkerThreadPool
|
||||
bool SubmitJobs(CPLThreadFunc pfnFunc, const std::vector<void*>& apData);
|
||||
void WaitCompletion(int nMaxRemainingJobs = 0);
|
||||
|
||||
/** Return the number of threads setup */
|
||||
int GetThreadCount() const { return (int)aWT.size(); }
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cplkeywordparser.h 33666 2016-03-07 05:21:07Z goatbar $
|
||||
* $Id: cplkeywordparser.h 34931 2016-08-05 17:13:05Z rouault $
|
||||
*
|
||||
* Project: Common Portability Library
|
||||
* Purpose: Implementation of CPLKeywordParser - a class for parsing
|
||||
@@ -41,6 +41,8 @@
|
||||
/* ==================================================================== */
|
||||
/************************************************************************/
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
|
||||
class CPLKeywordParser
|
||||
{
|
||||
char **papszKeywordList;
|
||||
@@ -63,4 +65,6 @@ public:
|
||||
char **GetAllKeywords() { return papszKeywordList; }
|
||||
};
|
||||
|
||||
/*! @endcond */
|
||||
|
||||
#endif /* def CPL_KEYWORD_PARSER */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal.h 33852 2016-04-01 23:27:53Z goatbar $
|
||||
* $Id: gdal.h 37723 2017-03-16 17:07:53Z rouault $
|
||||
*
|
||||
* Project: GDAL Core
|
||||
* Purpose: GDAL Core C/Public declarations.
|
||||
@@ -78,17 +78,18 @@ const char CPL_DLL * CPL_STDCALL GDALGetDataTypeName( GDALDataType );
|
||||
GDALDataType CPL_DLL CPL_STDCALL GDALGetDataTypeByName( const char * );
|
||||
GDALDataType CPL_DLL CPL_STDCALL GDALDataTypeUnion( GDALDataType, GDALDataType );
|
||||
double CPL_DLL GDALAdjustValueToDataType( GDALDataType eDT, double dfValue, int* pbClamped, int* pbRounded );
|
||||
GDALDataType CPL_STDCALL GDALGetNonComplexDataType( GDALDataType );
|
||||
|
||||
/**
|
||||
* status of the asynchronous stream
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GARIO_PENDING = 0,
|
||||
GARIO_UPDATE = 1,
|
||||
GARIO_ERROR = 2,
|
||||
GARIO_COMPLETE = 3,
|
||||
GARIO_TypeCount = 4
|
||||
GARIO_PENDING = 0,
|
||||
GARIO_UPDATE = 1,
|
||||
GARIO_ERROR = 2,
|
||||
GARIO_COMPLETE = 3,
|
||||
GARIO_TypeCount = 4
|
||||
} GDALAsyncStatusType;
|
||||
|
||||
const char CPL_DLL * CPL_STDCALL GDALGetAsyncStatusTypeName( GDALAsyncStatusType );
|
||||
@@ -157,7 +158,9 @@ typedef struct
|
||||
double dfYSize;
|
||||
} GDALRasterIOExtraArg;
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
#define RASTERIO_EXTRA_ARG_CURRENT_VERSION 1
|
||||
#endif
|
||||
|
||||
/** Macro to initialize an instance of GDALRasterIOExtraArg structure.
|
||||
* @since GDAL 2.0
|
||||
@@ -208,8 +211,14 @@ const char CPL_DLL *GDALGetPaletteInterpretationName( GDALPaletteInterp );
|
||||
|
||||
/* "well known" metadata items. */
|
||||
|
||||
/** Metadata item for dataset that indicates the spatial interpreation of a
|
||||
* pixel */
|
||||
#define GDALMD_AREA_OR_POINT "AREA_OR_POINT"
|
||||
/** Value for GDALMD_AREA_OR_POINT that indicates that a pixel represents an
|
||||
* area */
|
||||
# define GDALMD_AOP_AREA "Area"
|
||||
/** Value for GDALMD_AREA_OR_POINT that indicates that a pixel represents a
|
||||
* point */
|
||||
# define GDALMD_AOP_POINT "Point"
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
@@ -217,7 +226,9 @@ const char CPL_DLL *GDALGetPaletteInterpretationName( GDALPaletteInterp );
|
||||
/* */
|
||||
/* error codes 100 to 299 reserved for GDAL. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
#ifndef DOXYGEN_SKIP
|
||||
#define CPLE_WrongFormat (CPLErrorNum)200
|
||||
#endif
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Define handle types related to various internal classes. */
|
||||
@@ -346,11 +357,15 @@ GDALCreateCopy( GDALDriverH, const char *, GDALDatasetH,
|
||||
|
||||
GDALDriverH CPL_DLL CPL_STDCALL GDALIdentifyDriver( const char * pszFilename,
|
||||
char ** papszFileList );
|
||||
|
||||
GDALDriverH CPL_DLL CPL_STDCALL GDALIdentifyDriverEx(
|
||||
const char *pszFilename, unsigned int nIdentifyFlags,
|
||||
const char *const *papszAllowedDrivers, const char *const *papszFileList);
|
||||
|
||||
GDALDatasetH CPL_DLL CPL_STDCALL
|
||||
GDALOpen( const char *pszFilename, GDALAccess eAccess ) CPL_WARN_UNUSED_RESULT;
|
||||
GDALDatasetH CPL_DLL CPL_STDCALL GDALOpenShared( const char *, GDALAccess ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
|
||||
/* Note: we define GDAL_OF_READONLY and GDAL_OF_UPDATE to be on purpose */
|
||||
/* equals to GA_ReadOnly and GA_Update */
|
||||
|
||||
@@ -384,7 +399,6 @@ GDALDatasetH CPL_DLL CPL_STDCALL GDALOpenShared( const char *, GDALAccess ) CPL_
|
||||
*/
|
||||
#define GDAL_OF_VECTOR 0x04
|
||||
|
||||
|
||||
/** Allow gnm drivers to be used.
|
||||
* Used by GDALOpenEx().
|
||||
* @since GDAL 2.1
|
||||
@@ -449,8 +463,14 @@ GDALDatasetH CPL_DLL CPL_STDCALL GDALOpenShared( const char *, GDALAccess ) CPL_
|
||||
*/
|
||||
#define GDAL_OF_HASHSET_BLOCK_ACCESS 0x200
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
/* Reserved for a potential future alternative to GDAL_OF_ARRAY_BLOCK_ACCESS
|
||||
* and GDAL_OF_HASHSET_BLOCK_ACCESS */
|
||||
#define GDAL_OF_RESERVED_1 0x300
|
||||
|
||||
/** Mask to detect the block access method */
|
||||
#define GDAL_OF_BLOCK_ACCESS_MASK 0x300
|
||||
#endif
|
||||
|
||||
GDALDatasetH CPL_DLL CPL_STDCALL GDALOpenEx( const char* pszFilename,
|
||||
unsigned int nOpenFlags,
|
||||
@@ -467,7 +487,9 @@ void CPL_DLL CPL_STDCALL GDALDestroyDriver( GDALDriverH );
|
||||
int CPL_DLL CPL_STDCALL GDALRegisterDriver( GDALDriverH );
|
||||
void CPL_DLL CPL_STDCALL GDALDeregisterDriver( GDALDriverH );
|
||||
void CPL_DLL CPL_STDCALL GDALDestroyDriverManager( void );
|
||||
#ifndef DOXYGEN_SKIP
|
||||
void CPL_DLL GDALDestroy( void );
|
||||
#endif
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALDeleteDataset( GDALDriverH, const char * );
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALRenameDataset( GDALDriverH,
|
||||
const char * pszNewName,
|
||||
@@ -548,6 +570,7 @@ void CPL_DLL CPL_STDCALL GDALSetDescription( GDALMajorObjectH, const char * );
|
||||
/* GDALDataset class ... normally this represents one file. */
|
||||
/* ==================================================================== */
|
||||
|
||||
/** Name of driver metadata item for layer creation option list */
|
||||
#define GDAL_DS_LAYER_CREATIONOPTIONLIST "DS_LAYER_CREATIONOPTIONLIST"
|
||||
|
||||
GDALDriverH CPL_DLL CPL_STDCALL GDALGetDatasetDriver( GDALDatasetH );
|
||||
@@ -606,6 +629,7 @@ CPLErr CPL_DLL CPL_STDCALL GDALSetGCPs( GDALDatasetH, int, const GDAL_GCP *,
|
||||
void CPL_DLL * CPL_STDCALL GDALGetInternalHandle( GDALDatasetH, const char * );
|
||||
int CPL_DLL CPL_STDCALL GDALReferenceDataset( GDALDatasetH );
|
||||
int CPL_DLL CPL_STDCALL GDALDereferenceDataset( GDALDatasetH );
|
||||
int CPL_DLL CPL_STDCALL GDALReleaseDataset( GDALDatasetH );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALBuildOverviews( GDALDatasetH, const char *, int, int *,
|
||||
@@ -622,7 +646,8 @@ CPLErr CPL_DLL CPL_STDCALL GDALDatasetCopyWholeRaster(
|
||||
GDALProgressFunc pfnProgress, void *pProgressData ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALRasterBandCopyWholeRaster(
|
||||
GDALRasterBandH hSrcBand, GDALRasterBandH hDstBand, char **papszOptions,
|
||||
GDALRasterBandH hSrcBand, GDALRasterBandH hDstBand,
|
||||
const char * const * constpapszOptions,
|
||||
GDALProgressFunc pfnProgress, void *pProgressData ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
CPLErr CPL_DLL
|
||||
@@ -640,6 +665,12 @@ OGRLayerH CPL_DLL GDALDatasetCreateLayer( GDALDatasetH, const char *,
|
||||
char ** );
|
||||
OGRLayerH CPL_DLL GDALDatasetCopyLayer( GDALDatasetH, OGRLayerH, const char *,
|
||||
char ** );
|
||||
void CPL_DLL GDALDatasetResetReading( GDALDatasetH );
|
||||
OGRFeatureH CPL_DLL GDALDatasetGetNextFeature( GDALDatasetH hDS,
|
||||
OGRLayerH* phBelongingLayer,
|
||||
double* pdfProgressPct,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void* pProgressData );
|
||||
int CPL_DLL GDALDatasetTestCapability( GDALDatasetH, const char * );
|
||||
OGRLayerH CPL_DLL GDALDatasetExecuteSQL( GDALDatasetH, const char *,
|
||||
OGRGeometryH, const char * );
|
||||
@@ -651,7 +682,6 @@ OGRErr CPL_DLL GDALDatasetStartTransaction(GDALDatasetH hDS, int bForce);
|
||||
OGRErr CPL_DLL GDALDatasetCommitTransaction(GDALDatasetH hDS);
|
||||
OGRErr CPL_DLL GDALDatasetRollbackTransaction(GDALDatasetH hDS);
|
||||
|
||||
|
||||
/* ==================================================================== */
|
||||
/* GDALRasterBand ... one band/channel in a dataset. */
|
||||
/* ==================================================================== */
|
||||
@@ -684,16 +714,22 @@ OGRErr CPL_DLL GDALDatasetRollbackTransaction(GDALDatasetH hDS);
|
||||
(eSrcType == GDT_CFloat64 ? \
|
||||
((double *)papoSource)[ii * 2] : 0)))))))))))
|
||||
|
||||
/** Type of functions to pass to GDALAddDerivedBandPixelFunc.
|
||||
* @since GDAL 2.2 */
|
||||
typedef CPLErr
|
||||
(*GDALDerivedPixelFunc)(void **papoSources, int nSources, void *pData,
|
||||
int nBufXSize, int nBufYSize,
|
||||
GDALDataType eSrcType, GDALDataType eBufType,
|
||||
int nBufXSize, int nBufYSize,
|
||||
GDALDataType eSrcType, GDALDataType eBufType,
|
||||
int nPixelSpace, int nLineSpace);
|
||||
|
||||
GDALDataType CPL_DLL CPL_STDCALL GDALGetRasterDataType( GDALRasterBandH );
|
||||
void CPL_DLL CPL_STDCALL
|
||||
GDALGetBlockSize( GDALRasterBandH, int * pnXSize, int * pnYSize );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALGetActualBlockSize( GDALRasterBandH, int nXBlockOff, int nYBlockOff,
|
||||
int *pnXValid, int *pnYValid );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALRasterAdviseRead( GDALRasterBandH hRB,
|
||||
int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
|
||||
int nBXSize, int nBYSize, GDALDataType eBDataType, char **papszOptions );
|
||||
@@ -815,11 +851,42 @@ int CPL_DLL CPL_STDCALL GDALGetMaskFlags( GDALRasterBandH hBand );
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALCreateMaskBand( GDALRasterBandH hBand, int nFlags );
|
||||
|
||||
/** Flag returned by GDALGetMaskFlags() to indicate that all pixels are valid */
|
||||
#define GMF_ALL_VALID 0x01
|
||||
/** Flag returned by GDALGetMaskFlags() to indicate that the mask band is
|
||||
* valid for all bands */
|
||||
#define GMF_PER_DATASET 0x02
|
||||
/** Flag returned by GDALGetMaskFlags() to indicate that the mask band is
|
||||
* an alpha band */
|
||||
#define GMF_ALPHA 0x04
|
||||
/** Flag returned by GDALGetMaskFlags() to indicate that the mask band is
|
||||
* computed from nodata values */
|
||||
#define GMF_NODATA 0x08
|
||||
|
||||
/** Flag returned by GDALGetDataCoverageStatus() when the driver does not
|
||||
* implement GetDataCoverageStatus(). This flag should be returned together
|
||||
* with GDAL_DATA_COVERAGE_STATUS_DATA */
|
||||
#define GDAL_DATA_COVERAGE_STATUS_UNIMPLEMENTED 0x01
|
||||
|
||||
/** Flag returned by GDALGetDataCoverageStatus() when there is (potentially)
|
||||
* data in the queried window. Can be combined with the binary or operator
|
||||
* with GDAL_DATA_COVERAGE_STATUS_UNIMPLEMENTED or
|
||||
* GDAL_DATA_COVERAGE_STATUS_EMPTY */
|
||||
#define GDAL_DATA_COVERAGE_STATUS_DATA 0x02
|
||||
|
||||
/** Flag returned by GDALGetDataCoverageStatus() when there is nodata in the
|
||||
* queried window. This is typically identified by the concept of missing block
|
||||
* in formats that supports it.
|
||||
* Can be combined with the binary or operator with
|
||||
* GDAL_DATA_COVERAGE_STATUS_DATA */
|
||||
#define GDAL_DATA_COVERAGE_STATUS_EMPTY 0x04
|
||||
|
||||
int CPL_DLL CPL_STDCALL GDALGetDataCoverageStatus( GDALRasterBandH hBand,
|
||||
int nXOff, int nYOff,
|
||||
int nXSize, int nYSize,
|
||||
int nMaskFlagStop,
|
||||
double* pdfDataPct );
|
||||
|
||||
/* ==================================================================== */
|
||||
/* GDALAsyncReader */
|
||||
/* ==================================================================== */
|
||||
@@ -843,8 +910,10 @@ void CPL_DLL CPL_STDCALL GDALSwapWordsEx( void *pData, int nWordSize, size_t nWo
|
||||
int nWordSkip );
|
||||
|
||||
void CPL_DLL CPL_STDCALL
|
||||
GDALCopyWords( const void * pSrcData, GDALDataType eSrcType, int nSrcPixelOffset,
|
||||
void * pDstData, GDALDataType eDstType, int nDstPixelOffset,
|
||||
GDALCopyWords( const void * CPL_RESTRICT pSrcData,
|
||||
GDALDataType eSrcType, int nSrcPixelOffset,
|
||||
void * CPL_RESTRICT pDstData,
|
||||
GDALDataType eDstType, int nDstPixelOffset,
|
||||
int nWordCount );
|
||||
|
||||
void CPL_DLL
|
||||
@@ -873,7 +942,9 @@ double CPL_DLL CPL_STDCALL GDALDecToPackedDMS( double );
|
||||
/* Note to developers : please keep this section in sync with ogr_core.h */
|
||||
|
||||
#ifndef GDAL_VERSION_INFO_DEFINED
|
||||
#ifndef DOXYGEN_SKIP
|
||||
#define GDAL_VERSION_INFO_DEFINED
|
||||
#endif
|
||||
const char CPL_DLL * CPL_STDCALL GDALVersionInfo( const char * );
|
||||
#endif
|
||||
|
||||
@@ -890,29 +961,31 @@ int CPL_DLL CPL_STDCALL GDALCheckVersion( int nVersionMajor, int nVersionMinor,
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
double dfLINE_OFF;
|
||||
double dfSAMP_OFF;
|
||||
double dfLAT_OFF;
|
||||
double dfLONG_OFF;
|
||||
double dfHEIGHT_OFF;
|
||||
/** Strucutre to store Rational Polynomial Coefficients / Rigorous Projection
|
||||
* Model. See http://geotiff.maptools.org/rpc_prop.html */
|
||||
typedef struct
|
||||
{
|
||||
double dfLINE_OFF; /*!< Line offset */
|
||||
double dfSAMP_OFF; /*!< Sample/Pixel offset */
|
||||
double dfLAT_OFF; /*!< Latitude offset */
|
||||
double dfLONG_OFF; /*!< Longitude offset */
|
||||
double dfHEIGHT_OFF; /*!< Height offset */
|
||||
|
||||
double dfLINE_SCALE;
|
||||
double dfSAMP_SCALE;
|
||||
double dfLAT_SCALE;
|
||||
double dfLONG_SCALE;
|
||||
double dfHEIGHT_SCALE;
|
||||
double dfLINE_SCALE; /*!< Line scale */
|
||||
double dfSAMP_SCALE; /*!< Sample/Pixel scale */
|
||||
double dfLAT_SCALE; /*!< Latitude scale */
|
||||
double dfLONG_SCALE; /*!< Longitude scale */
|
||||
double dfHEIGHT_SCALE; /*!< Height scale */
|
||||
|
||||
double adfLINE_NUM_COEFF[20];
|
||||
double adfLINE_DEN_COEFF[20];
|
||||
double adfSAMP_NUM_COEFF[20];
|
||||
double adfSAMP_DEN_COEFF[20];
|
||||
|
||||
double dfMIN_LONG;
|
||||
double dfMIN_LAT;
|
||||
double dfMAX_LONG;
|
||||
double dfMAX_LAT;
|
||||
double adfLINE_NUM_COEFF[20]; /*!< Line Numerator Coefficients */
|
||||
double adfLINE_DEN_COEFF[20]; /*!< Line Denominator Coefficients */
|
||||
double adfSAMP_NUM_COEFF[20]; /*!< Sample/Pixel Numerator Coefficients */
|
||||
double adfSAMP_DEN_COEFF[20]; /*!< Sample/Pixel Denominator Coefficients */
|
||||
|
||||
double dfMIN_LONG; /*!< Minimum longitude */
|
||||
double dfMIN_LAT; /*!< Minimum latitude */
|
||||
double dfMAX_LONG; /*!< Maximum longitude */
|
||||
double dfMAX_LAT; /*!< Maximum latitude */
|
||||
} GDALRPCInfo;
|
||||
|
||||
int CPL_DLL CPL_STDCALL GDALExtractRPCInfo( char **, GDALRPCInfo * );
|
||||
@@ -950,12 +1023,12 @@ void CPL_DLL CPL_STDCALL GDALCreateColorRamp( GDALColorTableH hTable,
|
||||
int nEndIndex, const GDALColorEntry *psEndColor );
|
||||
|
||||
/* ==================================================================== */
|
||||
/* Raster Attribute Table */
|
||||
/* Raster Attribute Table */
|
||||
/* ==================================================================== */
|
||||
|
||||
/** Field type of raster attribute table */
|
||||
typedef enum {
|
||||
/*! Integer field */ GFT_Integer,
|
||||
/*! Integer field */ GFT_Integer,
|
||||
/*! Floating point (double) field */ GFT_Real,
|
||||
/*! String field */ GFT_String
|
||||
} GDALRATFieldType;
|
||||
@@ -1048,7 +1121,6 @@ void CPL_DLL* CPL_STDCALL
|
||||
|
||||
int CPL_DLL CPL_STDCALL GDALRATGetRowOfValue( GDALRasterAttributeTableH, double );
|
||||
|
||||
|
||||
/* ==================================================================== */
|
||||
/* GDAL Cache Management */
|
||||
/* ==================================================================== */
|
||||
@@ -1100,6 +1172,7 @@ CPLVirtualMem CPL_DLL* GDALGetVirtualMemAuto( GDALRasterBandH hBand,
|
||||
GIntBig *pnLineSpace,
|
||||
char **papszOptions ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
/**! Enumeration to describe the tile organization */
|
||||
typedef enum
|
||||
{
|
||||
/*! Tile Interleaved by Pixel: tile (0,0) with internal band interleaved by pixel organization, tile (1, 0), ... */
|
||||
|
||||
@@ -1,603 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_alg.h 33715 2016-03-13 08:52:06Z goatbar $
|
||||
*
|
||||
* Project: GDAL Image Processing Algorithms
|
||||
* Purpose: Prototypes, and definitions for various GDAL based algorithms.
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2001, Frank Warmerdam
|
||||
* Copyright (c) 2008-2012, Even Rouault <even dot rouault at mines-paris dot org>
|
||||
*
|
||||
* 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 GDAL_ALG_H_INCLUDED
|
||||
#define GDAL_ALG_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \file gdal_alg.h
|
||||
*
|
||||
* Public (C callable) GDAL algorithm entry points, and definitions.
|
||||
*/
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
#include "gdal.h"
|
||||
#include "cpl_minixml.h"
|
||||
#include "ogr_api.h"
|
||||
#endif
|
||||
|
||||
CPL_C_START
|
||||
|
||||
int CPL_DLL CPL_STDCALL GDALComputeMedianCutPCT( GDALRasterBandH hRed,
|
||||
GDALRasterBandH hGreen,
|
||||
GDALRasterBandH hBlue,
|
||||
int (*pfnIncludePixel)(int,int,void*),
|
||||
int nColors,
|
||||
GDALColorTableH hColorTable,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
int CPL_DLL CPL_STDCALL GDALDitherRGB2PCT( GDALRasterBandH hRed,
|
||||
GDALRasterBandH hGreen,
|
||||
GDALRasterBandH hBlue,
|
||||
GDALRasterBandH hTarget,
|
||||
GDALColorTableH hColorTable,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
int CPL_DLL CPL_STDCALL GDALChecksumImage( GDALRasterBandH hBand,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALComputeProximity( GDALRasterBandH hSrcBand,
|
||||
GDALRasterBandH hProximityBand,
|
||||
char **papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALFillNodata( GDALRasterBandH hTargetBand,
|
||||
GDALRasterBandH hMaskBand,
|
||||
double dfMaxSearchDist,
|
||||
int bDeprecatedOption,
|
||||
int nSmoothingIterations,
|
||||
char **papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALPolygonize( GDALRasterBandH hSrcBand,
|
||||
GDALRasterBandH hMaskBand,
|
||||
OGRLayerH hOutLayer, int iPixValField,
|
||||
char **papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALFPolygonize( GDALRasterBandH hSrcBand,
|
||||
GDALRasterBandH hMaskBand,
|
||||
OGRLayerH hOutLayer, int iPixValField,
|
||||
char **papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALSieveFilter( GDALRasterBandH hSrcBand, GDALRasterBandH hMaskBand,
|
||||
GDALRasterBandH hDstBand,
|
||||
int nSizeThreshold, int nConnectedness,
|
||||
char **papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
/*
|
||||
* Warp Related.
|
||||
*/
|
||||
|
||||
typedef int
|
||||
(*GDALTransformerFunc)( void *pTransformerArg,
|
||||
int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
#define GDAL_GTI2_SIGNATURE "GTI2"
|
||||
|
||||
typedef struct {
|
||||
GByte abySignature[4];
|
||||
const char *pszClassName;
|
||||
GDALTransformerFunc pfnTransform;
|
||||
void (*pfnCleanup)( void * pTransformerArg );
|
||||
CPLXMLNode *(*pfnSerialize)( void * pTransformerArg );
|
||||
void* (*pfnCreateSimilar)( void* pTransformerArg, double dfSrcRatioX, double dfSrcRatioY );
|
||||
} GDALTransformerInfo;
|
||||
|
||||
void CPL_DLL GDALDestroyTransformer( void *pTransformerArg );
|
||||
int CPL_DLL GDALUseTransformer( void *pTransformerArg,
|
||||
int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z,
|
||||
int *panSuccess );
|
||||
void* GDALCreateSimilarTransformer( void* psTransformerArg, double dfSrcRatioX, double dfSrcRatioY );
|
||||
|
||||
|
||||
/* High level transformer for going from image coordinates on one file
|
||||
to image coordinates on another, potentially doing reprojection,
|
||||
utilizing GCPs or using the geotransform. */
|
||||
|
||||
void CPL_DLL *
|
||||
GDALCreateGenImgProjTransformer( GDALDatasetH hSrcDS, const char *pszSrcWKT,
|
||||
GDALDatasetH hDstDS, const char *pszDstWKT,
|
||||
int bGCPUseOK, double dfGCPErrorThreshold,
|
||||
int nOrder );
|
||||
void CPL_DLL *
|
||||
GDALCreateGenImgProjTransformer2( GDALDatasetH hSrcDS, GDALDatasetH hDstDS,
|
||||
char **papszOptions );
|
||||
void CPL_DLL *
|
||||
GDALCreateGenImgProjTransformer3( const char *pszSrcWKT,
|
||||
const double *padfSrcGeoTransform,
|
||||
const char *pszDstWKT,
|
||||
const double *padfDstGeoTransform );
|
||||
void CPL_DLL GDALSetGenImgProjTransformerDstGeoTransform( void *,
|
||||
const double * );
|
||||
void CPL_DLL GDALDestroyGenImgProjTransformer( void * );
|
||||
int CPL_DLL GDALGenImgProjTransform(
|
||||
void *pTransformArg, int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
void GDALSetTransformerDstGeoTransform( void *, const double * );
|
||||
|
||||
/* Geo to geo reprojection transformer. */
|
||||
void CPL_DLL *
|
||||
GDALCreateReprojectionTransformer( const char *pszSrcWKT,
|
||||
const char *pszDstWKT );
|
||||
void CPL_DLL GDALDestroyReprojectionTransformer( void * );
|
||||
int CPL_DLL GDALReprojectionTransform(
|
||||
void *pTransformArg, int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
/* GCP based transformer ... forward is to georef coordinates */
|
||||
void CPL_DLL *
|
||||
GDALCreateGCPTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
int nReqOrder, int bReversed );
|
||||
|
||||
/* GCP based transformer with refinement of the GCPs ... forward is to georef coordinates */
|
||||
void CPL_DLL *
|
||||
GDALCreateGCPRefineTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
int nReqOrder, int bReversed, double tolerance, int minimumGcps);
|
||||
|
||||
void CPL_DLL GDALDestroyGCPTransformer( void *pTransformArg );
|
||||
int CPL_DLL GDALGCPTransform(
|
||||
void *pTransformArg, int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
/* Thin Plate Spine transformer ... forward is to georef coordinates */
|
||||
|
||||
void CPL_DLL *
|
||||
GDALCreateTPSTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
int bReversed );
|
||||
void CPL_DLL GDALDestroyTPSTransformer( void *pTransformArg );
|
||||
int CPL_DLL GDALTPSTransform(
|
||||
void *pTransformArg, int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
char CPL_DLL ** RPCInfoToMD( GDALRPCInfo *psRPCInfo );
|
||||
|
||||
/* RPC based transformer ... src is pixel/line/elev, dst is long/lat/elev */
|
||||
|
||||
void CPL_DLL *
|
||||
GDALCreateRPCTransformer( GDALRPCInfo *psRPC, int bReversed,
|
||||
double dfPixErrThreshold,
|
||||
char **papszOptions );
|
||||
void CPL_DLL GDALDestroyRPCTransformer( void *pTransformArg );
|
||||
int CPL_DLL GDALRPCTransform(
|
||||
void *pTransformArg, int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
/* Geolocation transformer */
|
||||
|
||||
void CPL_DLL *
|
||||
GDALCreateGeoLocTransformer( GDALDatasetH hBaseDS,
|
||||
char **papszGeolocationInfo,
|
||||
int bReversed );
|
||||
void CPL_DLL GDALDestroyGeoLocTransformer( void *pTransformArg );
|
||||
int CPL_DLL GDALGeoLocTransform(
|
||||
void *pTransformArg, int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
/* Approximate transformer */
|
||||
void CPL_DLL *
|
||||
GDALCreateApproxTransformer( GDALTransformerFunc pfnRawTransformer,
|
||||
void *pRawTransformerArg, double dfMaxError );
|
||||
void CPL_DLL GDALApproxTransformerOwnsSubtransformer( void *pCBData,
|
||||
int bOwnFlag );
|
||||
void CPL_DLL GDALDestroyApproxTransformer( void *pApproxArg );
|
||||
int CPL_DLL GDALApproxTransform(
|
||||
void *pTransformArg, int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
|
||||
int CPL_DLL CPL_STDCALL
|
||||
GDALSimpleImageWarp( GDALDatasetH hSrcDS,
|
||||
GDALDatasetH hDstDS,
|
||||
int nBandCount, int *panBandList,
|
||||
GDALTransformerFunc pfnTransform,
|
||||
void *pTransformArg,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressArg,
|
||||
char **papszWarpOptions );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALSuggestedWarpOutput( GDALDatasetH hSrcDS,
|
||||
GDALTransformerFunc pfnTransformer,
|
||||
void *pTransformArg,
|
||||
double *padfGeoTransformOut,
|
||||
int *pnPixels, int *pnLines );
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALSuggestedWarpOutput2( GDALDatasetH hSrcDS,
|
||||
GDALTransformerFunc pfnTransformer,
|
||||
void *pTransformArg,
|
||||
double *padfGeoTransformOut,
|
||||
int *pnPixels, int *pnLines,
|
||||
double *padfExtents,
|
||||
int nOptions );
|
||||
|
||||
CPLXMLNode CPL_DLL *
|
||||
GDALSerializeTransformer( GDALTransformerFunc pfnFunc, void *pTransformArg );
|
||||
CPLErr CPL_DLL GDALDeserializeTransformer( CPLXMLNode *psTree,
|
||||
GDALTransformerFunc *ppfnFunc,
|
||||
void **ppTransformArg );
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALTransformGeolocations( GDALRasterBandH hXBand,
|
||||
GDALRasterBandH hYBand,
|
||||
GDALRasterBandH hZBand,
|
||||
GDALTransformerFunc pfnTransformer,
|
||||
void *pTransformArg,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressArg,
|
||||
char **papszOptions );
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Contour Line Generation */
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
typedef CPLErr (*GDALContourWriter)( double dfLevel, int nPoints,
|
||||
double *padfX, double *padfY, void * );
|
||||
|
||||
typedef void *GDALContourGeneratorH;
|
||||
|
||||
GDALContourGeneratorH CPL_DLL
|
||||
GDAL_CG_Create( int nWidth, int nHeight,
|
||||
int bNoDataSet, double dfNoDataValue,
|
||||
double dfContourInterval, double dfContourBase,
|
||||
GDALContourWriter pfnWriter, void *pCBData );
|
||||
CPLErr CPL_DLL GDAL_CG_FeedLine( GDALContourGeneratorH hCG,
|
||||
double *padfScanline );
|
||||
void CPL_DLL GDAL_CG_Destroy( GDALContourGeneratorH hCG );
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *hLayer;
|
||||
|
||||
double adfGeoTransform[6];
|
||||
|
||||
int nElevField;
|
||||
int nIDField;
|
||||
int nNextID;
|
||||
} OGRContourWriterInfo;
|
||||
|
||||
CPLErr CPL_DLL
|
||||
OGRContourWriter( double, int, double *, double *, void *pInfo );
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALContourGenerate( GDALRasterBandH hBand,
|
||||
double dfContourInterval, double dfContourBase,
|
||||
int nFixedLevelCount, double *padfFixedLevels,
|
||||
int bUseNoData, double dfNoDataValue,
|
||||
void *hLayer, int iIDField, int iElevField,
|
||||
GDALProgressFunc pfnProgress, void *pProgressArg );
|
||||
|
||||
/************************************************************************/
|
||||
/* Rasterizer API - geometries burned into GDAL raster. */
|
||||
/************************************************************************/
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALRasterizeGeometries( GDALDatasetH hDS,
|
||||
int nBandCount, int *panBandList,
|
||||
int nGeomCount, OGRGeometryH *pahGeometries,
|
||||
GDALTransformerFunc pfnTransformer,
|
||||
void *pTransformArg,
|
||||
double *padfGeomBurnValue,
|
||||
char **papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
CPLErr CPL_DLL
|
||||
GDALRasterizeLayers( GDALDatasetH hDS,
|
||||
int nBandCount, int *panBandList,
|
||||
int nLayerCount, OGRLayerH *pahLayers,
|
||||
GDALTransformerFunc pfnTransformer,
|
||||
void *pTransformArg,
|
||||
double *padfLayerBurnValues,
|
||||
char **papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressArg );
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALRasterizeLayersBuf( void *pData, int nBufXSize, int nBufYSize,
|
||||
GDALDataType eBufType, int nPixelSpace, int nLineSpace,
|
||||
int nLayerCount, OGRLayerH *pahLayers,
|
||||
const char *pszDstProjection,
|
||||
double *padfDstGeoTransform,
|
||||
GDALTransformerFunc pfnTransformer,
|
||||
void *pTransformArg, double dfBurnValue,
|
||||
char **papszOptions, GDALProgressFunc pfnProgress,
|
||||
void *pProgressArg );
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/* Gridding interface. */
|
||||
/************************************************************************/
|
||||
|
||||
/** Gridding Algorithms */
|
||||
typedef enum {
|
||||
/*! Inverse distance to a power */ GGA_InverseDistanceToAPower = 1,
|
||||
/*! Moving Average */ GGA_MovingAverage = 2,
|
||||
/*! Nearest Neighbor */ GGA_NearestNeighbor = 3,
|
||||
/*! Minimum Value (Data Metric) */ GGA_MetricMinimum = 4,
|
||||
/*! Maximum Value (Data Metric) */ GGA_MetricMaximum = 5,
|
||||
/*! Data Range (Data Metric) */ GGA_MetricRange = 6,
|
||||
/*! Number of Points (Data Metric) */ GGA_MetricCount = 7,
|
||||
/*! Average Distance (Data Metric) */ GGA_MetricAverageDistance = 8,
|
||||
/*! Average Distance Between Data Points (Data Metric) */
|
||||
GGA_MetricAverageDistancePts = 9,
|
||||
/*! Linear interpolation (from Delaunay triangulation. Since GDAL 2.1 */
|
||||
GGA_Linear = 10,
|
||||
/*! Inverse distance to a power with nearest neighbor search for max points */
|
||||
GGA_InverseDistanceToAPowerNearestNeighbor = 11
|
||||
} GDALGridAlgorithm;
|
||||
|
||||
/** Inverse distance to a power method control options */
|
||||
typedef struct
|
||||
{
|
||||
/*! Weighting power. */
|
||||
double dfPower;
|
||||
/*! Smoothing parameter. */
|
||||
double dfSmoothing;
|
||||
/*! Reserved for future use. */
|
||||
double dfAnisotropyRatio;
|
||||
/*! Reserved for future use. */
|
||||
double dfAnisotropyAngle;
|
||||
/*! The first radius (X axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius1;
|
||||
/*! The second radius (Y axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius2;
|
||||
/*! Angle of ellipse rotation in degrees.
|
||||
*
|
||||
* Ellipse rotated counter clockwise.
|
||||
*/
|
||||
double dfAngle;
|
||||
/*! Maximum number of data points to use.
|
||||
*
|
||||
* Do not search for more points than this number.
|
||||
* If less amount of points found the grid node considered empty and will
|
||||
* be filled with NODATA marker.
|
||||
*/
|
||||
GUInt32 nMaxPoints;
|
||||
/*! Minimum number of data points to use.
|
||||
*
|
||||
* If less amount of points found the grid node considered empty and will
|
||||
* be filled with NODATA marker.
|
||||
*/
|
||||
GUInt32 nMinPoints;
|
||||
/*! No data marker to fill empty points. */
|
||||
double dfNoDataValue;
|
||||
} GDALGridInverseDistanceToAPowerOptions;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/*! Weighting power. */
|
||||
double dfPower;
|
||||
/*! The radius of search circle. */
|
||||
double dfRadius;
|
||||
|
||||
/*! Maximum number of data points to use.
|
||||
*
|
||||
* Do not search for more points than this number.
|
||||
* If less amount of points found the grid node considered empty and will
|
||||
* be filled with NODATA marker.
|
||||
*/
|
||||
GUInt32 nMaxPoints;
|
||||
/*! Minimum number of data points to use.
|
||||
*
|
||||
* If less amount of points found the grid node considered empty and will
|
||||
* be filled with NODATA marker.
|
||||
*/
|
||||
GUInt32 nMinPoints;
|
||||
/*! No data marker to fill empty points. */
|
||||
double dfNoDataValue;
|
||||
} GDALGridInverseDistanceToAPowerNearestNeighborOptions;
|
||||
|
||||
/** Moving average method control options */
|
||||
typedef struct
|
||||
{
|
||||
/*! The first radius (X axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius1;
|
||||
/*! The second radius (Y axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius2;
|
||||
/*! Angle of ellipse rotation in degrees.
|
||||
*
|
||||
* Ellipse rotated counter clockwise.
|
||||
*/
|
||||
double dfAngle;
|
||||
/*! Minimum number of data points to average.
|
||||
*
|
||||
* If less amount of points found the grid node considered empty and will
|
||||
* be filled with NODATA marker.
|
||||
*/
|
||||
GUInt32 nMinPoints;
|
||||
/*! No data marker to fill empty points. */
|
||||
double dfNoDataValue;
|
||||
} GDALGridMovingAverageOptions;
|
||||
|
||||
/** Nearest neighbor method control options */
|
||||
typedef struct
|
||||
{
|
||||
/*! The first radius (X axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius1;
|
||||
/*! The second radius (Y axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius2;
|
||||
/*! Angle of ellipse rotation in degrees.
|
||||
*
|
||||
* Ellipse rotated counter clockwise.
|
||||
*/
|
||||
double dfAngle;
|
||||
/*! No data marker to fill empty points. */
|
||||
double dfNoDataValue;
|
||||
} GDALGridNearestNeighborOptions;
|
||||
|
||||
/** Data metrics method control options */
|
||||
typedef struct
|
||||
{
|
||||
/*! The first radius (X axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius1;
|
||||
/*! The second radius (Y axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius2;
|
||||
/*! Angle of ellipse rotation in degrees.
|
||||
*
|
||||
* Ellipse rotated counter clockwise.
|
||||
*/
|
||||
double dfAngle;
|
||||
/*! Minimum number of data points to average.
|
||||
*
|
||||
* If less amount of points found the grid node considered empty and will
|
||||
* be filled with NODATA marker.
|
||||
*/
|
||||
GUInt32 nMinPoints;
|
||||
/*! No data marker to fill empty points. */
|
||||
double dfNoDataValue;
|
||||
} GDALGridDataMetricsOptions;
|
||||
|
||||
/** Linear method control options */
|
||||
typedef struct
|
||||
{
|
||||
/*! In case the point to be interpolated does not fit into a triangle of
|
||||
* the Delaunay triangulation, use that maximum distance to search a nearest
|
||||
* neighbour, or use nodata otherwise. If set to -1, the search distance is infinite.
|
||||
* If set to 0, nodata value will be always used.
|
||||
*/
|
||||
double dfRadius;
|
||||
/*! No data marker to fill empty points. */
|
||||
double dfNoDataValue;
|
||||
} GDALGridLinearOptions;
|
||||
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALGridCreate( GDALGridAlgorithm, const void *, GUInt32,
|
||||
const double *, const double *, const double *,
|
||||
double, double, double, double,
|
||||
GUInt32, GUInt32, GDALDataType, void *,
|
||||
GDALProgressFunc, void *);
|
||||
|
||||
typedef struct GDALGridContext GDALGridContext;
|
||||
|
||||
GDALGridContext CPL_DLL*
|
||||
GDALGridContextCreate( GDALGridAlgorithm eAlgorithm, const void *poOptions,
|
||||
GUInt32 nPoints,
|
||||
const double *padfX, const double *padfY, const double *padfZ,
|
||||
int bCallerWillKeepPointArraysAlive );
|
||||
|
||||
void CPL_DLL GDALGridContextFree(GDALGridContext* psContext);
|
||||
|
||||
CPLErr CPL_DLL GDALGridContextProcess(GDALGridContext* psContext,
|
||||
double dfXMin, double dfXMax, double dfYMin, double dfYMax,
|
||||
GUInt32 nXSize, GUInt32 nYSize, GDALDataType eType, void *pData,
|
||||
GDALProgressFunc pfnProgress, void *pProgressArg );
|
||||
|
||||
GDAL_GCP CPL_DLL *
|
||||
GDALComputeMatchingPoints( GDALDatasetH hFirstImage,
|
||||
GDALDatasetH hSecondImage,
|
||||
char **papszOptions,
|
||||
int *pnGCPCount );
|
||||
|
||||
/************************************************************************/
|
||||
/* Delaunay triangulation interface. */
|
||||
/************************************************************************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int anVertexIdx[3]; /* index to the padfX/padfY arrays */
|
||||
int anNeighborIdx[3]; /* index to GDALDelaunayTriangulation.pasFacets, or -1 */
|
||||
/* anNeighborIdx[k] is the triangle to the opposite side */
|
||||
/* of the opposite segment of anVertexIdx[k] */
|
||||
} GDALTriFacet;
|
||||
|
||||
/* Conversion from cartesian (x,y) to barycentric (l1,l2,l3) with :
|
||||
l1 = dfMul1X * (x - dfCxtX) + dfMul1Y * (y - dfCstY)
|
||||
l2 = dfMul2X * (x - dfCxtX) + dfMul2Y * (y - dfCstY)
|
||||
l3 = 1 - l1 - l2
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
double dfMul1X;
|
||||
double dfMul1Y;
|
||||
double dfMul2X;
|
||||
double dfMul2Y;
|
||||
double dfCstX;
|
||||
double dfCstY;
|
||||
} GDALTriBarycentricCoefficients;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int nFacets;
|
||||
GDALTriFacet *pasFacets; /* nFacets elements */
|
||||
GDALTriBarycentricCoefficients *pasFacetCoefficients; /* nFacets elements */
|
||||
} GDALTriangulation;
|
||||
|
||||
int CPL_DLL GDALHasTriangulation(void);
|
||||
|
||||
GDALTriangulation CPL_DLL *GDALTriangulationCreateDelaunay(int nPoints,
|
||||
const double* padfX,
|
||||
const double* padfY);
|
||||
int CPL_DLL GDALTriangulationComputeBarycentricCoefficients(
|
||||
GDALTriangulation* psDT,
|
||||
const double* padfX,
|
||||
const double* padfY);
|
||||
int CPL_DLL GDALTriangulationComputeBarycentricCoordinates(
|
||||
const GDALTriangulation* psDT,
|
||||
int nFacetIdx,
|
||||
double dfX,
|
||||
double dfY,
|
||||
double* pdfL1,
|
||||
double* pdfL2,
|
||||
double* pdfL3);
|
||||
int CPL_DLL GDALTriangulationFindFacetBruteForce( const GDALTriangulation* psDT,
|
||||
double dfX,
|
||||
double dfY,
|
||||
int* panOutputFacetIdx );
|
||||
int CPL_DLL GDALTriangulationFindFacetDirected( const GDALTriangulation* psDT,
|
||||
int nFacetIdx,
|
||||
double dfX,
|
||||
double dfY,
|
||||
int* panOutputFacetIdx );
|
||||
void CPL_DLL GDALTriangulationFree(GDALTriangulation* psDT);
|
||||
|
||||
// GDAL internal use only
|
||||
void GDALTriangulationTerminate(void);
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif /* ndef GDAL_ALG_H_INCLUDED */
|
||||
@@ -1,209 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_alg_priv.h 33757 2016-03-20 20:22:33Z goatbar $
|
||||
*
|
||||
* Project: GDAL Image Processing Algorithms
|
||||
* Purpose: Prototypes and definitions for various GDAL based algorithms:
|
||||
* private declarations.
|
||||
* Author: Andrey Kiselev, dron@ak4719.spb.edu
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2008, Andrey Kiselev <dron@ak4719.spb.edu>
|
||||
* Copyright (c) 2010-2013, Even Rouault <even dot rouault at mines-paris dot org>
|
||||
*
|
||||
* 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 GDAL_ALG_PRIV_H_INCLUDED
|
||||
#define GDAL_ALG_PRIV_H_INCLUDED
|
||||
|
||||
#include "gdal_alg.h"
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/** Source of the burn value */
|
||||
typedef enum {
|
||||
/*! Use value from padfBurnValue */ GBV_UserBurnValue = 0,
|
||||
/*! Use value from the Z coordinate */ GBV_Z = 1,
|
||||
/*! Use value form the M value */ GBV_M = 2
|
||||
} GDALBurnValueSrc;
|
||||
|
||||
typedef enum {
|
||||
GRMA_Replace = 0,
|
||||
GRMA_Add = 1,
|
||||
} GDALRasterMergeAlg;
|
||||
|
||||
typedef struct {
|
||||
unsigned char * pabyChunkBuf;
|
||||
int nXSize;
|
||||
int nYSize;
|
||||
int nBands;
|
||||
GDALDataType eType;
|
||||
double *padfBurnValue;
|
||||
GDALBurnValueSrc eBurnValueSource;
|
||||
GDALRasterMergeAlg eMergeAlg;
|
||||
} GDALRasterizeInfo;
|
||||
|
||||
/************************************************************************/
|
||||
/* Low level rasterizer API. */
|
||||
/************************************************************************/
|
||||
|
||||
typedef void (*llScanlineFunc)( void *, int, int, int, double );
|
||||
typedef void (*llPointFunc)( void *, int, int, double );
|
||||
|
||||
void GDALdllImagePoint( int nRasterXSize, int nRasterYSize,
|
||||
int nPartCount, int *panPartSize,
|
||||
double *padfX, double *padfY, double *padfVariant,
|
||||
llPointFunc pfnPointFunc, void *pCBData );
|
||||
|
||||
void GDALdllImageLine( int nRasterXSize, int nRasterYSize,
|
||||
int nPartCount, int *panPartSize,
|
||||
double *padfX, double *padfY, double *padfVariant,
|
||||
llPointFunc pfnPointFunc, void *pCBData );
|
||||
|
||||
void GDALdllImageLineAllTouched(int nRasterXSize, int nRasterYSize,
|
||||
int nPartCount, int *panPartSize,
|
||||
double *padfX, double *padfY,
|
||||
double *padfVariant,
|
||||
llPointFunc pfnPointFunc, void *pCBData );
|
||||
|
||||
void GDALdllImageFilledPolygon(int nRasterXSize, int nRasterYSize,
|
||||
int nPartCount, int *panPartSize,
|
||||
double *padfX, double *padfY,
|
||||
double *padfVariant,
|
||||
llScanlineFunc pfnScanlineFunc, void *pCBData );
|
||||
|
||||
CPL_C_END
|
||||
|
||||
/************************************************************************/
|
||||
/* Polygon Enumerator */
|
||||
/************************************************************************/
|
||||
|
||||
#define GP_NODATA_MARKER -51502112
|
||||
|
||||
template<class DataType, class EqualityTest> class GDALRasterPolygonEnumeratorT
|
||||
|
||||
{
|
||||
private:
|
||||
void MergePolygon( int nSrcId, int nDstId );
|
||||
int NewPolygon( DataType nValue );
|
||||
|
||||
public: // these are intended to be readonly.
|
||||
|
||||
GInt32 *panPolyIdMap;
|
||||
DataType *panPolyValue;
|
||||
|
||||
int nNextPolygonId;
|
||||
int nPolyAlloc;
|
||||
|
||||
int nConnectedness;
|
||||
|
||||
public:
|
||||
GDALRasterPolygonEnumeratorT( int nConnectedness=4 );
|
||||
~GDALRasterPolygonEnumeratorT();
|
||||
|
||||
void ProcessLine( DataType *panLastLineVal, DataType *panThisLineVal,
|
||||
GInt32 *panLastLineId, GInt32 *panThisLineId,
|
||||
int nXSize );
|
||||
|
||||
void CompleteMerges();
|
||||
|
||||
void Clear();
|
||||
};
|
||||
|
||||
struct IntEqualityTest
|
||||
{
|
||||
bool operator()(GInt32 a, GInt32 b) { return a == b; }
|
||||
};
|
||||
|
||||
typedef GDALRasterPolygonEnumeratorT<GInt32, IntEqualityTest> GDALRasterPolygonEnumerator;
|
||||
|
||||
typedef void* (*GDALTransformDeserializeFunc)( CPLXMLNode *psTree );
|
||||
|
||||
void* GDALRegisterTransformDeserializer(const char* pszTransformName,
|
||||
GDALTransformerFunc pfnTransformerFunc,
|
||||
GDALTransformDeserializeFunc pfnDeserializeFunc);
|
||||
void GDALUnregisterTransformDeserializer(void* pData);
|
||||
|
||||
void GDALCleanupTransformDeserializerMutex();
|
||||
|
||||
/* Transformer cloning */
|
||||
|
||||
void* GDALCreateTPSTransformerInt( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
int bReversed, char** papszOptions );
|
||||
|
||||
void CPL_DLL * GDALCloneTransformer( void *pTransformerArg );
|
||||
|
||||
/************************************************************************/
|
||||
/* Color table related */
|
||||
/************************************************************************/
|
||||
|
||||
/* definitions exists for T = GUInt32 and T = GUIntBig */
|
||||
template<class T> int
|
||||
GDALComputeMedianCutPCTInternal( GDALRasterBandH hRed,
|
||||
GDALRasterBandH hGreen,
|
||||
GDALRasterBandH hBlue,
|
||||
GByte* pabyRedBand,
|
||||
GByte* pabyGreenBand,
|
||||
GByte* pabyBlueBand,
|
||||
int (*pfnIncludePixel)(int,int,void*),
|
||||
int nColors,
|
||||
int nBits,
|
||||
T* panHistogram,
|
||||
GDALColorTableH hColorTable,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
int GDALDitherRGB2PCTInternal( GDALRasterBandH hRed,
|
||||
GDALRasterBandH hGreen,
|
||||
GDALRasterBandH hBlue,
|
||||
GDALRasterBandH hTarget,
|
||||
GDALColorTableH hColorTable,
|
||||
int nBits,
|
||||
GInt16* pasDynamicColorMap,
|
||||
int bDither,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
#define PRIME_FOR_65536 98317
|
||||
|
||||
/* See HashHistogram structure in gdalmediancut.cpp and ColorIndex structure in gdaldither.cpp */
|
||||
/* 6 * sizeof(int) should be the size of the largest of both structures */
|
||||
#define MEDIAN_CUT_AND_DITHER_BUFFER_SIZE_65536 (6 * sizeof(int) * PRIME_FOR_65536)
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/* Float comparison function. */
|
||||
/************************************************************************/
|
||||
|
||||
/**
|
||||
* Units in the Last Place. This specifies how big an error we are willing to
|
||||
* accept in terms of the value of the least significant digit of the floating
|
||||
* point number’s representation. MAX_ULPS can also be interpreted in terms of
|
||||
* how many representable floats we are willing to accept between A and B.
|
||||
*/
|
||||
#define MAX_ULPS 10
|
||||
|
||||
GBool GDALFloatEquals(float A, float B);
|
||||
|
||||
struct FloatEqualityTest
|
||||
{
|
||||
bool operator()(float a, float b) { return GDALFloatEquals(a,b) == TRUE; }
|
||||
};
|
||||
|
||||
#endif /* ndef GDAL_ALG_PRIV_H_INCLUDED */
|
||||
@@ -0,0 +1,240 @@
|
||||
/******************************************************************************
|
||||
* Project: GDAL
|
||||
* Purpose: AVX2 emulation with SSE2 + a few SSE4.1 emulation
|
||||
* Author: Even Rouault <even dot rouault at spatialys dot com>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2016, Even Rouault <even dot rouault at spatialys dot 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 GDAL_AVX2_EMULATION_H_INCLUDED
|
||||
#define GDAL_AVX2_EMULATION_H_INCLUDED
|
||||
|
||||
#include <emmintrin.h>
|
||||
|
||||
#ifdef __SSE4_1__
|
||||
#include <smmintrin.h>
|
||||
|
||||
#define GDALmm_min_epu16 _mm_min_epu16
|
||||
#define GDALmm_max_epu16 _mm_max_epu16
|
||||
#define GDALmm_mullo_epi32 _mm_mullo_epi32
|
||||
|
||||
#else
|
||||
// Emulation of SSE4.1 _mm_min_epu16 and _mm_max_epu16 with SSE2 only
|
||||
|
||||
static inline __m128i GDALAVX2Emul_mm_cmple_epu16 (__m128i x, __m128i y)
|
||||
{
|
||||
return _mm_cmpeq_epi16(_mm_subs_epu16(x, y), _mm_setzero_si128() );
|
||||
}
|
||||
|
||||
static inline __m128i GDALAVX2Emul_mm_ternary(__m128i mask,
|
||||
__m128i then_reg,
|
||||
__m128i else_reg)
|
||||
{
|
||||
return _mm_or_si128(_mm_and_si128(mask, then_reg),
|
||||
_mm_andnot_si128(mask, else_reg));
|
||||
}
|
||||
|
||||
static inline __m128i GDALmm_min_epu16 (__m128i x, __m128i y)
|
||||
{
|
||||
const __m128i mask = GDALAVX2Emul_mm_cmple_epu16(x, y);
|
||||
return GDALAVX2Emul_mm_ternary(mask, x, y);
|
||||
}
|
||||
|
||||
static inline __m128i GDALmm_max_epu16 (__m128i x, __m128i y)
|
||||
{
|
||||
const __m128i mask = GDALAVX2Emul_mm_cmple_epu16(x, y);
|
||||
return GDALAVX2Emul_mm_ternary(mask, y, x);
|
||||
}
|
||||
|
||||
static inline __m128i GDALmm_mullo_epi32 (__m128i x, __m128i y)
|
||||
{
|
||||
const __m128i mul02 = _mm_shuffle_epi32(_mm_mul_epu32(x, y), 2 << 2);
|
||||
const __m128i mul13 = _mm_shuffle_epi32(_mm_mul_epu32(_mm_srli_si128(x, 4),
|
||||
_mm_srli_si128(y, 4)),
|
||||
2 << 2);
|
||||
return _mm_unpacklo_epi32(mul02, mul13);;
|
||||
}
|
||||
#endif // __SSE4_1__
|
||||
|
||||
|
||||
#ifdef __AVX2__
|
||||
|
||||
#include <immintrin.h>
|
||||
|
||||
typedef __m256i GDALm256i;
|
||||
|
||||
#define GDALmm256_set1_epi8 _mm256_set1_epi8
|
||||
#define GDALmm256_set1_epi16 _mm256_set1_epi16
|
||||
#define GDALmm256_setzero_si256 _mm256_setzero_si256
|
||||
#define GDALmm256_load_si256 _mm256_load_si256
|
||||
#define GDALmm256_store_si256 _mm256_store_si256
|
||||
#define GDALmm256_storeu_si256 _mm256_storeu_si256
|
||||
#define GDALmm256_cmpeq_epi8 _mm256_cmpeq_epi8
|
||||
#define GDALmm256_sad_epu8 _mm256_sad_epu8
|
||||
#define GDALmm256_add_epi32 _mm256_add_epi32
|
||||
#define GDALmm256_andnot_si256 _mm256_andnot_si256
|
||||
#define GDALmm256_and_si256 _mm256_and_si256
|
||||
#define GDALmm256_or_si256 _mm256_or_si256
|
||||
#define GDALmm256_min_epu8 _mm256_min_epu8
|
||||
#define GDALmm256_max_epu8 _mm256_max_epu8
|
||||
#define GDALmm256_extracti128_si256 _mm256_extracti128_si256
|
||||
#define GDALmm256_cvtepu8_epi16 _mm256_cvtepu8_epi16
|
||||
#define GDALmm256_madd_epi16 _mm256_madd_epi16
|
||||
#define GDALmm256_min_epu16 _mm256_min_epu16
|
||||
#define GDALmm256_max_epu16 _mm256_max_epu16
|
||||
#define GDALmm256_cvtepu16_epi32 _mm256_cvtepu16_epi32
|
||||
#define GDALmm256_cvtepu16_epi64 _mm256_cvtepu16_epi64
|
||||
#define GDALmm256_cvtepu32_epi64 _mm256_cvtepu32_epi64
|
||||
#define GDALmm256_mullo_epi32 _mm256_mullo_epi32
|
||||
#define GDALmm256_add_epi64 _mm256_add_epi64
|
||||
#define GDALmm256_add_epi16 _mm256_add_epi16
|
||||
#define GDALmm256_sub_epi16 _mm256_sub_epi16
|
||||
#define GDALmm256_min_epi16 _mm256_min_epi16
|
||||
#define GDALmm256_max_epi16 _mm256_max_epi16
|
||||
|
||||
#else
|
||||
|
||||
typedef struct
|
||||
{
|
||||
__m128i low;
|
||||
__m128i high;
|
||||
} GDALm256i;
|
||||
|
||||
static inline GDALm256i GDALmm256_set1_epi8(char c)
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_set1_epi8(c);
|
||||
reg.high = _mm_set1_epi8(c);
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline GDALm256i GDALmm256_set1_epi16(short s)
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_set1_epi16(s);
|
||||
reg.high = _mm_set1_epi16(s);
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline GDALm256i GDALmm256_setzero_si256()
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_setzero_si128();
|
||||
reg.high = _mm_setzero_si128();
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline GDALm256i GDALmm256_load_si256(GDALm256i const * p)
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_load_si128((__m128i const*)p);
|
||||
reg.high = _mm_load_si128((__m128i const*)((char*)p+16));
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline void GDALmm256_store_si256(GDALm256i * p, GDALm256i reg)
|
||||
{
|
||||
_mm_store_si128((__m128i*)p, reg.low);
|
||||
_mm_store_si128((__m128i*)((char*)p+16), reg.high);
|
||||
}
|
||||
|
||||
static inline void GDALmm256_storeu_si256(GDALm256i * p, GDALm256i reg)
|
||||
{
|
||||
_mm_storeu_si128((__m128i*)p, reg.low);
|
||||
_mm_storeu_si128((__m128i*)((char*)p+16), reg.high);
|
||||
}
|
||||
|
||||
#define DEFINE_BINARY_MM256(mm256name, mm128name) \
|
||||
static inline GDALm256i mm256name(GDALm256i r1, GDALm256i r2) \
|
||||
{ \
|
||||
GDALm256i reg; \
|
||||
reg.low = mm128name(r1.low, r2.low); \
|
||||
reg.high = mm128name(r1.high, r2.high); \
|
||||
return reg; \
|
||||
}
|
||||
|
||||
DEFINE_BINARY_MM256(GDALmm256_cmpeq_epi8, _mm_cmpeq_epi8)
|
||||
DEFINE_BINARY_MM256(GDALmm256_sad_epu8, _mm_sad_epu8)
|
||||
DEFINE_BINARY_MM256(GDALmm256_add_epi32, _mm_add_epi32)
|
||||
DEFINE_BINARY_MM256(GDALmm256_andnot_si256, _mm_andnot_si128)
|
||||
DEFINE_BINARY_MM256(GDALmm256_and_si256, _mm_and_si128)
|
||||
DEFINE_BINARY_MM256(GDALmm256_or_si256, _mm_or_si128)
|
||||
DEFINE_BINARY_MM256(GDALmm256_min_epu8, _mm_min_epu8)
|
||||
DEFINE_BINARY_MM256(GDALmm256_max_epu8, _mm_max_epu8)
|
||||
DEFINE_BINARY_MM256(GDALmm256_madd_epi16, _mm_madd_epi16)
|
||||
DEFINE_BINARY_MM256(GDALmm256_min_epu16, GDALmm_min_epu16)
|
||||
DEFINE_BINARY_MM256(GDALmm256_max_epu16, GDALmm_max_epu16)
|
||||
DEFINE_BINARY_MM256(GDALmm256_mullo_epi32, GDALmm_mullo_epi32)
|
||||
DEFINE_BINARY_MM256(GDALmm256_add_epi64, _mm_add_epi64)
|
||||
DEFINE_BINARY_MM256(GDALmm256_add_epi16, _mm_add_epi16)
|
||||
DEFINE_BINARY_MM256(GDALmm256_sub_epi16, _mm_sub_epi16)
|
||||
DEFINE_BINARY_MM256(GDALmm256_min_epi16, _mm_min_epi16)
|
||||
DEFINE_BINARY_MM256(GDALmm256_max_epi16, _mm_max_epi16)
|
||||
|
||||
static inline __m128i GDALmm256_extracti128_si256(GDALm256i reg, int index)
|
||||
{
|
||||
return (index == 0) ? reg.low : reg.high;
|
||||
}
|
||||
|
||||
static inline GDALm256i GDALmm256_cvtepu8_epi16(__m128i reg128)
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_unpacklo_epi8(reg128, _mm_setzero_si128());
|
||||
reg.high = _mm_unpacklo_epi8(_mm_shuffle_epi32(reg128, 2 | (3 << 2)),
|
||||
_mm_setzero_si128());
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline GDALm256i GDALmm256_cvtepu16_epi32(__m128i reg128)
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_unpacklo_epi16(reg128, _mm_setzero_si128());
|
||||
reg.high = _mm_unpacklo_epi16(_mm_shuffle_epi32(reg128, 2 | (3 << 2)),
|
||||
_mm_setzero_si128());
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline GDALm256i GDALmm256_cvtepu16_epi64(__m128i reg128)
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_unpacklo_epi32(_mm_unpacklo_epi16(reg128,
|
||||
_mm_setzero_si128()),
|
||||
_mm_setzero_si128());
|
||||
reg.high = _mm_unpacklo_epi32(_mm_unpacklo_epi16(
|
||||
_mm_srli_si128(reg128, 4),
|
||||
_mm_setzero_si128()),
|
||||
_mm_setzero_si128());
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline GDALm256i GDALmm256_cvtepu32_epi64(__m128i reg128)
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_unpacklo_epi32(reg128, _mm_setzero_si128());
|
||||
reg.high = _mm_unpacklo_epi32(_mm_shuffle_epi32(reg128, 2 | (3 << 2)),
|
||||
_mm_setzero_si128());
|
||||
return reg;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* GDAL_AVX2_EMULATION_H_INCLUDED */
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_frmts.h 33351 2016-02-03 15:52:38Z goatbar $
|
||||
* $Id: gdal_frmts.h 36731 2016-12-07 11:08:07Z rouault $
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: Prototypes for all format specific driver initialization.
|
||||
@@ -186,6 +186,10 @@ void CPL_DLL GDALRegister_WMTS(void);
|
||||
void CPL_DLL GDALRegister_SAFE(void);
|
||||
void CPL_DLL GDALRegister_SENTINEL2(void);
|
||||
void CPL_DLL GDALRegister_mrf(void);
|
||||
void CPL_DLL GDALRegister_RRASTER(void);
|
||||
void CPL_DLL GDALRegister_Derived(void);
|
||||
void CPL_DLL GDALRegister_JP2Lura(void);
|
||||
void CPL_DLL GDALRegister_PRF(void);
|
||||
CPL_C_END
|
||||
|
||||
#endif /* ndef GDAL_FRMTS_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_mdreader.h 33694 2016-03-10 17:54:30Z goatbar $
|
||||
* $Id: gdal_mdreader.h 35883 2016-10-24 05:49:15Z goatbar $
|
||||
*
|
||||
* Project: GDAL Core
|
||||
* Purpose: Read metadata (mainly the remote sensing imagery) from files of
|
||||
@@ -31,7 +31,6 @@
|
||||
#ifndef GDAL_MDREADER_H_INCLUDED
|
||||
#define GDAL_MDREADER_H_INCLUDED
|
||||
|
||||
|
||||
#include "cpl_port.h"
|
||||
#include "gdal_priv.h"
|
||||
|
||||
@@ -88,7 +87,6 @@ typedef enum {
|
||||
MDR_LS | MDR_RE | MDR_KOMPSAT | MDR_EROS | MDR_ALOS /**< any reader */
|
||||
} MDReaders;
|
||||
|
||||
|
||||
/**
|
||||
* The base class for all metadata readers
|
||||
*/
|
||||
@@ -156,11 +154,13 @@ protected:
|
||||
virtual char** AddXMLNameValueToList(char** papszList, const char *pszName,
|
||||
const char *pszValue);
|
||||
protected:
|
||||
//! @cond Doxygen_Suppress
|
||||
char **m_papszIMDMD;
|
||||
char **m_papszRPCMD;
|
||||
char **m_papszIMAGERYMD;
|
||||
char **m_papszDEFAULTMD;
|
||||
bool m_bIsMetadataLoad;
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -187,7 +187,9 @@ public:
|
||||
char **papszSiblingFiles,
|
||||
GUInt32 nType = MDR_ANY);
|
||||
protected:
|
||||
//! @cond Doxygen_Suppress
|
||||
GDALMDReaderBase *m_pReader;
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
// misc
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_pam.h 33694 2016-03-10 17:54:30Z goatbar $
|
||||
* $Id: gdal_pam.h 36501 2016-11-25 14:09:24Z rouault $
|
||||
*
|
||||
* Project: GDAL Core
|
||||
* Purpose: Declaration for Peristable Auxiliary Metadata classes.
|
||||
@@ -30,6 +30,8 @@
|
||||
#ifndef GDAL_PAM_H_INCLUDED
|
||||
#define GDAL_PAM_H_INCLUDED
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
|
||||
#include "gdal_priv.h"
|
||||
|
||||
class GDALPamRasterBand;
|
||||
@@ -68,7 +70,7 @@ class GDALPamRasterBand;
|
||||
|
||||
/* GDAL PAM Flags */
|
||||
/* ERO 2011/04/13 : GPF_AUXMODE seems to be unimplemented */
|
||||
#define GPF_DIRTY 0x01 // .pam file needs to be written on close
|
||||
#define GPF_DIRTY 0x01 // .pam file needs to be written on close
|
||||
#define GPF_TRIED_READ_FAILED 0x02 // no need to keep trying to read .pam.
|
||||
#define GPF_DISABLED 0x04 // do not try any PAM stuff.
|
||||
#define GPF_AUXMODE 0x08 // store info in .aux (HFA) file.
|
||||
@@ -87,7 +89,7 @@ class GDALDatasetPamInfo
|
||||
public:
|
||||
char *pszPamFilename;
|
||||
|
||||
char *pszProjection;
|
||||
char *pszProjection;
|
||||
|
||||
int bHaveGeoTransform;
|
||||
double adfGeoTransform[6];
|
||||
@@ -102,11 +104,13 @@ public:
|
||||
|
||||
int bHasMetadata;
|
||||
};
|
||||
//! @endcond
|
||||
|
||||
/* ******************************************************************** */
|
||||
/* GDALPamDataset */
|
||||
/* ******************************************************************** */
|
||||
|
||||
/** PAM dataset */
|
||||
class CPL_DLL GDALPamDataset : public GDALDataset
|
||||
{
|
||||
friend class GDALPamRasterBand;
|
||||
@@ -115,8 +119,9 @@ class CPL_DLL GDALPamDataset : public GDALDataset
|
||||
int IsPamFilenameAPotentialSiblingFile();
|
||||
|
||||
protected:
|
||||
GDALPamDataset(void);
|
||||
|
||||
GDALPamDataset(void);
|
||||
//! @cond Doxygen_Suppress
|
||||
int nPamFlags;
|
||||
GDALDatasetPamInfo *psPam;
|
||||
|
||||
@@ -138,54 +143,57 @@ class CPL_DLL GDALPamDataset : public GDALDataset
|
||||
const char *GetPhysicalFilename();
|
||||
void SetSubdatasetName( const char *);
|
||||
const char *GetSubdatasetName();
|
||||
//! @endcond
|
||||
|
||||
public:
|
||||
virtual ~GDALPamDataset();
|
||||
|
||||
virtual void FlushCache(void);
|
||||
virtual void FlushCache(void) CPL_OVERRIDE;
|
||||
|
||||
virtual const char *GetProjectionRef(void);
|
||||
virtual CPLErr SetProjection( const char * );
|
||||
virtual const char *GetProjectionRef(void) CPL_OVERRIDE;
|
||||
virtual CPLErr SetProjection( const char * ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr GetGeoTransform( double * );
|
||||
virtual CPLErr SetGeoTransform( double * );
|
||||
virtual CPLErr GetGeoTransform( double * ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetGeoTransform( double * ) CPL_OVERRIDE;
|
||||
|
||||
virtual int GetGCPCount();
|
||||
virtual const char *GetGCPProjection();
|
||||
virtual const GDAL_GCP *GetGCPs();
|
||||
virtual int GetGCPCount() CPL_OVERRIDE;
|
||||
virtual const char *GetGCPProjection() CPL_OVERRIDE;
|
||||
virtual const GDAL_GCP *GetGCPs() CPL_OVERRIDE;
|
||||
virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
const char *pszGCPProjection );
|
||||
const char *pszGCPProjection ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain = "" );
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain = "" );
|
||||
virtual char **GetMetadata( const char * pszDomain = "" );
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual char **GetMetadata( const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain = "" );
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
|
||||
virtual char **GetFileList(void);
|
||||
virtual char **GetFileList(void) CPL_OVERRIDE;
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
virtual CPLErr CloneInfo( GDALDataset *poSrcDS, int nCloneInfoFlags );
|
||||
|
||||
virtual CPLErr IBuildOverviews( const char *pszResampling,
|
||||
int nOverviews, int *panOverviewList,
|
||||
int nListBands, int *panBandList,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressData );
|
||||
|
||||
void * pProgressData ) CPL_OVERRIDE;
|
||||
|
||||
// "semi private" methods.
|
||||
void MarkPamDirty() { nPamFlags |= GPF_DIRTY; }
|
||||
GDALDatasetPamInfo *GetPamInfo() { return psPam; }
|
||||
int GetPamFlags() { return nPamFlags; }
|
||||
void SetPamFlags(int nValue ) { nPamFlags = nValue; }
|
||||
//! @endcond
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALPamDataset);
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALPamDataset)
|
||||
};
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
/* ==================================================================== */
|
||||
/* GDALRasterBandPamInfo */
|
||||
/* */
|
||||
@@ -223,16 +231,18 @@ typedef struct {
|
||||
GDALRasterAttributeTable *poDefaultRAT;
|
||||
|
||||
} GDALRasterBandPamInfo;
|
||||
|
||||
//! @endcond
|
||||
/* ******************************************************************** */
|
||||
/* GDALPamRasterBand */
|
||||
/* ******************************************************************** */
|
||||
|
||||
/** PAM raster band */
|
||||
class CPL_DLL GDALPamRasterBand : public GDALRasterBand
|
||||
{
|
||||
friend class GDALPamDataset;
|
||||
|
||||
protected:
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
|
||||
virtual CPLErr XMLInit( CPLXMLNode *, const char * );
|
||||
|
||||
@@ -240,67 +250,72 @@ class CPL_DLL GDALPamRasterBand : public GDALRasterBand
|
||||
void PamClear();
|
||||
|
||||
GDALRasterBandPamInfo *psPam;
|
||||
//! @endcond
|
||||
|
||||
public:
|
||||
GDALPamRasterBand();
|
||||
GDALPamRasterBand(int bForceCachedIO);
|
||||
//! @cond Doxygen_Suppress
|
||||
explicit GDALPamRasterBand(int bForceCachedIO);
|
||||
//! @endcond
|
||||
virtual ~GDALPamRasterBand();
|
||||
|
||||
virtual void SetDescription( const char * );
|
||||
virtual void SetDescription( const char * ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr SetNoDataValue( double );
|
||||
virtual double GetNoDataValue( int *pbSuccess = NULL );
|
||||
virtual CPLErr DeleteNoDataValue();
|
||||
virtual CPLErr SetNoDataValue( double ) CPL_OVERRIDE;
|
||||
virtual double GetNoDataValue( int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
virtual CPLErr DeleteNoDataValue() CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr SetColorTable( GDALColorTable * );
|
||||
virtual GDALColorTable *GetColorTable();
|
||||
virtual CPLErr SetColorTable( GDALColorTable * ) CPL_OVERRIDE;
|
||||
virtual GDALColorTable *GetColorTable() CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr SetColorInterpretation( GDALColorInterp );
|
||||
virtual GDALColorInterp GetColorInterpretation();
|
||||
virtual CPLErr SetColorInterpretation( GDALColorInterp ) CPL_OVERRIDE;
|
||||
virtual GDALColorInterp GetColorInterpretation() CPL_OVERRIDE;
|
||||
|
||||
virtual const char *GetUnitType();
|
||||
CPLErr SetUnitType( const char * );
|
||||
virtual const char *GetUnitType() CPL_OVERRIDE;
|
||||
CPLErr SetUnitType( const char * ) CPL_OVERRIDE;
|
||||
|
||||
virtual char **GetCategoryNames();
|
||||
virtual CPLErr SetCategoryNames( char ** );
|
||||
virtual char **GetCategoryNames() CPL_OVERRIDE;
|
||||
virtual CPLErr SetCategoryNames( char ** ) CPL_OVERRIDE;
|
||||
|
||||
virtual double GetOffset( int *pbSuccess = NULL );
|
||||
CPLErr SetOffset( double );
|
||||
virtual double GetScale( int *pbSuccess = NULL );
|
||||
CPLErr SetScale( double );
|
||||
virtual double GetOffset( int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
CPLErr SetOffset( double ) CPL_OVERRIDE;
|
||||
virtual double GetScale( int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
CPLErr SetScale( double ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr GetHistogram( double dfMin, double dfMax,
|
||||
int nBuckets, GUIntBig * panHistogram,
|
||||
int bIncludeOutOfRange, int bApproxOK,
|
||||
GDALProgressFunc, void *pProgressData );
|
||||
GDALProgressFunc, void *pProgressData ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
|
||||
int *pnBuckets, GUIntBig ** ppanHistogram,
|
||||
int bForce,
|
||||
GDALProgressFunc, void *pProgressData);
|
||||
GDALProgressFunc, void *pProgressData) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
|
||||
int nBuckets, GUIntBig *panHistogram );
|
||||
int nBuckets, GUIntBig *panHistogram ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain = "" );
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain = "" );
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
|
||||
virtual GDALRasterAttributeTable *GetDefaultRAT();
|
||||
virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * );
|
||||
virtual GDALRasterAttributeTable *GetDefaultRAT() CPL_OVERRIDE;
|
||||
virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * ) CPL_OVERRIDE;
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
// new in GDALPamRasterBand.
|
||||
virtual CPLErr CloneInfo( GDALRasterBand *poSrcBand, int nCloneInfoFlags );
|
||||
|
||||
// "semi private" methods.
|
||||
GDALRasterBandPamInfo *GetPamInfo() { return psPam; }
|
||||
|
||||
//! @endcond
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALPamRasterBand);
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALPamRasterBand)
|
||||
};
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
// These are mainly helper functions for internal use.
|
||||
int CPL_DLL PamParseHistogram( CPLXMLNode *psHistItem,
|
||||
double *pdfMin, double *pdfMax,
|
||||
@@ -321,4 +336,6 @@ const char CPL_DLL * PamAllocateProxy( const char * );
|
||||
const char CPL_DLL * PamDeallocateProxy( const char * );
|
||||
void CPL_DLL PamCleanProxyDB( void );
|
||||
|
||||
//! @endcond
|
||||
|
||||
#endif /* ndef GDAL_PAM_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_priv.h 33808 2016-03-29 21:15:28Z goatbar $
|
||||
* $Id: gdal_priv.h 37723 2017-03-16 17:07:53Z rouault $
|
||||
*
|
||||
* Name: gdal_priv.h
|
||||
* Project: GDAL Core
|
||||
@@ -69,17 +69,20 @@ class GDALAsyncReader;
|
||||
#include <map>
|
||||
#include "ogr_core.h"
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
#define GMO_VALID 0x0001
|
||||
#define GMO_IGNORE_UNIMPLEMENTED 0x0002
|
||||
#define GMO_SUPPORT_MD 0x0004
|
||||
#define GMO_SUPPORT_MDMD 0x0008
|
||||
#define GMO_MD_DIRTY 0x0010
|
||||
#define GMO_PAM_CLASS 0x0020
|
||||
//! @endcond
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALMultiDomainMetadata */
|
||||
/************************************************************************/
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
class CPL_DLL GDALMultiDomainMetadata
|
||||
{
|
||||
private:
|
||||
@@ -107,8 +110,9 @@ public:
|
||||
void Clear();
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALMultiDomainMetadata);
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALMultiDomainMetadata)
|
||||
};
|
||||
//! @endcond
|
||||
|
||||
/* ******************************************************************** */
|
||||
/* GDALMajorObject */
|
||||
@@ -117,23 +121,25 @@ public:
|
||||
/* services shared by major objects. */
|
||||
/* ******************************************************************** */
|
||||
|
||||
//! Object with metadata.
|
||||
|
||||
/** Object with metadata. */
|
||||
class CPL_DLL GDALMajorObject
|
||||
{
|
||||
protected:
|
||||
//! @cond Doxygen_Suppress
|
||||
int nFlags; // GMO_* flags.
|
||||
CPLString sDescription;
|
||||
GDALMultiDomainMetadata oMDMD;
|
||||
|
||||
char **BuildMetadataDomainList(char** papszList, int bCheckNonEmpty, ...) CPL_NULL_TERMINATED;
|
||||
//! @endcond
|
||||
|
||||
char **BuildMetadataDomainList( char** papszList,
|
||||
int bCheckNonEmpty, ... ) CPL_NULL_TERMINATED;
|
||||
public:
|
||||
GDALMajorObject();
|
||||
virtual ~GDALMajorObject();
|
||||
|
||||
int GetMOFlags();
|
||||
void SetMOFlags(int nFlagsIn);
|
||||
int GetMOFlags() const;
|
||||
void SetMOFlags( int nFlagsIn );
|
||||
|
||||
virtual const char *GetDescription() const;
|
||||
virtual void SetDescription( const char * );
|
||||
@@ -153,6 +159,8 @@ class CPL_DLL GDALMajorObject
|
||||
/* ******************************************************************** */
|
||||
/* GDALDefaultOverviews */
|
||||
/* ******************************************************************** */
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
class CPL_DLL GDALDefaultOverviews
|
||||
{
|
||||
friend class GDALDataset;
|
||||
@@ -162,21 +170,21 @@ class CPL_DLL GDALDefaultOverviews
|
||||
|
||||
CPLString osOvrFilename;
|
||||
|
||||
int bOvrIsAux;
|
||||
bool bOvrIsAux;
|
||||
|
||||
int bCheckedForMask;
|
||||
int bOwnMaskDS;
|
||||
bool bCheckedForMask;
|
||||
bool bOwnMaskDS;
|
||||
GDALDataset *poMaskDS;
|
||||
|
||||
// for "overview datasets" we record base level info so we can
|
||||
// For "overview datasets" we record base level info so we can
|
||||
// find our way back to get overview masks.
|
||||
GDALDataset *poBaseDS;
|
||||
|
||||
// Stuff for deferred initialize/overviewscans...
|
||||
// Stuff for deferred initialize/overviewscans.
|
||||
bool bCheckedForOverviews;
|
||||
void OverviewScan();
|
||||
char *pszInitName;
|
||||
int bInitNameIsOVR;
|
||||
bool bInitNameIsOVR;
|
||||
char **papszInitSiblingFiles;
|
||||
|
||||
public:
|
||||
@@ -187,7 +195,7 @@ class CPL_DLL GDALDefaultOverviews
|
||||
char **papszSiblingFiles = NULL,
|
||||
int bNameIsOVR = FALSE );
|
||||
|
||||
void TransferSiblingFiles(char** papszSiblingFiles);
|
||||
void TransferSiblingFiles( char** papszSiblingFiles );
|
||||
|
||||
int IsInitialized();
|
||||
|
||||
@@ -195,8 +203,8 @@ class CPL_DLL GDALDefaultOverviews
|
||||
|
||||
// Overview Related
|
||||
|
||||
int GetOverviewCount(int);
|
||||
GDALRasterBand *GetOverview(int,int);
|
||||
int GetOverviewCount( int nBand );
|
||||
GDALRasterBand *GetOverview( int nBand, int iOverview );
|
||||
|
||||
CPLErr BuildOverviews( const char * pszBasename,
|
||||
const char * pszResampling,
|
||||
@@ -226,15 +234,15 @@ class CPL_DLL GDALDefaultOverviews
|
||||
char** GetSiblingFiles() { return papszInitSiblingFiles; }
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALDefaultOverviews);
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALDefaultOverviews)
|
||||
};
|
||||
//! @endcond
|
||||
|
||||
/* ******************************************************************** */
|
||||
/* GDALOpenInfo */
|
||||
/* */
|
||||
/* Structure of data about dataset for open functions. */
|
||||
/* ******************************************************************** */
|
||||
|
||||
/** Class for dataset open functions. */
|
||||
class CPL_DLL GDALOpenInfo
|
||||
{
|
||||
bool bHasGotSiblingFiles;
|
||||
@@ -246,27 +254,39 @@ class CPL_DLL GDALOpenInfo
|
||||
char **papszSiblingFiles = NULL );
|
||||
~GDALOpenInfo( void );
|
||||
|
||||
/** Filename */
|
||||
char *pszFilename;
|
||||
/** Open options */
|
||||
char** papszOpenOptions;
|
||||
|
||||
/** Access flag */
|
||||
GDALAccess eAccess;
|
||||
/** Open flags */
|
||||
int nOpenFlags;
|
||||
|
||||
/** Whether stat()'ing the file was successful */
|
||||
int bStatOK;
|
||||
/** Whether the file is a directory */
|
||||
int bIsDirectory;
|
||||
|
||||
/** Pointer to the file */
|
||||
VSILFILE *fpL;
|
||||
|
||||
/** Number of bytes in pabyHeader */
|
||||
int nHeaderBytes;
|
||||
/** Buffer with first bytes of the file */
|
||||
GByte *pabyHeader;
|
||||
|
||||
/** Allowed drivers (NULL for all) */
|
||||
const char* const* papszAllowedDrivers;
|
||||
|
||||
int TryToIngest(int nBytes);
|
||||
char **GetSiblingFiles();
|
||||
char **StealSiblingFiles();
|
||||
bool AreSiblingFilesLoaded() const;
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALOpenInfo);
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALOpenInfo)
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
@@ -279,20 +299,26 @@ class OGRSpatialReference;
|
||||
class OGRStyleTable;
|
||||
class swq_select;
|
||||
class swq_select_parse_options;
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
typedef struct GDALSQLParseInfo GDALSQLParseInfo;
|
||||
//! @endcond
|
||||
|
||||
#ifdef DETECT_OLD_IRASTERIO
|
||||
typedef void signature_changed;
|
||||
#endif
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
#ifdef GDAL_COMPILATION
|
||||
#define OPTIONAL_OUTSIDE_GDAL(val)
|
||||
#else
|
||||
#define OPTIONAL_OUTSIDE_GDAL(val) = val
|
||||
#endif
|
||||
//! @endcond
|
||||
|
||||
//! A set of associated raster bands, usually from one file.
|
||||
class OGRFeature;
|
||||
|
||||
/** A set of associated raster bands, usually from one file. */
|
||||
class CPL_DLL GDALDataset : public GDALMajorObject
|
||||
{
|
||||
friend GDALDatasetH CPL_STDCALL GDALOpenEx( const char* pszFilename,
|
||||
@@ -309,9 +335,10 @@ class CPL_DLL GDALDataset : public GDALMajorObject
|
||||
|
||||
void AddToDatasetOpenList();
|
||||
|
||||
void Init(int bForceCachedIO);
|
||||
void Init( bool bForceCachedIO );
|
||||
|
||||
protected:
|
||||
//! @cond Doxygen_Suppress
|
||||
GDALDriver *poDriver;
|
||||
GDALAccess eAccess;
|
||||
|
||||
@@ -324,13 +351,13 @@ class CPL_DLL GDALDataset : public GDALMajorObject
|
||||
int nOpenFlags;
|
||||
|
||||
int nRefCount;
|
||||
GByte bForceCachedIO;
|
||||
GByte bShared;
|
||||
GByte bIsInternal;
|
||||
GByte bSuppressOnClose;
|
||||
bool bForceCachedIO;
|
||||
bool bShared;
|
||||
bool bIsInternal;
|
||||
bool bSuppressOnClose;
|
||||
|
||||
GDALDataset(void);
|
||||
GDALDataset(int bForceCachedIO);
|
||||
explicit GDALDataset(int bForceCachedIO);
|
||||
|
||||
void RasterInitialize( int, int );
|
||||
void SetBand( int, GDALRasterBand * );
|
||||
@@ -392,8 +419,9 @@ class CPL_DLL GDALDataset : public GDALMajorObject
|
||||
GDALRasterIOExtraArg* psExtraArg,
|
||||
int* pbTried);
|
||||
|
||||
//! @endcond
|
||||
virtual int CloseDependentDatasets();
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
int ValidateLayerCreationOptions( const char* const* papszLCO );
|
||||
|
||||
char **papszOpenOptions;
|
||||
@@ -404,6 +432,7 @@ class CPL_DLL GDALDataset : public GDALMajorObject
|
||||
// should not be used by out-of-tree code if possible.
|
||||
int EnterReadWrite(GDALRWFlag eRWFlag);
|
||||
void LeaveReadWrite();
|
||||
void InitRWLock();
|
||||
|
||||
void TemporarilyDropReadWriteLock();
|
||||
void ReacquireReadWriteLock();
|
||||
@@ -412,6 +441,7 @@ class CPL_DLL GDALDataset : public GDALMajorObject
|
||||
|
||||
int AcquireMutex();
|
||||
void ReleaseMutex();
|
||||
//! @endcond
|
||||
|
||||
public:
|
||||
virtual ~GDALDataset();
|
||||
@@ -424,15 +454,15 @@ class CPL_DLL GDALDataset : public GDALMajorObject
|
||||
virtual void FlushCache(void);
|
||||
|
||||
virtual const char *GetProjectionRef(void);
|
||||
virtual CPLErr SetProjection( const char * );
|
||||
virtual CPLErr SetProjection( const char * pszProjection );
|
||||
|
||||
virtual CPLErr GetGeoTransform( double * );
|
||||
virtual CPLErr SetGeoTransform( double * );
|
||||
virtual CPLErr GetGeoTransform( double * padfTransform );
|
||||
virtual CPLErr SetGeoTransform( double * padfTransform );
|
||||
|
||||
virtual CPLErr AddBand( GDALDataType eType,
|
||||
char **papszOptions=NULL );
|
||||
|
||||
virtual void *GetInternalHandle( const char * );
|
||||
virtual void *GetInternalHandle( const char * pszHandleName );
|
||||
virtual GDALDriver *GetDriver(void);
|
||||
virtual char **GetFileList(void);
|
||||
|
||||
@@ -472,13 +502,22 @@ class CPL_DLL GDALDataset : public GDALMajorObject
|
||||
|
||||
int Reference();
|
||||
int Dereference();
|
||||
int ReleaseRef();
|
||||
|
||||
/** Return access mode.
|
||||
* @return access mode.
|
||||
*/
|
||||
GDALAccess GetAccess() const { return eAccess; }
|
||||
|
||||
int GetShared();
|
||||
int GetShared() const;
|
||||
void MarkAsShared();
|
||||
|
||||
void MarkSuppressOnClose() { bSuppressOnClose = TRUE; }
|
||||
/** Set that the dataset must be deleted on close. */
|
||||
void MarkSuppressOnClose() { bSuppressOnClose = true; }
|
||||
|
||||
/** Return open options.
|
||||
* @return open options.
|
||||
*/
|
||||
char **GetOpenOptions() { return papszOpenOptions; }
|
||||
|
||||
static GDALDataset **GetOpenDatasets( int *pnDatasetCount );
|
||||
@@ -488,6 +527,21 @@ class CPL_DLL GDALDataset : public GDALMajorObject
|
||||
|
||||
void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5);
|
||||
|
||||
virtual char ** GetMetadata(const char * pszDomain = "") CPL_OVERRIDE;
|
||||
|
||||
// Only defined when Doxygen enabled
|
||||
#ifdef DOXYGEN_SKIP
|
||||
virtual CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
#endif
|
||||
|
||||
virtual char ** GetMetadataDomainList() CPL_OVERRIDE;
|
||||
|
||||
private:
|
||||
void *m_hPrivateData;
|
||||
|
||||
@@ -495,13 +549,19 @@ private:
|
||||
OGRGeometry *poSpatialFilter,
|
||||
const char *pszDialect,
|
||||
swq_select_parse_options* poSelectParseOptions);
|
||||
|
||||
CPLStringList oDerivedMetadataList;
|
||||
public:
|
||||
|
||||
virtual int GetLayerCount();
|
||||
virtual OGRLayer *GetLayer(int);
|
||||
virtual OGRLayer *GetLayer(int iLayer);
|
||||
virtual OGRLayer *GetLayerByName(const char *);
|
||||
virtual OGRErr DeleteLayer(int);
|
||||
virtual OGRErr DeleteLayer(int iLayer);
|
||||
|
||||
virtual void ResetReading();
|
||||
virtual OGRFeature* GetNextFeature( OGRLayer** ppoBelongingLayer,
|
||||
double* pdfProgressPct,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void* pProgressData );
|
||||
|
||||
virtual int TestCapability( const char * );
|
||||
|
||||
@@ -531,24 +591,26 @@ private:
|
||||
virtual OGRErr CommitTransaction();
|
||||
virtual OGRErr RollbackTransaction();
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
static int IsGenericSQLDialect(const char* pszDialect);
|
||||
|
||||
// Semi-public methods. Only to be used by in-tree drivers.
|
||||
GDALSQLParseInfo* BuildParseInfo(swq_select* psSelectInfo,
|
||||
swq_select_parse_options* poSelectParseOptions);
|
||||
void DestroyParseInfo(GDALSQLParseInfo* psParseInfo );
|
||||
static void DestroyParseInfo(GDALSQLParseInfo* psParseInfo );
|
||||
OGRLayer * ExecuteSQL( const char *pszStatement,
|
||||
OGRGeometry *poSpatialFilter,
|
||||
const char *pszDialect,
|
||||
swq_select_parse_options* poSelectParseOptions);
|
||||
//! @endcond
|
||||
|
||||
protected:
|
||||
|
||||
virtual OGRLayer *ICreateLayer( const char *pszName,
|
||||
OGRSpatialReference *poSpatialRef = NULL,
|
||||
OGRwkbGeometryType eGType = wkbUnknown,
|
||||
char ** papszOptions = NULL );
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
OGRErr ProcessSQLCreateIndex( const char * );
|
||||
OGRErr ProcessSQLDropIndex( const char * );
|
||||
OGRErr ProcessSQLDropTable( const char * );
|
||||
@@ -558,26 +620,27 @@ private:
|
||||
OGRErr ProcessSQLAlterTableRenameColumn( const char * );
|
||||
|
||||
OGRStyleTable *m_poStyleTable;
|
||||
//! @endcond
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALDataset);
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALDataset)
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
/* GDALRasterBlock */
|
||||
/* ******************************************************************** */
|
||||
|
||||
//! A single raster block in the block cache.
|
||||
// And the global block manager that manages a least-recently-used list of
|
||||
// blocks from various datasets/bands
|
||||
|
||||
/** A single raster block in the block cache.
|
||||
*
|
||||
* And the global block manager that manages a least-recently-used list of
|
||||
* blocks from various datasets/bands */
|
||||
class CPL_DLL GDALRasterBlock
|
||||
{
|
||||
friend class GDALAbstractBandBlockCache;
|
||||
|
||||
GDALDataType eType;
|
||||
|
||||
int bDirty;
|
||||
bool bDirty;
|
||||
volatile int nLockCount;
|
||||
|
||||
int nXOff;
|
||||
@@ -593,7 +656,7 @@ class CPL_DLL GDALRasterBlock
|
||||
GDALRasterBlock *poNext;
|
||||
GDALRasterBlock *poPrevious;
|
||||
|
||||
int bMustDetach;
|
||||
bool bMustDetach;
|
||||
|
||||
void Detach_unlocked( void );
|
||||
void Touch_unlocked( void );
|
||||
@@ -609,20 +672,45 @@ class CPL_DLL GDALRasterBlock
|
||||
void Touch( void );
|
||||
void MarkDirty( void );
|
||||
void MarkClean( void );
|
||||
/** Increment the lock count */
|
||||
int AddLock( void ) { return CPLAtomicInc(&nLockCount); }
|
||||
/** Decrement the lock count */
|
||||
int DropLock( void ) { return CPLAtomicDec(&nLockCount); }
|
||||
void Detach();
|
||||
|
||||
CPLErr Write();
|
||||
|
||||
/** Return the data type
|
||||
* @return data type
|
||||
*/
|
||||
GDALDataType GetDataType() const { return eType; }
|
||||
/** Return the x offset of the top-left corner of the block
|
||||
* @return x offset
|
||||
*/
|
||||
int GetXOff() const { return nXOff; }
|
||||
/** Return the y offset of the top-left corner of the block
|
||||
* @return y offset
|
||||
*/
|
||||
int GetYOff() const { return nYOff; }
|
||||
/** Return the width of the block
|
||||
* @return width
|
||||
*/
|
||||
int GetXSize() const { return nXSize; }
|
||||
/** Return the height of the block
|
||||
* @return height
|
||||
*/
|
||||
int GetYSize() const { return nYSize; }
|
||||
/** Return the dirty flag
|
||||
* @return dirty flag
|
||||
*/
|
||||
int GetDirty() const { return bDirty; }
|
||||
|
||||
/** Return the data buffer
|
||||
* @return data buffer
|
||||
*/
|
||||
void *GetDataRef( void ) { return pData; }
|
||||
/** Return the block size in bytes
|
||||
* @return block size.
|
||||
*/
|
||||
int GetBlockSize() const {
|
||||
return nXSize * nYSize * GDALGetDataTypeSizeBytes(eType); }
|
||||
|
||||
@@ -644,17 +732,19 @@ class CPL_DLL GDALRasterBlock
|
||||
#endif
|
||||
|
||||
/* Should only be called by GDALDestroyDriverManager() */
|
||||
//! @cond Doxygen_Suppress
|
||||
static void DestroyRBMutex();
|
||||
//! @endcond
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALRasterBlock);
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALRasterBlock)
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
/* GDALColorTable */
|
||||
/* ******************************************************************** */
|
||||
|
||||
/*! A color table / palette. */
|
||||
/** A color table / palette. */
|
||||
|
||||
class CPL_DLL GDALColorTable
|
||||
{
|
||||
@@ -663,7 +753,7 @@ class CPL_DLL GDALColorTable
|
||||
std::vector<GDALColorEntry> aoEntries;
|
||||
|
||||
public:
|
||||
GDALColorTable( GDALPaletteInterp = GPI_RGB );
|
||||
explicit GDALColorTable( GDALPaletteInterp = GPI_RGB );
|
||||
~GDALColorTable();
|
||||
|
||||
GDALColorTable *Clone() const;
|
||||
@@ -683,6 +773,8 @@ public:
|
||||
/* GDALAbstractBandBlockCache */
|
||||
/* ******************************************************************** */
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
|
||||
//! This manages how a raster band store its cached block.
|
||||
// CPL_DLL is just technical here. This is really a private concept
|
||||
// only used by GDALRasterBand implementation.
|
||||
@@ -706,7 +798,7 @@ class CPL_DLL GDALAbstractBandBlockCache
|
||||
void WaitKeepAliveCounter();
|
||||
|
||||
public:
|
||||
GDALAbstractBandBlockCache(GDALRasterBand* poBand);
|
||||
explicit GDALAbstractBandBlockCache(GDALRasterBand* poBand);
|
||||
virtual ~GDALAbstractBandBlockCache();
|
||||
|
||||
GDALRasterBlock* CreateBlock(int nXBlockOff, int nYBlockOff);
|
||||
@@ -726,11 +818,13 @@ class CPL_DLL GDALAbstractBandBlockCache
|
||||
GDALAbstractBandBlockCache* GDALArrayBandBlockCacheCreate(GDALRasterBand* poBand);
|
||||
GDALAbstractBandBlockCache* GDALHashSetBandBlockCacheCreate(GDALRasterBand* poBand);
|
||||
|
||||
//! @endcond
|
||||
|
||||
/* ******************************************************************** */
|
||||
/* GDALRasterBand */
|
||||
/* ******************************************************************** */
|
||||
|
||||
//! A single raster band (or channel).
|
||||
/** A single raster band (or channel). */
|
||||
|
||||
class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
{
|
||||
@@ -748,6 +842,7 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
void Init(int bForceCachedIO);
|
||||
|
||||
protected:
|
||||
//! @cond Doxygen_Suppress
|
||||
GDALDataset *poDS;
|
||||
int nBand; /* 1 based */
|
||||
|
||||
@@ -782,10 +877,12 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
|
||||
int EnterReadWrite(GDALRWFlag eRWFlag);
|
||||
void LeaveReadWrite();
|
||||
void InitRWLock();
|
||||
//! @endcond
|
||||
|
||||
protected:
|
||||
virtual CPLErr IReadBlock( int, int, void * ) = 0;
|
||||
virtual CPLErr IWriteBlock( int, int, void * );
|
||||
virtual CPLErr IReadBlock( int nBlockXOff, int nBlockYOff, void * pData ) = 0;
|
||||
virtual CPLErr IWriteBlock( int nBlockXOff, int nBlockYOff, void * pData );
|
||||
|
||||
#ifdef DETECT_OLD_IRASTERIO
|
||||
virtual signature_changed IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
@@ -796,6 +893,12 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
virtual int IGetDataCoverageStatus( int nXOff, int nYOff,
|
||||
int nXSize, int nYSize,
|
||||
int nMaskFlagStop,
|
||||
double* pdfDataPct);
|
||||
//! @cond Doxygen_Suppress
|
||||
CPLErr OverviewRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT;
|
||||
@@ -810,13 +913,14 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
|
||||
int InitBlockInfo();
|
||||
|
||||
CPLErr AdoptBlock( GDALRasterBlock * );
|
||||
GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff, int nYBlockYOff );
|
||||
void AddBlockToFreeList( GDALRasterBlock * );
|
||||
//! @endcond
|
||||
|
||||
GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff, int nYBlockYOff );
|
||||
|
||||
public:
|
||||
GDALRasterBand();
|
||||
GDALRasterBand(int bForceCachedIO);
|
||||
explicit GDALRasterBand(int bForceCachedIO);
|
||||
|
||||
virtual ~GDALRasterBand();
|
||||
|
||||
@@ -827,6 +931,7 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
|
||||
GDALDataType GetRasterDataType( void );
|
||||
void GetBlockSize( int *, int * );
|
||||
CPLErr GetActualBlockSize ( int, int, int *, int * );
|
||||
GDALAccess GetAccess();
|
||||
|
||||
CPLErr RasterIO( GDALRWFlag, int, int, int, int,
|
||||
@@ -862,14 +967,14 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
virtual GDALColorTable *GetColorTable();
|
||||
virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0);
|
||||
|
||||
virtual CPLErr SetCategoryNames( char ** );
|
||||
virtual CPLErr SetNoDataValue( double );
|
||||
virtual CPLErr SetCategoryNames( char ** papszNames );
|
||||
virtual CPLErr SetNoDataValue( double dfNoData );
|
||||
virtual CPLErr DeleteNoDataValue();
|
||||
virtual CPLErr SetColorTable( GDALColorTable * );
|
||||
virtual CPLErr SetColorInterpretation( GDALColorInterp );
|
||||
virtual CPLErr SetOffset( double );
|
||||
virtual CPLErr SetScale( double );
|
||||
virtual CPLErr SetUnitType( const char * );
|
||||
virtual CPLErr SetColorTable( GDALColorTable * poCT );
|
||||
virtual CPLErr SetColorInterpretation( GDALColorInterp eColorInterp );
|
||||
virtual CPLErr SetOffset( double dfNewOffset );
|
||||
virtual CPLErr SetScale( double dfNewScale );
|
||||
virtual CPLErr SetUnitType( const char * pszNewValue );
|
||||
|
||||
virtual CPLErr GetStatistics( int bApproxOK, int bForce,
|
||||
double *pdfMin, double *pdfMax,
|
||||
@@ -882,16 +987,31 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
double dfMean, double dfStdDev );
|
||||
virtual CPLErr ComputeRasterMinMax( int, double* );
|
||||
|
||||
// Only defined when Doxygen enabled
|
||||
#ifdef DOXYGEN_SKIP
|
||||
virtual char **GetMetadata( const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
#endif
|
||||
|
||||
virtual int HasArbitraryOverviews();
|
||||
virtual int GetOverviewCount();
|
||||
virtual GDALRasterBand *GetOverview(int);
|
||||
virtual GDALRasterBand *GetRasterSampleOverview( GUIntBig );
|
||||
virtual CPLErr BuildOverviews( const char *, int, int *,
|
||||
GDALProgressFunc, void * );
|
||||
virtual CPLErr BuildOverviews( const char * pszResampling,
|
||||
int nOverviews,
|
||||
int * panOverviewList,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressData );
|
||||
|
||||
virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
int nBufXSize, int nBufYSize,
|
||||
GDALDataType eDT, char **papszOptions );
|
||||
GDALDataType eBufType, char **papszOptions );
|
||||
|
||||
virtual CPLErr GetHistogram( double dfMin, double dfMax,
|
||||
int nBuckets, GUIntBig * panHistogram,
|
||||
@@ -906,7 +1026,7 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
int nBuckets, GUIntBig *panHistogram );
|
||||
|
||||
virtual GDALRasterAttributeTable *GetDefaultRAT();
|
||||
virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * );
|
||||
virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * poRAT );
|
||||
|
||||
virtual GDALRasterBand *GetMaskBand();
|
||||
virtual int GetMaskFlags();
|
||||
@@ -917,12 +1037,18 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
GIntBig *pnLineSpace,
|
||||
char **papszOptions ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
int GetDataCoverageStatus( int nXOff, int nYOff,
|
||||
int nXSize, int nYSize,
|
||||
int nMaskFlagStop = 0,
|
||||
double* pdfDataPct = NULL );
|
||||
|
||||
void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5);
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALRasterBand);
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALRasterBand)
|
||||
};
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
/* ******************************************************************** */
|
||||
/* GDALAllValidMaskBand */
|
||||
/* ******************************************************************** */
|
||||
@@ -930,14 +1056,14 @@ private:
|
||||
class CPL_DLL GDALAllValidMaskBand : public GDALRasterBand
|
||||
{
|
||||
protected:
|
||||
virtual CPLErr IReadBlock( int, int, void * );
|
||||
virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
|
||||
|
||||
public:
|
||||
GDALAllValidMaskBand( GDALRasterBand * );
|
||||
explicit GDALAllValidMaskBand( GDALRasterBand * );
|
||||
virtual ~GDALAllValidMaskBand();
|
||||
|
||||
virtual GDALRasterBand *GetMaskBand();
|
||||
virtual int GetMaskFlags();
|
||||
virtual GDALRasterBand *GetMaskBand() CPL_OVERRIDE;
|
||||
virtual int GetMaskFlags() CPL_OVERRIDE;
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
@@ -950,13 +1076,13 @@ class CPL_DLL GDALNoDataMaskBand : public GDALRasterBand
|
||||
GDALRasterBand *poParent;
|
||||
|
||||
protected:
|
||||
virtual CPLErr IReadBlock( int, int, void * );
|
||||
virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
|
||||
virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg );
|
||||
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
|
||||
|
||||
public:
|
||||
GDALNoDataMaskBand( GDALRasterBand * );
|
||||
explicit GDALNoDataMaskBand( GDALRasterBand * );
|
||||
virtual ~GDALNoDataMaskBand();
|
||||
};
|
||||
|
||||
@@ -969,10 +1095,10 @@ class CPL_DLL GDALNoDataValuesMaskBand : public GDALRasterBand
|
||||
double *padfNodataValues;
|
||||
|
||||
protected:
|
||||
virtual CPLErr IReadBlock( int, int, void * );
|
||||
virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
|
||||
|
||||
public:
|
||||
GDALNoDataValuesMaskBand( GDALDataset * );
|
||||
explicit GDALNoDataValuesMaskBand( GDALDataset * );
|
||||
virtual ~GDALNoDataValuesMaskBand();
|
||||
};
|
||||
|
||||
@@ -986,15 +1112,16 @@ class GDALRescaledAlphaBand : public GDALRasterBand
|
||||
void *pTemp;
|
||||
|
||||
protected:
|
||||
virtual CPLErr IReadBlock( int, int, void * );
|
||||
virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
|
||||
virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg );
|
||||
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
|
||||
|
||||
public:
|
||||
GDALRescaledAlphaBand( GDALRasterBand * );
|
||||
explicit GDALRescaledAlphaBand( GDALRasterBand * );
|
||||
virtual ~GDALRescaledAlphaBand();
|
||||
};
|
||||
//! @endcond
|
||||
|
||||
/* ******************************************************************** */
|
||||
/* GDALIdentifyEnum */
|
||||
@@ -1019,7 +1146,6 @@ typedef enum
|
||||
/* GDALDriver */
|
||||
/* ******************************************************************** */
|
||||
|
||||
|
||||
/**
|
||||
* \brief Format specific driver.
|
||||
*
|
||||
@@ -1035,11 +1161,11 @@ class CPL_DLL GDALDriver : public GDALMajorObject
|
||||
{
|
||||
public:
|
||||
GDALDriver();
|
||||
~GDALDriver();
|
||||
virtual ~GDALDriver();
|
||||
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain = "" );
|
||||
const char * pszValue,
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Public C++ methods. */
|
||||
@@ -1064,6 +1190,7 @@ class CPL_DLL GDALDriver : public GDALMajorObject
|
||||
/* by anyone but the formats instantiating and populating the */
|
||||
/* drivers. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
//! @cond Doxygen_Suppress
|
||||
GDALDataset *(*pfnOpen)( GDALOpenInfo * );
|
||||
|
||||
GDALDataset *(*pfnCreate)( const char * pszName,
|
||||
@@ -1103,10 +1230,12 @@ class CPL_DLL GDALDriver : public GDALMajorObject
|
||||
char ** papszOptions );
|
||||
CPLErr (*pfnDeleteDataSource)( GDALDriver*,
|
||||
const char * pszName );
|
||||
//! @endcond
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Helper methods. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
//! @cond Doxygen_Suppress
|
||||
GDALDataset *DefaultCreateCopy( const char *, GDALDataset *,
|
||||
int, char **,
|
||||
GDALProgressFunc pfnProgress,
|
||||
@@ -1114,14 +1243,17 @@ class CPL_DLL GDALDriver : public GDALMajorObject
|
||||
static CPLErr DefaultCopyMasks( GDALDataset *poSrcDS,
|
||||
GDALDataset *poDstDS,
|
||||
int bStrict );
|
||||
//! @endcond
|
||||
static CPLErr QuietDelete( const char * pszName );
|
||||
|
||||
CPLErr DefaultRename( const char * pszNewName,
|
||||
//! @cond Doxygen_Suppress
|
||||
static CPLErr DefaultRename( const char * pszNewName,
|
||||
const char * pszOldName );
|
||||
CPLErr DefaultCopyFiles( const char * pszNewName,
|
||||
static CPLErr DefaultCopyFiles( const char * pszNewName,
|
||||
const char * pszOldName );
|
||||
//! @endcond
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALDriver);
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALDriver)
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
@@ -1142,7 +1274,8 @@ class CPL_DLL GDALDriverManager : public GDALMajorObject
|
||||
std::map<CPLString, GDALDriver*> oMapNameToDrivers;
|
||||
|
||||
GDALDriver *GetDriver_unlocked( int iDriver )
|
||||
{ return (iDriver >= 0 && iDriver < nDrivers) ? papoDrivers[iDriver] : NULL; }
|
||||
{ return (iDriver >= 0 && iDriver < nDrivers) ?
|
||||
papoDrivers[iDriver] : NULL; }
|
||||
|
||||
GDALDriver *GetDriverByName_unlocked( const char * pszName )
|
||||
{ return oMapNameToDrivers[CPLString(pszName).toupper()]; }
|
||||
@@ -1151,7 +1284,7 @@ class CPL_DLL GDALDriverManager : public GDALMajorObject
|
||||
GDALDriverManager();
|
||||
~GDALDriverManager();
|
||||
|
||||
int GetDriverCount( void );
|
||||
int GetDriverCount( void ) const;
|
||||
GDALDriver *GetDriver( int );
|
||||
GDALDriver *GetDriverByName( const char * );
|
||||
|
||||
@@ -1159,7 +1292,7 @@ class CPL_DLL GDALDriverManager : public GDALMajorObject
|
||||
void DeregisterDriver( GDALDriver * );
|
||||
|
||||
// AutoLoadDrivers is a no-op if compiled with GDAL_NO_AUTOLOAD defined.
|
||||
void AutoLoadDrivers();
|
||||
static void AutoLoadDrivers();
|
||||
void AutoSkipDrivers();
|
||||
};
|
||||
|
||||
@@ -1179,6 +1312,7 @@ CPL_C_END
|
||||
class CPL_DLL GDALAsyncReader
|
||||
{
|
||||
protected:
|
||||
//! @cond Doxygen_Suppress
|
||||
GDALDataset* poDS;
|
||||
int nXOff;
|
||||
int nYOff;
|
||||
@@ -1193,24 +1327,67 @@ class CPL_DLL GDALAsyncReader
|
||||
int nPixelSpace;
|
||||
int nLineSpace;
|
||||
int nBandSpace;
|
||||
//! @endcond
|
||||
|
||||
public:
|
||||
GDALAsyncReader();
|
||||
virtual ~GDALAsyncReader();
|
||||
|
||||
/** Return dataset.
|
||||
* @return dataset
|
||||
*/
|
||||
GDALDataset* GetGDALDataset() {return poDS;}
|
||||
/** Return x offset.
|
||||
* @return x offset.
|
||||
*/
|
||||
int GetXOffset() const { return nXOff; }
|
||||
/** Return y offset.
|
||||
* @return y offset.
|
||||
*/
|
||||
int GetYOffset() const { return nYOff; }
|
||||
/** Return width.
|
||||
* @return width
|
||||
*/
|
||||
int GetXSize() const { return nXSize; }
|
||||
/** Return height.
|
||||
* @return height
|
||||
*/
|
||||
int GetYSize() const { return nYSize; }
|
||||
/** Return buffer.
|
||||
* @return buffer
|
||||
*/
|
||||
void * GetBuffer() {return pBuf;}
|
||||
/** Return buffer width.
|
||||
* @return buffer width.
|
||||
*/
|
||||
int GetBufferXSize() const { return nBufXSize; }
|
||||
/** Return buffer height.
|
||||
* @return buffer height.
|
||||
*/
|
||||
int GetBufferYSize() const { return nBufYSize; }
|
||||
/** Return buffer data type.
|
||||
* @return buffer data type.
|
||||
*/
|
||||
GDALDataType GetBufferType() const { return eBufType; }
|
||||
/** Return band count.
|
||||
* @return band count
|
||||
*/
|
||||
int GetBandCount() const { return nBandCount; }
|
||||
/** Return band map.
|
||||
* @return band map.
|
||||
*/
|
||||
int* GetBandMap() { return panBandMap; }
|
||||
/** Return pixel spacing.
|
||||
* @return pixel spacing.
|
||||
*/
|
||||
int GetPixelSpace() const { return nPixelSpace; }
|
||||
/** Return line spacing.
|
||||
* @return line spacing.
|
||||
*/
|
||||
int GetLineSpace() const { return nLineSpace; }
|
||||
/** Return band spacing.
|
||||
* @return band spacing.
|
||||
*/
|
||||
int GetBandSpace() const { return nBandSpace; }
|
||||
|
||||
virtual GDALAsyncStatusType
|
||||
@@ -1225,6 +1402,7 @@ class CPL_DLL GDALAsyncReader
|
||||
/* An assortment of overview related stuff. */
|
||||
/* ==================================================================== */
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
/* Only exported for drivers as plugin. Signature may change */
|
||||
CPLErr CPL_DLL
|
||||
GDALRegenerateOverviewsMultiBand(int nBands, GDALRasterBand** papoSrcBands,
|
||||
@@ -1249,7 +1427,8 @@ typedef CPLErr (*GDALResampleFunction)
|
||||
const char * pszResampling,
|
||||
int bHasNoData, float fNoDataValue,
|
||||
GDALColorTable* poColorTable,
|
||||
GDALDataType eSrcDataType);
|
||||
GDALDataType eSrcDataType,
|
||||
bool bPropagateNoData );
|
||||
|
||||
GDALResampleFunction GDALGetResampleFunction(const char* pszResampling,
|
||||
int* pnRadius);
|
||||
@@ -1340,11 +1519,15 @@ CPLErr CPL_DLL GDALParseGMLCoverage( CPLXMLNode *psTree,
|
||||
int CPL_DLL GDALCheckDatasetDimensions( int nXSize, int nYSize );
|
||||
int CPL_DLL GDALCheckBandCount( int nBands, int bIsZeroAllowed );
|
||||
|
||||
|
||||
// Test if 2 floating point values match. Useful when comparing values
|
||||
// stored as a string at some point. See #3573, #4183, #4506
|
||||
#define ARE_REAL_EQUAL(dfVal1, dfVal2) \
|
||||
(dfVal1 == dfVal2 || fabs(dfVal1 - dfVal2) < 1e-10 || (dfVal2 != 0 && fabs(1 - dfVal1 / dfVal2) < 1e-10 ))
|
||||
/* Is it FLT_MIN ? Cf #6578 */ \
|
||||
(((float)dfVal2 == (float)1.17549435e-38) ? ((float)dfVal1 == (float)dfVal2) : \
|
||||
/* Or DBL_MIN ? */ \
|
||||
(dfVal2 == 2.2250738585072014e-308) ? (dfVal1 == dfVal2) : \
|
||||
/* General case */ \
|
||||
(dfVal1 == dfVal2 || fabs(dfVal1 - dfVal2) < 1e-10 || (dfVal2 != 0 && fabs(1 - dfVal1 / dfVal2) < 1e-10 )))
|
||||
|
||||
/* Internal use only */
|
||||
|
||||
@@ -1392,9 +1575,9 @@ void GDALRasterIOExtraArgSetResampleAlg(GDALRasterIOExtraArg* psExtraArg,
|
||||
int nXSize, int nYSize,
|
||||
int nBufXSize, int nBufYSize);
|
||||
|
||||
/* CPL_DLL exported, but only for gdalwarp */
|
||||
GDALDataset CPL_DLL* GDALCreateOverviewDataset(GDALDataset* poDS, int nOvrLevel,
|
||||
int bThisLevelOnly, int bOwnDS);
|
||||
|
||||
GDALDataset* GDALCreateOverviewDataset(GDALDataset* poDS, int nOvrLevel,
|
||||
int bThisLevelOnly);
|
||||
|
||||
#define DIV_ROUND_UP(a, b) ( ((a) % (b)) == 0 ? ((a) / (b)) : (((a) / (b)) + 1) )
|
||||
|
||||
@@ -1419,5 +1602,6 @@ void GDALSerializeOpenOptionsToXML( CPLXMLNode* psParentNode, char** papszOpenOp
|
||||
char** GDALDeserializeOpenOptionsFromXML( CPLXMLNode* psParentNode );
|
||||
|
||||
int GDALCanFileAcceptSidecarFile(const char* pszFilename);
|
||||
//! @endcond
|
||||
|
||||
#endif /* ndef GDAL_PRIV_H_INCLUDED */
|
||||
|
||||
@@ -0,0 +1,354 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_priv_templates.hpp 36822 2016-12-12 11:18:45Z rouault $
|
||||
*
|
||||
* Project: GDAL Core
|
||||
* Purpose: Inline C++ templates
|
||||
* Author: Phil Vachon, <philippe at cowpig.ca>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2009, Phil Vachon, <philippe at cowpig.ca>
|
||||
*
|
||||
* 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 GDAL_PRIV_TEMPLATES_HPP_INCLUDED
|
||||
#define GDAL_PRIV_TEMPLATES_HPP_INCLUDED
|
||||
|
||||
#include <limits>
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALGetDataLimits() */
|
||||
/************************************************************************/
|
||||
/**
|
||||
* Compute the limits of values that can be placed in Tout in terms of
|
||||
* Tin. Usually used for output clamping, when the output data type's
|
||||
* limits are stable relative to the input type (i.e. no roundoff error).
|
||||
*
|
||||
* @param tMaxValue the returned maximum value
|
||||
* @param tMinValue the returned minimum value
|
||||
*/
|
||||
|
||||
template <class Tin, class Tout>
|
||||
inline void GDALGetDataLimits(Tin &tMaxValue, Tin &tMinValue)
|
||||
{
|
||||
tMaxValue = std::numeric_limits<Tin>::max();
|
||||
tMinValue = std::numeric_limits<Tin>::min();
|
||||
|
||||
// Compute the actual minimum value of Tout in terms of Tin.
|
||||
if (std::numeric_limits<Tout>::is_signed && std::numeric_limits<Tout>::is_integer)
|
||||
{
|
||||
// the minimum value is less than zero
|
||||
if (std::numeric_limits<Tout>::digits < std::numeric_limits<Tin>::digits ||
|
||||
!std::numeric_limits<Tin>::is_integer)
|
||||
{
|
||||
// Tout is smaller than Tin, so we need to clamp values in input
|
||||
// to the range of Tout's min/max values
|
||||
if (std::numeric_limits<Tin>::is_signed)
|
||||
{
|
||||
tMinValue = static_cast<Tin>(std::numeric_limits<Tout>::min());
|
||||
}
|
||||
tMaxValue = static_cast<Tin>(std::numeric_limits<Tout>::max());
|
||||
}
|
||||
}
|
||||
else if (std::numeric_limits<Tout>::is_integer)
|
||||
{
|
||||
// the output is unsigned, so we just need to determine the max
|
||||
/* coverity[same_on_both_sides] */
|
||||
if (std::numeric_limits<Tout>::digits <= std::numeric_limits<Tin>::digits)
|
||||
{
|
||||
// Tout is smaller than Tin, so we need to clamp the input values
|
||||
// to the range of Tout's max
|
||||
tMaxValue = static_cast<Tin>(std::numeric_limits<Tout>::max());
|
||||
}
|
||||
tMinValue = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALClampValue() */
|
||||
/************************************************************************/
|
||||
/**
|
||||
* Clamp values of type T to a specified range
|
||||
*
|
||||
* @param tValue the value
|
||||
* @param tMax the max value
|
||||
* @param tMin the min value
|
||||
*/
|
||||
template <class T>
|
||||
inline T GDALClampValue(const T tValue, const T tMax, const T tMin)
|
||||
{
|
||||
return tValue > tMax ? tMax :
|
||||
tValue < tMin ? tMin : tValue;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALCopyWord() */
|
||||
/************************************************************************/
|
||||
/**
|
||||
* Copy a single word, optionally rounding if appropriate (i.e. going
|
||||
* from the float to the integer case). Note that this is the function
|
||||
* you should specialize if you're adding a new data type.
|
||||
*
|
||||
* @param tValueIn value of type Tin; the input value to be converted
|
||||
* @param tValueOut value of type Tout; the output value
|
||||
*/
|
||||
|
||||
template <class Tin, class Tout>
|
||||
inline void GDALCopyWord(const Tin tValueIn, Tout &tValueOut)
|
||||
{
|
||||
Tin tMaxVal, tMinVal;
|
||||
GDALGetDataLimits<Tin, Tout>(tMaxVal, tMinVal);
|
||||
tValueOut = static_cast<Tout>(GDALClampValue(tValueIn, tMaxVal, tMinVal));
|
||||
}
|
||||
|
||||
template <class Tin>
|
||||
inline void GDALCopyWord(const Tin tValueIn, float &fValueOut)
|
||||
{
|
||||
fValueOut = (float) tValueIn;
|
||||
}
|
||||
|
||||
template <class Tin>
|
||||
inline void GDALCopyWord(const Tin tValueIn, double &dfValueOut)
|
||||
{
|
||||
dfValueOut = tValueIn;
|
||||
}
|
||||
|
||||
inline void GDALCopyWord(const double dfValueIn, double &dfValueOut)
|
||||
{
|
||||
dfValueOut = dfValueIn;
|
||||
}
|
||||
|
||||
inline void GDALCopyWord(const float fValueIn, float &fValueOut)
|
||||
{
|
||||
fValueOut = fValueIn;
|
||||
}
|
||||
|
||||
inline void GDALCopyWord(const float fValueIn, double &dfValueOut)
|
||||
{
|
||||
dfValueOut = fValueIn;
|
||||
}
|
||||
|
||||
inline void GDALCopyWord(const double dfValueIn, float &fValueOut)
|
||||
{
|
||||
fValueOut = static_cast<float>(dfValueIn);
|
||||
}
|
||||
|
||||
template <class Tout>
|
||||
inline void GDALCopyWord(const float fValueIn, Tout &tValueOut)
|
||||
{
|
||||
float fMaxVal, fMinVal;
|
||||
GDALGetDataLimits<float, Tout>(fMaxVal, fMinVal);
|
||||
tValueOut = static_cast<Tout>(
|
||||
GDALClampValue(fValueIn + 0.5f, fMaxVal, fMinVal));
|
||||
}
|
||||
|
||||
inline void GDALCopyWord(const float fValueIn, short &nValueOut)
|
||||
{
|
||||
float fMaxVal, fMinVal;
|
||||
GDALGetDataLimits<float, short>(fMaxVal, fMinVal);
|
||||
float fValue = fValueIn >= 0.0f ? fValueIn + 0.5f :
|
||||
fValueIn - 0.5f;
|
||||
nValueOut = static_cast<short>(
|
||||
GDALClampValue(fValue, fMaxVal, fMinVal));
|
||||
}
|
||||
|
||||
template <class Tout>
|
||||
inline void GDALCopyWord(const double dfValueIn, Tout &tValueOut)
|
||||
{
|
||||
double dfMaxVal, dfMinVal;
|
||||
GDALGetDataLimits<double, Tout>(dfMaxVal, dfMinVal);
|
||||
tValueOut = static_cast<Tout>(
|
||||
GDALClampValue(dfValueIn + 0.5, dfMaxVal, dfMinVal));
|
||||
}
|
||||
|
||||
inline void GDALCopyWord(const double dfValueIn, int &nValueOut)
|
||||
{
|
||||
double dfMaxVal, dfMinVal;
|
||||
GDALGetDataLimits<double, int>(dfMaxVal, dfMinVal);
|
||||
double dfValue = dfValueIn >= 0.0 ? dfValueIn + 0.5 :
|
||||
dfValueIn - 0.5;
|
||||
nValueOut = static_cast<int>(
|
||||
GDALClampValue(dfValue, dfMaxVal, dfMinVal));
|
||||
}
|
||||
|
||||
inline void GDALCopyWord(const double dfValueIn, short &nValueOut)
|
||||
{
|
||||
double dfMaxVal, dfMinVal;
|
||||
GDALGetDataLimits<double, short>(dfMaxVal, dfMinVal);
|
||||
double dfValue = dfValueIn > 0.0 ? dfValueIn + 0.5 :
|
||||
dfValueIn - 0.5;
|
||||
nValueOut = static_cast<short>(
|
||||
GDALClampValue(dfValue, dfMaxVal, dfMinVal));
|
||||
}
|
||||
|
||||
// Roundoff occurs for Float32 -> int32 for max/min. Overload GDALCopyWord
|
||||
// specifically for this case.
|
||||
inline void GDALCopyWord(const float fValueIn, int &nValueOut)
|
||||
{
|
||||
if (fValueIn >= static_cast<float>(std::numeric_limits<int>::max()))
|
||||
{
|
||||
nValueOut = std::numeric_limits<int>::max();
|
||||
}
|
||||
else if (fValueIn <= static_cast<float>(std::numeric_limits<int>::min()))
|
||||
{
|
||||
nValueOut = std::numeric_limits<int>::min();
|
||||
}
|
||||
else
|
||||
{
|
||||
nValueOut = static_cast<int>(fValueIn > 0.0f ?
|
||||
fValueIn + 0.5f : fValueIn - 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
// Roundoff occurs for Float32 -> uint32 for max. Overload GDALCopyWord
|
||||
// specifically for this case.
|
||||
inline void GDALCopyWord(const float fValueIn, unsigned int &nValueOut)
|
||||
{
|
||||
if (fValueIn >= static_cast<float>(std::numeric_limits<unsigned int>::max()))
|
||||
{
|
||||
nValueOut = std::numeric_limits<unsigned int>::max();
|
||||
}
|
||||
else if (fValueIn <= static_cast<float>(std::numeric_limits<unsigned int>::min()))
|
||||
{
|
||||
nValueOut = std::numeric_limits<unsigned int>::min();
|
||||
}
|
||||
else
|
||||
{
|
||||
nValueOut = static_cast<unsigned int>(fValueIn + 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALCopy4Words() */
|
||||
/************************************************************************/
|
||||
/**
|
||||
* Copy 4 packed words to 4 packed words, optionally rounding if appropriate
|
||||
* (i.e. going from the float to the integer case).
|
||||
*
|
||||
* @param pValueIn pointer to 4 input values of type Tin.
|
||||
* @param pValueOut pointer to 4 output values of type Tout.
|
||||
*/
|
||||
|
||||
template <class Tin, class Tout>
|
||||
inline void GDALCopy4Words(const Tin* pValueIn, Tout* const &pValueOut)
|
||||
{
|
||||
GDALCopyWord(pValueIn[0], pValueOut[0]);
|
||||
GDALCopyWord(pValueIn[1], pValueOut[1]);
|
||||
GDALCopyWord(pValueIn[2], pValueOut[2]);
|
||||
GDALCopyWord(pValueIn[3], pValueOut[3]);
|
||||
}
|
||||
|
||||
// Needs SSE2
|
||||
// _mm_cvtsi128_si64 doesn't work gcc 3.4
|
||||
#if (defined(__x86_64) || defined(_M_X64)) && !(defined(__GNUC__) && __GNUC__ < 4)
|
||||
|
||||
#include <emmintrin.h>
|
||||
|
||||
static inline void GDALCopyXMMToInt32(const __m128i xmm, void* pDest)
|
||||
{
|
||||
#ifdef CPL_CPU_REQUIRES_ALIGNED_ACCESS
|
||||
int n32 = _mm_cvtsi128_si32 (xmm); // Extract lower 32 bit word
|
||||
memcpy(pDest, &n32, sizeof(n32));
|
||||
#else
|
||||
*(int*)pDest = _mm_cvtsi128_si32 (xmm);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void GDALCopyXMMToInt64(const __m128i xmm, void* pDest)
|
||||
{
|
||||
#ifdef CPL_CPU_REQUIRES_ALIGNED_ACCESS
|
||||
GInt64 n64 = _mm_cvtsi128_si64 (xmm); // Extract lower 64 bit word
|
||||
memcpy(pDest, &n64, sizeof(n64));
|
||||
#else
|
||||
*(GInt64*)pDest = _mm_cvtsi128_si64 (xmm);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if __SSE4_1__
|
||||
#include <smmintrin.h>
|
||||
#endif
|
||||
|
||||
inline void GDALCopy4Words(const float* pValueIn, GByte* const &pValueOut)
|
||||
{
|
||||
__m128 xmm = _mm_loadu_ps(pValueIn);
|
||||
|
||||
// The following clamping would be useless due to the final saturating
|
||||
// packing if we could guarantee the input range in [INT_MIN,INT_MAX]
|
||||
const __m128 xmm_min = _mm_set1_ps(0);
|
||||
const __m128 xmm_max = _mm_set1_ps(255);
|
||||
xmm = _mm_min_ps(_mm_max_ps(xmm, xmm_min), xmm_max);
|
||||
|
||||
const __m128 p0d5 = _mm_set1_ps(0.5f);
|
||||
xmm = _mm_add_ps(xmm, p0d5);
|
||||
|
||||
__m128i xmm_i = _mm_cvttps_epi32 (xmm);
|
||||
|
||||
xmm_i = _mm_packs_epi32(xmm_i, xmm_i); // Pack int32 to int16
|
||||
xmm_i = _mm_packus_epi16(xmm_i, xmm_i); // Pack int16 to uint8
|
||||
GDALCopyXMMToInt32(xmm_i, pValueOut);
|
||||
}
|
||||
|
||||
inline void GDALCopy4Words(const float* pValueIn, GInt16* const &pValueOut)
|
||||
{
|
||||
__m128 xmm = _mm_loadu_ps(pValueIn);
|
||||
|
||||
const __m128 xmm_min = _mm_set1_ps(-32768);
|
||||
const __m128 xmm_max = _mm_set1_ps(32767);
|
||||
xmm = _mm_min_ps(_mm_max_ps(xmm, xmm_min), xmm_max);
|
||||
|
||||
const __m128 p0d5 = _mm_set1_ps(0.5f);
|
||||
const __m128 m0d5 = _mm_set1_ps(-0.5f);
|
||||
const __m128 mask = _mm_cmpge_ps(xmm, p0d5);
|
||||
// f >= 0.5f ? f + 0.5f : f - 0.5f
|
||||
xmm = _mm_add_ps(xmm, _mm_or_ps(_mm_and_ps(mask, p0d5),
|
||||
_mm_andnot_ps(mask, m0d5)));
|
||||
|
||||
__m128i xmm_i = _mm_cvttps_epi32 (xmm);
|
||||
|
||||
xmm_i = _mm_packs_epi32(xmm_i, xmm_i); // Pack int32 to int16
|
||||
GDALCopyXMMToInt64(xmm_i, pValueOut);
|
||||
}
|
||||
|
||||
inline void GDALCopy4Words(const float* pValueIn, GUInt16* const &pValueOut)
|
||||
{
|
||||
__m128 xmm = _mm_loadu_ps(pValueIn);
|
||||
|
||||
const __m128 xmm_min = _mm_set1_ps(0);
|
||||
const __m128 xmm_max = _mm_set1_ps(65535);
|
||||
xmm = _mm_min_ps(_mm_max_ps(xmm, xmm_min), xmm_max);
|
||||
|
||||
xmm = _mm_add_ps(xmm, _mm_set1_ps(0.5f));
|
||||
|
||||
__m128i xmm_i = _mm_cvttps_epi32 (xmm);
|
||||
|
||||
#if __SSE4_1__
|
||||
xmm_i = _mm_packus_epi32(xmm_i, xmm_i); // Pack int32 to uint16
|
||||
#else
|
||||
// Translate to int16 range because _mm_packus_epi32 is SSE4.1 only
|
||||
xmm_i = _mm_add_epi32(xmm_i, _mm_set1_epi32(-32768));
|
||||
xmm_i = _mm_packs_epi32(xmm_i, xmm_i); // Pack int32 to int16
|
||||
// Translate back to uint16 range (actually -32768==32768 in int16)
|
||||
xmm_i = _mm_add_epi16(xmm_i, _mm_set1_epi16(-32768));
|
||||
#endif
|
||||
GDALCopyXMMToInt64(xmm_i, pValueOut);
|
||||
}
|
||||
#endif // defined(__x86_64) || defined(_M_X64)
|
||||
|
||||
#endif // GDAL_PRIV_TEMPLATES_HPP_INCLUDED
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_proxy.h 33694 2016-03-10 17:54:30Z goatbar $
|
||||
* $Id: gdal_proxy.h 36501 2016-11-25 14:09:24Z rouault $
|
||||
*
|
||||
* Project: GDAL Core
|
||||
* Purpose: GDAL Core C++/Private declarations
|
||||
@@ -30,6 +30,8 @@
|
||||
#ifndef GDAL_PROXY_H_INCLUDED
|
||||
#define GDAL_PROXY_H_INCLUDED
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#include "gdal.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -50,51 +52,51 @@ class CPL_DLL GDALProxyDataset : public GDALDataset
|
||||
virtual void UnrefUnderlyingDataset(GDALDataset* poUnderlyingDataset);
|
||||
|
||||
virtual CPLErr IBuildOverviews( const char *, int, int *,
|
||||
int, int *, GDALProgressFunc, void * );
|
||||
int, int *, GDALProgressFunc, void * ) CPL_OVERRIDE;
|
||||
virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
int, int *, GSpacing, GSpacing, GSpacing,
|
||||
GDALRasterIOExtraArg* psExtraArg );
|
||||
GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
|
||||
public:
|
||||
|
||||
virtual char **GetMetadataDomainList();
|
||||
virtual char **GetMetadata( const char * pszDomain );
|
||||
virtual char **GetMetadataDomainList() CPL_OVERRIDE;
|
||||
virtual char **GetMetadata( const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain );
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain );
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain );
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
|
||||
virtual void FlushCache(void);
|
||||
virtual void FlushCache(void) CPL_OVERRIDE;
|
||||
|
||||
virtual const char *GetProjectionRef(void);
|
||||
virtual CPLErr SetProjection( const char * );
|
||||
virtual const char *GetProjectionRef(void) CPL_OVERRIDE;
|
||||
virtual CPLErr SetProjection( const char * ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr GetGeoTransform( double * );
|
||||
virtual CPLErr SetGeoTransform( double * );
|
||||
virtual CPLErr GetGeoTransform( double * ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetGeoTransform( double * ) CPL_OVERRIDE;
|
||||
|
||||
virtual void *GetInternalHandle( const char * );
|
||||
virtual GDALDriver *GetDriver(void);
|
||||
virtual char **GetFileList(void);
|
||||
virtual void *GetInternalHandle( const char * ) CPL_OVERRIDE;
|
||||
virtual GDALDriver *GetDriver(void) CPL_OVERRIDE;
|
||||
virtual char **GetFileList(void) CPL_OVERRIDE;
|
||||
|
||||
virtual int GetGCPCount();
|
||||
virtual const char *GetGCPProjection();
|
||||
virtual const GDAL_GCP *GetGCPs();
|
||||
virtual int GetGCPCount() CPL_OVERRIDE;
|
||||
virtual const char *GetGCPProjection() CPL_OVERRIDE;
|
||||
virtual const GDAL_GCP *GetGCPs() CPL_OVERRIDE;
|
||||
virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
const char *pszGCPProjection );
|
||||
const char *pszGCPProjection ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
int nBufXSize, int nBufYSize,
|
||||
GDALDataType eDT,
|
||||
int nBandCount, int *panBandList,
|
||||
char **papszOptions );
|
||||
char **papszOptions ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr CreateMaskBand( int nFlags );
|
||||
virtual CPLErr CreateMaskBand( int nFlags ) CPL_OVERRIDE;
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALProxyDataset);
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALProxyDataset)
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
@@ -109,94 +111,93 @@ class CPL_DLL GDALProxyRasterBand : public GDALRasterBand
|
||||
virtual GDALRasterBand* RefUnderlyingRasterBand() = 0;
|
||||
virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand);
|
||||
|
||||
virtual CPLErr IReadBlock( int, int, void * );
|
||||
virtual CPLErr IWriteBlock( int, int, void * );
|
||||
virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
|
||||
virtual CPLErr IWriteBlock( int, int, void * ) CPL_OVERRIDE;
|
||||
virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg );
|
||||
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
|
||||
|
||||
public:
|
||||
|
||||
virtual char **GetMetadataDomainList();
|
||||
virtual char **GetMetadata( const char * pszDomain );
|
||||
virtual char **GetMetadataDomainList() CPL_OVERRIDE;
|
||||
virtual char **GetMetadata( const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain );
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain );
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain );
|
||||
virtual CPLErr FlushCache();
|
||||
virtual char **GetCategoryNames();
|
||||
virtual double GetNoDataValue( int *pbSuccess = NULL );
|
||||
virtual double GetMinimum( int *pbSuccess = NULL );
|
||||
virtual double GetMaximum(int *pbSuccess = NULL );
|
||||
virtual double GetOffset( int *pbSuccess = NULL );
|
||||
virtual double GetScale( int *pbSuccess = NULL );
|
||||
virtual const char *GetUnitType();
|
||||
virtual GDALColorInterp GetColorInterpretation();
|
||||
virtual GDALColorTable *GetColorTable();
|
||||
virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0);
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual CPLErr FlushCache() CPL_OVERRIDE;
|
||||
virtual char **GetCategoryNames() CPL_OVERRIDE;
|
||||
virtual double GetNoDataValue( int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
virtual double GetMinimum( int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
virtual double GetMaximum(int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
virtual double GetOffset( int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
virtual double GetScale( int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
virtual const char *GetUnitType() CPL_OVERRIDE;
|
||||
virtual GDALColorInterp GetColorInterpretation() CPL_OVERRIDE;
|
||||
virtual GDALColorTable *GetColorTable() CPL_OVERRIDE;
|
||||
virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr SetCategoryNames( char ** );
|
||||
virtual CPLErr SetNoDataValue( double );
|
||||
virtual CPLErr DeleteNoDataValue();
|
||||
virtual CPLErr SetColorTable( GDALColorTable * );
|
||||
virtual CPLErr SetColorInterpretation( GDALColorInterp );
|
||||
virtual CPLErr SetOffset( double );
|
||||
virtual CPLErr SetScale( double );
|
||||
virtual CPLErr SetUnitType( const char * );
|
||||
virtual CPLErr SetCategoryNames( char ** ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetNoDataValue( double ) CPL_OVERRIDE;
|
||||
virtual CPLErr DeleteNoDataValue() CPL_OVERRIDE;
|
||||
virtual CPLErr SetColorTable( GDALColorTable * ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetColorInterpretation( GDALColorInterp ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetOffset( double ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetScale( double ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetUnitType( const char * ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr GetStatistics( int bApproxOK, int bForce,
|
||||
double *pdfMin, double *pdfMax,
|
||||
double *pdfMean, double *padfStdDev );
|
||||
double *pdfMean, double *padfStdDev ) CPL_OVERRIDE;
|
||||
virtual CPLErr ComputeStatistics( int bApproxOK,
|
||||
double *pdfMin, double *pdfMax,
|
||||
double *pdfMean, double *pdfStdDev,
|
||||
GDALProgressFunc, void *pProgressData );
|
||||
GDALProgressFunc, void *pProgressData ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetStatistics( double dfMin, double dfMax,
|
||||
double dfMean, double dfStdDev );
|
||||
virtual CPLErr ComputeRasterMinMax( int, double* );
|
||||
double dfMean, double dfStdDev ) CPL_OVERRIDE;
|
||||
virtual CPLErr ComputeRasterMinMax( int, double* ) CPL_OVERRIDE;
|
||||
|
||||
virtual int HasArbitraryOverviews();
|
||||
virtual int GetOverviewCount();
|
||||
virtual GDALRasterBand *GetOverview(int);
|
||||
virtual GDALRasterBand *GetRasterSampleOverview( GUIntBig );
|
||||
virtual int HasArbitraryOverviews() CPL_OVERRIDE;
|
||||
virtual int GetOverviewCount() CPL_OVERRIDE;
|
||||
virtual GDALRasterBand *GetOverview(int) CPL_OVERRIDE;
|
||||
virtual GDALRasterBand *GetRasterSampleOverview( GUIntBig ) CPL_OVERRIDE;
|
||||
virtual CPLErr BuildOverviews( const char *, int, int *,
|
||||
GDALProgressFunc, void * );
|
||||
GDALProgressFunc, void * ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
int nBufXSize, int nBufYSize,
|
||||
GDALDataType eDT, char **papszOptions );
|
||||
GDALDataType eDT, char **papszOptions ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr GetHistogram( double dfMin, double dfMax,
|
||||
int nBuckets, GUIntBig * panHistogram,
|
||||
int bIncludeOutOfRange, int bApproxOK,
|
||||
GDALProgressFunc, void *pProgressData );
|
||||
GDALProgressFunc, void *pProgressData ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
|
||||
int *pnBuckets, GUIntBig ** ppanHistogram,
|
||||
int bForce,
|
||||
GDALProgressFunc, void *pProgressData);
|
||||
GDALProgressFunc, void *pProgressData) CPL_OVERRIDE;
|
||||
virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
|
||||
int nBuckets, GUIntBig *panHistogram );
|
||||
int nBuckets, GUIntBig *panHistogram ) CPL_OVERRIDE;
|
||||
|
||||
virtual GDALRasterAttributeTable *GetDefaultRAT();
|
||||
virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * );
|
||||
virtual GDALRasterAttributeTable *GetDefaultRAT() CPL_OVERRIDE;
|
||||
virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * ) CPL_OVERRIDE;
|
||||
|
||||
virtual GDALRasterBand *GetMaskBand();
|
||||
virtual int GetMaskFlags();
|
||||
virtual CPLErr CreateMaskBand( int nFlags );
|
||||
virtual GDALRasterBand *GetMaskBand() CPL_OVERRIDE;
|
||||
virtual int GetMaskFlags() CPL_OVERRIDE;
|
||||
virtual CPLErr CreateMaskBand( int nFlags ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLVirtualMem *GetVirtualMemAuto( GDALRWFlag eRWFlag,
|
||||
int *pnPixelSpace,
|
||||
GIntBig *pnLineSpace,
|
||||
char **papszOptions );
|
||||
char **papszOptions ) CPL_OVERRIDE;
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALProxyRasterBand);
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALProxyRasterBand)
|
||||
};
|
||||
|
||||
|
||||
/* ******************************************************************** */
|
||||
/* GDALProxyPoolDataset */
|
||||
/* ******************************************************************** */
|
||||
@@ -222,8 +223,8 @@ class CPL_DLL GDALProxyPoolDataset : public GDALProxyDataset
|
||||
GDALProxyPoolCacheEntry* cacheEntry;
|
||||
|
||||
protected:
|
||||
virtual GDALDataset *RefUnderlyingDataset();
|
||||
virtual void UnrefUnderlyingDataset(GDALDataset* poUnderlyingDataset);
|
||||
virtual GDALDataset *RefUnderlyingDataset() CPL_OVERRIDE;
|
||||
virtual void UnrefUnderlyingDataset(GDALDataset* poUnderlyingDataset) CPL_OVERRIDE;
|
||||
|
||||
friend class GDALProxyPoolRasterBand;
|
||||
|
||||
@@ -234,30 +235,30 @@ class CPL_DLL GDALProxyPoolDataset : public GDALProxyDataset
|
||||
int bShared = FALSE,
|
||||
const char * pszProjectionRef = NULL,
|
||||
double * padfGeoTransform = NULL);
|
||||
~GDALProxyPoolDataset();
|
||||
virtual ~GDALProxyPoolDataset();
|
||||
|
||||
void SetOpenOptions(char** papszOpenOptions);
|
||||
void AddSrcBandDescription( GDALDataType eDataType, int nBlockXSize, int nBlockYSize);
|
||||
|
||||
virtual const char *GetProjectionRef(void);
|
||||
virtual CPLErr SetProjection( const char * );
|
||||
virtual const char *GetProjectionRef(void) CPL_OVERRIDE;
|
||||
virtual CPLErr SetProjection( const char * ) CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr GetGeoTransform( double * );
|
||||
virtual CPLErr SetGeoTransform( double * );
|
||||
virtual CPLErr GetGeoTransform( double * ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetGeoTransform( double * ) CPL_OVERRIDE;
|
||||
|
||||
/* Special behaviour for the following methods : they return a pointer */
|
||||
/* data type, that must be cached by the proxy, so it doesn't become invalid */
|
||||
/* when the underlying object get closed */
|
||||
virtual char **GetMetadata( const char * pszDomain );
|
||||
virtual char **GetMetadata( const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain );
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
|
||||
virtual void *GetInternalHandle( const char * pszRequest );
|
||||
virtual void *GetInternalHandle( const char * pszRequest ) CPL_OVERRIDE;
|
||||
|
||||
virtual const char *GetGCPProjection();
|
||||
virtual const GDAL_GCP *GetGCPs();
|
||||
virtual const char *GetGCPProjection() CPL_OVERRIDE;
|
||||
virtual const GDAL_GCP *GetGCPs() CPL_OVERRIDE;
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolDataset);
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolDataset)
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
@@ -283,8 +284,8 @@ class CPL_DLL GDALProxyPoolRasterBand : public GDALProxyRasterBand
|
||||
void Init();
|
||||
|
||||
protected:
|
||||
virtual GDALRasterBand* RefUnderlyingRasterBand();
|
||||
virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand);
|
||||
virtual GDALRasterBand* RefUnderlyingRasterBand() CPL_OVERRIDE;
|
||||
virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand) CPL_OVERRIDE;
|
||||
|
||||
friend class GDALProxyPoolOverviewRasterBand;
|
||||
friend class GDALProxyPoolMaskBand;
|
||||
@@ -295,24 +296,24 @@ class CPL_DLL GDALProxyPoolRasterBand : public GDALProxyRasterBand
|
||||
int nBlockXSize, int nBlockYSize);
|
||||
GDALProxyPoolRasterBand(GDALProxyPoolDataset* poDS,
|
||||
GDALRasterBand* poUnderlyingRasterBand);
|
||||
~GDALProxyPoolRasterBand();
|
||||
virtual ~GDALProxyPoolRasterBand();
|
||||
|
||||
void AddSrcMaskBandDescription( GDALDataType eDataType, int nBlockXSize, int nBlockYSize);
|
||||
|
||||
/* Special behaviour for the following methods : they return a pointer */
|
||||
/* data type, that must be cached by the proxy, so it doesn't become invalid */
|
||||
/* when the underlying object get closed */
|
||||
virtual char **GetMetadata( const char * pszDomain );
|
||||
virtual char **GetMetadata( const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain );
|
||||
virtual char **GetCategoryNames();
|
||||
virtual const char *GetUnitType();
|
||||
virtual GDALColorTable *GetColorTable();
|
||||
virtual GDALRasterBand *GetOverview(int);
|
||||
virtual GDALRasterBand *GetRasterSampleOverview( GUIntBig nDesiredSamples); // TODO
|
||||
virtual GDALRasterBand *GetMaskBand();
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual char **GetCategoryNames() CPL_OVERRIDE;
|
||||
virtual const char *GetUnitType() CPL_OVERRIDE;
|
||||
virtual GDALColorTable *GetColorTable() CPL_OVERRIDE;
|
||||
virtual GDALRasterBand *GetOverview(int) CPL_OVERRIDE;
|
||||
virtual GDALRasterBand *GetRasterSampleOverview( GUIntBig nDesiredSamples) CPL_OVERRIDE; // TODO
|
||||
virtual GDALRasterBand *GetMaskBand() CPL_OVERRIDE;
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolRasterBand);
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolRasterBand)
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
@@ -329,15 +330,15 @@ class GDALProxyPoolOverviewRasterBand : public GDALProxyPoolRasterBand
|
||||
int nRefCountUnderlyingMainRasterBand;
|
||||
|
||||
protected:
|
||||
virtual GDALRasterBand* RefUnderlyingRasterBand();
|
||||
virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand);
|
||||
virtual GDALRasterBand* RefUnderlyingRasterBand() CPL_OVERRIDE;
|
||||
virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand) CPL_OVERRIDE;
|
||||
|
||||
public:
|
||||
GDALProxyPoolOverviewRasterBand(GDALProxyPoolDataset* poDS,
|
||||
GDALRasterBand* poUnderlyingOverviewBand,
|
||||
GDALProxyPoolRasterBand* poMainBand,
|
||||
int nOverviewBand);
|
||||
~GDALProxyPoolOverviewRasterBand();
|
||||
virtual ~GDALProxyPoolOverviewRasterBand();
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
@@ -353,8 +354,8 @@ class GDALProxyPoolMaskBand : public GDALProxyPoolRasterBand
|
||||
int nRefCountUnderlyingMainRasterBand;
|
||||
|
||||
protected:
|
||||
virtual GDALRasterBand* RefUnderlyingRasterBand();
|
||||
virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand);
|
||||
virtual GDALRasterBand* RefUnderlyingRasterBand() CPL_OVERRIDE;
|
||||
virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand) CPL_OVERRIDE;
|
||||
|
||||
public:
|
||||
GDALProxyPoolMaskBand(GDALProxyPoolDataset* poDS,
|
||||
@@ -364,17 +365,15 @@ class GDALProxyPoolMaskBand : public GDALProxyPoolRasterBand
|
||||
GDALProxyPoolRasterBand* poMainBand,
|
||||
GDALDataType eDataType,
|
||||
int nBlockXSize, int nBlockYSize);
|
||||
~GDALProxyPoolMaskBand();
|
||||
virtual ~GDALProxyPoolMaskBand();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* ******************************************************************** */
|
||||
/* C types and methods declarations */
|
||||
/* ******************************************************************** */
|
||||
|
||||
|
||||
CPL_C_START
|
||||
|
||||
typedef struct GDALProxyPoolDatasetHS *GDALProxyPoolDatasetH;
|
||||
@@ -393,4 +392,6 @@ void CPL_DLL GDALProxyPoolDatasetAddSrcBandDescription( GDALProxyPoolDatasetH hP
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* GDAL_PROXY_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_rat.h 33773 2016-03-23 18:39:47Z goatbar $
|
||||
* $Id: gdal_rat.h 36501 2016-11-25 14:09:24Z rouault $
|
||||
*
|
||||
* Project: GDAL Core
|
||||
* Purpose: GDALRasterAttributeTable class declarations.
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
*
|
||||
* @return the column name or an empty string for invalid column numbers.
|
||||
*/
|
||||
virtual const char *GetNameOfCol( int ) const = 0;
|
||||
virtual const char *GetNameOfCol( int iCol ) const = 0;
|
||||
|
||||
/**
|
||||
* \brief Fetch column usage value.
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
*
|
||||
* @return the column usage, or GFU_Generic for improper column numbers.
|
||||
*/
|
||||
virtual GDALRATFieldUsage GetUsageOfCol( int ) const = 0;
|
||||
virtual GDALRATFieldUsage GetUsageOfCol( int iCol ) const = 0;
|
||||
|
||||
/**
|
||||
* \brief Fetch column type.
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
*
|
||||
* @return column type or GFT_Integer if the column index is illegal.
|
||||
*/
|
||||
virtual GDALRATFieldType GetTypeOfCol( int ) const = 0;
|
||||
virtual GDALRATFieldType GetTypeOfCol( int iCol ) const = 0;
|
||||
|
||||
/**
|
||||
* \brief Fetch column index for given usage.
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
*
|
||||
* @return column index, or -1 on failure.
|
||||
*/
|
||||
virtual int GetColOfUsage( GDALRATFieldUsage ) const = 0;
|
||||
virtual int GetColOfUsage( GDALRATFieldUsage eUsage ) const = 0;
|
||||
|
||||
/**
|
||||
* \brief Fetch row count.
|
||||
@@ -279,7 +279,7 @@ public:
|
||||
/* */
|
||||
/* (private) */
|
||||
/************************************************************************/
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
class GDALRasterAttributeField
|
||||
{
|
||||
public:
|
||||
@@ -293,6 +293,7 @@ class GDALRasterAttributeField
|
||||
std::vector<double> adfValues;
|
||||
std::vector<CPLString> aosValues;
|
||||
};
|
||||
//! @endcond
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALDefaultRasterAttributeTable */
|
||||
@@ -321,42 +322,42 @@ class CPL_DLL GDALDefaultRasterAttributeTable : public GDALRasterAttributeTable
|
||||
public:
|
||||
GDALDefaultRasterAttributeTable();
|
||||
GDALDefaultRasterAttributeTable( const GDALDefaultRasterAttributeTable& );
|
||||
~GDALDefaultRasterAttributeTable();
|
||||
virtual ~GDALDefaultRasterAttributeTable();
|
||||
|
||||
GDALDefaultRasterAttributeTable *Clone() const;
|
||||
GDALDefaultRasterAttributeTable *Clone() const CPL_OVERRIDE;
|
||||
|
||||
virtual int GetColumnCount() const;
|
||||
virtual int GetColumnCount() const CPL_OVERRIDE;
|
||||
|
||||
virtual const char *GetNameOfCol( int ) const;
|
||||
virtual GDALRATFieldUsage GetUsageOfCol( int ) const;
|
||||
virtual GDALRATFieldType GetTypeOfCol( int ) const;
|
||||
virtual const char *GetNameOfCol( int ) const CPL_OVERRIDE;
|
||||
virtual GDALRATFieldUsage GetUsageOfCol( int ) const CPL_OVERRIDE;
|
||||
virtual GDALRATFieldType GetTypeOfCol( int ) const CPL_OVERRIDE;
|
||||
|
||||
virtual int GetColOfUsage( GDALRATFieldUsage ) const;
|
||||
virtual int GetColOfUsage( GDALRATFieldUsage ) const CPL_OVERRIDE;
|
||||
|
||||
virtual int GetRowCount() const;
|
||||
virtual int GetRowCount() const CPL_OVERRIDE;
|
||||
|
||||
virtual const char *GetValueAsString( int iRow, int iField ) const;
|
||||
virtual int GetValueAsInt( int iRow, int iField ) const;
|
||||
virtual double GetValueAsDouble( int iRow, int iField ) const;
|
||||
virtual const char *GetValueAsString( int iRow, int iField ) const CPL_OVERRIDE;
|
||||
virtual int GetValueAsInt( int iRow, int iField ) const CPL_OVERRIDE;
|
||||
virtual double GetValueAsDouble( int iRow, int iField ) const CPL_OVERRIDE;
|
||||
|
||||
virtual void SetValue( int iRow, int iField,
|
||||
const char *pszValue );
|
||||
virtual void SetValue( int iRow, int iField, double dfValue);
|
||||
virtual void SetValue( int iRow, int iField, int nValue );
|
||||
const char *pszValue ) CPL_OVERRIDE;
|
||||
virtual void SetValue( int iRow, int iField, double dfValue) CPL_OVERRIDE;
|
||||
virtual void SetValue( int iRow, int iField, int nValue ) CPL_OVERRIDE;
|
||||
|
||||
virtual int ChangesAreWrittenToFile();
|
||||
virtual void SetRowCount( int iCount );
|
||||
virtual int ChangesAreWrittenToFile() CPL_OVERRIDE;
|
||||
virtual void SetRowCount( int iCount ) CPL_OVERRIDE;
|
||||
|
||||
virtual int GetRowOfValue( double dfValue ) const;
|
||||
virtual int GetRowOfValue( int nValue ) const;
|
||||
virtual int GetRowOfValue( double dfValue ) const CPL_OVERRIDE;
|
||||
virtual int GetRowOfValue( int nValue ) const CPL_OVERRIDE;
|
||||
|
||||
virtual CPLErr CreateColumn( const char *pszFieldName,
|
||||
GDALRATFieldType eFieldType,
|
||||
GDALRATFieldUsage eFieldUsage );
|
||||
GDALRATFieldUsage eFieldUsage ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetLinearBinning( double dfRow0Min,
|
||||
double dfBinSize );
|
||||
double dfBinSize ) CPL_OVERRIDE;
|
||||
virtual int GetLinearBinning( double *pdfRow0Min,
|
||||
double *pdfBinSize ) const;
|
||||
double *pdfBinSize ) const CPL_OVERRIDE;
|
||||
};
|
||||
|
||||
#endif /* ndef GDAL_RAT_H_INCLUDED */
|
||||
|
||||
@@ -1,554 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Project: GDAL
|
||||
* Purpose: Correlator
|
||||
* Author: Andrew Migal, migal.drew@gmail.com
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2012, Andrew Migal
|
||||
*
|
||||
* 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.
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @author Andrew Migal migal.drew@gmail.com
|
||||
* @brief Class for searching corresponding points on images.
|
||||
*/
|
||||
|
||||
#ifndef GDALSIMPLESURF_H_
|
||||
#define GDALSIMPLESURF_H_
|
||||
|
||||
#include "gdal_priv.h"
|
||||
#include "cpl_conv.h"
|
||||
#include <list>
|
||||
|
||||
/**
|
||||
* @brief Class of "feature point" in raster. Used by SURF-based algorithm.
|
||||
*
|
||||
* @details This point presents coordinates of distinctive pixel in image.
|
||||
* In computer vision, feature points - the most "strong" and "unique"
|
||||
* pixels (or areas) in picture, which can be distinguished from others.
|
||||
* For more details, see FAST corner detector, SIFT, SURF and similar algorithms.
|
||||
*/
|
||||
class GDALFeaturePoint
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Standard constructor. Initializes all parameters with negative numbers
|
||||
* and allocates memory for descriptor.
|
||||
*/
|
||||
GDALFeaturePoint();
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
* @param fp Copied instance of GDALFeaturePoint class
|
||||
*/
|
||||
GDALFeaturePoint(const GDALFeaturePoint& fp);
|
||||
|
||||
/**
|
||||
* Create instance of GDALFeaturePoint class
|
||||
*
|
||||
* @param nX X-coordinate (pixel)
|
||||
* @param nY Y-coordinate (line)
|
||||
* @param nScale Scale which contains this point (2, 4, 8, 16 and so on)
|
||||
* @param nRadius Half of the side of descriptor area
|
||||
* @param nSign Sign of Hessian determinant for this point
|
||||
*
|
||||
* @note This constructor normally is invoked by SURF-based algorithm,
|
||||
* which provides all necessary parameters.
|
||||
*/
|
||||
GDALFeaturePoint(int nX, int nY, int nScale, int nRadius, int nSign);
|
||||
virtual ~GDALFeaturePoint();
|
||||
|
||||
GDALFeaturePoint& operator=(const GDALFeaturePoint& point);
|
||||
|
||||
/**
|
||||
* Provide access to point's descriptor.
|
||||
*
|
||||
* @param nIndex Position of descriptor's value.
|
||||
* nIndex should be within range from 0 to DESC_SIZE (in current version - 64)
|
||||
*
|
||||
* @return Reference to value of descriptor in 'nIndex' position.
|
||||
* If index is out of range then behaviour is undefined.
|
||||
*/
|
||||
double& operator[](int nIndex);
|
||||
|
||||
// Descriptor length
|
||||
static const int DESC_SIZE = 64;
|
||||
|
||||
/**
|
||||
* Fetch X-coordinate (pixel) of point
|
||||
*
|
||||
* @return X-coordinate in pixels
|
||||
*/
|
||||
int GetX();
|
||||
|
||||
/**
|
||||
* Set X coordinate of point
|
||||
*
|
||||
* @param nX X coordinate in pixels
|
||||
*/
|
||||
void SetX(int nX);
|
||||
|
||||
/**
|
||||
* Fetch Y-coordinate (line) of point.
|
||||
*
|
||||
* @return Y-coordinate in pixels.
|
||||
*/
|
||||
int GetY();
|
||||
|
||||
/**
|
||||
* Set Y coordinate of point.
|
||||
*
|
||||
* @param nY Y coordinate in pixels.
|
||||
*/
|
||||
void SetY(int nY);
|
||||
|
||||
/**
|
||||
* Fetch scale of point.
|
||||
*
|
||||
* @return Scale for this point.
|
||||
*/
|
||||
int GetScale();
|
||||
|
||||
/**
|
||||
* Set scale of point.
|
||||
*
|
||||
* @param nScale Scale for this point.
|
||||
*/
|
||||
void SetScale(int nScale);
|
||||
|
||||
/**
|
||||
* Fetch radius of point.
|
||||
*
|
||||
* @return Radius for this point.
|
||||
*/
|
||||
int GetRadius();
|
||||
|
||||
/**
|
||||
* Set radius of point.
|
||||
*
|
||||
* @param nRadius Radius for this point.
|
||||
*/
|
||||
void SetRadius(int nRadius);
|
||||
|
||||
/**
|
||||
* Fetch sign of Hessian determinant of point.
|
||||
*
|
||||
* @return Sign for this point.
|
||||
*/
|
||||
int GetSign();
|
||||
|
||||
/**
|
||||
* Set sign of point.
|
||||
*
|
||||
* @param nSign Sign of Hessian determinant for this point.
|
||||
*/
|
||||
void SetSign(int nSign);
|
||||
|
||||
private:
|
||||
// Coordinates of point in image
|
||||
int nX;
|
||||
int nY;
|
||||
// --------------------
|
||||
int nScale;
|
||||
int nRadius;
|
||||
int nSign;
|
||||
// Descriptor array
|
||||
double *padfDescriptor;
|
||||
};
|
||||
|
||||
/**
|
||||
* @author Andrew Migal migal.drew@gmail.com
|
||||
* @brief Integral image class (summed area table).
|
||||
* @details Integral image is a table for fast computing the sum of
|
||||
* values in rectangular subarea. In more detail, for 2-dimensional array
|
||||
* of numbers this class provides capability to get sum of values in
|
||||
* rectangular arbitrary area with any size in constant time.
|
||||
* Integral image is constructed from grayscale picture.
|
||||
*/
|
||||
class GDALIntegralImage
|
||||
{
|
||||
public:
|
||||
GDALIntegralImage();
|
||||
virtual ~GDALIntegralImage();
|
||||
|
||||
/**
|
||||
* Compute integral image for specified array. Result is stored internally.
|
||||
*
|
||||
* @param padfImg Pointer to 2-dimensional array of values
|
||||
* @param nHeight Number of rows in array
|
||||
* @param nWidth Number of columns in array
|
||||
*/
|
||||
void Initialize(const double **padfImg, int nHeight, int nWidth);
|
||||
|
||||
/**
|
||||
* Fetch value of specified position in integral image.
|
||||
*
|
||||
* @param nRow Row of this position
|
||||
* @param nCol Column of this position
|
||||
*
|
||||
* @return Value in specified position or zero if parameters are out of range.
|
||||
*/
|
||||
double GetValue(int nRow, int nCol);
|
||||
|
||||
/**
|
||||
* Get sum of values in specified rectangular grid. Rectangle is constructed
|
||||
* from left top point.
|
||||
*
|
||||
* @param nRow Row of left top point of rectangle
|
||||
* @param nCol Column of left top point of rectangle
|
||||
* @param nWidth Width of rectangular area (number of columns)
|
||||
* @param nHeight Height of rectangular area (number of rows)
|
||||
*
|
||||
* @return Sum of values in specified grid.
|
||||
*/
|
||||
double GetRectangleSum(int nRow, int nCol, int nWidth, int nHeight);
|
||||
|
||||
/**
|
||||
* Get value of horizontal Haar wavelet in specified square grid.
|
||||
*
|
||||
* @param nRow Row of left top point of square
|
||||
* @param nCol Column of left top point of square
|
||||
* @param nSize Side of the square
|
||||
*
|
||||
* @return Value of horizontal Haar wavelet in specified square grid.
|
||||
*/
|
||||
double HaarWavelet_X(int nRow, int nCol, int nSize);
|
||||
|
||||
/**
|
||||
* Get value of vertical Haar wavelet in specified square grid.
|
||||
*
|
||||
* @param nRow Row of left top point of square
|
||||
* @param nCol Column of left top point of square
|
||||
* @param nSize Side of the square
|
||||
*
|
||||
* @return Value of vertical Haar wavelet in specified square grid.
|
||||
*/
|
||||
double HaarWavelet_Y(int nRow, int nCol, int nSize);
|
||||
|
||||
/**
|
||||
* Fetch height of integral image.
|
||||
*
|
||||
* @return Height of integral image (number of rows).
|
||||
*/
|
||||
int GetHeight();
|
||||
|
||||
/**
|
||||
* Fetch width of integral image.
|
||||
*
|
||||
* @return Width of integral image (number of columns).
|
||||
*/
|
||||
int GetWidth();
|
||||
|
||||
private:
|
||||
double **pMatrix;
|
||||
int nWidth;
|
||||
int nHeight;
|
||||
};
|
||||
|
||||
/**
|
||||
* @author Andrew Migal migal.drew@gmail.com
|
||||
* @brief Class for computation and storage of Hessian values in SURF-based algorithm.
|
||||
*
|
||||
* @details SURF-based algorithm normally uses this class for searching
|
||||
* feature points on raster images. Class also contains traces of Hessian matrices
|
||||
* to provide fast computations.
|
||||
*/
|
||||
class GDALOctaveLayer
|
||||
{
|
||||
public:
|
||||
GDALOctaveLayer();
|
||||
|
||||
/**
|
||||
* Create instance with provided parameters.
|
||||
*
|
||||
* @param nOctave Number of octave which contains this layer
|
||||
* @param nInterval Number of position in octave
|
||||
*
|
||||
* @note Normally constructor is invoked only by SURF-based algorithm.
|
||||
*/
|
||||
GDALOctaveLayer(int nOctave, int nInterval);
|
||||
virtual ~GDALOctaveLayer();
|
||||
|
||||
/**
|
||||
* Perform calculation of Hessian determinants and their signs
|
||||
* for specified integral image. Result is stored internally.
|
||||
*
|
||||
* @param poImg Integral image object, which provides all necessary
|
||||
* data for computation
|
||||
*
|
||||
* @note Normally method is invoked only by SURF-based algorithm.
|
||||
*/
|
||||
void ComputeLayer(GDALIntegralImage *poImg);
|
||||
|
||||
/**
|
||||
* Octave which contains this layer (1,2,3...)
|
||||
*/
|
||||
int octaveNum;
|
||||
/**
|
||||
* Length of the side of filter
|
||||
*/
|
||||
int filterSize;
|
||||
/**
|
||||
* Length of the border
|
||||
*/
|
||||
int radius;
|
||||
/**
|
||||
* Scale for this layer
|
||||
*/
|
||||
int scale;
|
||||
/**
|
||||
* Image width in pixels
|
||||
*/
|
||||
int width;
|
||||
/**
|
||||
* Image height in pixels
|
||||
*/
|
||||
int height;
|
||||
/**
|
||||
* Hessian values for image pixels
|
||||
*/
|
||||
double **detHessians;
|
||||
/**
|
||||
* Hessian signs for speeded matching
|
||||
*/
|
||||
int **signs;
|
||||
};
|
||||
|
||||
/**
|
||||
* @author Andrew Migal migal.drew@gmail.com
|
||||
* @brief Class for handling octave layers in SURF-based algorithm.
|
||||
* @details Class contains OctaveLayers and provides capability to construct octave space and distinguish
|
||||
* feature points. Normally this class is used only by SURF-based algorithm.
|
||||
*/
|
||||
class GDALOctaveMap
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Create octave space. Octave numbers are start with one. (1, 2, 3, 4, ... )
|
||||
*
|
||||
* @param nOctaveStart Number of bottom octave
|
||||
* @param nOctaveEnd Number of top octave. Should be equal or greater than OctaveStart
|
||||
*/
|
||||
GDALOctaveMap(int nOctaveStart, int nOctaveEnd);
|
||||
virtual ~GDALOctaveMap();
|
||||
|
||||
/**
|
||||
* Calculate Hessian values for octave space
|
||||
* (for all stored octave layers) using specified integral image
|
||||
* @param poImg Integral image instance which provides necessary data
|
||||
* @see GDALOctaveLayer
|
||||
*/
|
||||
void ComputeMap(GDALIntegralImage *poImg);
|
||||
|
||||
/**
|
||||
* Method makes decision that specified point
|
||||
* in middle octave layer is maximum among all points
|
||||
* from 3x3x3 neighbourhood (surrounding points in
|
||||
* bottom, middle and top layers). Provided layers should be from the same octave's interval.
|
||||
* Detects feature points.
|
||||
*
|
||||
* @param row Row of point, which is candidate to be feature point
|
||||
* @param col Column of point, which is candidate to be feature point
|
||||
* @param bot Bottom octave layer
|
||||
* @param mid Middle octave layer
|
||||
* @param top Top octave layer
|
||||
* @param threshold Threshold for feature point recognition. Detected feature point
|
||||
* will have Hessian value greater than this provided threshold.
|
||||
*
|
||||
* @return TRUE if candidate was evaluated as feature point or FALSE otherwise.
|
||||
*/
|
||||
bool PointIsExtremum(int row, int col, GDALOctaveLayer *bot,
|
||||
GDALOctaveLayer *mid, GDALOctaveLayer *top, double threshold);
|
||||
|
||||
/**
|
||||
* 2-dimensional array of octave layers
|
||||
*/
|
||||
GDALOctaveLayer ***pMap;
|
||||
|
||||
/**
|
||||
* Value for constructing internal octave space
|
||||
*/
|
||||
static const int INTERVALS = 4;
|
||||
|
||||
/**
|
||||
* Number of bottom octave
|
||||
*/
|
||||
int octaveStart;
|
||||
|
||||
/**
|
||||
* Number of top octave. Should be equal or greater than OctaveStart
|
||||
*/
|
||||
int octaveEnd;
|
||||
};
|
||||
|
||||
/**
|
||||
* @author Andrew Migal migal.drew@gmail.com
|
||||
* @brief Class for searching corresponding points on images.
|
||||
* @details Provides capability for detection feature points
|
||||
* and finding equal points on different images.
|
||||
* Class implements simplified version of SURF algorithm (Speeded Up Robust Features).
|
||||
* As original, this realization is scale invariant, but sensitive to rotation.
|
||||
* Images should have similar rotation angles (maximum difference is up to 10-15 degrees),
|
||||
* otherwise algorithm produces incorrect and very unstable results.
|
||||
*/
|
||||
|
||||
class GDALSimpleSURF
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* Class stores indexes of pair of point
|
||||
* and distance between them.
|
||||
*/
|
||||
class MatchedPointPairInfo
|
||||
{
|
||||
public:
|
||||
MatchedPointPairInfo(int nInd_1, int nInd_2, double dfDist)
|
||||
{
|
||||
ind_1 = nInd_1;
|
||||
ind_2 = nInd_2;
|
||||
euclideanDist = dfDist;
|
||||
}
|
||||
|
||||
int ind_1;
|
||||
int ind_2;
|
||||
double euclideanDist;
|
||||
};
|
||||
|
||||
public:
|
||||
/**
|
||||
* Prepare class according to specified parameters. Octave numbers affects
|
||||
* to amount of detected points and their robustness.
|
||||
* Range between bottom and top octaves also affects to required time of detection points
|
||||
* (if range is large, algorithm should perform more operations).
|
||||
* @param nOctaveStart Number of bottom octave. Octave numbers starts with one
|
||||
* @param nOctaveEnd Number of top octave. Should be equal or greater than OctaveStart
|
||||
*
|
||||
* @note
|
||||
* Every octave finds points with specific size. For small images
|
||||
* use small octave numbers, for high resolution - large.
|
||||
* For 1024x1024 images it's normal to use any octave numbers from range 1-6.
|
||||
* (for example, octave start - 1, octave end - 3, or octave start - 2, octave end - 2.)
|
||||
* For larger images, try 1-10 range or even higher.
|
||||
* Pay attention that number of detected point decreases quickly per octave
|
||||
* for particular image. Algorithm finds more points in case of small octave numbers.
|
||||
* If method detects nothing, reduce bottom bound of octave range.
|
||||
*
|
||||
* NOTICE that every octave requires time to compute. Use a little range
|
||||
* or only one octave if execution time is significant.
|
||||
*/
|
||||
GDALSimpleSURF(int nOctaveStart, int nOctaveEnd);
|
||||
virtual ~GDALSimpleSURF();
|
||||
|
||||
/**
|
||||
* Convert image with RGB channels to grayscale using "luminosity" method.
|
||||
* Result is used in SURF-based algorithm, but may be used anywhere where
|
||||
* grayscale images with nice contrast are required.
|
||||
*
|
||||
* @param red Image's red channel
|
||||
* @param green Image's green channel
|
||||
* @param blue Image's blue channel
|
||||
* @param nXSize Width of initial image
|
||||
* @param nYSize Height of initial image
|
||||
* @param padfImg Array for resulting grayscale image
|
||||
* @param nHeight Height of resulting image
|
||||
* @param nWidth Width of resulting image
|
||||
*
|
||||
* @return CE_None or CE_Failure if error occurs.
|
||||
*/
|
||||
static CPLErr ConvertRGBToLuminosity(
|
||||
GDALRasterBand *red,
|
||||
GDALRasterBand *green,
|
||||
GDALRasterBand *blue,
|
||||
int nXSize, int nYSize,
|
||||
double **padfImg, int nHeight, int nWidth);
|
||||
|
||||
/**
|
||||
* Find feature points using specified integral image.
|
||||
*
|
||||
* @param poImg Integral image to be used
|
||||
* @param dfThreshold Threshold for feature point recognition. Detected feature point
|
||||
* will have Hessian value greater than this provided threshold.
|
||||
*
|
||||
* @note Typical threshold's value is 0,001. But this value
|
||||
* can be various in each case and depends on image's nature.
|
||||
* For example, value can be 0.002 or 0.005.
|
||||
* Fill free to experiment with it.
|
||||
* If threshold is high, than number of detected feature points is small,
|
||||
* and vice versa.
|
||||
*/
|
||||
std::vector<GDALFeaturePoint>*
|
||||
ExtractFeaturePoints(GDALIntegralImage *poImg, double dfThreshold);
|
||||
|
||||
/**
|
||||
* Find corresponding points (equal points in two collections).
|
||||
*
|
||||
* @param poMatchPairs Resulting collection for matched points
|
||||
* @param poSecondCollect Points on the first image
|
||||
* @param poSecondCollect Points on the second image
|
||||
* @param dfThreshold Value from 0 to 1. Threshold affects to number of
|
||||
* matched points. If threshold is lower, amount of corresponding
|
||||
* points is larger, and vice versa
|
||||
*
|
||||
* @return CE_None or CE_Failure if error occurs.
|
||||
*/
|
||||
static CPLErr MatchFeaturePoints(
|
||||
std::vector<GDALFeaturePoint*> *poMatchPairs,
|
||||
std::vector<GDALFeaturePoint> *poFirstCollect,
|
||||
std::vector<GDALFeaturePoint> *poSecondCollect,
|
||||
double dfThreshold);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Compute euclidean distance between descriptors of two feature points.
|
||||
* It's used in comparison and matching of points.
|
||||
*
|
||||
* @param firstPoint First feature point to be compared
|
||||
* @param secondPoint Second feature point to be compared
|
||||
*
|
||||
* @return Euclidean distance between descriptors.
|
||||
*/
|
||||
static double GetEuclideanDistance(
|
||||
GDALFeaturePoint &firstPoint, GDALFeaturePoint &secondPoint);
|
||||
|
||||
/**
|
||||
* Set provided distance values to range from 0 to 1.
|
||||
*
|
||||
* @param poList List of distances to be normalized
|
||||
*/
|
||||
static void NormalizeDistances(std::list<MatchedPointPairInfo> *poList);
|
||||
|
||||
/**
|
||||
* Compute descriptor for specified feature point.
|
||||
*
|
||||
* @param poPoint Feature point instance
|
||||
* @param poImg image where feature point was found
|
||||
*/
|
||||
void SetDescriptor(GDALFeaturePoint *poPoint, GDALIntegralImage *poImg);
|
||||
|
||||
|
||||
private:
|
||||
int octaveStart;
|
||||
int octaveEnd;
|
||||
GDALOctaveMap *poOctMap;
|
||||
};
|
||||
|
||||
|
||||
#endif /* GDALSIMPLESURF_H_ */
|
||||
@@ -1,214 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id$
|
||||
*
|
||||
* Project: GDAL Utilities
|
||||
* Purpose: GDAL Utilities Public Declarations.
|
||||
* Author: Faza Mahamood, fazamhd at gmail dot com
|
||||
*
|
||||
* ****************************************************************************
|
||||
* Copyright (c) 1998, Frank Warmerdam
|
||||
* Copyright (c) 2007-2015, Even Rouault <even.rouault at spatialys.com>
|
||||
* Copyright (c) 2015, Faza Mahamood
|
||||
*
|
||||
* 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 GDAL_UTILS_H_INCLUDED
|
||||
#define GDAL_UTILS_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \file gdal_utils.h
|
||||
*
|
||||
* Public (C callable) GDAL Utilities entry points.
|
||||
*
|
||||
* @since GDAL 2.1
|
||||
*/
|
||||
|
||||
#include "cpl_port.h"
|
||||
#include "gdal.h"
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/*! Options for GDALInfo(). Opaque type */
|
||||
typedef struct GDALInfoOptions GDALInfoOptions;
|
||||
|
||||
typedef struct GDALInfoOptionsForBinary GDALInfoOptionsForBinary;
|
||||
|
||||
GDALInfoOptions CPL_DLL *GDALInfoOptionsNew(char** papszArgv, GDALInfoOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALInfoOptionsFree( GDALInfoOptions *psOptions );
|
||||
|
||||
char CPL_DLL *GDALInfo( GDALDatasetH hDataset, const GDALInfoOptions *psOptions );
|
||||
|
||||
|
||||
/*! Options for GDALTranslate(). Opaque type */
|
||||
typedef struct GDALTranslateOptions GDALTranslateOptions;
|
||||
|
||||
typedef struct GDALTranslateOptionsForBinary GDALTranslateOptionsForBinary;
|
||||
|
||||
GDALTranslateOptions CPL_DLL *GDALTranslateOptionsNew(char** papszArgv,
|
||||
GDALTranslateOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALTranslateOptionsFree( GDALTranslateOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALTranslateOptionsSetProgress( GDALTranslateOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALTranslate(const char *pszDestFilename,
|
||||
GDALDatasetH hSrcDataset,
|
||||
const GDALTranslateOptions *psOptions,
|
||||
int *pbUsageError);
|
||||
|
||||
/*! Options for GDALWarp(). Opaque type */
|
||||
typedef struct GDALWarpAppOptions GDALWarpAppOptions;
|
||||
|
||||
typedef struct GDALWarpAppOptionsForBinary GDALWarpAppOptionsForBinary;
|
||||
|
||||
GDALWarpAppOptions CPL_DLL *GDALWarpAppOptionsNew(char** papszArgv,
|
||||
GDALWarpAppOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALWarpAppOptionsFree( GDALWarpAppOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALWarpAppOptionsSetProgress( GDALWarpAppOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
void CPL_DLL GDALWarpAppOptionsSetWarpOption( GDALWarpAppOptions *psOptions,
|
||||
const char* pszKey,
|
||||
const char* pszValue );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALWarp( const char *pszDest, GDALDatasetH hDstDS,
|
||||
int nSrcCount, GDALDatasetH *pahSrcDS,
|
||||
const GDALWarpAppOptions *psOptions, int *pbUsageError );
|
||||
|
||||
/*! Options for GDALVectorTranslate(). Opaque type */
|
||||
typedef struct GDALVectorTranslateOptions GDALVectorTranslateOptions;
|
||||
|
||||
typedef struct GDALVectorTranslateOptionsForBinary GDALVectorTranslateOptionsForBinary;
|
||||
|
||||
GDALVectorTranslateOptions CPL_DLL *GDALVectorTranslateOptionsNew(char** papszArgv,
|
||||
GDALVectorTranslateOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALVectorTranslateOptionsFree( GDALVectorTranslateOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALVectorTranslateOptionsSetProgress( GDALVectorTranslateOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALVectorTranslate( const char *pszDest, GDALDatasetH hDstDS, int nSrcCount,
|
||||
GDALDatasetH *pahSrcDS,
|
||||
const GDALVectorTranslateOptions *psOptions, int *pbUsageError );
|
||||
|
||||
|
||||
/*! Options for GDALDEMProcessing(). Opaque type */
|
||||
typedef struct GDALDEMProcessingOptions GDALDEMProcessingOptions;
|
||||
|
||||
typedef struct GDALDEMProcessingOptionsForBinary GDALDEMProcessingOptionsForBinary;
|
||||
|
||||
GDALDEMProcessingOptions CPL_DLL *GDALDEMProcessingOptionsNew(char** papszArgv,
|
||||
GDALDEMProcessingOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALDEMProcessingOptionsFree( GDALDEMProcessingOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALDEMProcessingOptionsSetProgress( GDALDEMProcessingOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALDEMProcessing(const char *pszDestFilename,
|
||||
GDALDatasetH hSrcDataset,
|
||||
const char* pszProcessing,
|
||||
const char* pszColorFilename,
|
||||
const GDALDEMProcessingOptions *psOptions,
|
||||
int *pbUsageError);
|
||||
|
||||
/*! Options for GDALNearblack(). Opaque type */
|
||||
typedef struct GDALNearblackOptions GDALNearblackOptions;
|
||||
|
||||
typedef struct GDALNearblackOptionsForBinary GDALNearblackOptionsForBinary;
|
||||
|
||||
GDALNearblackOptions CPL_DLL *GDALNearblackOptionsNew(char** papszArgv,
|
||||
GDALNearblackOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALNearblackOptionsFree( GDALNearblackOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALNearblackOptionsSetProgress( GDALNearblackOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALNearblack( const char *pszDest, GDALDatasetH hDstDS,
|
||||
GDALDatasetH hSrcDS,
|
||||
const GDALNearblackOptions *psOptions, int *pbUsageError );
|
||||
|
||||
/*! Options for GDALGrid(). Opaque type */
|
||||
typedef struct GDALGridOptions GDALGridOptions;
|
||||
|
||||
typedef struct GDALGridOptionsForBinary GDALGridOptionsForBinary;
|
||||
|
||||
GDALGridOptions CPL_DLL *GDALGridOptionsNew(char** papszArgv,
|
||||
GDALGridOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALGridOptionsFree( GDALGridOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALGridOptionsSetProgress( GDALGridOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALGrid( const char *pszDest,
|
||||
GDALDatasetH hSrcDS,
|
||||
const GDALGridOptions *psOptions, int *pbUsageError );
|
||||
|
||||
/*! Options for GDALRasterize(). Opaque type */
|
||||
typedef struct GDALRasterizeOptions GDALRasterizeOptions;
|
||||
|
||||
typedef struct GDALRasterizeOptionsForBinary GDALRasterizeOptionsForBinary;
|
||||
|
||||
GDALRasterizeOptions CPL_DLL *GDALRasterizeOptionsNew(char** papszArgv,
|
||||
GDALRasterizeOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALRasterizeOptionsFree( GDALRasterizeOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALRasterizeOptionsSetProgress( GDALRasterizeOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALRasterize( const char *pszDest, GDALDatasetH hDstDS,
|
||||
GDALDatasetH hSrcDS,
|
||||
const GDALRasterizeOptions *psOptions, int *pbUsageError );
|
||||
|
||||
/*! Options for GDALBuildVRT(). Opaque type */
|
||||
typedef struct GDALBuildVRTOptions GDALBuildVRTOptions;
|
||||
|
||||
typedef struct GDALBuildVRTOptionsForBinary GDALBuildVRTOptionsForBinary;
|
||||
|
||||
GDALBuildVRTOptions CPL_DLL *GDALBuildVRTOptionsNew(char** papszArgv,
|
||||
GDALBuildVRTOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALBuildVRTOptionsFree( GDALBuildVRTOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALBuildVRTOptionsSetProgress( GDALBuildVRTOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALBuildVRT( const char *pszDest,
|
||||
int nSrcCount, GDALDatasetH *pahSrcDS, const char* const* papszSrcDSNames,
|
||||
const GDALBuildVRTOptions *psOptions, int *pbUsageError );
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif /* GDAL_UTILS_H_INCLUDED */
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $Id: gdal_version.h 38167 2017-04-28 16:00:45Z rouault $ */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* GDAL Version Information. */
|
||||
@@ -5,7 +6,7 @@
|
||||
|
||||
#ifndef GDAL_VERSION_MAJOR
|
||||
# define GDAL_VERSION_MAJOR 2
|
||||
# define GDAL_VERSION_MINOR 1
|
||||
# define GDAL_VERSION_MINOR 2
|
||||
# define GDAL_VERSION_REV 0
|
||||
# define GDAL_VERSION_BUILD 0
|
||||
#endif
|
||||
@@ -22,8 +23,8 @@
|
||||
#endif
|
||||
|
||||
#ifndef GDAL_RELEASE_DATE
|
||||
# define GDAL_RELEASE_DATE 20160425
|
||||
# define GDAL_RELEASE_DATE 20170428
|
||||
#endif
|
||||
#ifndef GDAL_RELEASE_NAME
|
||||
# define GDAL_RELEASE_NAME "2.1.0"
|
||||
# define GDAL_RELEASE_NAME "2.2.0"
|
||||
#endif
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_vrt.h 33720 2016-03-15 00:39:53Z goatbar $
|
||||
*
|
||||
* Project: Virtual GDAL Datasets
|
||||
* Purpose: C/Public declarations of virtual GDAL dataset objects.
|
||||
* Author: Andrey Kiselev, dron@ak4719.spb.edu
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2007, Andrey Kiselev <dron@ak4719.spb.edu>
|
||||
*
|
||||
* 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 GDAL_VRT_H_INCLUDED
|
||||
#define GDAL_VRT_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \file gdal_vrt.h
|
||||
*
|
||||
* Public (C callable) entry points for virtual GDAL dataset objects.
|
||||
*/
|
||||
|
||||
#include "gdal.h"
|
||||
#include "cpl_port.h"
|
||||
#include "cpl_error.h"
|
||||
#include "cpl_minixml.h"
|
||||
|
||||
#define VRT_NODATA_UNSET -1234.56
|
||||
|
||||
CPL_C_START
|
||||
|
||||
void GDALRegister_VRT();
|
||||
typedef CPLErr
|
||||
(*VRTImageReadFunc)( void *hCBData,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
void *pData );
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Define handle types related to various VRT dataset classes. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
typedef void *VRTDriverH;
|
||||
typedef void *VRTSourceH;
|
||||
typedef void *VRTSimpleSourceH;
|
||||
typedef void *VRTAveragedSourceH;
|
||||
typedef void *VRTComplexSourceH;
|
||||
typedef void *VRTFilteredSourceH;
|
||||
typedef void *VRTKernelFilteredSourceH;
|
||||
typedef void *VRTAverageFilteredSourceH;
|
||||
typedef void *VRTFuncSourceH;
|
||||
typedef void *VRTDatasetH;
|
||||
typedef void *VRTWarpedDatasetH;
|
||||
typedef void *VRTRasterBandH;
|
||||
typedef void *VRTSourcedRasterBandH;
|
||||
typedef void *VRTWarpedRasterBandH;
|
||||
typedef void *VRTDerivedRasterBandH;
|
||||
typedef void *VRTRawRasterBandH;
|
||||
|
||||
/* ==================================================================== */
|
||||
/* VRTDataset class. */
|
||||
/* ==================================================================== */
|
||||
|
||||
VRTDatasetH CPL_DLL CPL_STDCALL VRTCreate( int, int );
|
||||
void CPL_DLL CPL_STDCALL VRTFlushCache( VRTDatasetH );
|
||||
CPLXMLNode CPL_DLL * CPL_STDCALL VRTSerializeToXML( VRTDatasetH, const char * );
|
||||
int CPL_DLL CPL_STDCALL VRTAddBand( VRTDatasetH, GDALDataType, char ** );
|
||||
|
||||
/* ==================================================================== */
|
||||
/* VRTSourcedRasterBand class. */
|
||||
/* ==================================================================== */
|
||||
|
||||
CPLErr CPL_STDCALL VRTAddSource( VRTSourcedRasterBandH, VRTSourceH );
|
||||
CPLErr CPL_DLL CPL_STDCALL VRTAddSimpleSource( VRTSourcedRasterBandH,
|
||||
GDALRasterBandH,
|
||||
int, int, int, int,
|
||||
int, int, int, int,
|
||||
const char *, double );
|
||||
CPLErr CPL_DLL CPL_STDCALL VRTAddComplexSource( VRTSourcedRasterBandH,
|
||||
GDALRasterBandH,
|
||||
int, int, int, int,
|
||||
int, int, int, int,
|
||||
double, double, double );
|
||||
CPLErr CPL_DLL CPL_STDCALL VRTAddFuncSource( VRTSourcedRasterBandH,
|
||||
VRTImageReadFunc,
|
||||
void *, double );
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif /* GDAL_VRT_H_INCLUDED */
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalexif.h 33175 2016-01-27 00:37:49Z goatbar $
|
||||
* $Id: gdalexif.h 35883 2016-10-24 05:49:15Z goatbar $
|
||||
*
|
||||
* Project: JPEG JFIF Driver
|
||||
* Purpose: Implement GDAL JPEG Support based on IJG libjpeg.
|
||||
@@ -27,6 +27,8 @@
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
|
||||
#ifdef RENAME_INTERNAL_LIBTIFF_SYMBOLS
|
||||
#include "../frmts/gtiff/libtiff/gdal_libtiff_symbol_rename.h"
|
||||
#endif
|
||||
@@ -73,119 +75,117 @@ static const struct tagname {
|
||||
GUInt16 tag;
|
||||
const char* name;
|
||||
} tagnames [] = {
|
||||
|
||||
// { 0x100, "EXIF_Image_Width"},
|
||||
// { 0x101, "EXIF_Image_Length"},
|
||||
{ 0x102, "EXIF_BitsPerSample"},
|
||||
{ 0x103, "EXIF_Compression"},
|
||||
{ 0x106, "EXIF_PhotometricInterpretation"},
|
||||
{ 0x10A, "EXIF_Fill_Order"},
|
||||
{ 0x10D, "EXIF_Document_Name"},
|
||||
{ 0x10E, "EXIF_ImageDescription"},
|
||||
{ 0x10F, "EXIF_Make"},
|
||||
{ 0x110, "EXIF_Model"},
|
||||
{ 0x111, "EXIF_StripOffsets"},
|
||||
{ 0x112, "EXIF_Orientation"},
|
||||
{ 0x115, "EXIF_SamplesPerPixel"},
|
||||
{ 0x116, "EXIF_RowsPerStrip"},
|
||||
{ 0x117, "EXIF_StripByteCounts"},
|
||||
{ 0x11A, "EXIF_XResolution"},
|
||||
{ 0x11B, "EXIF_YResolution"},
|
||||
{ 0x11C, "EXIF_PlanarConfiguration"},
|
||||
{ 0x128, "EXIF_ResolutionUnit"},
|
||||
{ 0x12D, "EXIF_TransferFunction"},
|
||||
{ 0x131, "EXIF_Software"},
|
||||
{ 0x132, "EXIF_DateTime"},
|
||||
{ 0x13B, "EXIF_Artist"},
|
||||
{ 0x13E, "EXIF_WhitePoint"},
|
||||
{ 0x13F, "EXIF_PrimaryChromaticities"},
|
||||
{ 0x156, "EXIF_Transfer_Range"},
|
||||
{ 0x200, "EXIF_JPEG_Proc"},
|
||||
{ 0x201, "EXIF_JPEGInterchangeFormat"},
|
||||
{ 0x202, "EXIF_JPEGInterchangeFormatLength"},
|
||||
{ 0x211, "EXIF_YCbCrCoefficients"},
|
||||
{ 0x212, "EXIF_YCbCrSubSampling"},
|
||||
{ 0x213, "EXIF_YCbCrPositioning"},
|
||||
{ 0x214, "EXIF_ReferenceBlackWhite"},
|
||||
{ 0x828D, "EXIF_CFA_Repeat_Pattern_Dim"},
|
||||
{ 0x828E, "EXIF_CFA_Pattern"},
|
||||
{ 0x828F, "EXIF_Battery_Level"},
|
||||
{ 0x8298, "EXIF_Copyright"},
|
||||
{ 0x829A, "EXIF_ExposureTime"},
|
||||
{ 0x829D, "EXIF_FNumber"},
|
||||
{ 0x83BB, "EXIF_IPTC/NAA"},
|
||||
// { 0x8769, "EXIF_Offset"},
|
||||
{ 0x8773, "EXIF_Inter_Color_Profile"},
|
||||
{ 0x8822, "EXIF_ExposureProgram"},
|
||||
{ 0x8824, "EXIF_SpectralSensitivity"},
|
||||
// { 0x8825, "EXIF_GPSOffset"},
|
||||
{ 0x8827, "EXIF_ISOSpeedRatings"},
|
||||
{ 0x8828, "EXIF_OECF"},
|
||||
{ 0x9000, "EXIF_ExifVersion"},
|
||||
{ 0x9003, "EXIF_DateTimeOriginal"},
|
||||
{ 0x9004, "EXIF_DateTimeDigitized"},
|
||||
{ 0x9101, "EXIF_ComponentsConfiguration"},
|
||||
{ 0x9102, "EXIF_CompressedBitsPerPixel"},
|
||||
{ 0x9201, "EXIF_ShutterSpeedValue"},
|
||||
{ 0x9202, "EXIF_ApertureValue"},
|
||||
{ 0x9203, "EXIF_BrightnessValue"},
|
||||
{ 0x9204, "EXIF_ExposureBiasValue"},
|
||||
{ 0x9205, "EXIF_MaxApertureValue"},
|
||||
{ 0x9206, "EXIF_SubjectDistance"},
|
||||
{ 0x9207, "EXIF_MeteringMode"},
|
||||
{ 0x9208, "EXIF_LightSource"},
|
||||
{ 0x9209, "EXIF_Flash"},
|
||||
{ 0x920A, "EXIF_FocalLength"},
|
||||
{ 0x9214, "EXIF_SubjectArea"},
|
||||
{ 0x927C, "EXIF_MakerNote"},
|
||||
{ 0x9286, "EXIF_UserComment"},
|
||||
{ 0x9290, "EXIF_SubSecTime"},
|
||||
{ 0x9291, "EXIF_SubSecTime_Original"},
|
||||
{ 0x9292, "EXIF_SubSecTime_Digitized"},
|
||||
{ 0xA000, "EXIF_FlashpixVersion"},
|
||||
{ 0xA001, "EXIF_ColorSpace"},
|
||||
{ 0xA002, "EXIF_PixelXDimension"},
|
||||
{ 0xA003, "EXIF_PixelYDimension"},
|
||||
{ 0xA004, "EXIF_RelatedSoundFile"},
|
||||
// { 0xA005, "EXIF_InteroperabilityOffset"},
|
||||
{ 0xA20B, "EXIF_FlashEnergy"}, // 0x920B in TIFF/EP
|
||||
{ 0xA20C, "EXIF_SpatialFrequencyResponse"}, // 0x920C - -
|
||||
{ 0xA20E, "EXIF_FocalPlaneXResolution"}, // 0x920E - -
|
||||
{ 0xA20F, "EXIF_FocalPlaneYResolution"}, // 0x920F - -
|
||||
{ 0xA210, "EXIF_FocalPlaneResolutionUnit"}, // 0x9210 - -
|
||||
{ 0xA214, "EXIF_SubjectLocation"}, // 0x9214 - -
|
||||
{ 0xA215, "EXIF_ExposureIndex"}, // 0x9215 - -
|
||||
{ 0xA217, "EXIF_SensingMethod"}, // 0x9217 - -
|
||||
{ 0xA300, "EXIF_FileSource"},
|
||||
{ 0xA301, "EXIF_SceneType"},
|
||||
{ 0xA302, "EXIF_CFAPattern"},
|
||||
{ 0xA401, "EXIF_CustomRendered"},
|
||||
{ 0xA402, "EXIF_ExposureMode"},
|
||||
{ 0XA403, "EXIF_WhiteBalance"},
|
||||
{ 0xA404, "EXIF_DigitalZoomRatio"},
|
||||
{ 0xA405, "EXIF_FocalLengthIn35mmFilm"},
|
||||
{ 0xA406, "EXIF_SceneCaptureType"},
|
||||
{ 0xA407, "EXIF_GainControl"},
|
||||
{ 0xA408, "EXIF_Contrast"},
|
||||
{ 0xA409, "EXIF_Saturation"},
|
||||
{ 0xA40A, "EXIF_Sharpness"},
|
||||
{ 0xA40B, "EXIF_DeviceSettingDescription"},
|
||||
{ 0xA40C, "EXIF_SubjectDistanceRange"},
|
||||
{ 0xA420, "EXIF_ImageUniqueID"},
|
||||
{ 0x0000, ""}
|
||||
//{ 0x100, "EXIF_Image_Width"},
|
||||
// { 0x101, "EXIF_Image_Length"},
|
||||
{ 0x102, "EXIF_BitsPerSample"},
|
||||
{ 0x103, "EXIF_Compression"},
|
||||
{ 0x106, "EXIF_PhotometricInterpretation"},
|
||||
{ 0x10A, "EXIF_Fill_Order"},
|
||||
{ 0x10D, "EXIF_Document_Name"},
|
||||
{ 0x10E, "EXIF_ImageDescription"},
|
||||
{ 0x10F, "EXIF_Make"},
|
||||
{ 0x110, "EXIF_Model"},
|
||||
{ 0x111, "EXIF_StripOffsets"},
|
||||
{ 0x112, "EXIF_Orientation"},
|
||||
{ 0x115, "EXIF_SamplesPerPixel"},
|
||||
{ 0x116, "EXIF_RowsPerStrip"},
|
||||
{ 0x117, "EXIF_StripByteCounts"},
|
||||
{ 0x11A, "EXIF_XResolution"},
|
||||
{ 0x11B, "EXIF_YResolution"},
|
||||
{ 0x11C, "EXIF_PlanarConfiguration"},
|
||||
{ 0x128, "EXIF_ResolutionUnit"},
|
||||
{ 0x12D, "EXIF_TransferFunction"},
|
||||
{ 0x131, "EXIF_Software"},
|
||||
{ 0x132, "EXIF_DateTime"},
|
||||
{ 0x13B, "EXIF_Artist"},
|
||||
{ 0x13E, "EXIF_WhitePoint"},
|
||||
{ 0x13F, "EXIF_PrimaryChromaticities"},
|
||||
{ 0x156, "EXIF_Transfer_Range"},
|
||||
{ 0x200, "EXIF_JPEG_Proc"},
|
||||
{ 0x201, "EXIF_JPEGInterchangeFormat"},
|
||||
{ 0x202, "EXIF_JPEGInterchangeFormatLength"},
|
||||
{ 0x211, "EXIF_YCbCrCoefficients"},
|
||||
{ 0x212, "EXIF_YCbCrSubSampling"},
|
||||
{ 0x213, "EXIF_YCbCrPositioning"},
|
||||
{ 0x214, "EXIF_ReferenceBlackWhite"},
|
||||
{ 0x828D, "EXIF_CFA_Repeat_Pattern_Dim"},
|
||||
{ 0x828E, "EXIF_CFA_Pattern"},
|
||||
{ 0x828F, "EXIF_Battery_Level"},
|
||||
{ 0x8298, "EXIF_Copyright"},
|
||||
{ 0x829A, "EXIF_ExposureTime"},
|
||||
{ 0x829D, "EXIF_FNumber"},
|
||||
{ 0x83BB, "EXIF_IPTC/NAA"},
|
||||
// { 0x8769, "EXIF_Offset"},
|
||||
{ 0x8773, "EXIF_Inter_Color_Profile"},
|
||||
{ 0x8822, "EXIF_ExposureProgram"},
|
||||
{ 0x8824, "EXIF_SpectralSensitivity"},
|
||||
// { 0x8825, "EXIF_GPSOffset"},
|
||||
{ 0x8827, "EXIF_ISOSpeedRatings"},
|
||||
{ 0x8828, "EXIF_OECF"},
|
||||
{ 0x9000, "EXIF_ExifVersion"},
|
||||
{ 0x9003, "EXIF_DateTimeOriginal"},
|
||||
{ 0x9004, "EXIF_DateTimeDigitized"},
|
||||
{ 0x9101, "EXIF_ComponentsConfiguration"},
|
||||
{ 0x9102, "EXIF_CompressedBitsPerPixel"},
|
||||
{ 0x9201, "EXIF_ShutterSpeedValue"},
|
||||
{ 0x9202, "EXIF_ApertureValue"},
|
||||
{ 0x9203, "EXIF_BrightnessValue"},
|
||||
{ 0x9204, "EXIF_ExposureBiasValue"},
|
||||
{ 0x9205, "EXIF_MaxApertureValue"},
|
||||
{ 0x9206, "EXIF_SubjectDistance"},
|
||||
{ 0x9207, "EXIF_MeteringMode"},
|
||||
{ 0x9208, "EXIF_LightSource"},
|
||||
{ 0x9209, "EXIF_Flash"},
|
||||
{ 0x920A, "EXIF_FocalLength"},
|
||||
{ 0x9214, "EXIF_SubjectArea"},
|
||||
{ 0x927C, "EXIF_MakerNote"},
|
||||
{ 0x9286, "EXIF_UserComment"},
|
||||
{ 0x9290, "EXIF_SubSecTime"},
|
||||
{ 0x9291, "EXIF_SubSecTime_Original"},
|
||||
{ 0x9292, "EXIF_SubSecTime_Digitized"},
|
||||
{ 0xA000, "EXIF_FlashpixVersion"},
|
||||
{ 0xA001, "EXIF_ColorSpace"},
|
||||
{ 0xA002, "EXIF_PixelXDimension"},
|
||||
{ 0xA003, "EXIF_PixelYDimension"},
|
||||
{ 0xA004, "EXIF_RelatedSoundFile"},
|
||||
// { 0xA005, "EXIF_InteroperabilityOffset"},
|
||||
{ 0xA20B, "EXIF_FlashEnergy"}, // 0x920B in TIFF/EP
|
||||
{ 0xA20C, "EXIF_SpatialFrequencyResponse"}, // 0x920C - -
|
||||
{ 0xA20E, "EXIF_FocalPlaneXResolution"}, // 0x920E - -
|
||||
{ 0xA20F, "EXIF_FocalPlaneYResolution"}, // 0x920F - -
|
||||
{ 0xA210, "EXIF_FocalPlaneResolutionUnit"}, // 0x9210 - -
|
||||
{ 0xA214, "EXIF_SubjectLocation"}, // 0x9214 - -
|
||||
{ 0xA215, "EXIF_ExposureIndex"}, // 0x9215 - -
|
||||
{ 0xA217, "EXIF_SensingMethod"}, // 0x9217 - -
|
||||
{ 0xA300, "EXIF_FileSource"},
|
||||
{ 0xA301, "EXIF_SceneType"},
|
||||
{ 0xA302, "EXIF_CFAPattern"},
|
||||
{ 0xA401, "EXIF_CustomRendered"},
|
||||
{ 0xA402, "EXIF_ExposureMode"},
|
||||
{ 0XA403, "EXIF_WhiteBalance"},
|
||||
{ 0xA404, "EXIF_DigitalZoomRatio"},
|
||||
{ 0xA405, "EXIF_FocalLengthIn35mmFilm"},
|
||||
{ 0xA406, "EXIF_SceneCaptureType"},
|
||||
{ 0xA407, "EXIF_GainControl"},
|
||||
{ 0xA408, "EXIF_Contrast"},
|
||||
{ 0xA409, "EXIF_Saturation"},
|
||||
{ 0xA40A, "EXIF_Sharpness"},
|
||||
{ 0xA40B, "EXIF_DeviceSettingDescription"},
|
||||
{ 0xA40C, "EXIF_SubjectDistanceRange"},
|
||||
{ 0xA420, "EXIF_ImageUniqueID"},
|
||||
{ 0x0000, ""}
|
||||
};
|
||||
|
||||
|
||||
static const struct intr_tag {
|
||||
GInt16 tag;
|
||||
const char* name;
|
||||
} intr_tags [] = {
|
||||
|
||||
{ 0x1, "EXIF_Interoperability_Index"},
|
||||
{ 0x2, "EXIF_Interoperability_Version"},
|
||||
{ 0x1000, "EXIF_Related_Image_File_Format"},
|
||||
{ 0x1001, "EXIF_Related_Image_Width"},
|
||||
{ 0x1002, "EXIF_Related_Image_Length"},
|
||||
{ 0x1, "EXIF_Interoperability_Index"},
|
||||
{ 0x2, "EXIF_Interoperability_Version"},
|
||||
{ 0x1000, "EXIF_Related_Image_File_Format"},
|
||||
{ 0x1001, "EXIF_Related_Image_Width"},
|
||||
{ 0x1002, "EXIF_Related_Image_Length"},
|
||||
{ 0x0000, ""}
|
||||
};
|
||||
|
||||
@@ -225,11 +225,14 @@ typedef struct {
|
||||
} GDALEXIFTIFFDirEntry;
|
||||
|
||||
CPL_C_START
|
||||
extern int TIFFDataWidth(GDALEXIFTIFFDataType); /* table of tag datatype widths */
|
||||
extern void TIFFSwabShort(GUInt16*);
|
||||
extern void TIFFSwabLong(GUInt32*);
|
||||
extern void TIFFSwabDouble(double*);
|
||||
extern void TIFFSwabArrayOfShort(GUInt16*, unsigned long);
|
||||
extern void TIFFSwabArrayOfLong(GUInt32*, unsigned long);
|
||||
extern void TIFFSwabArrayOfDouble(double*, unsigned long);
|
||||
/* Table of tag datatype widths. */
|
||||
extern int TIFFDataWidth(GDALEXIFTIFFDataType);
|
||||
extern void TIFFSwabShort(GUInt16*);
|
||||
extern void TIFFSwabLong(GUInt32*);
|
||||
extern void TIFFSwabDouble(double*);
|
||||
extern void TIFFSwabArrayOfShort(GUInt16*, unsigned long);
|
||||
extern void TIFFSwabArrayOfLong(GUInt32*, unsigned long);
|
||||
extern void TIFFSwabArrayOfDouble(double*, unsigned long);
|
||||
CPL_C_END
|
||||
|
||||
//! @endcond
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalgeorefpamdataset.h 33794 2016-03-26 13:19:07Z goatbar $
|
||||
* $Id: gdalgeorefpamdataset.h 36501 2016-11-25 14:09:24Z rouault $
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: GDALPamDataset with internal storage for georeferencing, with
|
||||
@@ -31,6 +31,8 @@
|
||||
#ifndef GDAL_GEOREF_PAM_DATASET_H_INCLUDED
|
||||
#define GDAL_GEOREF_PAM_DATASET_H_INCLUDED
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#include "gdal_pam.h"
|
||||
|
||||
class CPL_DLL GDALGeorefPamDataset : public GDALPamDataset
|
||||
@@ -41,17 +43,45 @@ class CPL_DLL GDALGeorefPamDataset : public GDALPamDataset
|
||||
char *pszProjection;
|
||||
int nGCPCount;
|
||||
GDAL_GCP *pasGCPList;
|
||||
char** m_papszRPC;
|
||||
bool m_bPixelIsPoint;
|
||||
|
||||
int m_nGeoTransformGeorefSrcIndex;
|
||||
int m_nGCPGeorefSrcIndex;
|
||||
int m_nProjectionGeorefSrcIndex;
|
||||
int m_nRPCGeorefSrcIndex;
|
||||
int m_nPixelIsPointGeorefSrcIndex;
|
||||
|
||||
int GetPAMGeorefSrcIndex();
|
||||
bool m_bGotPAMGeorefSrcIndex;
|
||||
int m_nPAMGeorefSrcIndex;
|
||||
|
||||
bool m_bPAMLoaded;
|
||||
char** m_papszMainMD;
|
||||
|
||||
public:
|
||||
GDALGeorefPamDataset();
|
||||
virtual ~GDALGeorefPamDataset();
|
||||
|
||||
virtual CPLErr GetGeoTransform( double * );
|
||||
virtual const char *GetProjectionRef();
|
||||
virtual CPLErr TryLoadXML(char **papszSiblingFiles = NULL) CPL_OVERRIDE;
|
||||
|
||||
virtual int GetGCPCount();
|
||||
virtual const char *GetGCPProjection();
|
||||
virtual const GDAL_GCP *GetGCPs();
|
||||
virtual CPLErr GetGeoTransform( double * ) CPL_OVERRIDE;
|
||||
virtual const char *GetProjectionRef() CPL_OVERRIDE;
|
||||
|
||||
virtual int GetGCPCount() CPL_OVERRIDE;
|
||||
virtual const char *GetGCPProjection() CPL_OVERRIDE;
|
||||
virtual const GDAL_GCP *GetGCPs() CPL_OVERRIDE;
|
||||
|
||||
virtual char **GetMetadata( const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
};
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* GDAL_GEOREF_PAM_DATASET_H_INCLUDED */
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalgrid.h 29541 2015-07-20 14:03:42Z rouault $
|
||||
*
|
||||
* Project: GDAL Gridding API.
|
||||
* Purpose: Prototypes, and definitions for of GDAL scattered data gridder.
|
||||
* Author: Andrey Kiselev, dron@ak4719.spb.edu
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2007, Andrey Kiselev <dron@ak4719.spb.edu>
|
||||
* Copyright (c) 2012, Even Rouault <even dot rouault at mines-paris dot org>
|
||||
*
|
||||
* 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 GDALGRID_H_INCLUDED
|
||||
#define GDALGRID_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \file gdalgrid.h
|
||||
*
|
||||
* GDAL gridder related entry points and definitions.
|
||||
*/
|
||||
|
||||
#include "gdal_alg.h"
|
||||
|
||||
/*
|
||||
* GridCreate Algorithm names
|
||||
*/
|
||||
|
||||
static const char szAlgNameInvDist[] = "invdist";
|
||||
static const char szAlgNameInvDistNearestNeighbor[] = "invdistnn";
|
||||
static const char szAlgNameAverage[] = "average";
|
||||
static const char szAlgNameNearest[] = "nearest";
|
||||
static const char szAlgNameMinimum[] = "minimum";
|
||||
static const char szAlgNameMaximum[] = "maximum";
|
||||
static const char szAlgNameRange[] = "range";
|
||||
static const char szAlgNameCount[] = "count";
|
||||
static const char szAlgNameAverageDistance[] = "average_distance";
|
||||
static const char szAlgNameAverageDistancePts[] = "average_distance_pts";
|
||||
static const char szAlgNameLinear[] = "linear";
|
||||
|
||||
CPL_C_START
|
||||
|
||||
typedef CPLErr (*GDALGridFunction)( const void *, GUInt32,
|
||||
const double *, const double *,
|
||||
const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridInverseDistanceToAPower( const void *, GUInt32,
|
||||
const double *, const double *,
|
||||
const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridInverseDistanceToAPowerNearestNeighbor( const void *, GUInt32,
|
||||
const double *, const double *,
|
||||
const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridInverseDistanceToAPowerNoSearch( const void *, GUInt32,
|
||||
const double *, const double *,
|
||||
const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridMovingAverage( const void *, GUInt32,
|
||||
const double *, const double *, const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridNearestNeighbor( const void *, GUInt32,
|
||||
const double *, const double *, const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridDataMetricMinimum( const void *, GUInt32,
|
||||
const double *, const double *, const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridDataMetricMaximum( const void *, GUInt32,
|
||||
const double *, const double *, const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridDataMetricRange( const void *, GUInt32,
|
||||
const double *, const double *, const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridDataMetricCount( const void *, GUInt32,
|
||||
const double *, const double *, const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridDataMetricAverageDistance( const void *, GUInt32,
|
||||
const double *, const double *,
|
||||
const double *, double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridDataMetricAverageDistancePts( const void *, GUInt32,
|
||||
const double *, const double *,
|
||||
const double *, double, double,
|
||||
double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridLinear( const void *, GUInt32,
|
||||
const double *, const double *,
|
||||
const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
|
||||
CPLErr CPL_DLL
|
||||
ParseAlgorithmAndOptions( const char *,
|
||||
GDALGridAlgorithm *,
|
||||
void ** );
|
||||
CPL_C_END
|
||||
|
||||
#endif /* GDALGRID_H_INCLUDED */
|
||||
@@ -1,106 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalgrid_priv.h 33715 2016-03-13 08:52:06Z goatbar $
|
||||
*
|
||||
* Project: GDAL Gridding API.
|
||||
* Purpose: Prototypes, and definitions for of GDAL scattered data gridder.
|
||||
* Author: Even Rouault, <even dot rouault at mines dash paris dot org>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2013, Even Rouault <even dot rouault at mines-paris dot org>
|
||||
*
|
||||
* 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.
|
||||
****************************************************************************/
|
||||
|
||||
#include "cpl_error.h"
|
||||
#include "cpl_quad_tree.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const double* padfX;
|
||||
const double* padfY;
|
||||
} GDALGridXYArrays;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GDALGridXYArrays* psXYArrays;
|
||||
int i;
|
||||
} GDALGridPoint;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CPLQuadTree* hQuadTree;
|
||||
double dfInitialSearchRadius;
|
||||
const float *pafX;
|
||||
const float *pafY;
|
||||
const float *pafZ;
|
||||
GDALTriangulation* psTriangulation;
|
||||
int nInitialFacetIdx;
|
||||
/*! Weighting power divided by 2 (pre-computation). */
|
||||
double dfPowerDiv2PreComp;
|
||||
/*! The radius of search circle squared (pre-computation). */
|
||||
double dfRadiusPower2PreComp;
|
||||
/*! The radius of search circle to power 4 (pre-computation). */
|
||||
double dfRadiusPower4PreComp;
|
||||
} GDALGridExtraParameters;
|
||||
|
||||
#ifdef HAVE_SSE_AT_COMPILE_TIME
|
||||
int CPLHaveRuntimeSSE();
|
||||
|
||||
CPLErr
|
||||
GDALGridInverseDistanceToAPower2NoSmoothingNoSearchSSE(
|
||||
const void *poOptions,
|
||||
GUInt32 nPoints,
|
||||
const double *unused_padfX,
|
||||
const double *unused_padfY,
|
||||
const double *unused_padfZ,
|
||||
double dfXPoint, double dfYPoint,
|
||||
double *pdfValue,
|
||||
void* hExtraParamsIn );
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX_AT_COMPILE_TIME
|
||||
int CPLHaveRuntimeAVX();
|
||||
|
||||
CPLErr GDALGridInverseDistanceToAPower2NoSmoothingNoSearchAVX(
|
||||
const void *poOptions,
|
||||
GUInt32 nPoints,
|
||||
const double *unused_padfX,
|
||||
const double *unused_padfY,
|
||||
const double *unused_padfZ,
|
||||
double dfXPoint, double dfYPoint,
|
||||
double *pdfValue,
|
||||
void* hExtraParamsIn );
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#if defined(__x86_64)
|
||||
#define GCC_CPUID(level, a, b, c, d) \
|
||||
__asm__ ("xchgq %%rbx, %q1\n" \
|
||||
"cpuid\n" \
|
||||
"xchgq %%rbx, %q1" \
|
||||
: "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
|
||||
: "0" (level))
|
||||
#else
|
||||
#define GCC_CPUID(level, a, b, c, d) \
|
||||
__asm__ ("xchgl %%ebx, %1\n" \
|
||||
"cpuid\n" \
|
||||
"xchgl %%ebx, %1" \
|
||||
: "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
|
||||
: "0" (level))
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdaljp2abstractdataset.h 33794 2016-03-26 13:19:07Z goatbar $
|
||||
* $Id: gdaljp2abstractdataset.h 36501 2016-11-25 14:09:24Z rouault $
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: GDALGeorefPamDataset with helper to read georeferencing and other
|
||||
@@ -31,6 +31,7 @@
|
||||
#ifndef GDAL_JP2_ABSTRACT_DATASET_H_INCLUDED
|
||||
#define GDAL_JP2_ABSTRACT_DATASET_H_INCLUDED
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
#include "gdalgeorefpamdataset.h"
|
||||
|
||||
class CPL_DLL GDALJP2AbstractDataset: public GDALGeorefPamDataset
|
||||
@@ -39,22 +40,24 @@ class CPL_DLL GDALJP2AbstractDataset: public GDALGeorefPamDataset
|
||||
|
||||
GDALDataset* poMemDS;
|
||||
char** papszMetadataFiles;
|
||||
int m_nWORLDFILEIndex;
|
||||
|
||||
protected:
|
||||
virtual int CloseDependentDatasets();
|
||||
virtual int CloseDependentDatasets() CPL_OVERRIDE;
|
||||
|
||||
public:
|
||||
GDALJP2AbstractDataset();
|
||||
virtual ~GDALJP2AbstractDataset();
|
||||
|
||||
void LoadJP2Metadata(GDALOpenInfo* poOpenInfo,
|
||||
const char* pszOverrideFilename = NULL);
|
||||
void LoadVectorLayers(int bOpenRemoteResources = FALSE);
|
||||
void LoadJP2Metadata( GDALOpenInfo* poOpenInfo,
|
||||
const char* pszOverrideFilename = NULL );
|
||||
void LoadVectorLayers( int bOpenRemoteResources = FALSE );
|
||||
|
||||
virtual char **GetFileList(void);
|
||||
virtual char **GetFileList( void ) CPL_OVERRIDE;
|
||||
|
||||
virtual int GetLayerCount();
|
||||
virtual OGRLayer *GetLayer(int i);
|
||||
virtual int GetLayerCount() CPL_OVERRIDE;
|
||||
virtual OGRLayer *GetLayer( int i ) CPL_OVERRIDE;
|
||||
};
|
||||
//! @endcond
|
||||
|
||||
#endif /* GDAL_JP2_ABSTRACT_DATASET_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdaljp2metadata.h 33694 2016-03-10 17:54:30Z goatbar $
|
||||
* $Id: gdaljp2metadata.h 36411 2016-11-21 22:03:48Z rouault $
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: JP2 Box Reader (and GMLJP2 Interpreter)
|
||||
@@ -31,6 +31,8 @@
|
||||
#ifndef GDAL_JP2READER_H_INCLUDED
|
||||
#define GDAL_JP2READER_H_INCLUDED
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#include "cpl_conv.h"
|
||||
#include "cpl_minixml.h"
|
||||
#include "cpl_vsi.h"
|
||||
@@ -58,7 +60,7 @@ class CPL_DLL GDALJP2Box
|
||||
GByte *pabyData;
|
||||
|
||||
public:
|
||||
GDALJP2Box( VSILFILE * = NULL );
|
||||
explicit GDALJP2Box( VSILFILE * = NULL );
|
||||
~GDALJP2Box();
|
||||
|
||||
int SetOffset( GIntBig nNewOffset );
|
||||
@@ -141,9 +143,9 @@ private:
|
||||
public:
|
||||
char **papszGMLMetadata;
|
||||
|
||||
int bHaveGeoTransform;
|
||||
bool bHaveGeoTransform;
|
||||
double adfGeoTransform[6];
|
||||
int bPixelIsPoint;
|
||||
bool bPixelIsPoint;
|
||||
|
||||
char *pszProjection;
|
||||
|
||||
@@ -167,8 +169,12 @@ public:
|
||||
int ParseMSIG();
|
||||
int ParseGMLCoverageDesc();
|
||||
|
||||
int ReadAndParse( VSILFILE * fpVSIL );
|
||||
int ReadAndParse( const char *pszFilename );
|
||||
int ReadAndParse( VSILFILE * fpVSIL,
|
||||
int nGEOJP2Index = 0, int nGMLJP2Index = 1,
|
||||
int nMSIGIndex = 2, int *pnIndexUsed = NULL );
|
||||
int ReadAndParse( const char *pszFilename, int nGEOJP2Index = 0,
|
||||
int nGMLJP2Index = 1, int nMSIGIndex = 2,
|
||||
int nWorldFileIndex = 3, int *pnIndexUsed = NULL );
|
||||
|
||||
// Write oriented.
|
||||
void SetProjection( const char *pszWKT );
|
||||
@@ -193,4 +199,6 @@ public:
|
||||
static int IsUUID_XMP(const GByte *abyUUID);
|
||||
};
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* ndef GDAL_JP2READER_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdaljp2metadatagenerator.h 33694 2016-03-10 17:54:30Z goatbar $
|
||||
* $Id: gdaljp2metadatagenerator.h 35883 2016-10-24 05:49:15Z goatbar $
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: GDALJP2Metadata: metadata generator
|
||||
@@ -30,7 +30,6 @@
|
||||
#ifndef GDAL_JP2METADATA_GENERATOR_H_INCLUDED
|
||||
#define GDAL_JP2METADATA_GENERATOR_H_INCLUDED
|
||||
|
||||
|
||||
#include "cpl_string.h"
|
||||
#include "cpl_minixml.h"
|
||||
|
||||
|
||||
@@ -1,270 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalpansharpen.h 33715 2016-03-13 08:52:06Z goatbar $
|
||||
*
|
||||
* Project: GDAL Pansharpening module
|
||||
* Purpose: Prototypes, and definitions for pansharpening related work.
|
||||
* Author: Even Rouault <even.rouault at spatialys.com>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2015, Even Rouault <even.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 GDALPANSHARPEN_H_INCLUDED
|
||||
#define GDALPANSHARPEN_H_INCLUDED
|
||||
|
||||
#include "gdal.h"
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/**
|
||||
* \file gdalpansharpen.h
|
||||
*
|
||||
* GDAL pansharpening related entry points and definitions.
|
||||
*
|
||||
* @since GDAL 2.1
|
||||
*/
|
||||
|
||||
/** Pansharpening algorithms.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
/*! Weighted Brovery. */
|
||||
GDAL_PSH_WEIGHTED_BROVEY
|
||||
} GDALPansharpenAlg;
|
||||
|
||||
/** Pansharpening options.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
/*! Pan sharpening algorithm/method. Only weighed Brovey for now. */
|
||||
GDALPansharpenAlg ePansharpenAlg;
|
||||
|
||||
/*! Resampling algorithm to upsample spectral bands to pan band resolution. */
|
||||
GDALRIOResampleAlg eResampleAlg;
|
||||
|
||||
/*! Bit depth of the spectral bands. Can be let to 0 for default behaviour. */
|
||||
int nBitDepth;
|
||||
|
||||
/*! Number of weight coefficients in padfWeights. */
|
||||
int nWeightCount;
|
||||
|
||||
/*! Array of nWeightCount weights used by weighted Brovey. */
|
||||
double *padfWeights;
|
||||
|
||||
/*! Panchromatic band. */
|
||||
GDALRasterBandH hPanchroBand;
|
||||
|
||||
/*! Number of input spectral bands. */
|
||||
int nInputSpectralBands;
|
||||
|
||||
/** Array of nInputSpectralBands input spectral bands. The spectral band have
|
||||
* generally a coarser resolution than the panchromatic band, but they
|
||||
* are assumed to have the same spatial extent (and projection) at that point.
|
||||
* Necessary spatial adjustments must be done beforehand, for example by wrapping
|
||||
* inside a VRT dataset.
|
||||
*/
|
||||
GDALRasterBandH *pahInputSpectralBands;
|
||||
|
||||
/*! Number of output pansharpened spectral bands. */
|
||||
int nOutPansharpenedBands;
|
||||
|
||||
/*! Array of nOutPansharpendBands values such as panOutPansharpenedBands[k] is a value in the range [0,nInputSpectralBands-1] . */
|
||||
int *panOutPansharpenedBands;
|
||||
|
||||
/*! Whether the panchromatic and spectral bands have a noData value. */
|
||||
int bHasNoData;
|
||||
|
||||
/** NoData value of the panchromatic and spectral bands (only taken into account if bHasNoData = TRUE).
|
||||
This will also be use has the output nodata value. */
|
||||
double dfNoData;
|
||||
|
||||
/** Number of threads or -1 to mean ALL_CPUS. By default (0), single threaded mode is enabled
|
||||
* unless the GDAL_NUM_THREADS configuration option is set to an integer or ALL_CPUS. */
|
||||
int nThreads;
|
||||
|
||||
double dfMSShiftX;
|
||||
double dfMSShiftY;
|
||||
|
||||
} GDALPansharpenOptions;
|
||||
|
||||
|
||||
GDALPansharpenOptions CPL_DLL * GDALCreatePansharpenOptions(void);
|
||||
void CPL_DLL GDALDestroyPansharpenOptions( GDALPansharpenOptions * );
|
||||
GDALPansharpenOptions CPL_DLL * GDALClonePansharpenOptions(
|
||||
const GDALPansharpenOptions* psOptions);
|
||||
|
||||
/*! Pansharpening operation handle. */
|
||||
typedef void* GDALPansharpenOperationH;
|
||||
|
||||
GDALPansharpenOperationH CPL_DLL GDALCreatePansharpenOperation(const GDALPansharpenOptions* );
|
||||
void CPL_DLL GDALDestroyPansharpenOperation( GDALPansharpenOperationH );
|
||||
CPLErr CPL_DLL GDALPansharpenProcessRegion( GDALPansharpenOperationH hOperation,
|
||||
int nXOff, int nYOff,
|
||||
int nXSize, int nYSize,
|
||||
void *pDataBuf,
|
||||
GDALDataType eBufDataType);
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <vector>
|
||||
#include "gdal_priv.h"
|
||||
#include "cpl_worker_thread_pool.h"
|
||||
|
||||
#ifdef DEBUG_TIMING
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
class GDALPansharpenOperation;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GDALPansharpenOperation* poPansharpenOperation;
|
||||
GDALDataType eWorkDataType;
|
||||
GDALDataType eBufDataType;
|
||||
const void* pPanBuffer;
|
||||
const void* pUpsampledSpectralBuffer;
|
||||
void* pDataBuf;
|
||||
int nValues;
|
||||
int nBandValues;
|
||||
GUInt32 nMaxValue;
|
||||
|
||||
#ifdef DEBUG_TIMING
|
||||
struct timeval* ptv;
|
||||
#endif
|
||||
|
||||
CPLErr eErr;
|
||||
} GDALPansharpenJob;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GDALDataset* poMEMDS;
|
||||
int nXOff;
|
||||
int nYOff;
|
||||
int nXSize;
|
||||
int nYSize;
|
||||
double dfXOff;
|
||||
double dfYOff;
|
||||
double dfXSize;
|
||||
double dfYSize;
|
||||
void *pBuffer;
|
||||
GDALDataType eDT;
|
||||
int nBufXSize;
|
||||
int nBufYSize;
|
||||
int nBandCount;
|
||||
GDALRIOResampleAlg eResampleAlg;
|
||||
GSpacing nBandSpace;
|
||||
|
||||
#ifdef DEBUG_TIMING
|
||||
struct timeval* ptv;
|
||||
#endif
|
||||
} GDALPansharpenResampleJob;
|
||||
|
||||
/** Pansharpening operation class.
|
||||
*/
|
||||
class GDALPansharpenOperation
|
||||
{
|
||||
GDALPansharpenOptions* psOptions;
|
||||
std::vector<int> anInputBands;
|
||||
std::vector<GDALDataset*> aVDS; // to destroy
|
||||
std::vector<GDALRasterBand*> aMSBands; // original multispectral bands potentially warped into a VRT
|
||||
int bPositiveWeights;
|
||||
CPLWorkerThreadPool* poThreadPool;
|
||||
int nKernelRadius;
|
||||
|
||||
static void PansharpenJobThreadFunc(void* pUserData);
|
||||
static void PansharpenResampleJobThreadFunc(void* pUserData);
|
||||
|
||||
template<class WorkDataType, class OutDataType> void WeightedBroveyWithNoData(
|
||||
const WorkDataType* pPanBuffer,
|
||||
const WorkDataType* pUpsampledSpectralBuffer,
|
||||
OutDataType* pDataBuf,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
WorkDataType nMaxValue) const;
|
||||
template<class WorkDataType, class OutDataType, int bHasBitDepth> void WeightedBrovey3(
|
||||
const WorkDataType* pPanBuffer,
|
||||
const WorkDataType* pUpsampledSpectralBuffer,
|
||||
OutDataType* pDataBuf,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
WorkDataType nMaxValue) const;
|
||||
template<class WorkDataType, class OutDataType> void WeightedBrovey(
|
||||
const WorkDataType* pPanBuffer,
|
||||
const WorkDataType* pUpsampledSpectralBuffer,
|
||||
OutDataType* pDataBuf,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
WorkDataType nMaxValue) const;
|
||||
template<class WorkDataType> CPLErr WeightedBrovey(
|
||||
const WorkDataType* pPanBuffer,
|
||||
const WorkDataType* pUpsampledSpectralBuffer,
|
||||
void *pDataBuf,
|
||||
GDALDataType eBufDataType,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
WorkDataType nMaxValue) const;
|
||||
template<class WorkDataType> CPLErr WeightedBrovey(
|
||||
const WorkDataType* pPanBuffer,
|
||||
const WorkDataType* pUpsampledSpectralBuffer,
|
||||
void *pDataBuf,
|
||||
GDALDataType eBufDataType,
|
||||
int nValues,
|
||||
int nBandValues) const;
|
||||
void WeightedBroveyPositiveWeights(
|
||||
const GUInt16* pPanBuffer,
|
||||
const GUInt16* pUpsampledSpectralBuffer,
|
||||
GUInt16* pDataBuf,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
GUInt16 nMaxValue) const;
|
||||
|
||||
template<int NINPUT, int NOUTPUT> int WeightedBroveyPositiveWeightsInternal(
|
||||
const GUInt16* pPanBuffer,
|
||||
const GUInt16* pUpsampledSpectralBuffer,
|
||||
GUInt16* pDataBuf,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
GUInt16 nMaxValue) const;
|
||||
|
||||
CPLErr PansharpenChunk( GDALDataType eWorkDataType, GDALDataType eBufDataType,
|
||||
const void* pPanBuffer,
|
||||
const void* pUpsampledSpectralBuffer,
|
||||
void* pDataBuf,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
GUInt32 nMaxValue) const;
|
||||
public:
|
||||
GDALPansharpenOperation();
|
||||
~GDALPansharpenOperation();
|
||||
|
||||
CPLErr Initialize(const GDALPansharpenOptions* psOptions);
|
||||
CPLErr ProcessRegion(int nXOff, int nYOff,
|
||||
int nXSize, int nYSize,
|
||||
void *pDataBuf,
|
||||
GDALDataType eBufDataType);
|
||||
GDALPansharpenOptions* GetOptions();
|
||||
};
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* GDALPANSHARPEN_H_INCLUDED */
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalsse_priv.h 32173 2015-12-14 00:04:53Z goatbar $
|
||||
* $Id: gdalsse_priv.h 34921 2016-08-04 22:26:31Z rouault $
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: SSE2 helper
|
||||
@@ -30,6 +30,8 @@
|
||||
#ifndef GDALSSE_PRIV_H_INCLUDED
|
||||
#define GDALSSE_PRIV_H_INCLUDED
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#include "cpl_port.h"
|
||||
|
||||
/* We restrict to 64bit processors because they are guaranteed to have SSE2 */
|
||||
@@ -40,6 +42,10 @@
|
||||
#include <emmintrin.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __SSE4_1__
|
||||
#include <smmintrin.h>
|
||||
#endif
|
||||
|
||||
class XMMReg2Double
|
||||
{
|
||||
public:
|
||||
@@ -182,8 +188,12 @@ class XMMReg2Double
|
||||
#else
|
||||
__m128i xmm_i = _mm_cvtsi32_si128(*(unsigned short*)(ptr));
|
||||
#endif
|
||||
#ifdef __SSE4_1__
|
||||
xmm_i = _mm_cvtepu8_epi32(xmm_i);
|
||||
#else
|
||||
xmm_i = _mm_unpacklo_epi8(xmm_i, _mm_setzero_si128());
|
||||
xmm_i = _mm_unpacklo_epi16(xmm_i, _mm_setzero_si128());
|
||||
#endif
|
||||
xmm = _mm_cvtepi32_pd(xmm_i);
|
||||
}
|
||||
|
||||
@@ -192,8 +202,12 @@ class XMMReg2Double
|
||||
int i;
|
||||
memcpy(&i, ptr, 4);
|
||||
__m128i xmm_i = _mm_cvtsi32_si128(i);
|
||||
#ifdef __SSE4_1__
|
||||
xmm_i = _mm_cvtepi16_epi32(xmm_i);
|
||||
#else
|
||||
xmm_i = _mm_unpacklo_epi16(xmm_i,xmm_i); /* 0|0|0|0|0|0|b|a --> 0|0|0|0|b|b|a|a */
|
||||
xmm_i = _mm_srai_epi32(xmm_i, 16); /* 0|0|0|0|b|b|a|a --> 0|0|0|0|sign(b)|b|sign(a)|a */
|
||||
#endif
|
||||
xmm = _mm_cvtepi32_pd(xmm_i);
|
||||
}
|
||||
|
||||
@@ -202,8 +216,11 @@ class XMMReg2Double
|
||||
int i;
|
||||
memcpy(&i, ptr, 4);
|
||||
__m128i xmm_i = _mm_cvtsi32_si128(i);
|
||||
xmm_i = _mm_unpacklo_epi16(xmm_i,xmm_i); /* 0|0|0|0|0|0|b|a --> 0|0|0|0|b|b|a|a */
|
||||
xmm_i = _mm_srli_epi32(xmm_i, 16); /* 0|0|0|0|b|b|a|a --> 0|0|0|0|0|b|0|a */
|
||||
#ifdef __SSE4_1__
|
||||
xmm_i = _mm_cvtepu16_epi32(xmm_i);
|
||||
#else
|
||||
xmm_i = _mm_unpacklo_epi16(xmm_i,_mm_setzero_si128()); /* 0|0|0|0|0|0|b|a --> 0|0|0|0|0|b|0|a */
|
||||
#endif
|
||||
xmm = _mm_cvtepi32_pd(xmm_i);
|
||||
}
|
||||
|
||||
@@ -216,8 +233,12 @@ class XMMReg2Double
|
||||
#else
|
||||
__m128i xmm_i = _mm_cvtsi32_si128(*(int*)(ptr));
|
||||
#endif
|
||||
#ifdef __SSE4_1__
|
||||
xmm_i = _mm_cvtepu8_epi32(xmm_i);
|
||||
#else
|
||||
xmm_i = _mm_unpacklo_epi8(xmm_i, _mm_setzero_si128());
|
||||
xmm_i = _mm_unpacklo_epi16(xmm_i, _mm_setzero_si128());
|
||||
#endif
|
||||
low.xmm = _mm_cvtepi32_pd(xmm_i);
|
||||
high.xmm = _mm_cvtepi32_pd(_mm_shuffle_epi32(xmm_i,_MM_SHUFFLE(3,2,3,2)));
|
||||
}
|
||||
@@ -852,4 +873,6 @@ class XMMReg4Double
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* GDALSSE_PRIV_H_INCLUDED */
|
||||
|
||||
@@ -1,459 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalwarper.h 33717 2016-03-14 06:29:14Z goatbar $
|
||||
*
|
||||
* Project: GDAL High Performance Warper
|
||||
* Purpose: Prototypes, and definitions for warping related work.
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2003, Frank Warmerdam
|
||||
* Copyright (c) 2009-2012, Even Rouault <even dot rouault at mines-paris dot org>
|
||||
*
|
||||
* 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 GDALWARPER_H_INCLUDED
|
||||
#define GDALWARPER_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \file gdalwarper.h
|
||||
*
|
||||
* GDAL warper related entry points and definitions. Eventually it is
|
||||
* expected that this file will be mostly private to the implementation,
|
||||
* and the public C entry points will be available in gdal_alg.h.
|
||||
*/
|
||||
|
||||
#include "gdal_alg.h"
|
||||
#include "cpl_minixml.h"
|
||||
#include "cpl_multiproc.h"
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/* Note: values are selected to be consistent with GDALRIOResampleAlg of gcore/gdal.h */
|
||||
/*! Warp Resampling Algorithm */
|
||||
typedef enum {
|
||||
/*! Nearest neighbour (select on one input pixel) */ GRA_NearestNeighbour=0,
|
||||
/*! Bilinear (2x2 kernel) */ GRA_Bilinear=1,
|
||||
/*! Cubic Convolution Approximation (4x4 kernel) */ GRA_Cubic=2,
|
||||
/*! Cubic B-Spline Approximation (4x4 kernel) */ GRA_CubicSpline=3,
|
||||
/*! Lanczos windowed sinc interpolation (6x6 kernel) */ GRA_Lanczos=4,
|
||||
/*! Average (computes the average of all non-NODATA contributing pixels) */ GRA_Average=5,
|
||||
/*! Mode (selects the value which appears most often of all the sampled points) */ GRA_Mode=6,
|
||||
// GRA_Gauss=7 reserved.
|
||||
/*! Max (selects maximum of all non-NODATA contributing pixels) */ GRA_Max=8,
|
||||
/*! Min (selects minimum of all non-NODATA contributing pixels) */ GRA_Min=9,
|
||||
/*! Med (selects median of all non-NODATA contributing pixels) */ GRA_Med=10,
|
||||
/*! Q1 (selects first quartile of all non-NODATA contributing pixels) */ GRA_Q1=11,
|
||||
/*! Q3 (selects third quartile of all non-NODATA contributing pixels) */ GRA_Q3=12
|
||||
} GDALResampleAlg;
|
||||
|
||||
/*! GWKAverageOrMode Algorithm */
|
||||
typedef enum {
|
||||
/*! Average */ GWKAOM_Average=1,
|
||||
/*! Mode */ GWKAOM_Fmode=2,
|
||||
/*! Mode of GDT_Byte, GDT_UInt16, or GDT_Int16 */ GWKAOM_Imode=3,
|
||||
/*! Maximum */ GWKAOM_Max=4,
|
||||
/*! Minimum */ GWKAOM_Min=5,
|
||||
/*! Quantile */ GWKAOM_Quant=6
|
||||
} GWKAverageOrModeAlg;
|
||||
|
||||
typedef int
|
||||
(*GDALMaskFunc)( void *pMaskFuncArg,
|
||||
int nBandCount, GDALDataType eType,
|
||||
int nXOff, int nYOff,
|
||||
int nXSize, int nYSize,
|
||||
GByte **papabyImageData,
|
||||
int bMaskIsFloat, void *pMask );
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALWarpNoDataMasker( void *pMaskFuncArg, int nBandCount, GDALDataType eType,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
GByte **papabyImageData, int bMaskIsFloat,
|
||||
void *pValidityMask, int* pbOutAllValid );
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALWarpDstAlphaMasker( void *pMaskFuncArg, int nBandCount, GDALDataType eType,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
GByte ** /*ppImageData */,
|
||||
int bMaskIsFloat, void *pValidityMask );
|
||||
CPLErr CPL_DLL
|
||||
GDALWarpSrcAlphaMasker( void *pMaskFuncArg, int nBandCount, GDALDataType eType,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
GByte ** /*ppImageData */,
|
||||
int bMaskIsFloat, void *pValidityMask, int* pbOutAllOpaque );
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALWarpSrcMaskMasker( void *pMaskFuncArg, int nBandCount, GDALDataType eType,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
GByte ** /*ppImageData */,
|
||||
int bMaskIsFloat, void *pValidityMask );
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALWarpCutlineMasker( void *pMaskFuncArg, int nBandCount, GDALDataType eType,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
GByte ** /* ppImageData */,
|
||||
int bMaskIsFloat, void *pValidityMask );
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALWarpOptions */
|
||||
/************************************************************************/
|
||||
|
||||
/** Warp control options for use with GDALWarpOperation::Initialize() */
|
||||
typedef struct {
|
||||
|
||||
char **papszWarpOptions;
|
||||
|
||||
/*! In bytes, 0.0 for internal default */
|
||||
double dfWarpMemoryLimit;
|
||||
|
||||
/*! Resampling algorithm to use */
|
||||
GDALResampleAlg eResampleAlg;
|
||||
|
||||
/*! data type to use during warp operation, GDT_Unknown lets the algorithm
|
||||
select the type */
|
||||
GDALDataType eWorkingDataType;
|
||||
|
||||
/*! Source image dataset. */
|
||||
GDALDatasetH hSrcDS;
|
||||
|
||||
/*! Destination image dataset - may be NULL if only using GDALWarpOperation::WarpRegionToBuffer(). */
|
||||
GDALDatasetH hDstDS;
|
||||
|
||||
/*! Number of bands to process, may be 0 to select all bands. */
|
||||
int nBandCount;
|
||||
|
||||
/*! The band numbers for the source bands to process (1 based) */
|
||||
int *panSrcBands;
|
||||
|
||||
/*! The band numbers for the destination bands to process (1 based) */
|
||||
int *panDstBands;
|
||||
|
||||
/*! The source band so use as an alpha (transparency) value, 0=disabled */
|
||||
int nSrcAlphaBand;
|
||||
|
||||
/*! The dest. band so use as an alpha (transparency) value, 0=disabled */
|
||||
int nDstAlphaBand;
|
||||
|
||||
/*! The "nodata" value real component for each input band, if NULL there isn't one */
|
||||
double *padfSrcNoDataReal;
|
||||
/*! The "nodata" value imaginary component - may be NULL even if real
|
||||
component is provided. */
|
||||
double *padfSrcNoDataImag;
|
||||
|
||||
/*! The "nodata" value real component for each output band, if NULL there isn't one */
|
||||
double *padfDstNoDataReal;
|
||||
/*! The "nodata" value imaginary component - may be NULL even if real
|
||||
component is provided. */
|
||||
double *padfDstNoDataImag;
|
||||
|
||||
/*! GDALProgressFunc() compatible progress reporting function, or NULL
|
||||
if there isn't one. */
|
||||
GDALProgressFunc pfnProgress;
|
||||
|
||||
/*! Callback argument to be passed to pfnProgress. */
|
||||
void *pProgressArg;
|
||||
|
||||
/*! Type of spatial point transformer function */
|
||||
GDALTransformerFunc pfnTransformer;
|
||||
|
||||
/*! Handle to image transformer setup structure */
|
||||
void *pTransformerArg;
|
||||
|
||||
GDALMaskFunc *papfnSrcPerBandValidityMaskFunc;
|
||||
void **papSrcPerBandValidityMaskFuncArg;
|
||||
|
||||
GDALMaskFunc pfnSrcValidityMaskFunc;
|
||||
void *pSrcValidityMaskFuncArg;
|
||||
|
||||
GDALMaskFunc pfnSrcDensityMaskFunc;
|
||||
void *pSrcDensityMaskFuncArg;
|
||||
|
||||
GDALMaskFunc pfnDstDensityMaskFunc;
|
||||
void *pDstDensityMaskFuncArg;
|
||||
|
||||
GDALMaskFunc pfnDstValidityMaskFunc;
|
||||
void *pDstValidityMaskFuncArg;
|
||||
|
||||
CPLErr (*pfnPreWarpChunkProcessor)( void *pKern, void *pArg );
|
||||
void *pPreWarpProcessorArg;
|
||||
|
||||
CPLErr (*pfnPostWarpChunkProcessor)( void *pKern, void *pArg);
|
||||
void *pPostWarpProcessorArg;
|
||||
|
||||
/*! Optional OGRPolygonH for a masking cutline. */
|
||||
void *hCutline;
|
||||
|
||||
/*! Optional blending distance to apply across cutline in pixels, default is zero. */
|
||||
double dfCutlineBlendDist;
|
||||
|
||||
} GDALWarpOptions;
|
||||
|
||||
GDALWarpOptions CPL_DLL * CPL_STDCALL GDALCreateWarpOptions(void);
|
||||
void CPL_DLL CPL_STDCALL GDALDestroyWarpOptions( GDALWarpOptions * );
|
||||
GDALWarpOptions CPL_DLL * CPL_STDCALL
|
||||
GDALCloneWarpOptions( const GDALWarpOptions * );
|
||||
|
||||
CPLXMLNode CPL_DLL * CPL_STDCALL
|
||||
GDALSerializeWarpOptions( const GDALWarpOptions * );
|
||||
GDALWarpOptions CPL_DLL * CPL_STDCALL
|
||||
GDALDeserializeWarpOptions( CPLXMLNode * );
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALReprojectImage() */
|
||||
/************************************************************************/
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALReprojectImage( GDALDatasetH hSrcDS, const char *pszSrcWKT,
|
||||
GDALDatasetH hDstDS, const char *pszDstWKT,
|
||||
GDALResampleAlg eResampleAlg, double dfWarpMemoryLimit,
|
||||
double dfMaxError,
|
||||
GDALProgressFunc pfnProgress, void *pProgressArg,
|
||||
GDALWarpOptions *psOptions );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALCreateAndReprojectImage( GDALDatasetH hSrcDS, const char *pszSrcWKT,
|
||||
const char *pszDstFilename, const char *pszDstWKT,
|
||||
GDALDriverH hDstDriver, char **papszCreateOptions,
|
||||
GDALResampleAlg eResampleAlg, double dfWarpMemoryLimit,
|
||||
double dfMaxError,
|
||||
GDALProgressFunc pfnProgress, void *pProgressArg,
|
||||
GDALWarpOptions *psOptions );
|
||||
|
||||
/************************************************************************/
|
||||
/* VRTWarpedDataset */
|
||||
/************************************************************************/
|
||||
|
||||
GDALDatasetH CPL_DLL CPL_STDCALL
|
||||
GDALAutoCreateWarpedVRT( GDALDatasetH hSrcDS,
|
||||
const char *pszSrcWKT, const char *pszDstWKT,
|
||||
GDALResampleAlg eResampleAlg,
|
||||
double dfMaxError, const GDALWarpOptions *psOptions );
|
||||
|
||||
GDALDatasetH CPL_DLL CPL_STDCALL
|
||||
GDALCreateWarpedVRT( GDALDatasetH hSrcDS,
|
||||
int nPixels, int nLines, double *padfGeoTransform,
|
||||
GDALWarpOptions *psOptions );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALInitializeWarpedVRT( GDALDatasetH hDS,
|
||||
GDALWarpOptions *psWO );
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALWarpKernel */
|
||||
/* */
|
||||
/* This class represents the lowest level of abstraction. It */
|
||||
/* is holds the imagery for one "chunk" of a warp, and the */
|
||||
/* pre-prepared masks. All IO is done before and after it's */
|
||||
/* operation. This class is not normally used by the */
|
||||
/* application. */
|
||||
/************************************************************************/
|
||||
|
||||
// This is the number of dummy pixels that must be reserved in source arrays
|
||||
// in order to satisfy assumptions made in GWKResample(), and more specifically
|
||||
// by GWKGetPixelRow() that always read a even number of pixels. So if we are
|
||||
// in the situation to read the last pixel of the source array, we need 1 extra
|
||||
// dummy pixel to avoid reading out of bounds.
|
||||
#define WARP_EXTRA_ELTS 1
|
||||
|
||||
class CPL_DLL GDALWarpKernel
|
||||
{
|
||||
public:
|
||||
char **papszWarpOptions;
|
||||
|
||||
GDALResampleAlg eResample;
|
||||
GDALDataType eWorkingDataType;
|
||||
int nBands;
|
||||
|
||||
int nSrcXSize;
|
||||
int nSrcYSize;
|
||||
int nSrcXExtraSize; /* extra pixels (included in nSrcXSize) reserved for filter window. Should be ignored in scale computation */
|
||||
int nSrcYExtraSize; /* extra pixels (included in nSrcYSize) reserved for filter window. Should be ignored in scale computation */
|
||||
GByte **papabySrcImage; /* each subarray must have WARP_EXTRA_ELTS at the end */
|
||||
|
||||
GUInt32 **papanBandSrcValid; /* each subarray must have WARP_EXTRA_ELTS at the end */
|
||||
GUInt32 *panUnifiedSrcValid; /* must have WARP_EXTRA_ELTS at the end */
|
||||
float *pafUnifiedSrcDensity; /* must have WARP_EXTRA_ELTS at the end */
|
||||
|
||||
int nDstXSize;
|
||||
int nDstYSize;
|
||||
GByte **papabyDstImage;
|
||||
GUInt32 *panDstValid;
|
||||
float *pafDstDensity;
|
||||
|
||||
double dfXScale; // Resampling scale, i.e.
|
||||
double dfYScale; // nDstSize/nSrcSize.
|
||||
double dfXFilter; // Size of filter kernel.
|
||||
double dfYFilter;
|
||||
int nXRadius; // Size of window to filter.
|
||||
int nYRadius;
|
||||
int nFiltInitX; // Filtering offset
|
||||
int nFiltInitY;
|
||||
|
||||
int nSrcXOff;
|
||||
int nSrcYOff;
|
||||
|
||||
int nDstXOff;
|
||||
int nDstYOff;
|
||||
|
||||
GDALTransformerFunc pfnTransformer;
|
||||
void *pTransformerArg;
|
||||
|
||||
GDALProgressFunc pfnProgress;
|
||||
void *pProgress;
|
||||
|
||||
double dfProgressBase;
|
||||
double dfProgressScale;
|
||||
|
||||
double *padfDstNoDataReal;
|
||||
|
||||
void *psThreadData;
|
||||
|
||||
GDALWarpKernel();
|
||||
virtual ~GDALWarpKernel();
|
||||
|
||||
CPLErr Validate();
|
||||
CPLErr PerformWarp();
|
||||
};
|
||||
|
||||
void* GWKThreadsCreate(char** papszWarpOptions,
|
||||
GDALTransformerFunc pfnTransformer,
|
||||
void* pTransformerArg);
|
||||
void GWKThreadsEnd(void* psThreadDataIn);
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALWarpOperation() */
|
||||
/* */
|
||||
/* This object is application created, or created by a higher */
|
||||
/* level convenience function. It is responsible for */
|
||||
/* subdividing the operation into chunks, loading and saving */
|
||||
/* imagery, and establishing the varios validity and density */
|
||||
/* masks. Actual resampling is done by the GDALWarpKernel. */
|
||||
/************************************************************************/
|
||||
|
||||
typedef struct _GDALWarpChunk GDALWarpChunk;
|
||||
|
||||
class CPL_DLL GDALWarpOperation {
|
||||
private:
|
||||
GDALWarpOptions *psOptions;
|
||||
|
||||
void WipeOptions();
|
||||
int ValidateOptions();
|
||||
|
||||
CPLErr ComputeSourceWindow( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize,
|
||||
int *pnSrcXOff, int *pnSrcYOff,
|
||||
int *pnSrcXSize, int *pnSrcYSize,
|
||||
int *pnSrcXExtraSize, int *pnSrcYExtraSize,
|
||||
double* pdfSrcFillRatio );
|
||||
|
||||
CPLErr CreateKernelMask( GDALWarpKernel *, int iBand,
|
||||
const char *pszType );
|
||||
|
||||
CPLMutex *hIOMutex;
|
||||
CPLMutex *hWarpMutex;
|
||||
|
||||
int nChunkListCount;
|
||||
int nChunkListMax;
|
||||
GDALWarpChunk *pasChunkList;
|
||||
|
||||
int bReportTimings;
|
||||
unsigned long nLastTimeReported;
|
||||
|
||||
void *psThreadData;
|
||||
|
||||
void WipeChunkList();
|
||||
CPLErr CollectChunkList( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize );
|
||||
void ReportTiming( const char * );
|
||||
|
||||
public:
|
||||
GDALWarpOperation();
|
||||
virtual ~GDALWarpOperation();
|
||||
|
||||
CPLErr Initialize( const GDALWarpOptions *psNewOptions );
|
||||
|
||||
const GDALWarpOptions *GetOptions();
|
||||
|
||||
CPLErr ChunkAndWarpImage( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize );
|
||||
CPLErr ChunkAndWarpMulti( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize );
|
||||
CPLErr WarpRegion( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize,
|
||||
int nSrcXOff=0, int nSrcYOff=0,
|
||||
int nSrcXSize=0, int nSrcYSize=0,
|
||||
double dfProgressBase=0.0, double dfProgressScale=1.0);
|
||||
CPLErr WarpRegion( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize,
|
||||
int nSrcXOff, int nSrcYOff,
|
||||
int nSrcXSize, int nSrcYSize,
|
||||
int nSrcXExtraSize, int nSrcYExtraSize,
|
||||
double dfProgressBase, double dfProgressScale);
|
||||
CPLErr WarpRegionToBuffer( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize,
|
||||
void *pDataBuf,
|
||||
GDALDataType eBufDataType,
|
||||
int nSrcXOff=0, int nSrcYOff=0,
|
||||
int nSrcXSize=0, int nSrcYSize=0,
|
||||
double dfProgressBase=0.0, double dfProgressScale=1.0);
|
||||
CPLErr WarpRegionToBuffer( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize,
|
||||
void *pDataBuf,
|
||||
GDALDataType eBufDataType,
|
||||
int nSrcXOff, int nSrcYOff,
|
||||
int nSrcXSize, int nSrcYSize,
|
||||
int nSrcXExtraSize, int nSrcYExtraSize,
|
||||
double dfProgressBase, double dfProgressScale);
|
||||
};
|
||||
|
||||
#endif /* def __cplusplus */
|
||||
|
||||
CPL_C_START
|
||||
|
||||
typedef void * GDALWarpOperationH;
|
||||
|
||||
GDALWarpOperationH CPL_DLL GDALCreateWarpOperation(const GDALWarpOptions* );
|
||||
void CPL_DLL GDALDestroyWarpOperation( GDALWarpOperationH );
|
||||
CPLErr CPL_DLL GDALChunkAndWarpImage( GDALWarpOperationH, int, int, int, int );
|
||||
CPLErr CPL_DLL GDALChunkAndWarpMulti( GDALWarpOperationH, int, int, int, int );
|
||||
CPLErr CPL_DLL GDALWarpRegion( GDALWarpOperationH,
|
||||
int, int, int, int, int, int, int, int );
|
||||
CPLErr CPL_DLL GDALWarpRegionToBuffer( GDALWarpOperationH, int, int, int, int,
|
||||
void *, GDALDataType,
|
||||
int, int, int, int );
|
||||
|
||||
/************************************************************************/
|
||||
/* Warping kernel functions */
|
||||
/************************************************************************/
|
||||
|
||||
int GWKGetFilterRadius(GDALResampleAlg eResampleAlg);
|
||||
|
||||
typedef double (*FilterFuncType)(double dfX);
|
||||
FilterFuncType GWKGetFilterFunc(GDALResampleAlg eResampleAlg);
|
||||
|
||||
typedef double (*FilterFunc4ValuesType)(double* padfVals);
|
||||
FilterFunc4ValuesType GWKGetFilterFunc4Values(GDALResampleAlg eResampleAlg);
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif /* ndef GDAL_ALG_H_INCLUDED */
|
||||
@@ -1,197 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalwarpkernel_opencl.h 33715 2016-03-13 08:52:06Z goatbar $
|
||||
*
|
||||
* Project: OpenCL Image Reprojector
|
||||
* Purpose: Implementation of the GDALWarpKernel reprojector in OpenCL.
|
||||
* Author: Seth Price, seth@pricepages.org
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2010, Seth Price <seth@pricepages.org>
|
||||
*
|
||||
* 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.
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(HAVE_OPENCL)
|
||||
|
||||
/* The following relates to the profiling calls to
|
||||
clSetCommandQueueProperty() which are not available by default
|
||||
with some OpenCL implementation (i.e. ATI) */
|
||||
|
||||
#if defined(DEBUG_OPENCL) && DEBUG_OPENCL == 1
|
||||
#define CL_USE_DEPRECATED_OPENCL_1_0_APIS
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <OpenCL/OpenCL.h>
|
||||
#else
|
||||
#include <CL/opencl.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus /* If this is a C++ compiler, use C linkage */
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
OCL_Bilinear=10,
|
||||
OCL_Cubic=11,
|
||||
OCL_CubicSpline=12,
|
||||
OCL_Lanczos=13
|
||||
} OCLResampAlg;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
VENDOR_OTHER,
|
||||
VENDOR_AMD,
|
||||
VENDOR_INTEL
|
||||
} OCLVendor;
|
||||
|
||||
struct oclWarper {
|
||||
cl_command_queue queue;
|
||||
cl_context context;
|
||||
cl_device_id dev;
|
||||
cl_kernel kern1;
|
||||
cl_kernel kern4;
|
||||
|
||||
int srcWidth;
|
||||
int srcHeight;
|
||||
int dstWidth;
|
||||
int dstHeight;
|
||||
|
||||
int useUnifiedSrcDensity;
|
||||
int useUnifiedSrcValid;
|
||||
int useDstDensity;
|
||||
int useDstValid;
|
||||
|
||||
int numBands;
|
||||
int numImages;
|
||||
OCLResampAlg resampAlg;
|
||||
|
||||
cl_channel_type imageFormat;
|
||||
cl_mem *realWorkCL;
|
||||
union {
|
||||
void **v;
|
||||
char **c;
|
||||
unsigned char **uc;
|
||||
short **s;
|
||||
unsigned short **us;
|
||||
float **f;
|
||||
} realWork;
|
||||
|
||||
cl_mem *imagWorkCL;
|
||||
union {
|
||||
void **v;
|
||||
char **c;
|
||||
unsigned char **uc;
|
||||
short **s;
|
||||
unsigned short **us;
|
||||
float **f;
|
||||
} imagWork;
|
||||
|
||||
cl_mem *dstRealWorkCL;
|
||||
union {
|
||||
void **v;
|
||||
char **c;
|
||||
unsigned char **uc;
|
||||
short **s;
|
||||
unsigned short **us;
|
||||
float **f;
|
||||
} dstRealWork;
|
||||
|
||||
cl_mem *dstImagWorkCL;
|
||||
union {
|
||||
void **v;
|
||||
char **c;
|
||||
unsigned char **uc;
|
||||
short **s;
|
||||
unsigned short **us;
|
||||
float **f;
|
||||
} dstImagWork;
|
||||
|
||||
unsigned int imgChSize1;
|
||||
cl_channel_order imgChOrder1;
|
||||
unsigned int imgChSize4;
|
||||
cl_channel_order imgChOrder4;
|
||||
char useVec;
|
||||
|
||||
cl_mem useBandSrcValidCL;
|
||||
char *useBandSrcValid;
|
||||
|
||||
cl_mem nBandSrcValidCL;
|
||||
float *nBandSrcValid;
|
||||
|
||||
cl_mem xyWorkCL;
|
||||
float *xyWork;
|
||||
|
||||
int xyWidth;
|
||||
int xyHeight;
|
||||
int coordMult;
|
||||
|
||||
unsigned int xyChSize;
|
||||
cl_channel_order xyChOrder;
|
||||
|
||||
cl_mem fDstNoDataRealCL;
|
||||
float *fDstNoDataReal;
|
||||
|
||||
OCLVendor eCLVendor;
|
||||
};
|
||||
|
||||
struct oclWarper* GDALWarpKernelOpenCL_createEnv(int srcWidth, int srcHeight,
|
||||
int dstWidth, int dstHeight,
|
||||
cl_channel_type imageFormat,
|
||||
int numBands, int coordMult,
|
||||
int useImag, int useBandSrcValid,
|
||||
float *fDstDensity,
|
||||
double *dfDstNoDataReal,
|
||||
OCLResampAlg resampAlg, cl_int *envErr);
|
||||
|
||||
cl_int GDALWarpKernelOpenCL_setSrcValid(struct oclWarper *warper,
|
||||
int *bandSrcValid, int bandNum);
|
||||
|
||||
cl_int GDALWarpKernelOpenCL_setSrcImg(struct oclWarper *warper, void *imgData,
|
||||
int bandNum);
|
||||
|
||||
cl_int GDALWarpKernelOpenCL_setDstImg(struct oclWarper *warper, void *imgData,
|
||||
int bandNum);
|
||||
|
||||
cl_int GDALWarpKernelOpenCL_setCoordRow(struct oclWarper *warper,
|
||||
double *rowSrcX, double *rowSrcY,
|
||||
double srcXOff, double srcYOff,
|
||||
int *success, int rowNum);
|
||||
|
||||
cl_int GDALWarpKernelOpenCL_runResamp(struct oclWarper *warper,
|
||||
float *unifiedSrcDensity,
|
||||
unsigned int *unifiedSrcValid,
|
||||
float *dstDensity,
|
||||
unsigned int *dstValid,
|
||||
double dfXScale, double dfYScale,
|
||||
double dfXFilter, double dfYFilter,
|
||||
int nXRadius, int nYRadius,
|
||||
int nFiltInitX, int nFiltInitY);
|
||||
|
||||
cl_int GDALWarpKernelOpenCL_getRow(struct oclWarper *warper,
|
||||
void **rowReal, void **rowImag,
|
||||
int rowNum, int bandNum);
|
||||
|
||||
cl_int GDALWarpKernelOpenCL_deleteEnv(struct oclWarper *warper);
|
||||
|
||||
#ifdef __cplusplus /* If this is a C++ compiler, end C linkage */
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* defined(HAVE_OPENCL) */
|
||||
@@ -1,94 +0,0 @@
|
||||
#ifndef GVGCPFIT_H_INCLUDED
|
||||
#define GVGCPFIT_H_INCLUDED
|
||||
|
||||
#include "cpl_port.h"
|
||||
#include "cpl_conv.h"
|
||||
#include "cpl_error.h"
|
||||
|
||||
#define EXTERNAL
|
||||
#define LOCAL static
|
||||
|
||||
#define SUCCESS 0
|
||||
#define ABORT -1
|
||||
|
||||
|
||||
/*------------------------ Start of file CURVEFIT.H -----------------------*/
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* *
|
||||
* CURVEFIT.H *
|
||||
* ========= *
|
||||
* *
|
||||
* This file contains the function prototype for CURVEFIT.C. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CURVEFIT_H
|
||||
#define CURVEFIT_H
|
||||
|
||||
/*- Function prototypes in CURVEFIT.C. -*/
|
||||
|
||||
EXTERNAL int svdfit(float x[], float y[], int ndata,
|
||||
double a[], int ma, double **u, double **v, double w[],
|
||||
double *chisq, void (*funcs)(double, double *, int));
|
||||
|
||||
EXTERNAL void svbksb(double **u, double w[], double **v, int m,int n,
|
||||
double b[], double x[]);
|
||||
|
||||
EXTERNAL void svdvar(double **v, int ma, double w[], double **cvm);
|
||||
|
||||
EXTERNAL int svdcmp(double **a, int m, int n, double *w, double **v);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*-------------------------- End of file CURVEFIT.H -----------------------*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*----------------------------- FILE polyfit.h ----------------------------*/
|
||||
#ifndef POLYFIT_H
|
||||
#define POLYFIT_H
|
||||
|
||||
EXTERNAL int OneDPolyFit( double *rms_err, double *coeffs_array,
|
||||
int fit_order, int no_samples, double *f_array, double *x_array );
|
||||
|
||||
EXTERNAL double OneDPolyEval( double *coeff, int order, double x );
|
||||
|
||||
EXTERNAL int TwoDPolyFit( double *rms_err, double *coeffs_array,
|
||||
int fit_order, int no_samples, double *f_array, double *x_array,
|
||||
double *y_array );
|
||||
|
||||
EXTERNAL double TwoDPolyEval( double *coeff, int order, double x, double y );
|
||||
|
||||
EXTERNAL int TwoDPolyGradFit( double *rms_err, double *coeffs_array,
|
||||
int fit_order, int no_samples, double *gradxy_array,
|
||||
double *x_array, double *y_array );
|
||||
|
||||
EXTERNAL void TwoDPolyGradEval(double *fgradx, double *fgrady,
|
||||
double *coeff, int order, double x, double y);
|
||||
|
||||
EXTERNAL void GetPolyInX (double *xcoeffs, double *xycoeffs, int order,
|
||||
double y);
|
||||
|
||||
EXTERNAL void GetPolyInY(double *ycoeffs, double *xycoeffs, int order,
|
||||
double x);
|
||||
|
||||
EXTERNAL int ThreeDPolyFit( double *rms_err, double *coeffs_array,
|
||||
int fit_order, int no_samples, double *f_array, double *x_array,
|
||||
double *y_array, double *z_array );
|
||||
|
||||
EXTERNAL double ThreeDPolyEval( double *coeff, int order, double x, double y, double z );
|
||||
|
||||
|
||||
|
||||
#endif /* POLYFIT_H */
|
||||
|
||||
|
||||
/*---------------------- End of FILE polyfit.h ----------------------------*/
|
||||
|
||||
#endif /* ndef _GVGCPFIT_INCLUDED */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,184 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id: memdataset.h 33838 2016-03-31 20:42:32Z goatbar $
|
||||
*
|
||||
* Project: Memory Array Translator
|
||||
* Purpose: Declaration of MEMDataset, and MEMRasterBand.
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2000, Frank Warmerdam
|
||||
*
|
||||
* 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 MEMDATASET_H_INCLUDED
|
||||
#define MEMDATASET_H_INCLUDED
|
||||
|
||||
#include "gdal_pam.h"
|
||||
#include "gdal_priv.h"
|
||||
|
||||
CPL_C_START
|
||||
void GDALRegister_MEM();
|
||||
/* Caution: if changing this prototype, also change in swig/include/gdal_python.i
|
||||
where it is redefined */
|
||||
GDALRasterBandH CPL_DLL MEMCreateRasterBand( GDALDataset *, int, GByte *,
|
||||
GDALDataType, int, int, int );
|
||||
GDALRasterBandH CPL_DLL MEMCreateRasterBandEx( GDALDataset *, int, GByte *,
|
||||
GDALDataType, GSpacing, GSpacing,
|
||||
int );
|
||||
CPL_C_END
|
||||
|
||||
/************************************************************************/
|
||||
/* MEMDataset */
|
||||
/************************************************************************/
|
||||
|
||||
class MEMRasterBand;
|
||||
|
||||
class CPL_DLL MEMDataset : public GDALDataset
|
||||
{
|
||||
int bGeoTransformSet;
|
||||
double adfGeoTransform[6];
|
||||
|
||||
char *pszProjection;
|
||||
|
||||
int nGCPCount;
|
||||
GDAL_GCP *pasGCPs;
|
||||
CPLString osGCPProjection;
|
||||
|
||||
#if 0
|
||||
protected:
|
||||
virtual int EnterReadWrite(GDALRWFlag eRWFlag);
|
||||
virtual void LeaveReadWrite();
|
||||
#endif
|
||||
|
||||
public:
|
||||
MEMDataset();
|
||||
virtual ~MEMDataset();
|
||||
|
||||
virtual const char *GetProjectionRef(void);
|
||||
virtual CPLErr SetProjection( const char * );
|
||||
|
||||
virtual CPLErr GetGeoTransform( double * );
|
||||
virtual CPLErr SetGeoTransform( double * );
|
||||
|
||||
virtual void *GetInternalHandle( const char * );
|
||||
|
||||
virtual int GetGCPCount();
|
||||
virtual const char *GetGCPProjection();
|
||||
virtual const GDAL_GCP *GetGCPs();
|
||||
virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
const char *pszGCPProjection );
|
||||
|
||||
virtual CPLErr AddBand( GDALDataType eType,
|
||||
char **papszOptions=NULL );
|
||||
virtual CPLErr IRasterIO( GDALRWFlag eRWFlag,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
void * pData, int nBufXSize, int nBufYSize,
|
||||
GDALDataType eBufType,
|
||||
int nBandCount, int *panBandMap,
|
||||
GSpacing nPixelSpaceBuf,
|
||||
GSpacing nLineSpaceBuf,
|
||||
GSpacing nBandSpaceBuf,
|
||||
GDALRasterIOExtraArg* psExtraArg);
|
||||
|
||||
static GDALDataset *Open( GDALOpenInfo * );
|
||||
static GDALDataset *Create( const char * pszFilename,
|
||||
int nXSize, int nYSize, int nBands,
|
||||
GDALDataType eType, char ** papszParmList );
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
/* MEMRasterBand */
|
||||
/************************************************************************/
|
||||
|
||||
class CPL_DLL MEMRasterBand : public GDALPamRasterBand
|
||||
{
|
||||
protected:
|
||||
friend class MEMDataset;
|
||||
|
||||
GByte *pabyData;
|
||||
GSpacing nPixelOffset;
|
||||
GSpacing nLineOffset;
|
||||
int bOwnData;
|
||||
|
||||
int bNoDataSet;
|
||||
double dfNoData;
|
||||
|
||||
GDALColorTable *poColorTable;
|
||||
GDALColorInterp eColorInterp;
|
||||
|
||||
char *pszUnitType;
|
||||
char **papszCategoryNames;
|
||||
|
||||
double dfOffset;
|
||||
double dfScale;
|
||||
|
||||
CPLXMLNode *psSavedHistograms;
|
||||
|
||||
public:
|
||||
MEMRasterBand( GDALDataset *poDS, int nBand,
|
||||
GByte *pabyData, GDALDataType eType,
|
||||
GSpacing nPixelOffset, GSpacing nLineOffset,
|
||||
int bAssumeOwnership,
|
||||
const char * pszPixelType = NULL );
|
||||
virtual ~MEMRasterBand();
|
||||
|
||||
virtual CPLErr IReadBlock( int, int, void * );
|
||||
virtual CPLErr IWriteBlock( int, int, void * );
|
||||
virtual CPLErr IRasterIO( GDALRWFlag eRWFlag,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
void * pData, int nBufXSize, int nBufYSize,
|
||||
GDALDataType eBufType,
|
||||
GSpacing nPixelSpaceBuf,
|
||||
GSpacing nLineSpaceBuf,
|
||||
GDALRasterIOExtraArg* psExtraArg );
|
||||
virtual double GetNoDataValue( int *pbSuccess = NULL );
|
||||
virtual CPLErr SetNoDataValue( double );
|
||||
virtual CPLErr DeleteNoDataValue();
|
||||
|
||||
virtual GDALColorInterp GetColorInterpretation();
|
||||
virtual GDALColorTable *GetColorTable();
|
||||
virtual CPLErr SetColorTable( GDALColorTable * );
|
||||
|
||||
virtual CPLErr SetColorInterpretation( GDALColorInterp );
|
||||
|
||||
virtual const char *GetUnitType();
|
||||
CPLErr SetUnitType( const char * );
|
||||
|
||||
virtual char **GetCategoryNames();
|
||||
virtual CPLErr SetCategoryNames( char ** );
|
||||
|
||||
virtual double GetOffset( int *pbSuccess = NULL );
|
||||
CPLErr SetOffset( double );
|
||||
virtual double GetScale( int *pbSuccess = NULL );
|
||||
CPLErr SetScale( double );
|
||||
|
||||
virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
|
||||
int nBuckets, GUIntBig *panHistogram );
|
||||
virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
|
||||
int *pnBuckets,
|
||||
GUIntBig ** ppanHistogram,
|
||||
int bForce,
|
||||
GDALProgressFunc, void *pProgressData);
|
||||
|
||||
// Allow access to MEM driver's private internal memory buffer.
|
||||
GByte *GetData(void) const { return(pabyData); }
|
||||
};
|
||||
|
||||
#endif /* ndef MEMDATASET_H_INCLUDED */
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogr_api.h 33631 2016-03-04 06:28:09Z goatbar $
|
||||
* $Id: ogr_api.h 37371 2017-02-13 11:41:59Z rouault $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: C API for OGR Geometry, Feature, Layers, DataSource and drivers.
|
||||
@@ -52,17 +52,22 @@ CPL_C_START
|
||||
#ifdef DEBUG
|
||||
typedef struct OGRGeometryHS *OGRGeometryH;
|
||||
#else
|
||||
/** Opaque type for a geometyr */
|
||||
typedef void *OGRGeometryH;
|
||||
#endif
|
||||
|
||||
#ifndef DEFINED_OGRSpatialReferenceH
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#define DEFINED_OGRSpatialReferenceH
|
||||
/*! @endcond */
|
||||
|
||||
#ifdef DEBUG
|
||||
typedef struct OGRSpatialReferenceHS *OGRSpatialReferenceH;
|
||||
typedef struct OGRCoordinateTransformationHS *OGRCoordinateTransformationH;
|
||||
#else
|
||||
/** Opaque type for a spatial reference system */
|
||||
typedef void *OGRSpatialReferenceH;
|
||||
/** Opaque type for a coordinate transformation object */
|
||||
typedef void *OGRCoordinateTransformationH;
|
||||
#endif
|
||||
|
||||
@@ -132,6 +137,7 @@ char CPL_DLL *OGR_G_ExportToKML( OGRGeometryH, const char* pszAltitudeMode ) C
|
||||
|
||||
char CPL_DLL *OGR_G_ExportToJson( OGRGeometryH ) CPL_WARN_UNUSED_RESULT;
|
||||
char CPL_DLL *OGR_G_ExportToJsonEx( OGRGeometryH, char** papszOptions ) CPL_WARN_UNUSED_RESULT;
|
||||
/** Create a OGR geometry from a GeoJSON geometry object */
|
||||
OGRGeometryH CPL_DLL OGR_G_CreateGeometryFromJson( const char* ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
void CPL_DLL OGR_G_AssignSpatialReference( OGRGeometryH,
|
||||
@@ -169,6 +175,7 @@ OGRGeometryH CPL_DLL OGR_G_PointOnSurface( OGRGeometryH ) CPL_WARN_UNUSED_RESULT
|
||||
OGRGeometryH CPL_DLL OGR_G_Difference( OGRGeometryH, OGRGeometryH ) CPL_WARN_UNUSED_RESULT;
|
||||
OGRGeometryH CPL_DLL OGR_G_SymDifference( OGRGeometryH, OGRGeometryH ) CPL_WARN_UNUSED_RESULT;
|
||||
double CPL_DLL OGR_G_Distance( OGRGeometryH, OGRGeometryH );
|
||||
double CPL_DLL OGR_G_Distance3D( OGRGeometryH, OGRGeometryH );
|
||||
double CPL_DLL OGR_G_Length( OGRGeometryH );
|
||||
double CPL_DLL OGR_G_Area( OGRGeometryH );
|
||||
int CPL_DLL OGR_G_Centroid( OGRGeometryH, OGRGeometryH );
|
||||
@@ -183,12 +190,14 @@ int CPL_DLL OGR_G_IsRing( OGRGeometryH );
|
||||
|
||||
OGRGeometryH CPL_DLL OGR_G_Polygonize( OGRGeometryH ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/* backward compatibility (non-standard methods) */
|
||||
int CPL_DLL OGR_G_Intersect( OGRGeometryH, OGRGeometryH ) CPL_WARN_DEPRECATED("Non standard method. Use OGR_G_Intersects() instead");
|
||||
int CPL_DLL OGR_G_Equal( OGRGeometryH, OGRGeometryH ) CPL_WARN_DEPRECATED("Non standard method. Use OGR_G_Equals() instead");
|
||||
OGRGeometryH CPL_DLL OGR_G_SymmetricDifference( OGRGeometryH, OGRGeometryH ) CPL_WARN_DEPRECATED("Non standard method. Use OGR_G_SymDifference() instead");
|
||||
double CPL_DLL OGR_G_GetArea( OGRGeometryH ) CPL_WARN_DEPRECATED("Non standard method. Use OGR_G_Area() instead");
|
||||
OGRGeometryH CPL_DLL OGR_G_GetBoundary( OGRGeometryH ) CPL_WARN_DEPRECATED("Non standard method. Use OGR_G_Boundary() instead");
|
||||
/*! @endcond */
|
||||
|
||||
/* Methods for getting/setting vertices in points, line strings and rings */
|
||||
int CPL_DLL OGR_G_GetPointCount( OGRGeometryH );
|
||||
@@ -247,16 +256,19 @@ OGRGeometryH CPL_DLL OGR_G_GetLinearGeometry( OGRGeometryH hGeom,
|
||||
OGRGeometryH CPL_DLL OGR_G_GetCurveGeometry( OGRGeometryH hGeom,
|
||||
char** papszOptions ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
OGRGeometryH CPL_DLL OGRBuildPolygonFromEdges( OGRGeometryH hLinesAsCollection,
|
||||
int bBestEffort,
|
||||
int bAutoClose,
|
||||
double dfTolerance,
|
||||
OGRErr * peErr ) CPL_WARN_UNUSED_RESULT;
|
||||
OGRGeometryH CPL_DLL
|
||||
OGRBuildPolygonFromEdges( OGRGeometryH hLinesAsCollection,
|
||||
int bBestEffort,
|
||||
int bAutoClose,
|
||||
double dfTolerance,
|
||||
OGRErr * peErr ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
OGRErr CPL_DLL OGRSetGenerate_DB2_V72_BYTE_ORDER(
|
||||
int bGenerate_DB2_V72_BYTE_ORDER );
|
||||
|
||||
int CPL_DLL OGRGetGenerate_DB2_V72_BYTE_ORDER(void);
|
||||
/*! @endcond */
|
||||
|
||||
void CPL_DLL OGRSetNonLinearGeometriesEnabledFlag(int bFlag);
|
||||
int CPL_DLL OGRGetNonLinearGeometriesEnabledFlag(void);
|
||||
@@ -271,11 +283,16 @@ typedef struct OGRFeatureDefnHS *OGRFeatureDefnH;
|
||||
typedef struct OGRFeatureHS *OGRFeatureH;
|
||||
typedef struct OGRStyleTableHS *OGRStyleTableH;
|
||||
#else
|
||||
/** Opaque type for a field definition (OGRFieldDefn) */
|
||||
typedef void *OGRFieldDefnH;
|
||||
/** Opaque type for a feature definition (OGRFeatureDefn) */
|
||||
typedef void *OGRFeatureDefnH;
|
||||
/** Opaque type for a feature (OGRFeature) */
|
||||
typedef void *OGRFeatureH;
|
||||
/** Opaque type for a style table (OGRStyleTable) */
|
||||
typedef void *OGRStyleTableH;
|
||||
#endif
|
||||
/** Opaque type for a geometry field definition (OGRGeomFieldDefn) */
|
||||
typedef struct OGRGeomFieldDefnHS *OGRGeomFieldDefnH;
|
||||
|
||||
/* OGRFieldDefn */
|
||||
@@ -384,8 +401,18 @@ int CPL_DLL OGR_F_GetFieldIndex( OGRFeatureH, const char * );
|
||||
|
||||
int CPL_DLL OGR_F_IsFieldSet( OGRFeatureH, int );
|
||||
void CPL_DLL OGR_F_UnsetField( OGRFeatureH, int );
|
||||
|
||||
int CPL_DLL OGR_F_IsFieldNull( OGRFeatureH, int );
|
||||
int CPL_DLL OGR_F_IsFieldSetAndNotNull( OGRFeatureH, int );
|
||||
void CPL_DLL OGR_F_SetFieldNull( OGRFeatureH, int );
|
||||
|
||||
OGRField CPL_DLL *OGR_F_GetRawFieldRef( OGRFeatureH, int );
|
||||
|
||||
int CPL_DLL OGR_RawField_IsUnset( const OGRField* );
|
||||
int CPL_DLL OGR_RawField_IsNull( const OGRField* );
|
||||
void CPL_DLL OGR_RawField_SetUnset( OGRField* );
|
||||
void CPL_DLL OGR_RawField_SetNull( OGRField* );
|
||||
|
||||
int CPL_DLL OGR_F_GetFieldAsInteger( OGRFeatureH, int );
|
||||
GIntBig CPL_DLL OGR_F_GetFieldAsInteger64( OGRFeatureH, int );
|
||||
double CPL_DLL OGR_F_GetFieldAsDouble( OGRFeatureH, int );
|
||||
@@ -440,8 +467,11 @@ OGRErr CPL_DLL OGR_F_SetFromWithMap( OGRFeatureH, OGRFeatureH, int , int * );
|
||||
const char CPL_DLL *OGR_F_GetStyleString( OGRFeatureH );
|
||||
void CPL_DLL OGR_F_SetStyleString( OGRFeatureH, const char * );
|
||||
void CPL_DLL OGR_F_SetStyleStringDirectly( OGRFeatureH, char * );
|
||||
/** Return style table */
|
||||
OGRStyleTableH CPL_DLL OGR_F_GetStyleTable( OGRFeatureH );
|
||||
/** Set style table and take ownership */
|
||||
void CPL_DLL OGR_F_SetStyleTableDirectly( OGRFeatureH, OGRStyleTableH );
|
||||
/** Set style table */
|
||||
void CPL_DLL OGR_F_SetStyleTable( OGRFeatureH, OGRStyleTableH );
|
||||
|
||||
const char CPL_DLL *OGR_F_GetNativeData( OGRFeatureH );
|
||||
@@ -463,8 +493,11 @@ typedef struct OGRLayerHS *OGRLayerH;
|
||||
typedef struct OGRDataSourceHS *OGRDataSourceH;
|
||||
typedef struct OGRDriverHS *OGRSFDriverH;
|
||||
#else
|
||||
/** Opaque type for a layer (OGRLayer) */
|
||||
typedef void *OGRLayerH;
|
||||
/** Opaque type for a OGR datasource (OGRDataSource) */
|
||||
typedef void *OGRDataSourceH;
|
||||
/** Opaque type for a OGR driver (OGRSFDriver) */
|
||||
typedef void *OGRSFDriverH;
|
||||
#endif
|
||||
|
||||
@@ -507,15 +540,22 @@ OGRErr CPL_DLL OGR_L_AlterFieldDefn( OGRLayerH, int iField, OGRFieldDefnH hNewFi
|
||||
OGRErr CPL_DLL OGR_L_StartTransaction( OGRLayerH ) CPL_WARN_UNUSED_RESULT;
|
||||
OGRErr CPL_DLL OGR_L_CommitTransaction( OGRLayerH ) CPL_WARN_UNUSED_RESULT;
|
||||
OGRErr CPL_DLL OGR_L_RollbackTransaction( OGRLayerH );
|
||||
/*! @cond Doxygen_Suppress */
|
||||
int CPL_DLL OGR_L_Reference( OGRLayerH );
|
||||
int CPL_DLL OGR_L_Dereference( OGRLayerH );
|
||||
int CPL_DLL OGR_L_GetRefCount( OGRLayerH );
|
||||
/*! @endcond */
|
||||
OGRErr CPL_DLL OGR_L_SyncToDisk( OGRLayerH );
|
||||
/*! @cond Doxygen_Suppress */
|
||||
GIntBig CPL_DLL OGR_L_GetFeaturesRead( OGRLayerH );
|
||||
/*! @endcond */
|
||||
const char CPL_DLL *OGR_L_GetFIDColumn( OGRLayerH );
|
||||
const char CPL_DLL *OGR_L_GetGeometryColumn( OGRLayerH );
|
||||
/** Get style table */
|
||||
OGRStyleTableH CPL_DLL OGR_L_GetStyleTable( OGRLayerH );
|
||||
/** Set style table (and take ownership) */
|
||||
void CPL_DLL OGR_L_SetStyleTableDirectly( OGRLayerH, OGRStyleTableH );
|
||||
/** Set style table */
|
||||
void CPL_DLL OGR_L_SetStyleTable( OGRLayerH, OGRStyleTableH );
|
||||
OGRErr CPL_DLL OGR_L_SetIgnoredFields( OGRLayerH, const char** );
|
||||
OGRErr CPL_DLL OGR_L_Intersection( OGRLayerH, OGRLayerH, OGRLayerH, char**, GDALProgressFunc, void * );
|
||||
@@ -544,13 +584,19 @@ int CPL_DLL OGR_DS_TestCapability( OGRDataSourceH, const char * );
|
||||
OGRLayerH CPL_DLL OGR_DS_ExecuteSQL( OGRDataSourceH, const char *,
|
||||
OGRGeometryH, const char * );
|
||||
void CPL_DLL OGR_DS_ReleaseResultSet( OGRDataSourceH, OGRLayerH );
|
||||
/*! @cond Doxygen_Suppress */
|
||||
int CPL_DLL OGR_DS_Reference( OGRDataSourceH );
|
||||
int CPL_DLL OGR_DS_Dereference( OGRDataSourceH );
|
||||
int CPL_DLL OGR_DS_GetRefCount( OGRDataSourceH );
|
||||
int CPL_DLL OGR_DS_GetSummaryRefCount( OGRDataSourceH );
|
||||
/*! @endcond */
|
||||
/** Flush pending changes to disk. See GDALDataset::FlushCache() */
|
||||
OGRErr CPL_DLL OGR_DS_SyncToDisk( OGRDataSourceH );
|
||||
/** Get style table */
|
||||
OGRStyleTableH CPL_DLL OGR_DS_GetStyleTable( OGRDataSourceH );
|
||||
/** Set style table (and take ownership) */
|
||||
void CPL_DLL OGR_DS_SetStyleTableDirectly( OGRDataSourceH, OGRStyleTableH );
|
||||
/** Set style table */
|
||||
void CPL_DLL OGR_DS_SetStyleTable( OGRDataSourceH, OGRStyleTableH );
|
||||
|
||||
/* OGRSFDriver */
|
||||
@@ -569,17 +615,22 @@ OGRErr CPL_DLL OGR_Dr_DeleteDataSource( OGRSFDriverH, const char * );
|
||||
OGRDataSourceH CPL_DLL OGROpen( const char *, int, OGRSFDriverH * ) CPL_WARN_UNUSED_RESULT;
|
||||
OGRDataSourceH CPL_DLL OGROpenShared( const char *, int, OGRSFDriverH * ) CPL_WARN_UNUSED_RESULT;
|
||||
OGRErr CPL_DLL OGRReleaseDataSource( OGRDataSourceH );
|
||||
/*! @cond Doxygen_Suppress */
|
||||
void CPL_DLL OGRRegisterDriver( OGRSFDriverH );
|
||||
void CPL_DLL OGRDeregisterDriver( OGRSFDriverH );
|
||||
/*! @endcond */
|
||||
int CPL_DLL OGRGetDriverCount(void);
|
||||
OGRSFDriverH CPL_DLL OGRGetDriver( int );
|
||||
OGRSFDriverH CPL_DLL OGRGetDriverByName( const char * );
|
||||
/*! @cond Doxygen_Suppress */
|
||||
int CPL_DLL OGRGetOpenDSCount(void);
|
||||
OGRDataSourceH CPL_DLL OGRGetOpenDS( int iDS );
|
||||
|
||||
/*! @endcond */
|
||||
|
||||
/* note: this is also declared in ogrsf_frmts.h */
|
||||
void CPL_DLL OGRRegisterAll(void);
|
||||
/** Clean-up all drivers (including raster ones starting with GDAL 2.0.
|
||||
* See GDALDestroyDriverManager() */
|
||||
void CPL_DLL OGRCleanupAll(void);
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
@@ -590,7 +641,9 @@ void CPL_DLL OGRCleanupAll(void);
|
||||
typedef struct OGRStyleMgrHS *OGRStyleMgrH;
|
||||
typedef struct OGRStyleToolHS *OGRStyleToolH;
|
||||
#else
|
||||
/** Style manager opaque type */
|
||||
typedef void *OGRStyleMgrH;
|
||||
/** Style tool opaque type */
|
||||
typedef void *OGRStyleToolH;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogr_attrind.h 32177 2015-12-14 07:25:30Z goatbar $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: Classes related to generic implementation of attribute indexing.
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2003, Frank Warmerdam <warmerdam@pobox.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_ATTRIND_H_INCLUDED
|
||||
#define OGR_ATTRIND_H_INCLUDED
|
||||
|
||||
#include "ogrsf_frmts.h"
|
||||
|
||||
/************************************************************************/
|
||||
/* OGRAttrIndex */
|
||||
/* */
|
||||
/* Base class for accessing the indexing info about one field. */
|
||||
/************************************************************************/
|
||||
|
||||
class CPL_DLL OGRAttrIndex
|
||||
{
|
||||
protected:
|
||||
OGRAttrIndex();
|
||||
|
||||
public:
|
||||
virtual ~OGRAttrIndex();
|
||||
|
||||
virtual GIntBig GetFirstMatch( OGRField *psKey ) = 0;
|
||||
virtual GIntBig *GetAllMatches( OGRField *psKey ) = 0;
|
||||
virtual GIntBig *GetAllMatches( OGRField *psKey, GIntBig* panFIDList, int* nFIDCount, int* nLength ) = 0;
|
||||
|
||||
virtual OGRErr AddEntry( OGRField *psKey, GIntBig nFID ) = 0;
|
||||
virtual OGRErr RemoveEntry( OGRField *psKey, GIntBig nFID ) = 0;
|
||||
|
||||
virtual OGRErr Clear() = 0;
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
/* OGRLayerAttrIndex */
|
||||
/* */
|
||||
/* Base class representing attribute indexes for all indexed */
|
||||
/* fields in a layer. */
|
||||
/************************************************************************/
|
||||
|
||||
class CPL_DLL OGRLayerAttrIndex
|
||||
{
|
||||
protected:
|
||||
OGRLayer *poLayer;
|
||||
char *pszIndexPath;
|
||||
|
||||
OGRLayerAttrIndex();
|
||||
|
||||
public:
|
||||
virtual ~OGRLayerAttrIndex();
|
||||
|
||||
virtual OGRErr Initialize( const char *pszIndexPath, OGRLayer * ) = 0;
|
||||
|
||||
virtual OGRErr CreateIndex( int iField ) = 0;
|
||||
virtual OGRErr DropIndex( int iField ) = 0;
|
||||
virtual OGRErr IndexAllFeatures( int iField = -1 ) = 0;
|
||||
|
||||
virtual OGRErr AddToIndex( OGRFeature *poFeature, int iField = -1 ) = 0;
|
||||
virtual OGRErr RemoveFromIndex( OGRFeature *poFeature ) = 0;
|
||||
|
||||
virtual OGRAttrIndex *GetFieldIndex( int iField ) = 0;
|
||||
};
|
||||
|
||||
OGRLayerAttrIndex CPL_DLL *OGRCreateDefaultLayerIndex();
|
||||
|
||||
|
||||
#endif /* ndef OGR_ATTRIND_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogr_core.h 33680 2016-03-08 09:59:03Z rouault $
|
||||
* $Id: ogr_core.h 37856 2017-03-28 12:10:47Z rouault $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: Define some core portability services for cross-platform OGR code.
|
||||
@@ -44,11 +44,20 @@
|
||||
* Simple container for a bounding region.
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) && !defined(DOXYGEN_SKIP)
|
||||
|
||||
extern "C++"
|
||||
{
|
||||
#include <limits>
|
||||
|
||||
class CPL_DLL OGREnvelope
|
||||
{
|
||||
public:
|
||||
OGREnvelope() : MinX(0.0), MaxX(0.0), MinY(0.0), MaxY(0.0)
|
||||
OGREnvelope() : MinX(std::numeric_limits<double>::infinity()),
|
||||
MaxX(-std::numeric_limits<double>::infinity()),
|
||||
MinY(std::numeric_limits<double>::infinity()),
|
||||
MaxY(-std::numeric_limits<double>::infinity())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -66,41 +75,24 @@ class CPL_DLL OGREnvelope
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wfloat-equal"
|
||||
#endif
|
||||
int IsInit() const { return MinX != 0 || MinY != 0 || MaxX != 0 || MaxY != 0; }
|
||||
int IsInit() const { return MinX != std::numeric_limits<double>::infinity(); }
|
||||
|
||||
#ifdef HAVE_GCC_DIAGNOSTIC_PUSH
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
void Merge( OGREnvelope const& sOther ) {
|
||||
if( IsInit() )
|
||||
{
|
||||
MinX = MIN(MinX,sOther.MinX);
|
||||
MaxX = MAX(MaxX,sOther.MaxX);
|
||||
MinY = MIN(MinY,sOther.MinY);
|
||||
MaxY = MAX(MaxY,sOther.MaxY);
|
||||
}
|
||||
else
|
||||
{
|
||||
MinX = sOther.MinX;
|
||||
MaxX = sOther.MaxX;
|
||||
MinY = sOther.MinY;
|
||||
MaxY = sOther.MaxY;
|
||||
}
|
||||
MinX = MIN(MinX,sOther.MinX);
|
||||
MaxX = MAX(MaxX,sOther.MaxX);
|
||||
MinY = MIN(MinY,sOther.MinY);
|
||||
MaxY = MAX(MaxY,sOther.MaxY);
|
||||
}
|
||||
|
||||
void Merge( double dfX, double dfY ) {
|
||||
if( IsInit() )
|
||||
{
|
||||
MinX = MIN(MinX,dfX);
|
||||
MaxX = MAX(MaxX,dfX);
|
||||
MinY = MIN(MinY,dfY);
|
||||
MaxY = MAX(MaxY,dfY);
|
||||
}
|
||||
else
|
||||
{
|
||||
MinX = MaxX = dfX;
|
||||
MinY = MaxY = dfY;
|
||||
}
|
||||
MinX = MIN(MinX,dfX);
|
||||
MaxX = MAX(MaxX,dfX);
|
||||
MinY = MIN(MinY,dfY);
|
||||
MaxY = MAX(MaxY,dfY);
|
||||
}
|
||||
|
||||
void Intersect( OGREnvelope const& sOther ) {
|
||||
@@ -123,10 +115,7 @@ class CPL_DLL OGREnvelope
|
||||
}
|
||||
else
|
||||
{
|
||||
MinX = 0;
|
||||
MaxX = 0;
|
||||
MinY = 0;
|
||||
MaxY = 0;
|
||||
*this = OGREnvelope();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,6 +131,9 @@ class CPL_DLL OGREnvelope
|
||||
MaxX >= other.MaxX && MaxY >= other.MaxY;
|
||||
}
|
||||
};
|
||||
|
||||
} // extern "C++"
|
||||
|
||||
#else
|
||||
typedef struct
|
||||
{
|
||||
@@ -152,16 +144,20 @@ typedef struct
|
||||
} OGREnvelope;
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Simple container for a bounding region in 3D.
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus) && !defined(CPL_SURESS_CPLUSPLUS)
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) && !defined(DOXYGEN_SKIP)
|
||||
|
||||
extern "C++" {
|
||||
|
||||
class CPL_DLL OGREnvelope3D : public OGREnvelope
|
||||
{
|
||||
public:
|
||||
OGREnvelope3D() : OGREnvelope(), MinZ(0.0), MaxZ(0.0)
|
||||
OGREnvelope3D() : OGREnvelope(),
|
||||
MinZ(std::numeric_limits<double>::infinity()),
|
||||
MaxZ(-std::numeric_limits<double>::infinity())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -178,47 +174,27 @@ class CPL_DLL OGREnvelope3D : public OGREnvelope
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wfloat-equal"
|
||||
#endif
|
||||
int IsInit() const { return MinX != 0 || MinY != 0 || MaxX != 0 || MaxY != 0 || MinZ != 0 || MaxZ != 0; }
|
||||
int IsInit() const { return MinX != std::numeric_limits<double>::infinity(); }
|
||||
#ifdef HAVE_GCC_DIAGNOSTIC_PUSH
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
void Merge( OGREnvelope3D const& sOther ) {
|
||||
if( IsInit() )
|
||||
{
|
||||
MinX = MIN(MinX,sOther.MinX);
|
||||
MaxX = MAX(MaxX,sOther.MaxX);
|
||||
MinY = MIN(MinY,sOther.MinY);
|
||||
MaxY = MAX(MaxY,sOther.MaxY);
|
||||
MinZ = MIN(MinZ,sOther.MinZ);
|
||||
MaxZ = MAX(MaxZ,sOther.MaxZ);
|
||||
}
|
||||
else
|
||||
{
|
||||
MinX = sOther.MinX;
|
||||
MaxX = sOther.MaxX;
|
||||
MinY = sOther.MinY;
|
||||
MaxY = sOther.MaxY;
|
||||
MinZ = sOther.MinZ;
|
||||
MaxZ = sOther.MaxZ;
|
||||
}
|
||||
MinX = MIN(MinX,sOther.MinX);
|
||||
MaxX = MAX(MaxX,sOther.MaxX);
|
||||
MinY = MIN(MinY,sOther.MinY);
|
||||
MaxY = MAX(MaxY,sOther.MaxY);
|
||||
MinZ = MIN(MinZ,sOther.MinZ);
|
||||
MaxZ = MAX(MaxZ,sOther.MaxZ);
|
||||
}
|
||||
|
||||
void Merge( double dfX, double dfY, double dfZ ) {
|
||||
if( IsInit() )
|
||||
{
|
||||
MinX = MIN(MinX,dfX);
|
||||
MaxX = MAX(MaxX,dfX);
|
||||
MinY = MIN(MinY,dfY);
|
||||
MaxY = MAX(MaxY,dfY);
|
||||
MinZ = MIN(MinZ,dfZ);
|
||||
MaxZ = MAX(MaxZ,dfZ);
|
||||
}
|
||||
else
|
||||
{
|
||||
MinX = MaxX = dfX;
|
||||
MinY = MaxY = dfY;
|
||||
MinZ = MaxZ = dfZ;
|
||||
}
|
||||
MinX = MIN(MinX,dfX);
|
||||
MaxX = MAX(MaxX,dfX);
|
||||
MinY = MIN(MinY,dfY);
|
||||
MaxY = MAX(MaxY,dfY);
|
||||
MinZ = MIN(MinZ,dfZ);
|
||||
MaxZ = MAX(MaxZ,dfZ);
|
||||
}
|
||||
|
||||
void Intersect( OGREnvelope3D const& sOther ) {
|
||||
@@ -245,12 +221,7 @@ class CPL_DLL OGREnvelope3D : public OGREnvelope
|
||||
}
|
||||
else
|
||||
{
|
||||
MinX = 0;
|
||||
MaxX = 0;
|
||||
MinY = 0;
|
||||
MaxY = 0;
|
||||
MinZ = 0;
|
||||
MaxZ = 0;
|
||||
*this = OGREnvelope3D();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,6 +239,9 @@ class CPL_DLL OGREnvelope3D : public OGREnvelope
|
||||
MinZ <= other.MinZ && MaxZ >= other.MaxZ;
|
||||
}
|
||||
};
|
||||
|
||||
} // extern "C++"
|
||||
|
||||
#else
|
||||
typedef struct
|
||||
{
|
||||
@@ -279,46 +253,51 @@ typedef struct
|
||||
double MaxZ;
|
||||
} OGREnvelope3D;
|
||||
#endif
|
||||
|
||||
/*! @endcond */
|
||||
|
||||
CPL_C_START
|
||||
|
||||
void CPL_DLL *OGRMalloc( size_t );
|
||||
void CPL_DLL *OGRCalloc( size_t, size_t );
|
||||
void CPL_DLL *OGRRealloc( void *, size_t );
|
||||
char CPL_DLL *OGRStrdup( const char * );
|
||||
void CPL_DLL OGRFree( void * );
|
||||
/*! @cond Doxygen_Suppress */
|
||||
void CPL_DLL *OGRMalloc( size_t ) CPL_WARN_DEPRECATED("Use CPLMalloc instead.");
|
||||
void CPL_DLL *OGRCalloc( size_t, size_t ) CPL_WARN_DEPRECATED("Use CPLCalloc instead.");
|
||||
void CPL_DLL *OGRRealloc( void *, size_t ) CPL_WARN_DEPRECATED("Use CPLRealloc instead.");
|
||||
char CPL_DLL *OGRStrdup( const char * ) CPL_WARN_DEPRECATED("Use CPLStrdup instead.");
|
||||
void CPL_DLL OGRFree( void * ) CPL_WARN_DEPRECATED("Use CPLFree instead.");
|
||||
/*! @endcond */
|
||||
|
||||
#ifdef STRICT_OGRERR_TYPE
|
||||
/** Type for a OGR error */
|
||||
typedef enum
|
||||
{
|
||||
OGRERR_NONE,
|
||||
OGRERR_NOT_ENOUGH_DATA,
|
||||
OGRERR_NOT_ENOUGH_MEMORY,
|
||||
OGRERR_UNSUPPORTED_GEOMETRY_TYPE,
|
||||
OGRERR_UNSUPPORTED_OPERATION,
|
||||
OGRERR_CORRUPT_DATA,
|
||||
OGRERR_FAILURE,
|
||||
OGRERR_UNSUPPORTED_SRS,
|
||||
OGRERR_INVALID_HANDLE,
|
||||
OGRERR_NON_EXISTING_FEATURE
|
||||
OGRERR_NONE, /**< Success */
|
||||
OGRERR_NOT_ENOUGH_DATA, /**< Not enough data to deserialize */
|
||||
OGRERR_NOT_ENOUGH_MEMORY, /**< Not enough memory */
|
||||
OGRERR_UNSUPPORTED_GEOMETRY_TYPE, /**< Unsupported geometry type */
|
||||
OGRERR_UNSUPPORTED_OPERATION, /**< Unsupported operation */
|
||||
OGRERR_CORRUPT_DATA, /**< Corrupt data */
|
||||
OGRERR_FAILURE, /**< Failure */
|
||||
OGRERR_UNSUPPORTED_SRS, /**< Unsupported SRS */
|
||||
OGRERR_INVALID_HANDLE, /**< Invalid handle */
|
||||
OGRERR_NON_EXISTING_FEATURE /**< Non existing feature. Added in GDAL 2.0 */
|
||||
} OGRErr;
|
||||
#else
|
||||
/** Type for a OGR error */
|
||||
typedef int OGRErr;
|
||||
|
||||
#define OGRERR_NONE 0
|
||||
#define OGRERR_NOT_ENOUGH_DATA 1 /* not enough data to deserialize */
|
||||
#define OGRERR_NOT_ENOUGH_MEMORY 2
|
||||
#define OGRERR_UNSUPPORTED_GEOMETRY_TYPE 3
|
||||
#define OGRERR_UNSUPPORTED_OPERATION 4
|
||||
#define OGRERR_CORRUPT_DATA 5
|
||||
#define OGRERR_FAILURE 6
|
||||
#define OGRERR_UNSUPPORTED_SRS 7
|
||||
#define OGRERR_INVALID_HANDLE 8
|
||||
#define OGRERR_NON_EXISTING_FEATURE 9 /* added in GDAL 2.0 */
|
||||
#define OGRERR_NONE 0 /**< Success */
|
||||
#define OGRERR_NOT_ENOUGH_DATA 1 /**< Not enough data to deserialize */
|
||||
#define OGRERR_NOT_ENOUGH_MEMORY 2 /**< Not enough memory */
|
||||
#define OGRERR_UNSUPPORTED_GEOMETRY_TYPE 3 /**< Unsupported geometry type */
|
||||
#define OGRERR_UNSUPPORTED_OPERATION 4 /**< Unsupported operation */
|
||||
#define OGRERR_CORRUPT_DATA 5 /**< Corrupt data */
|
||||
#define OGRERR_FAILURE 6 /**< Failure */
|
||||
#define OGRERR_UNSUPPORTED_SRS 7 /**< Unsupported SRS */
|
||||
#define OGRERR_INVALID_HANDLE 8 /**< Invalid handle */
|
||||
#define OGRERR_NON_EXISTING_FEATURE 9 /**< Non existing feature. Added in GDAL 2.0 */
|
||||
|
||||
#endif
|
||||
|
||||
/** Type for a OGR boolean */
|
||||
typedef int OGRBoolean;
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
@@ -360,7 +339,7 @@ typedef enum
|
||||
* ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented */
|
||||
wkbTIN = 16, /**< a PolyhedralSurface consisting only of Triangle patches
|
||||
* ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented */
|
||||
wkbTriangle = 17, /** < a Triangle. ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented */
|
||||
wkbTriangle = 17, /**< a Triangle. ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented */
|
||||
|
||||
wkbNone = 100, /**< non-standard, for pure attribute records */
|
||||
wkbLinearRing = 101, /**< non-standard, just for createGeometry() */
|
||||
@@ -443,9 +422,8 @@ typedef enum
|
||||
wkbVariantPostGIS1 /**< PostGIS 1.X has different codes for CurvePolygon, MultiCurve and MultiSurface */
|
||||
} OGRwkbVariant;
|
||||
|
||||
|
||||
/** @deprecated in GDAL 2.0. Use wkbHasZ() or wkbSetZ() instead */
|
||||
#ifndef GDAL_COMPILATION
|
||||
/** @deprecated in GDAL 2.0. Use wkbHasZ() or wkbSetZ() instead */
|
||||
#define wkb25DBit 0x80000000
|
||||
#endif
|
||||
|
||||
@@ -472,7 +450,9 @@ typedef enum
|
||||
*/
|
||||
#define wkbSetM(x) OGR_GT_SetM(x)
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
#define ogrZMarker 0x21125711
|
||||
#endif
|
||||
|
||||
const char CPL_DLL * OGRGeometryTypeToName( OGRwkbGeometryType eType );
|
||||
OGRwkbGeometryType CPL_DLL OGRMergeGeometryTypes( OGRwkbGeometryType eMain,
|
||||
@@ -495,12 +475,15 @@ OGRwkbGeometryType CPL_DLL OGR_GT_GetCollection( OGRwkbGeometryType eType );
|
||||
OGRwkbGeometryType CPL_DLL OGR_GT_GetCurve( OGRwkbGeometryType eType );
|
||||
OGRwkbGeometryType CPL_DLL OGR_GT_GetLinear( OGRwkbGeometryType eType );
|
||||
|
||||
/** Enumeration to describe byte order */
|
||||
typedef enum
|
||||
{
|
||||
wkbXDR = 0, /* MSB/Sun/Motoroloa: Most Significant Byte First */
|
||||
wkbNDR = 1 /* LSB/Intel/Vax: Least Significant Byte First */
|
||||
wkbXDR = 0, /**< MSB/Sun/Motoroloa: Most Significant Byte First */
|
||||
wkbNDR = 1 /**< LSB/Intel/Vax: Least Significant Byte First */
|
||||
} OGRwkbByteOrder;
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#ifndef NO_HACK_FOR_IBM_DB2_V72
|
||||
# define HACK_FOR_IBM_DB2_V72
|
||||
#endif
|
||||
@@ -513,6 +496,8 @@ typedef enum
|
||||
# define DB2_V72_UNFIX_BYTE_ORDER(x) (x)
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
/** Alter field name.
|
||||
* Used by OGR_L_AlterFieldDefn().
|
||||
*/
|
||||
@@ -545,7 +530,6 @@ typedef enum
|
||||
*/
|
||||
#define ALTER_ALL_FLAG (ALTER_NAME_FLAG | ALTER_TYPE_FLAG | ALTER_WIDTH_PRECISION_FLAG | ALTER_NULLABLE_FLAG | ALTER_DEFAULT_FLAG)
|
||||
|
||||
|
||||
/** Validate that fields respect not-null constraints.
|
||||
* Used by OGR_F_Validate().
|
||||
* @since GDAL 2.0
|
||||
@@ -648,9 +632,24 @@ typedef enum
|
||||
OJRight = 2
|
||||
} OGRJustification;
|
||||
|
||||
/** Special value for a unset FID */
|
||||
#define OGRNullFID -1
|
||||
|
||||
/** Special value set in OGRField.Set.nMarker1, nMarker2 and nMarker3 for
|
||||
* a unset field.
|
||||
* Direct use of this value is strongly discouraged.
|
||||
* Use OGR_RawField_SetUnset() or OGR_RawField_IsUnset() instead.
|
||||
*/
|
||||
#define OGRUnsetMarker -21121
|
||||
|
||||
/** Special value set in OGRField.Set.nMarker1, nMarker2 and nMarker3 for
|
||||
* a null field.
|
||||
* Direct use of this value is strongly discouraged.
|
||||
* Use OGR_RawField_SetNull() or OGR_RawField_IsNull() instead.
|
||||
* @since GDAL 2.2
|
||||
*/
|
||||
#define OGRNullMarker -21122
|
||||
|
||||
/************************************************************************/
|
||||
/* OGRField */
|
||||
/************************************************************************/
|
||||
@@ -660,6 +659,7 @@ typedef enum
|
||||
*/
|
||||
|
||||
typedef union {
|
||||
/*! @cond Doxygen_Suppress */
|
||||
int Integer;
|
||||
GIntBig Integer64;
|
||||
double Real;
|
||||
@@ -693,6 +693,7 @@ typedef union {
|
||||
struct {
|
||||
int nMarker1;
|
||||
int nMarker2;
|
||||
int nMarker3;
|
||||
} Set;
|
||||
|
||||
struct {
|
||||
@@ -706,8 +707,10 @@ typedef union {
|
||||
GByte Reserved; /* must be set to 0 */
|
||||
float Second; /* with millisecond accuracy. at the end of the structure, so as to keep it 12 bytes on 32 bit */
|
||||
} Date;
|
||||
/*! @endcond */
|
||||
} OGRField;
|
||||
|
||||
/** Return the number of milliseconds from a datetime with decimal seconds */
|
||||
#define OGR_GET_MS(floatingpoint_sec) (int)(((floatingpoint_sec) - (int)(floatingpoint_sec)) * 1000 + 0.5)
|
||||
|
||||
int CPL_DLL OGRParseDate( const char *pszInput, OGRField *psOutput,
|
||||
@@ -716,35 +719,37 @@ int CPL_DLL OGRParseDate( const char *pszInput, OGRField *psOutput,
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Constants from ogrsf_frmts.h for capabilities. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
#define OLCRandomRead "RandomRead"
|
||||
#define OLCSequentialWrite "SequentialWrite"
|
||||
#define OLCRandomWrite "RandomWrite"
|
||||
#define OLCFastSpatialFilter "FastSpatialFilter"
|
||||
#define OLCFastFeatureCount "FastFeatureCount"
|
||||
#define OLCFastGetExtent "FastGetExtent"
|
||||
#define OLCCreateField "CreateField"
|
||||
#define OLCDeleteField "DeleteField"
|
||||
#define OLCReorderFields "ReorderFields"
|
||||
#define OLCAlterFieldDefn "AlterFieldDefn"
|
||||
#define OLCTransactions "Transactions"
|
||||
#define OLCDeleteFeature "DeleteFeature"
|
||||
#define OLCFastSetNextByIndex "FastSetNextByIndex"
|
||||
#define OLCStringsAsUTF8 "StringsAsUTF8"
|
||||
#define OLCIgnoreFields "IgnoreFields"
|
||||
#define OLCCreateGeomField "CreateGeomField"
|
||||
#define OLCCurveGeometries "CurveGeometries"
|
||||
#define OLCMeasuredGeometries "MeasuredGeometries"
|
||||
#define OLCRandomRead "RandomRead" /**< Layer capability for random read */
|
||||
#define OLCSequentialWrite "SequentialWrite" /**< Layer capability for sequential write */
|
||||
#define OLCRandomWrite "RandomWrite" /**< Layer capability for random write */
|
||||
#define OLCFastSpatialFilter "FastSpatialFilter" /**< Layer capability for fast spatial filter */
|
||||
#define OLCFastFeatureCount "FastFeatureCount" /**< Layer capability for fast feature count retrieval */
|
||||
#define OLCFastGetExtent "FastGetExtent" /**< Layer capability for fast extent retrieval */
|
||||
#define OLCCreateField "CreateField" /**< Layer capability for field creation */
|
||||
#define OLCDeleteField "DeleteField" /**< Layer capability for field deletion */
|
||||
#define OLCReorderFields "ReorderFields" /**< Layer capability for field reordering */
|
||||
#define OLCAlterFieldDefn "AlterFieldDefn" /**< Layer capability for field alteration */
|
||||
#define OLCTransactions "Transactions" /**< Layer capability for transactions */
|
||||
#define OLCDeleteFeature "DeleteFeature" /**< Layer capability for feature deletion */
|
||||
#define OLCFastSetNextByIndex "FastSetNextByIndex" /**< Layer capability for setting next feature index */
|
||||
#define OLCStringsAsUTF8 "StringsAsUTF8" /**< Layer capability for strings returned with UTF-8 encoding */
|
||||
#define OLCIgnoreFields "IgnoreFields" /**< Layer capability for field ignoring */
|
||||
#define OLCCreateGeomField "CreateGeomField" /**< Layer capability for geometry field creation */
|
||||
#define OLCCurveGeometries "CurveGeometries" /**< Layer capability for curve geometries support */
|
||||
#define OLCMeasuredGeometries "MeasuredGeometries" /**< Layer capability for measured geometries support */
|
||||
|
||||
#define ODsCCreateLayer "CreateLayer"
|
||||
#define ODsCDeleteLayer "DeleteLayer"
|
||||
#define ODsCCreateGeomFieldAfterCreateLayer "CreateGeomFieldAfterCreateLayer"
|
||||
#define ODsCCurveGeometries "CurveGeometries"
|
||||
#define ODsCTransactions "Transactions"
|
||||
#define ODsCEmulatedTransactions "EmulatedTransactions"
|
||||
#define ODsCMeasuredGeometries "MeasuredGeometries"
|
||||
#define ODsCCreateLayer "CreateLayer" /**< Dataset capability for layer creation */
|
||||
#define ODsCDeleteLayer "DeleteLayer" /**< Dataset capability for layer deletion */
|
||||
#define ODsCCreateGeomFieldAfterCreateLayer "CreateGeomFieldAfterCreateLayer" /**< Dataset capability for geometry field creation support */
|
||||
#define ODsCCurveGeometries "CurveGeometries" /**< Dataset capability for curve geometries support */
|
||||
#define ODsCTransactions "Transactions" /**< Dataset capability for dataset transcations */
|
||||
#define ODsCEmulatedTransactions "EmulatedTransactions" /**< Dataset capability for emulated dataset transactions */
|
||||
#define ODsCMeasuredGeometries "MeasuredGeometries" /**< Dataset capability for measured geometries support */
|
||||
#define ODsCRandomLayerRead "RandomLayerRead" /**< Dataset capability for GetNextFeature() returning features from random layers */
|
||||
#define ODsCRandomLayerWrite "RandomLayerWrite " /**< Dataset capability for supporting CreateFeature on layer in random order */
|
||||
|
||||
#define ODrCCreateDataSource "CreateDataSource"
|
||||
#define ODrCDeleteDataSource "DeleteDataSource"
|
||||
#define ODrCCreateDataSource "CreateDataSource" /**< Driver capability for datasource creation */
|
||||
#define ODrCDeleteDataSource "DeleteDataSource" /**< Driver capability for datasource deletion */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Layer metadata items. */
|
||||
@@ -765,12 +770,12 @@ int CPL_DLL OGRParseDate( const char *pszInput, OGRField *psOutput,
|
||||
|
||||
typedef enum ogr_style_tool_class_id
|
||||
{
|
||||
OGRSTCNone = 0,
|
||||
OGRSTCPen = 1,
|
||||
OGRSTCBrush = 2,
|
||||
OGRSTCSymbol = 3,
|
||||
OGRSTCLabel = 4,
|
||||
OGRSTCVector = 5
|
||||
OGRSTCNone = 0, /**< None */
|
||||
OGRSTCPen = 1, /**< Pen */
|
||||
OGRSTCBrush = 2, /**< Brush */
|
||||
OGRSTCSymbol = 3, /**< Symbol */
|
||||
OGRSTCLabel = 4, /**< Label */
|
||||
OGRSTCVector = 5 /**< Vector */
|
||||
} OGRSTClassId;
|
||||
|
||||
/**
|
||||
@@ -778,12 +783,12 @@ typedef enum ogr_style_tool_class_id
|
||||
*/
|
||||
typedef enum ogr_style_tool_units_id
|
||||
{
|
||||
OGRSTUGround = 0,
|
||||
OGRSTUPixel = 1,
|
||||
OGRSTUPoints = 2,
|
||||
OGRSTUMM = 3,
|
||||
OGRSTUCM = 4,
|
||||
OGRSTUInches = 5
|
||||
OGRSTUGround = 0, /**< Ground unit */
|
||||
OGRSTUPixel = 1, /**< Pixel */
|
||||
OGRSTUPoints = 2, /**< Points */
|
||||
OGRSTUMM = 3, /**< Millimeter */
|
||||
OGRSTUCM = 4, /**< Centimeter */
|
||||
OGRSTUInches = 5 /**< Inch */
|
||||
} OGRSTUnitId;
|
||||
|
||||
/**
|
||||
@@ -791,16 +796,17 @@ typedef enum ogr_style_tool_units_id
|
||||
*/
|
||||
typedef enum ogr_style_tool_param_pen_id
|
||||
{
|
||||
OGRSTPenColor = 0,
|
||||
OGRSTPenWidth = 1,
|
||||
OGRSTPenPattern = 2,
|
||||
OGRSTPenId = 3,
|
||||
OGRSTPenPerOffset = 4,
|
||||
OGRSTPenCap = 5,
|
||||
OGRSTPenJoin = 6,
|
||||
OGRSTPenPriority = 7,
|
||||
OGRSTPenColor = 0, /**< Color */
|
||||
OGRSTPenWidth = 1, /**< Width */
|
||||
OGRSTPenPattern = 2, /**< Pattern */
|
||||
OGRSTPenId = 3, /**< Id */
|
||||
OGRSTPenPerOffset = 4, /**< Perpendicular offset */
|
||||
OGRSTPenCap = 5, /**< Cap */
|
||||
OGRSTPenJoin = 6, /**< Join */
|
||||
OGRSTPenPriority = 7, /**< Priority */
|
||||
#ifndef DOXYGEN_SKIP
|
||||
OGRSTPenLast = 8
|
||||
|
||||
#endif
|
||||
} OGRSTPenParam;
|
||||
|
||||
/**
|
||||
@@ -808,38 +814,40 @@ typedef enum ogr_style_tool_param_pen_id
|
||||
*/
|
||||
typedef enum ogr_style_tool_param_brush_id
|
||||
{
|
||||
OGRSTBrushFColor = 0,
|
||||
OGRSTBrushBColor = 1,
|
||||
OGRSTBrushId = 2,
|
||||
OGRSTBrushAngle = 3,
|
||||
OGRSTBrushSize = 4,
|
||||
OGRSTBrushDx = 5,
|
||||
OGRSTBrushDy = 6,
|
||||
OGRSTBrushPriority = 7,
|
||||
OGRSTBrushFColor = 0, /**< Foreground color */
|
||||
OGRSTBrushBColor = 1, /**< Background color */
|
||||
OGRSTBrushId = 2, /**< Id */
|
||||
OGRSTBrushAngle = 3, /**< Angle */
|
||||
OGRSTBrushSize = 4, /**< Size */
|
||||
OGRSTBrushDx = 5, /**< Dx */
|
||||
OGRSTBrushDy = 6, /**< Dy */
|
||||
OGRSTBrushPriority = 7, /**< Priority */
|
||||
#ifndef DOXYGEN_SKIP
|
||||
OGRSTBrushLast = 8
|
||||
#endif
|
||||
|
||||
} OGRSTBrushParam;
|
||||
|
||||
|
||||
/**
|
||||
* List of parameters for use with OGRStyleSymbol.
|
||||
*/
|
||||
typedef enum ogr_style_tool_param_symbol_id
|
||||
{
|
||||
OGRSTSymbolId = 0,
|
||||
OGRSTSymbolAngle = 1,
|
||||
OGRSTSymbolColor = 2,
|
||||
OGRSTSymbolSize = 3,
|
||||
OGRSTSymbolDx = 4,
|
||||
OGRSTSymbolDy = 5,
|
||||
OGRSTSymbolStep = 6,
|
||||
OGRSTSymbolPerp = 7,
|
||||
OGRSTSymbolOffset = 8,
|
||||
OGRSTSymbolPriority = 9,
|
||||
OGRSTSymbolFontName = 10,
|
||||
OGRSTSymbolOColor = 11,
|
||||
OGRSTSymbolId = 0, /**< Id */
|
||||
OGRSTSymbolAngle = 1, /**< Angle */
|
||||
OGRSTSymbolColor = 2, /**< Color */
|
||||
OGRSTSymbolSize = 3, /**< Size */
|
||||
OGRSTSymbolDx = 4, /**< Dx */
|
||||
OGRSTSymbolDy = 5, /**< Dy */
|
||||
OGRSTSymbolStep = 6, /**< Step */
|
||||
OGRSTSymbolPerp = 7, /**< Perpendicular */
|
||||
OGRSTSymbolOffset = 8, /**< Offset */
|
||||
OGRSTSymbolPriority = 9, /**< Priority */
|
||||
OGRSTSymbolFontName = 10, /**< Font name */
|
||||
OGRSTSymbolOColor = 11, /**< Outline color */
|
||||
#ifndef DOXYGEN_SKIP
|
||||
OGRSTSymbolLast = 12
|
||||
|
||||
#endif
|
||||
} OGRSTSymbolParam;
|
||||
|
||||
/**
|
||||
@@ -847,35 +855,38 @@ typedef enum ogr_style_tool_param_symbol_id
|
||||
*/
|
||||
typedef enum ogr_style_tool_param_label_id
|
||||
{
|
||||
OGRSTLabelFontName = 0,
|
||||
OGRSTLabelSize = 1,
|
||||
OGRSTLabelTextString = 2,
|
||||
OGRSTLabelAngle = 3,
|
||||
OGRSTLabelFColor = 4,
|
||||
OGRSTLabelBColor = 5,
|
||||
OGRSTLabelPlacement = 6,
|
||||
OGRSTLabelAnchor = 7,
|
||||
OGRSTLabelDx = 8,
|
||||
OGRSTLabelDy = 9,
|
||||
OGRSTLabelPerp = 10,
|
||||
OGRSTLabelBold = 11,
|
||||
OGRSTLabelItalic = 12,
|
||||
OGRSTLabelUnderline = 13,
|
||||
OGRSTLabelPriority = 14,
|
||||
OGRSTLabelStrikeout = 15,
|
||||
OGRSTLabelStretch = 16,
|
||||
OGRSTLabelAdjHor = 17,
|
||||
OGRSTLabelAdjVert = 18,
|
||||
OGRSTLabelHColor = 19,
|
||||
OGRSTLabelOColor = 20,
|
||||
OGRSTLabelFontName = 0, /**< Font name */
|
||||
OGRSTLabelSize = 1, /**< Size */
|
||||
OGRSTLabelTextString = 2, /**< Text string */
|
||||
OGRSTLabelAngle = 3, /**< Angle */
|
||||
OGRSTLabelFColor = 4, /**< Foreground color */
|
||||
OGRSTLabelBColor = 5, /**< Background color */
|
||||
OGRSTLabelPlacement = 6, /**< Placement */
|
||||
OGRSTLabelAnchor = 7, /**< Anchor */
|
||||
OGRSTLabelDx = 8, /**< Dx */
|
||||
OGRSTLabelDy = 9, /**< Dy */
|
||||
OGRSTLabelPerp = 10, /**< Perpendicular */
|
||||
OGRSTLabelBold = 11, /**< Bold */
|
||||
OGRSTLabelItalic = 12, /**< Italic */
|
||||
OGRSTLabelUnderline = 13, /**< Underline */
|
||||
OGRSTLabelPriority = 14, /**< Priority */
|
||||
OGRSTLabelStrikeout = 15, /**< Strike out */
|
||||
OGRSTLabelStretch = 16, /**< Stretch */
|
||||
OGRSTLabelAdjHor = 17, /**< Horizontal adjustment */
|
||||
OGRSTLabelAdjVert = 18, /**< Vectical adjustment */
|
||||
OGRSTLabelHColor = 19, /**< Highlight color */
|
||||
OGRSTLabelOColor = 20, /**< Outline color */
|
||||
#ifndef DOXYGEN_SKIP
|
||||
OGRSTLabelLast = 21
|
||||
|
||||
#endif
|
||||
} OGRSTLabelParam;
|
||||
|
||||
/* ------------------------------------------------------------------- */
|
||||
/* Version checking */
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
/* Note to developers : please keep this section in sync with gdal.h */
|
||||
|
||||
#ifndef GDAL_VERSION_INFO_DEFINED
|
||||
@@ -905,6 +916,8 @@ int CPL_DLL CPL_STDCALL GDALCheckVersion( int nVersionMajor, int nVersionMinor,
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif /* ndef OGR_CORE_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogr_expat.h 27044 2014-03-16 23:41:27Z rouault $
|
||||
* $Id: ogr_expat.h 34523 2016-07-02 21:50:47Z goatbar $
|
||||
*
|
||||
* Project: OGR
|
||||
* Purpose: Convenience function for parsing with Expat library
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogr_feature.h 33631 2016-03-04 06:28:09Z goatbar $
|
||||
* $Id: ogr_feature.h 37371 2017-02-13 11:41:59Z rouault $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: Class for representing a whole feature, and layer schemas.
|
||||
@@ -31,9 +31,9 @@
|
||||
#ifndef OGR_FEATURE_H_INCLUDED
|
||||
#define OGR_FEATURE_H_INCLUDED
|
||||
|
||||
#include "ogr_geometry.h"
|
||||
#include "ogr_featurestyle.h"
|
||||
#include "cpl_atomic_ops.h"
|
||||
#include "ogr_featurestyle.h"
|
||||
#include "ogr_geometry.h"
|
||||
|
||||
/**
|
||||
* \file ogr_feature.h
|
||||
@@ -65,7 +65,7 @@ class CPL_DLL OGRFieldDefn
|
||||
char *pszName;
|
||||
OGRFieldType eType;
|
||||
OGRJustification eJustify;
|
||||
int nWidth; /* zero is variable */
|
||||
int nWidth; // Zero is variable.
|
||||
int nPrecision;
|
||||
char *pszDefault;
|
||||
|
||||
@@ -74,32 +74,30 @@ class CPL_DLL OGRFieldDefn
|
||||
|
||||
int bNullable;
|
||||
|
||||
void Initialize( const char *, OGRFieldType );
|
||||
|
||||
public:
|
||||
OGRFieldDefn( const char *, OGRFieldType );
|
||||
OGRFieldDefn( OGRFieldDefn * );
|
||||
explicit OGRFieldDefn( OGRFieldDefn * );
|
||||
~OGRFieldDefn();
|
||||
|
||||
void SetName( const char * );
|
||||
const char *GetNameRef() { return pszName; }
|
||||
|
||||
OGRFieldType GetType() { return eType; }
|
||||
OGRFieldType GetType() const { return eType; }
|
||||
void SetType( OGRFieldType eTypeIn );
|
||||
static const char *GetFieldTypeName( OGRFieldType );
|
||||
|
||||
OGRFieldSubType GetSubType() { return eSubType; }
|
||||
OGRFieldSubType GetSubType() const { return eSubType; }
|
||||
void SetSubType( OGRFieldSubType eSubTypeIn );
|
||||
static const char *GetFieldSubTypeName( OGRFieldSubType );
|
||||
|
||||
OGRJustification GetJustify() { return eJustify; }
|
||||
OGRJustification GetJustify() const { return eJustify; }
|
||||
void SetJustify( OGRJustification eJustifyIn )
|
||||
{ eJustify = eJustifyIn; }
|
||||
|
||||
int GetWidth() { return nWidth; }
|
||||
int GetWidth() const { return nWidth; }
|
||||
void SetWidth( int nWidthIn ) { nWidth = MAX(0,nWidthIn); }
|
||||
|
||||
int GetPrecision() { return nPrecision; }
|
||||
int GetPrecision() const { return nPrecision; }
|
||||
void SetPrecision( int nPrecisionIn )
|
||||
{ nPrecision = nPrecisionIn; }
|
||||
|
||||
@@ -110,7 +108,7 @@ class CPL_DLL OGRFieldDefn
|
||||
const char *GetDefault() const;
|
||||
int IsDefaultDriverSpecific() const;
|
||||
|
||||
int IsIgnored() { return bIgnore; }
|
||||
int IsIgnored() const { return bIgnore; }
|
||||
void SetIgnored( int bIgnoreIn ) { bIgnore = bIgnoreIn; }
|
||||
|
||||
int IsNullable() const { return bNullable; }
|
||||
@@ -119,7 +117,7 @@ class CPL_DLL OGRFieldDefn
|
||||
int IsSame( const OGRFieldDefn * ) const;
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(OGRFieldDefn);
|
||||
CPL_DISALLOW_COPY_ASSIGN(OGRFieldDefn)
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
@@ -143,6 +141,7 @@ class CPL_DLL OGRFieldDefn
|
||||
class CPL_DLL OGRGeomFieldDefn
|
||||
{
|
||||
protected:
|
||||
//! @cond Doxygen_Suppress
|
||||
char *pszName;
|
||||
OGRwkbGeometryType eGeomType; /* all values possible except wkbNone */
|
||||
OGRSpatialReference* poSRS;
|
||||
@@ -151,32 +150,34 @@ protected:
|
||||
int bNullable;
|
||||
|
||||
void Initialize( const char *, OGRwkbGeometryType );
|
||||
//! @endcond
|
||||
|
||||
public:
|
||||
OGRGeomFieldDefn(const char *pszNameIn,
|
||||
OGRwkbGeometryType eGeomTypeIn);
|
||||
OGRGeomFieldDefn( OGRGeomFieldDefn * );
|
||||
OGRGeomFieldDefn( const char *pszNameIn,
|
||||
OGRwkbGeometryType eGeomTypeIn );
|
||||
explicit OGRGeomFieldDefn( OGRGeomFieldDefn * );
|
||||
virtual ~OGRGeomFieldDefn();
|
||||
|
||||
void SetName( const char * );
|
||||
const char *GetNameRef() { return pszName; }
|
||||
|
||||
OGRwkbGeometryType GetType() { return eGeomType; }
|
||||
OGRwkbGeometryType GetType() const { return eGeomType; }
|
||||
void SetType( OGRwkbGeometryType eTypeIn );
|
||||
|
||||
virtual OGRSpatialReference* GetSpatialRef();
|
||||
void SetSpatialRef(OGRSpatialReference* poSRSIn);
|
||||
void SetSpatialRef( OGRSpatialReference* poSRSIn );
|
||||
|
||||
int IsIgnored() { return bIgnore; }
|
||||
int IsIgnored() const { return bIgnore; }
|
||||
void SetIgnored( int bIgnoreIn ) { bIgnore = bIgnoreIn; }
|
||||
|
||||
int IsNullable() const { return bNullable; }
|
||||
void SetNullable( int bNullableIn ) { bNullable = bNullableIn; }
|
||||
void SetNullable( int bNullableIn )
|
||||
{ bNullable = bNullableIn; }
|
||||
|
||||
int IsSame( OGRGeomFieldDefn * );
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(OGRGeomFieldDefn);
|
||||
CPL_DISALLOW_COPY_ASSIGN(OGRGeomFieldDefn)
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
@@ -206,6 +207,7 @@ public:
|
||||
class CPL_DLL OGRFeatureDefn
|
||||
{
|
||||
protected:
|
||||
//! @cond Doxygen_Suppress
|
||||
volatile int nRefCount;
|
||||
|
||||
int nFieldCount;
|
||||
@@ -217,9 +219,10 @@ class CPL_DLL OGRFeatureDefn
|
||||
char *pszFeatureClassName;
|
||||
|
||||
int bIgnoreStyle;
|
||||
//! @endcond
|
||||
|
||||
public:
|
||||
OGRFeatureDefn( const char * pszName = NULL );
|
||||
explicit OGRFeatureDefn( const char * pszName = NULL );
|
||||
virtual ~OGRFeatureDefn();
|
||||
|
||||
virtual const char *GetName();
|
||||
@@ -236,7 +239,8 @@ class CPL_DLL OGRFeatureDefn
|
||||
virtual OGRGeomFieldDefn *GetGeomFieldDefn( int i );
|
||||
virtual int GetGeomFieldIndex( const char * );
|
||||
|
||||
virtual void AddGeomFieldDefn( OGRGeomFieldDefn *, int bCopy = TRUE );
|
||||
virtual void AddGeomFieldDefn( OGRGeomFieldDefn *,
|
||||
int bCopy = TRUE );
|
||||
virtual OGRErr DeleteGeomFieldDefn( int iGeomField );
|
||||
|
||||
virtual OGRwkbGeometryType GetGeomType();
|
||||
@@ -251,8 +255,9 @@ class CPL_DLL OGRFeatureDefn
|
||||
|
||||
virtual int IsGeometryIgnored();
|
||||
virtual void SetGeometryIgnored( int bIgnore );
|
||||
virtual int IsStyleIgnored() { return bIgnoreStyle; }
|
||||
virtual void SetStyleIgnored( int bIgnore ) { bIgnoreStyle = bIgnore; }
|
||||
virtual int IsStyleIgnored() const { return bIgnoreStyle; }
|
||||
virtual void SetStyleIgnored( int bIgnore )
|
||||
{ bIgnoreStyle = bIgnore; }
|
||||
|
||||
virtual int IsSame( OGRFeatureDefn * poOtherFeatureDefn );
|
||||
|
||||
@@ -260,7 +265,7 @@ class CPL_DLL OGRFeatureDefn
|
||||
static void DestroyFeatureDefn( OGRFeatureDefn * );
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(OGRFeatureDefn);
|
||||
CPL_DISALLOW_COPY_ASSIGN(OGRFeatureDefn)
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
@@ -285,47 +290,56 @@ class CPL_DLL OGRFeature
|
||||
bool SetFieldInternal( int i, OGRField * puValue );
|
||||
|
||||
protected:
|
||||
char * m_pszStyleString;
|
||||
//! @cond Doxygen_Suppress
|
||||
char *m_pszStyleString;
|
||||
OGRStyleTable *m_poStyleTable;
|
||||
char * m_pszTmpFieldValue;
|
||||
char *m_pszTmpFieldValue;
|
||||
//! @endcond
|
||||
|
||||
public:
|
||||
OGRFeature( OGRFeatureDefn * );
|
||||
explicit OGRFeature( OGRFeatureDefn * );
|
||||
virtual ~OGRFeature();
|
||||
|
||||
OGRFeatureDefn *GetDefnRef() { return poDefn; }
|
||||
|
||||
OGRErr SetGeometryDirectly( OGRGeometry * );
|
||||
OGRErr SetGeometry( OGRGeometry * );
|
||||
OGRErr SetGeometry( const OGRGeometry * );
|
||||
OGRGeometry *GetGeometryRef();
|
||||
OGRGeometry *StealGeometry() CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
int GetGeomFieldCount()
|
||||
int GetGeomFieldCount() const
|
||||
{ return poDefn->GetGeomFieldCount(); }
|
||||
OGRGeomFieldDefn *GetGeomFieldDefnRef( int iField )
|
||||
{ return poDefn->GetGeomFieldDefn(iField); }
|
||||
int GetGeomFieldIndex( const char * pszName)
|
||||
int GetGeomFieldIndex( const char * pszName )
|
||||
{ return poDefn->GetGeomFieldIndex(pszName); }
|
||||
|
||||
OGRGeometry* GetGeomFieldRef(int iField);
|
||||
OGRGeometry* StealGeometry(int iField);
|
||||
OGRGeometry* GetGeomFieldRef(const char* pszFName);
|
||||
OGRGeometry* GetGeomFieldRef( int iField );
|
||||
OGRGeometry* StealGeometry( int iField );
|
||||
OGRGeometry* GetGeomFieldRef( const char* pszFName );
|
||||
OGRErr SetGeomFieldDirectly( int iField, OGRGeometry * );
|
||||
OGRErr SetGeomField( int iField, OGRGeometry * );
|
||||
OGRErr SetGeomField( int iField, const OGRGeometry * );
|
||||
|
||||
OGRFeature *Clone() CPL_WARN_UNUSED_RESULT;
|
||||
virtual OGRBoolean Equal( OGRFeature * poFeature );
|
||||
|
||||
int GetFieldCount() { return poDefn->GetFieldCount(); }
|
||||
OGRFieldDefn *GetFieldDefnRef( int iField )
|
||||
int GetFieldCount() const
|
||||
{ return poDefn->GetFieldCount(); }
|
||||
OGRFieldDefn *GetFieldDefnRef( int iField ) const
|
||||
{ return poDefn->GetFieldDefn(iField); }
|
||||
int GetFieldIndex( const char * pszName)
|
||||
{ return poDefn->GetFieldIndex(pszName);}
|
||||
int GetFieldIndex( const char * pszName )
|
||||
{ return poDefn->GetFieldIndex(pszName); }
|
||||
|
||||
int IsFieldSet( int iField );
|
||||
|
||||
void UnsetField( int iField );
|
||||
|
||||
bool IsFieldNull( int iField );
|
||||
|
||||
void SetFieldNull( int iField );
|
||||
|
||||
bool IsFieldSetAndNotNull( int iField );
|
||||
|
||||
OGRField *GetRawFieldRef( int i ) { return pauFields + i; }
|
||||
|
||||
int GetFieldAsInteger( int i );
|
||||
@@ -338,13 +352,18 @@ class CPL_DLL OGRFeature
|
||||
char **GetFieldAsStringList( int i );
|
||||
GByte *GetFieldAsBinary( int i, int *pnCount );
|
||||
int GetFieldAsDateTime( int i,
|
||||
int *pnYear, int *pnMonth, int *pnDay,
|
||||
int *pnHour, int *pnMinute, int *pnSecond,
|
||||
int *pnTZFlag );
|
||||
int *pnYear, int *pnMonth,
|
||||
int *pnDay,
|
||||
int *pnHour, int *pnMinute,
|
||||
int *pnSecond,
|
||||
int *pnTZFlag );
|
||||
int GetFieldAsDateTime( int i,
|
||||
int *pnYear, int *pnMonth, int *pnDay,
|
||||
int *pnHour, int *pnMinute, float *pfSecond,
|
||||
int *pnTZFlag );
|
||||
int *pnYear, int *pnMonth,
|
||||
int *pnDay,
|
||||
int *pnHour, int *pnMinute,
|
||||
float *pfSecond,
|
||||
int *pnTZFlag );
|
||||
char *GetFieldAsSerializedJSon( int i );
|
||||
|
||||
int GetFieldAsInteger( const char *pszFName )
|
||||
{ return GetFieldAsInteger( GetFieldIndex(pszFName) ); }
|
||||
@@ -374,7 +393,8 @@ class CPL_DLL OGRFeature
|
||||
void SetField( int i, double dfValue );
|
||||
void SetField( int i, const char * pszValue );
|
||||
void SetField( int i, int nCount, int * panValues );
|
||||
void SetField( int i, int nCount, const GIntBig * panValues );
|
||||
void SetField( int i, int nCount,
|
||||
const GIntBig * panValues );
|
||||
void SetField( int i, int nCount, double * padfValues );
|
||||
void SetField( int i, char ** papszValues );
|
||||
void SetField( int i, OGRField * puValue );
|
||||
@@ -389,17 +409,17 @@ class CPL_DLL OGRFeature
|
||||
{ SetField( GetFieldIndex(pszFName), nValue ); }
|
||||
void SetField( const char *pszFName, double dfValue )
|
||||
{ SetField( GetFieldIndex(pszFName), dfValue ); }
|
||||
void SetField( const char *pszFName, const char * pszValue)
|
||||
void SetField( const char *pszFName, const char * pszValue )
|
||||
{ SetField( GetFieldIndex(pszFName), pszValue ); }
|
||||
void SetField( const char *pszFName, int nCount,
|
||||
int * panValues )
|
||||
{ SetField(GetFieldIndex(pszFName),nCount,panValues);}
|
||||
{ SetField(GetFieldIndex(pszFName),nCount,panValues); }
|
||||
void SetField( const char *pszFName, int nCount,
|
||||
const GIntBig * panValues )
|
||||
{ SetField(GetFieldIndex(pszFName),nCount,panValues);}
|
||||
{ SetField(GetFieldIndex(pszFName),nCount,panValues); }
|
||||
void SetField( const char *pszFName, int nCount,
|
||||
double * padfValues )
|
||||
{SetField(GetFieldIndex(pszFName),nCount,padfValues);}
|
||||
{SetField(GetFieldIndex(pszFName),nCount,padfValues); }
|
||||
void SetField( const char *pszFName, char ** papszValues )
|
||||
{ SetField( GetFieldIndex(pszFName), papszValues); }
|
||||
void SetField( const char *pszFName, OGRField * puValue )
|
||||
@@ -412,34 +432,41 @@ class CPL_DLL OGRFeature
|
||||
nYear, nMonth, nDay,
|
||||
nHour, nMinute, fSecond, nTZFlag ); }
|
||||
|
||||
GIntBig GetFID() { return nFID; }
|
||||
GIntBig GetFID() const { return nFID; }
|
||||
virtual OGRErr SetFID( GIntBig nFIDIn );
|
||||
|
||||
void DumpReadable( FILE *, char** papszOptions = NULL );
|
||||
|
||||
OGRErr SetFrom( OGRFeature *, int = TRUE);
|
||||
OGRErr SetFrom( OGRFeature *, int = TRUE );
|
||||
OGRErr SetFrom( OGRFeature *, int *, int = TRUE );
|
||||
OGRErr SetFieldsFrom( OGRFeature *, int *, int = TRUE );
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
OGRErr RemapFields( OGRFeatureDefn *poNewDefn,
|
||||
int *panRemapSource );
|
||||
OGRErr RemapGeomFields( OGRFeatureDefn *poNewDefn,
|
||||
int *panRemapSource );
|
||||
//! @endcond
|
||||
|
||||
int Validate( int nValidateFlags,
|
||||
int bEmitError );
|
||||
void FillUnsetWithDefault(int bNotNullableOnly,
|
||||
char** papszOptions );
|
||||
void FillUnsetWithDefault( int bNotNullableOnly,
|
||||
char** papszOptions );
|
||||
|
||||
virtual const char *GetStyleString();
|
||||
virtual void SetStyleString( const char * );
|
||||
virtual void SetStyleStringDirectly( char * );
|
||||
|
||||
/** Return style table.
|
||||
* @return style table.
|
||||
*/
|
||||
virtual OGRStyleTable *GetStyleTable() { return m_poStyleTable; }
|
||||
virtual void SetStyleTable(OGRStyleTable *poStyleTable);
|
||||
virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable);
|
||||
virtual void SetStyleTable( OGRStyleTable *poStyleTable );
|
||||
virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable );
|
||||
|
||||
const char *GetNativeData() const { return m_pszNativeData; }
|
||||
const char *GetNativeMediaType() const { return m_pszNativeMediaType; }
|
||||
const char *GetNativeMediaType() const
|
||||
{ return m_pszNativeMediaType; }
|
||||
void SetNativeData( const char* pszNativeData );
|
||||
void SetNativeMediaType( const char* pszNativeMediaType );
|
||||
|
||||
@@ -447,13 +474,14 @@ class CPL_DLL OGRFeature
|
||||
static void DestroyFeature( OGRFeature * );
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(OGRFeature);
|
||||
CPL_DISALLOW_COPY_ASSIGN(OGRFeature)
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
/* OGRFeatureQuery */
|
||||
/************************************************************************/
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
class OGRLayer;
|
||||
class swq_expr_node;
|
||||
class swq_custom_func_registrar;
|
||||
@@ -464,21 +492,24 @@ class CPL_DLL OGRFeatureQuery
|
||||
OGRFeatureDefn *poTargetDefn;
|
||||
void *pSWQExpr;
|
||||
|
||||
char **FieldCollector( void *, char ** );
|
||||
char **FieldCollector( void *, char ** );
|
||||
|
||||
GIntBig *EvaluateAgainstIndices( swq_expr_node*, OGRLayer *, GIntBig& nFIDCount);
|
||||
GIntBig *EvaluateAgainstIndices( swq_expr_node*, OGRLayer *,
|
||||
GIntBig& nFIDCount );
|
||||
|
||||
int CanUseIndex( swq_expr_node*, OGRLayer * );
|
||||
|
||||
public:
|
||||
OGRFeatureQuery();
|
||||
~OGRFeatureQuery();
|
||||
~OGRFeatureQuery();
|
||||
|
||||
OGRErr Compile( OGRFeatureDefn *, const char *,
|
||||
int bCheck = TRUE, swq_custom_func_registrar* poCustomFuncRegistrar = NULL );
|
||||
int bCheck = TRUE,
|
||||
swq_custom_func_registrar*
|
||||
poCustomFuncRegistrar = NULL );
|
||||
int Evaluate( OGRFeature * );
|
||||
|
||||
GIntBig *EvaluateAgainstIndices( OGRLayer *, OGRErr * );
|
||||
GIntBig *EvaluateAgainstIndices( OGRLayer *, OGRErr * );
|
||||
|
||||
int CanUseIndex( OGRLayer * );
|
||||
|
||||
@@ -486,5 +517,6 @@ class CPL_DLL OGRFeatureQuery
|
||||
|
||||
void *GetSWQExpr() { return pSWQExpr; }
|
||||
};
|
||||
//! @endcond
|
||||
|
||||
#endif /* ndef OGR_FEATURE_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogr_featurestyle.h 33631 2016-03-04 06:28:09Z goatbar $
|
||||
* $Id: ogr_featurestyle.h 36501 2016-11-25 14:09:24Z rouault $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: Define of Feature Representation
|
||||
@@ -46,6 +46,7 @@ class OGRFeature;
|
||||
* All OGRStyleTool param lists are defined in ogr_core.h.
|
||||
*/
|
||||
|
||||
/** OGR Style type */
|
||||
typedef enum ogr_style_type
|
||||
{
|
||||
OGRSTypeString,
|
||||
@@ -54,6 +55,7 @@ typedef enum ogr_style_type
|
||||
OGRSTypeBoolean
|
||||
} OGRSType;
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
typedef struct ogr_style_param
|
||||
{
|
||||
int eParam;
|
||||
@@ -62,7 +64,6 @@ typedef struct ogr_style_param
|
||||
OGRSType eType;
|
||||
} OGRStyleParamId;
|
||||
|
||||
|
||||
typedef struct ogr_style_value
|
||||
{
|
||||
char *pszValue;
|
||||
@@ -71,7 +72,7 @@ typedef struct ogr_style_value
|
||||
GBool bValid;
|
||||
OGRSTUnitId eUnit;
|
||||
} OGRStyleValue;
|
||||
|
||||
//! @endcond
|
||||
|
||||
// Every time a pszStyleString given in parameter is NULL,
|
||||
// the StyleString defined in the Mgr will be use.
|
||||
@@ -107,7 +108,6 @@ class CPL_DLL OGRStyleTable
|
||||
const char *GetLastStyleName();
|
||||
};
|
||||
|
||||
|
||||
class OGRStyleTool;
|
||||
|
||||
/**
|
||||
@@ -120,7 +120,7 @@ class CPL_DLL OGRStyleMgr
|
||||
char *m_pszStyleString;
|
||||
|
||||
public:
|
||||
OGRStyleMgr(OGRStyleTable *poDataSetStyleTable = NULL);
|
||||
explicit OGRStyleMgr(OGRStyleTable *poDataSetStyleTable = NULL);
|
||||
~OGRStyleMgr();
|
||||
|
||||
GBool SetFeatureStyleString(OGRFeature *,const char *pszStyleString=NULL,
|
||||
@@ -147,11 +147,11 @@ class CPL_DLL OGRStyleMgr
|
||||
|
||||
/* It could have a reference counting process us for the OGRStyleTable, if
|
||||
needed. */
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
OGRStyleTable *GetDataSetStyleTable(){return m_poDataSetStyleTable;}
|
||||
|
||||
OGRStyleTool *CreateStyleToolFromStyleString(const char *pszStyleString);
|
||||
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -170,29 +170,42 @@ class CPL_DLL OGRStyleTool
|
||||
virtual GBool Parse() = 0;
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SKIP
|
||||
GBool Parse(const OGRStyleParamId* pasStyle,
|
||||
OGRStyleValue* pasValue,
|
||||
int nCount);
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
OGRStyleTool(){}
|
||||
OGRStyleTool(OGRSTClassId eClassId);
|
||||
OGRStyleTool() :
|
||||
m_bModified(FALSE),
|
||||
m_bParsed(FALSE),
|
||||
m_dfScale(0.0),
|
||||
m_eUnit(OGRSTUGround),
|
||||
m_eClassId(OGRSTCNone),
|
||||
m_pszStyleString(NULL)
|
||||
{}
|
||||
explicit OGRStyleTool(OGRSTClassId eClassId);
|
||||
virtual ~OGRStyleTool();
|
||||
|
||||
GBool GetRGBFromString(const char *pszColor, int &nRed, int &nGreen,
|
||||
static GBool GetRGBFromString(const char *pszColor, int &nRed, int &nGreen,
|
||||
int &nBlue, int &nTransparence);
|
||||
int GetSpecificId(const char *pszId, const char *pszWanted);
|
||||
static int GetSpecificId(const char *pszId, const char *pszWanted);
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
GBool IsStyleModified() {return m_bModified;}
|
||||
void StyleModified() {m_bModified = TRUE;}
|
||||
|
||||
GBool IsStyleParsed() {return m_bParsed;}
|
||||
void StyleParsed() {m_bParsed = TRUE;}
|
||||
#endif
|
||||
|
||||
OGRSTClassId GetType();
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
void SetInternalInputUnitFromParam(char *pszString);
|
||||
#endif
|
||||
|
||||
void SetUnit(OGRSTUnitId,double dfScale = 1.0); //the dfScale will be
|
||||
//used if we are working with Ground Unit ( ground = paper * scale);
|
||||
@@ -231,12 +244,14 @@ class CPL_DLL OGRStyleTool
|
||||
void SetParamDbl(const OGRStyleParamId &sStyleParam ,
|
||||
OGRStyleValue &sStyleValue,
|
||||
double dfParam);
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
double ComputeWithUnit(double, OGRSTUnitId);
|
||||
int ComputeWithUnit(int , OGRSTUnitId);
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
|
||||
/**
|
||||
* This class represents a style pen
|
||||
*/
|
||||
@@ -246,7 +261,7 @@ class CPL_DLL OGRStylePen : public OGRStyleTool
|
||||
|
||||
OGRStyleValue *m_pasStyleValue;
|
||||
|
||||
GBool Parse();
|
||||
GBool Parse() CPL_OVERRIDE;
|
||||
|
||||
public:
|
||||
|
||||
@@ -282,7 +297,7 @@ class CPL_DLL OGRStylePen : public OGRStyleTool
|
||||
void SetParamStr(OGRSTPenParam eParam, const char *pszParamString);
|
||||
void SetParamNum(OGRSTPenParam eParam, int nParam);
|
||||
void SetParamDbl(OGRSTPenParam eParam, double dfParam);
|
||||
const char *GetStyleString();
|
||||
const char *GetStyleString() CPL_OVERRIDE;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -294,7 +309,7 @@ class CPL_DLL OGRStyleBrush : public OGRStyleTool
|
||||
|
||||
OGRStyleValue *m_pasStyleValue;
|
||||
|
||||
GBool Parse();
|
||||
GBool Parse() CPL_OVERRIDE;
|
||||
|
||||
public:
|
||||
|
||||
@@ -328,7 +343,7 @@ class CPL_DLL OGRStyleBrush : public OGRStyleTool
|
||||
void SetParamStr(OGRSTBrushParam eParam, const char *pszParamString);
|
||||
void SetParamNum(OGRSTBrushParam eParam, int nParam);
|
||||
void SetParamDbl(OGRSTBrushParam eParam, double dfParam);
|
||||
const char *GetStyleString();
|
||||
const char *GetStyleString() CPL_OVERRIDE;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -340,7 +355,7 @@ class CPL_DLL OGRStyleSymbol : public OGRStyleTool
|
||||
|
||||
OGRStyleValue *m_pasStyleValue;
|
||||
|
||||
GBool Parse();
|
||||
GBool Parse() CPL_OVERRIDE;
|
||||
|
||||
public:
|
||||
|
||||
@@ -386,7 +401,7 @@ class CPL_DLL OGRStyleSymbol : public OGRStyleTool
|
||||
void SetParamStr(OGRSTSymbolParam eParam, const char *pszParamString);
|
||||
void SetParamNum(OGRSTSymbolParam eParam, int nParam);
|
||||
void SetParamDbl(OGRSTSymbolParam eParam, double dfParam);
|
||||
const char *GetStyleString();
|
||||
const char *GetStyleString() CPL_OVERRIDE;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -398,7 +413,7 @@ class CPL_DLL OGRStyleLabel : public OGRStyleTool
|
||||
|
||||
OGRStyleValue *m_pasStyleValue;
|
||||
|
||||
GBool Parse();
|
||||
GBool Parse() CPL_OVERRIDE;
|
||||
|
||||
public:
|
||||
|
||||
@@ -460,7 +475,9 @@ class CPL_DLL OGRStyleLabel : public OGRStyleTool
|
||||
void SetParamStr(OGRSTLabelParam eParam, const char *pszParamString);
|
||||
void SetParamNum(OGRSTLabelParam eParam, int nParam);
|
||||
void SetParamDbl(OGRSTLabelParam eParam, double dfParam);
|
||||
const char *GetStyleString();
|
||||
const char *GetStyleString() CPL_OVERRIDE;
|
||||
};
|
||||
|
||||
//! @endcond
|
||||
|
||||
#endif /* OGR_FEATURESTYLE_INCLUDE */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogr_geocoding.h 33631 2016-03-04 06:28:09Z goatbar $
|
||||
* $Id: ogr_geocoding.h 34931 2016-08-05 17:13:05Z rouault $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: Client of geocoding service.
|
||||
@@ -41,6 +41,7 @@
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/** Opaque type for a geocoding session */
|
||||
typedef struct _OGRGeocodingSessionHS *OGRGeocodingSessionH;
|
||||
|
||||
OGRGeocodingSessionH CPL_DLL OGRGeocodeCreateSession(char** papszOptions);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogr_geos.h 33631 2016-03-04 06:28:09Z goatbar $
|
||||
* $Id: ogr_geos.h 34523 2016-07-02 21:50:47Z goatbar $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: Definitions related to support for use of GEOS in OGR.
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: Includes json-c header
|
||||
* Author: Even Rouault <even dot rouault at spatialys dot com>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2016, Even Rouault <even dot rouault at spatialys dot 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_JSON_HEADER_H
|
||||
#define OGR_JSON_HEADER_H
|
||||
|
||||
#if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) && !defined(_MSC_VER))
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#include <json.h>
|
||||
|
||||
#endif /* OGR_JSON_HEADER_H */
|
||||
@@ -0,0 +1,62 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogr_libs.h 36883 2016-12-15 13:31:12Z rouault $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: Definitions related to support for use of SFCGAL and GEOS in OGR.
|
||||
* This file is only intended to be pulled in by OGR implementation
|
||||
* code directly accessing SFCGAL and/or GEOS.
|
||||
* Author: Avyav Kumar Singh <avyavkumar at gmail dot com>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2016, Avyav Kumar Singh <avyavkumar at gmail dot 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 HAVE_GEOS
|
||||
#define UNUSED_IF_NO_GEOS CPL_UNUSED
|
||||
#else
|
||||
#define UNUSED_IF_NO_GEOS
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SFCGAL
|
||||
#define UNUSED_IF_NO_SFCGAL CPL_UNUSED
|
||||
#else
|
||||
#define UNUSED_IF_NO_SFCGAL
|
||||
#endif
|
||||
|
||||
#ifndef UNUSED_PARAMETER
|
||||
|
||||
#ifdef HAVE_GEOS
|
||||
#ifndef HAVE_SFCGAL
|
||||
#define UNUSED_PARAMETER UNUSED_IF_NO_SFCGAL // SFCGAL no and GEOS yes - GEOS methods always work
|
||||
#else
|
||||
#define UNUSED_PARAMETER // Both libraries are present
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_GEOS
|
||||
#ifdef HAVE_SFCGAL
|
||||
#define UNUSED_PARAMETER UNUSED_IF_NO_GEOS // SFCGAL yes and GEOS no - SFCGAL methods always work
|
||||
#else
|
||||
#define UNUSED_PARAMETER CPL_UNUSED // Neither of the libraries have support enabled
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogr_p.h 33631 2016-03-04 06:28:09Z goatbar $
|
||||
* $Id: ogr_p.h 37564 2017-03-03 09:09:26Z rouault $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: Some private helper functions and stuff for OGR implementation.
|
||||
@@ -109,8 +109,8 @@ char CPL_DLL * OGRGetRFC822DateTime(const OGRField* psField);
|
||||
char CPL_DLL * OGRGetXMLDateTime(const OGRField* psField);
|
||||
char CPL_DLL * OGRGetXML_UTF8_EscapedString(const char* pszString);
|
||||
|
||||
int OGRCompareDate( OGRField *psFirstTuple,
|
||||
OGRField *psSecondTuple ); /* used by ogr_gensql.cpp and ogrfeaturequery.cpp */
|
||||
int OGRCompareDate(const OGRField *psFirstTuple,
|
||||
const OGRField *psSecondTuple ); /* used by ogr_gensql.cpp and ogrfeaturequery.cpp */
|
||||
|
||||
/* General utility option processing. */
|
||||
int CPL_DLL OGRGeneralCmdLineProcessor( int nArgc, char ***ppapszArgv, int nOptions );
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogr_sfcgal.h 36883 2016-12-15 13:31:12Z rouault $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: Definitions related to support for use of SFCGAL in OGR.
|
||||
* This file is only intended to be pulled in by OGR implementation
|
||||
* code directly accessing SFCGAL.
|
||||
* Author: Avyav Kumar Singh <avyavkumar at gmail dot com>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2016, Avyav Kumar Singh <avyavkumar at gmail dot 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.
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef HAVE_SFCGAL
|
||||
|
||||
#include <SFCGAL/capi/sfcgal_c.h>
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogr_spatialref.h 33631 2016-03-04 06:28:09Z goatbar $
|
||||
* $Id: ogr_spatialref.h 36411 2016-11-21 22:03:48Z rouault $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: Classes for manipulating spatial reference systems in a
|
||||
@@ -70,9 +70,12 @@ class CPL_DLL OGR_SRSNode
|
||||
OGRErr importFromWkt( char **, int nRecLevel, int* pnNodes );
|
||||
|
||||
public:
|
||||
OGR_SRSNode(const char * = NULL);
|
||||
explicit OGR_SRSNode(const char * = NULL);
|
||||
~OGR_SRSNode();
|
||||
|
||||
/** Return whether this is a leaf node.
|
||||
* @return TRUE or FALSE
|
||||
*/
|
||||
int IsLeafNode() const { return nChildren == 0; }
|
||||
|
||||
int GetChildCount() const { return nChildren; }
|
||||
@@ -151,7 +154,7 @@ class CPL_DLL OGRSpatialReference
|
||||
const char* pszURN);
|
||||
public:
|
||||
OGRSpatialReference(const OGRSpatialReference&);
|
||||
OGRSpatialReference(const char * = NULL);
|
||||
explicit OGRSpatialReference(const char * = NULL);
|
||||
|
||||
virtual ~OGRSpatialReference();
|
||||
|
||||
@@ -186,9 +189,10 @@ class CPL_DLL OGRSpatialReference
|
||||
OGRErr importFromESRI( char ** );
|
||||
OGRErr importFromPCI( const char *, const char * = NULL,
|
||||
double * = NULL );
|
||||
#define USGS_ANGLE_DECIMALDEGREES 0
|
||||
#define USGS_ANGLE_PACKEDDMS TRUE /* 1 */
|
||||
#define USGS_ANGLE_RADIANS 2
|
||||
|
||||
#define USGS_ANGLE_DECIMALDEGREES 0 /**< Angle is in decimal degrees. */
|
||||
#define USGS_ANGLE_PACKEDDMS TRUE /**< Angle is in packed degree minute second. */
|
||||
#define USGS_ANGLE_RADIANS 2 /**< Angle is in radians. */
|
||||
OGRErr importFromUSGS( long iProjSys, long iZone,
|
||||
double *padfPrjParams, long iDatum,
|
||||
int nUSGSAngleFormat = USGS_ANGLE_PACKEDDMS );
|
||||
@@ -224,7 +228,10 @@ class CPL_DLL OGRSpatialReference
|
||||
OGRAxisOrientation eYAxisOrientation );
|
||||
|
||||
// Machinery for accessing parse nodes
|
||||
|
||||
//! Return root node
|
||||
OGR_SRSNode *GetRoot() { return poRoot; }
|
||||
//! Return root node
|
||||
const OGR_SRSNode *GetRoot() const { return poRoot; }
|
||||
void SetRoot( OGR_SRSNode * );
|
||||
|
||||
@@ -347,13 +354,15 @@ class CPL_DLL OGRSpatialReference
|
||||
double dfCenterLat, double dfCenterLong,
|
||||
double dfFalseEasting, double dfFalseNorthing );
|
||||
|
||||
/** Eckert I-VI */
|
||||
/** Eckert I */
|
||||
OGRErr SetEckert( int nVariation, double dfCentralMeridian,
|
||||
double dfFalseEasting, double dfFalseNorthing );
|
||||
|
||||
/** Eckert IV */
|
||||
OGRErr SetEckertIV( double dfCentralMeridian,
|
||||
double dfFalseEasting, double dfFalseNorthing );
|
||||
|
||||
/** Eckert VI */
|
||||
OGRErr SetEckertVI( double dfCentralMeridian,
|
||||
double dfFalseEasting, double dfFalseNorthing );
|
||||
|
||||
@@ -395,12 +404,14 @@ class CPL_DLL OGRSpatialReference
|
||||
double dfScale,
|
||||
double dfFalseEasting, double dfFalseNorthing );
|
||||
|
||||
/** Hotine Oblique Mercator 2 points */
|
||||
OGRErr SetHOM2PNO( double dfCenterLat,
|
||||
double dfLat1, double dfLong1,
|
||||
double dfLat2, double dfLong2,
|
||||
double dfScale,
|
||||
double dfFalseEasting, double dfFalseNorthing );
|
||||
|
||||
/** Oblique Mercator */
|
||||
OGRErr SetOM( double dfCenterLat, double dfCenterLong,
|
||||
double dfAzimuth, double dfRectToSkew,
|
||||
double dfScale,
|
||||
@@ -447,11 +458,12 @@ class CPL_DLL OGRSpatialReference
|
||||
OGRErr SetMC( double dfCenterLat, double dfCenterLong,
|
||||
double dfFalseEasting, double dfFalseNorthing );
|
||||
|
||||
/** Mercator */
|
||||
/** Mercator 1SP */
|
||||
OGRErr SetMercator( double dfCenterLat, double dfCenterLong,
|
||||
double dfScale,
|
||||
double dfFalseEasting, double dfFalseNorthing );
|
||||
|
||||
/** Mercator 2SP */
|
||||
OGRErr SetMercator2SP( double dfStdP1,
|
||||
double dfCenterLat, double dfCenterLong,
|
||||
double dfFalseEasting, double dfFalseNorthing );
|
||||
@@ -547,9 +559,12 @@ class CPL_DLL OGRSpatialReference
|
||||
const char *pszOverrideUnitName = NULL,
|
||||
double dfOverrideUnit = 0.0 );
|
||||
|
||||
/** ImportFromESRIStatePlaneWKT */
|
||||
OGRErr ImportFromESRIStatePlaneWKT(
|
||||
int nCode, const char* pszDatumName, const char* pszUnitsName,
|
||||
int nPCSCode, const char* pszCSName = NULL );
|
||||
|
||||
/** ImportFromESRIWisconsinWKT */
|
||||
OGRErr ImportFromESRIWisconsinWKT(
|
||||
const char* pszPrjName, double dfCentralMeridian, double dfLatOfOrigin,
|
||||
const char* pszUnitsName, const char* pszCSName = NULL );
|
||||
@@ -588,6 +603,12 @@ public:
|
||||
/** Fetch internal target coordinate system. */
|
||||
virtual OGRSpatialReference *GetTargetCS() = 0;
|
||||
|
||||
/** Whether the transformer will emit CPLError */
|
||||
virtual bool GetEmitErrors() { return false; }
|
||||
|
||||
/** Set if the transformer must emit CPLError */
|
||||
virtual void SetEmitErrors(bool /*bEmitErrors*/) {}
|
||||
|
||||
// From CT_MathTransform
|
||||
|
||||
/**
|
||||
@@ -626,7 +647,6 @@ public:
|
||||
virtual int TransformEx( int nCount,
|
||||
double *x, double *y, double *z = NULL,
|
||||
int *pabSuccess = NULL ) = 0;
|
||||
|
||||
};
|
||||
|
||||
OGRCoordinateTransformation CPL_DLL *
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogr_srs_api.h 33631 2016-03-04 06:28:09Z goatbar $
|
||||
* $Id: ogr_srs_api.h 35912 2016-10-24 16:41:45Z goatbar $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: C API and constant declarations for OGR Spatial References.
|
||||
@@ -44,17 +44,15 @@ CPL_C_START
|
||||
* See also: ogr_spatialref.h
|
||||
*/
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Axis orientations (corresponds to CS_AxisOrientationEnum). */
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** Axis orientations (corresponds to CS_AxisOrientationEnum). */
|
||||
typedef enum {
|
||||
OAO_Other=0,
|
||||
OAO_North=1,
|
||||
OAO_South=2,
|
||||
OAO_East=3,
|
||||
OAO_West=4,
|
||||
OAO_Up=5,
|
||||
OAO_Down=6
|
||||
OAO_Other=0, /**< Other */
|
||||
OAO_North=1, /**< North */
|
||||
OAO_South=2, /**< South */
|
||||
OAO_East=3, /**< East */
|
||||
OAO_West=4, /**< West */
|
||||
OAO_Up=5, /**< Up (to space) */
|
||||
OAO_Down=6 /**< Down (to Earth center) */
|
||||
} OGRAxisOrientation;
|
||||
|
||||
const char CPL_DLL *OSRAxisEnumToName( OGRAxisOrientation eOrientation );
|
||||
@@ -63,6 +61,8 @@ const char CPL_DLL *OSRAxisEnumToName( OGRAxisOrientation eOrientation );
|
||||
/* Datum types (corresponds to CS_DatumType). */
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
// Unused in the code base. TODO: remove
|
||||
typedef enum {
|
||||
ODT_HD_Min=1000,
|
||||
ODT_HD_Other=1000,
|
||||
@@ -81,6 +81,7 @@ typedef enum {
|
||||
ODT_LD_Min=10000,
|
||||
ODT_LD_Max=32767
|
||||
} OGRDatumType;
|
||||
/*! @endcond */
|
||||
|
||||
#endif // ndef SWIG
|
||||
|
||||
@@ -88,214 +89,379 @@ typedef enum {
|
||||
/* Some standard WKT geographic coordinate systems. */
|
||||
/* ==================================================================== */
|
||||
|
||||
/** WGS 84 geodetic (long/lat) WKT / EPSG:4326 with long,lat ordering */
|
||||
#define SRS_WKT_WGS84 "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]"
|
||||
|
||||
/* ==================================================================== */
|
||||
/* Some "standard" strings. */
|
||||
/* ==================================================================== */
|
||||
|
||||
/** Albers_Conic_Equal_Area projection */
|
||||
#define SRS_PT_ALBERS_CONIC_EQUAL_AREA \
|
||||
"Albers_Conic_Equal_Area"
|
||||
/** Azimuthal_Equidistant projection */
|
||||
#define SRS_PT_AZIMUTHAL_EQUIDISTANT "Azimuthal_Equidistant"
|
||||
/** Cassini_Soldner projection */
|
||||
#define SRS_PT_CASSINI_SOLDNER "Cassini_Soldner"
|
||||
/** Cylindrical_Equal_Area projection */
|
||||
#define SRS_PT_CYLINDRICAL_EQUAL_AREA "Cylindrical_Equal_Area"
|
||||
/** Cylindrical_Equal_Area projection */
|
||||
#define SRS_PT_BONNE "Bonne"
|
||||
/** Eckert_I projection */
|
||||
#define SRS_PT_ECKERT_I "Eckert_I"
|
||||
/** Eckert_II projection */
|
||||
#define SRS_PT_ECKERT_II "Eckert_II"
|
||||
/** Eckert_III projection */
|
||||
#define SRS_PT_ECKERT_III "Eckert_III"
|
||||
/** Eckert_IV projection */
|
||||
#define SRS_PT_ECKERT_IV "Eckert_IV"
|
||||
/** Eckert_V projection */
|
||||
#define SRS_PT_ECKERT_V "Eckert_V"
|
||||
/** Eckert_VI projection */
|
||||
#define SRS_PT_ECKERT_VI "Eckert_VI"
|
||||
/** Equidistant_Conic projection */
|
||||
#define SRS_PT_EQUIDISTANT_CONIC \
|
||||
"Equidistant_Conic"
|
||||
/** Equirectangular projection */
|
||||
#define SRS_PT_EQUIRECTANGULAR "Equirectangular"
|
||||
/** Gall_Stereographic projection */
|
||||
#define SRS_PT_GALL_STEREOGRAPHIC \
|
||||
"Gall_Stereographic"
|
||||
/** Gauss_Schreiber_Transverse_Mercator projection */
|
||||
#define SRS_PT_GAUSSSCHREIBERTMERCATOR \
|
||||
"Gauss_Schreiber_Transverse_Mercator"
|
||||
/** Geostationary_Satellite projection */
|
||||
#define SRS_PT_GEOSTATIONARY_SATELLITE \
|
||||
"Geostationary_Satellite"
|
||||
/** Goode_Homolosine projection */
|
||||
#define SRS_PT_GOODE_HOMOLOSINE "Goode_Homolosine"
|
||||
/** Interrupted_Goode_Homolosine projection */
|
||||
#define SRS_PT_IGH "Interrupted_Goode_Homolosine"
|
||||
/** Gnomonic projection */
|
||||
#define SRS_PT_GNOMONIC "Gnomonic"
|
||||
/** Hotine_Oblique_Mercator_Azimuth_Center projection */
|
||||
#define SRS_PT_HOTINE_OBLIQUE_MERCATOR_AZIMUTH_CENTER \
|
||||
"Hotine_Oblique_Mercator_Azimuth_Center"
|
||||
/** Hotine_Oblique_Mercator projection */
|
||||
#define SRS_PT_HOTINE_OBLIQUE_MERCATOR \
|
||||
"Hotine_Oblique_Mercator"
|
||||
/** Hotine_Oblique_Mercator_Two_Point_Natural_Origin projection */
|
||||
#define SRS_PT_HOTINE_OBLIQUE_MERCATOR_TWO_POINT_NATURAL_ORIGIN \
|
||||
"Hotine_Oblique_Mercator_Two_Point_Natural_Origin"
|
||||
/** Laborde_Oblique_Mercator projection */
|
||||
#define SRS_PT_LABORDE_OBLIQUE_MERCATOR \
|
||||
"Laborde_Oblique_Mercator"
|
||||
/** Lambert_Conformal_Conic_1SP projection */
|
||||
#define SRS_PT_LAMBERT_CONFORMAL_CONIC_1SP \
|
||||
"Lambert_Conformal_Conic_1SP"
|
||||
/** Lambert_Conformal_Conic_2SP projection */
|
||||
#define SRS_PT_LAMBERT_CONFORMAL_CONIC_2SP \
|
||||
"Lambert_Conformal_Conic_2SP"
|
||||
/** Lambert_Conformal_Conic_2SP_Belgium projection */
|
||||
#define SRS_PT_LAMBERT_CONFORMAL_CONIC_2SP_BELGIUM \
|
||||
"Lambert_Conformal_Conic_2SP_Belgium"
|
||||
/** Lambert_Azimuthal_Equal_Area projection */
|
||||
#define SRS_PT_LAMBERT_AZIMUTHAL_EQUAL_AREA \
|
||||
"Lambert_Azimuthal_Equal_Area"
|
||||
/** Mercator_1SP projection */
|
||||
#define SRS_PT_MERCATOR_1SP "Mercator_1SP"
|
||||
/** Mercator_2SP projection */
|
||||
#define SRS_PT_MERCATOR_2SP "Mercator_2SP"
|
||||
// Mercator_Auxiliary_Sphere is used used by ESRI to mean EPSG:3875
|
||||
/** Mercator_Auxiliary_Sphere is used used by ESRI to mean EPSG:3875 */
|
||||
#define SRS_PT_MERCATOR_AUXILIARY_SPHERE \
|
||||
"Mercator_Auxiliary_Sphere"
|
||||
/** Miller_Cylindrical projection */
|
||||
#define SRS_PT_MILLER_CYLINDRICAL "Miller_Cylindrical"
|
||||
/** Mollweide projection */
|
||||
#define SRS_PT_MOLLWEIDE "Mollweide"
|
||||
/** New_Zealand_Map_Grid projection */
|
||||
#define SRS_PT_NEW_ZEALAND_MAP_GRID \
|
||||
"New_Zealand_Map_Grid"
|
||||
/** Oblique_Stereographic projection */
|
||||
#define SRS_PT_OBLIQUE_STEREOGRAPHIC \
|
||||
"Oblique_Stereographic"
|
||||
/** Orthographic projection */
|
||||
#define SRS_PT_ORTHOGRAPHIC "Orthographic"
|
||||
/** Polar_Stereographic projection */
|
||||
#define SRS_PT_POLAR_STEREOGRAPHIC \
|
||||
"Polar_Stereographic"
|
||||
/** Polyconic projection */
|
||||
#define SRS_PT_POLYCONIC "Polyconic"
|
||||
/** Robinson projection */
|
||||
#define SRS_PT_ROBINSON "Robinson"
|
||||
/** Sinusoidal projection */
|
||||
#define SRS_PT_SINUSOIDAL "Sinusoidal"
|
||||
/** Stereographic projection */
|
||||
#define SRS_PT_STEREOGRAPHIC "Stereographic"
|
||||
/** Swiss_Oblique_Cylindrical projection */
|
||||
#define SRS_PT_SWISS_OBLIQUE_CYLINDRICAL \
|
||||
"Swiss_Oblique_Cylindrical"
|
||||
/** Transverse_Mercator projection */
|
||||
#define SRS_PT_TRANSVERSE_MERCATOR \
|
||||
"Transverse_Mercator"
|
||||
/** Transverse_Mercator_South_Orientated projection */
|
||||
#define SRS_PT_TRANSVERSE_MERCATOR_SOUTH_ORIENTED \
|
||||
"Transverse_Mercator_South_Orientated"
|
||||
|
||||
/* special mapinfo variants on Transverse Mercator */
|
||||
/** Transverse_Mercator_MapInfo_21 projection */
|
||||
#define SRS_PT_TRANSVERSE_MERCATOR_MI_21 \
|
||||
"Transverse_Mercator_MapInfo_21"
|
||||
/** Transverse_Mercator_MapInfo_22 projection */
|
||||
#define SRS_PT_TRANSVERSE_MERCATOR_MI_22 \
|
||||
"Transverse_Mercator_MapInfo_22"
|
||||
/** Transverse_Mercator_MapInfo_23 projection */
|
||||
#define SRS_PT_TRANSVERSE_MERCATOR_MI_23 \
|
||||
"Transverse_Mercator_MapInfo_23"
|
||||
/** Transverse_Mercator_MapInfo_24 projection */
|
||||
#define SRS_PT_TRANSVERSE_MERCATOR_MI_24 \
|
||||
"Transverse_Mercator_MapInfo_24"
|
||||
/** Transverse_Mercator_MapInfo_25 projection */
|
||||
#define SRS_PT_TRANSVERSE_MERCATOR_MI_25 \
|
||||
"Transverse_Mercator_MapInfo_25"
|
||||
|
||||
/** Tunisia_Mining_Grid projection */
|
||||
#define SRS_PT_TUNISIA_MINING_GRID \
|
||||
"Tunisia_Mining_Grid"
|
||||
/** Two_Point_Equidistant projection */
|
||||
#define SRS_PT_TWO_POINT_EQUIDISTANT \
|
||||
"Two_Point_Equidistant"
|
||||
/** VanDerGrinten projection */
|
||||
#define SRS_PT_VANDERGRINTEN "VanDerGrinten"
|
||||
/** Krovak projection */
|
||||
#define SRS_PT_KROVAK "Krovak"
|
||||
/** International_Map_of_the_World_Polyconic projection */
|
||||
#define SRS_PT_IMW_POLYCONIC "International_Map_of_the_World_Polyconic"
|
||||
/** Wagner_I projection */
|
||||
#define SRS_PT_WAGNER_I "Wagner_I"
|
||||
/** Wagner_II projection */
|
||||
#define SRS_PT_WAGNER_II "Wagner_II"
|
||||
/** Wagner_III projection */
|
||||
#define SRS_PT_WAGNER_III "Wagner_III"
|
||||
/** Wagner_IV projection */
|
||||
#define SRS_PT_WAGNER_IV "Wagner_IV"
|
||||
/** Wagner_V projection */
|
||||
#define SRS_PT_WAGNER_V "Wagner_V"
|
||||
/** Wagner_VI projection */
|
||||
#define SRS_PT_WAGNER_VI "Wagner_VI"
|
||||
/** Wagner_VII projection */
|
||||
#define SRS_PT_WAGNER_VII "Wagner_VII"
|
||||
/** Quadrilateralized_Spherical_Cube projection */
|
||||
#define SRS_PT_QSC "Quadrilateralized_Spherical_Cube"
|
||||
/** Aitoff projection */
|
||||
#define SRS_PT_AITOFF "Aitoff"
|
||||
/** Winkel_I projection */
|
||||
#define SRS_PT_WINKEL_I "Winkel_I"
|
||||
/** Winkel_II projection */
|
||||
#define SRS_PT_WINKEL_II "Winkel_II"
|
||||
/** Winkel_Tripel projection */
|
||||
#define SRS_PT_WINKEL_TRIPEL "Winkel_Tripel"
|
||||
/** Craster_Parabolic projection */
|
||||
#define SRS_PT_CRASTER_PARABOLIC "Craster_Parabolic"
|
||||
/** Loximuthal projection */
|
||||
#define SRS_PT_LOXIMUTHAL "Loximuthal"
|
||||
/** Quartic_Authalic projection */
|
||||
#define SRS_PT_QUARTIC_AUTHALIC "Quartic_Authalic"
|
||||
/** Spherical_Cross_Track_Height projection */
|
||||
#define SRS_PT_SCH "Spherical_Cross_Track_Height"
|
||||
|
||||
/** central_meridian projection parameter */
|
||||
#define SRS_PP_CENTRAL_MERIDIAN "central_meridian"
|
||||
/** scale_factor projection parameter */
|
||||
#define SRS_PP_SCALE_FACTOR "scale_factor"
|
||||
/** standard_parallel_1 projection parameter */
|
||||
#define SRS_PP_STANDARD_PARALLEL_1 "standard_parallel_1"
|
||||
/** standard_parallel_2 projection parameter */
|
||||
#define SRS_PP_STANDARD_PARALLEL_2 "standard_parallel_2"
|
||||
/** pseudo_standard_parallel_1 projection parameter */
|
||||
#define SRS_PP_PSEUDO_STD_PARALLEL_1 "pseudo_standard_parallel_1"
|
||||
/** longitude_of_center projection parameter */
|
||||
#define SRS_PP_LONGITUDE_OF_CENTER "longitude_of_center"
|
||||
/** latitude_of_center projection parameter */
|
||||
#define SRS_PP_LATITUDE_OF_CENTER "latitude_of_center"
|
||||
/** longitude_of_origin projection parameter */
|
||||
#define SRS_PP_LONGITUDE_OF_ORIGIN "longitude_of_origin"
|
||||
/** latitude_of_origin projection parameter */
|
||||
#define SRS_PP_LATITUDE_OF_ORIGIN "latitude_of_origin"
|
||||
/** false_easting projection parameter */
|
||||
#define SRS_PP_FALSE_EASTING "false_easting"
|
||||
/** false_northing projection parameter */
|
||||
#define SRS_PP_FALSE_NORTHING "false_northing"
|
||||
/** azimuth projection parameter */
|
||||
#define SRS_PP_AZIMUTH "azimuth"
|
||||
/** longitude_of_point_1 projection parameter */
|
||||
#define SRS_PP_LONGITUDE_OF_POINT_1 "longitude_of_point_1"
|
||||
/** latitude_of_point_1 projection parameter */
|
||||
#define SRS_PP_LATITUDE_OF_POINT_1 "latitude_of_point_1"
|
||||
/** longitude_of_point_2 projection parameter */
|
||||
#define SRS_PP_LONGITUDE_OF_POINT_2 "longitude_of_point_2"
|
||||
/** latitude_of_point_2 projection parameter */
|
||||
#define SRS_PP_LATITUDE_OF_POINT_2 "latitude_of_point_2"
|
||||
/** longitude_of_point_3 projection parameter */
|
||||
#define SRS_PP_LONGITUDE_OF_POINT_3 "longitude_of_point_3"
|
||||
/** latitude_of_point_3 projection parameter */
|
||||
#define SRS_PP_LATITUDE_OF_POINT_3 "latitude_of_point_3"
|
||||
/** rectified_grid_angle projection parameter */
|
||||
#define SRS_PP_RECTIFIED_GRID_ANGLE "rectified_grid_angle"
|
||||
/** landsat_number projection parameter */
|
||||
#define SRS_PP_LANDSAT_NUMBER "landsat_number"
|
||||
/** path_number projection parameter */
|
||||
#define SRS_PP_PATH_NUMBER "path_number"
|
||||
/** perspective_point_height projection parameter */
|
||||
#define SRS_PP_PERSPECTIVE_POINT_HEIGHT "perspective_point_height"
|
||||
/** satellite_height projection parameter */
|
||||
#define SRS_PP_SATELLITE_HEIGHT "satellite_height"
|
||||
/** fipszone projection parameter */
|
||||
#define SRS_PP_FIPSZONE "fipszone"
|
||||
/** zone projection parameter */
|
||||
#define SRS_PP_ZONE "zone"
|
||||
/** Latitude_Of_1st_Point projection parameter */
|
||||
#define SRS_PP_LATITUDE_OF_1ST_POINT "Latitude_Of_1st_Point"
|
||||
/** Longitude_Of_1st_Point projection parameter */
|
||||
#define SRS_PP_LONGITUDE_OF_1ST_POINT "Longitude_Of_1st_Point"
|
||||
/** Latitude_Of_2nd_Point projection parameter */
|
||||
#define SRS_PP_LATITUDE_OF_2ND_POINT "Latitude_Of_2nd_Point"
|
||||
/** Longitude_Of_2nd_Point projection parameter */
|
||||
#define SRS_PP_LONGITUDE_OF_2ND_POINT "Longitude_Of_2nd_Point"
|
||||
/** peg_point_latitude projection parameter */
|
||||
#define SRS_PP_PEG_POINT_LATITUDE "peg_point_latitude"
|
||||
/** peg_point_longitude projection parameter */
|
||||
#define SRS_PP_PEG_POINT_LONGITUDE "peg_point_longitude"
|
||||
/** peg_point_heading projection parameter */
|
||||
#define SRS_PP_PEG_POINT_HEADING "peg_point_heading"
|
||||
/** peg_point_height projection parameter */
|
||||
#define SRS_PP_PEG_POINT_HEIGHT "peg_point_height"
|
||||
|
||||
/** Linear unit Meter */
|
||||
#define SRS_UL_METER "Meter"
|
||||
/** Linear unit Foot (International) */
|
||||
#define SRS_UL_FOOT "Foot (International)" /* or just "FOOT"? */
|
||||
/** Linear unit Foot (International) conversion factor to meter*/
|
||||
#define SRS_UL_FOOT_CONV "0.3048"
|
||||
/** Linear unit Foot */
|
||||
#define SRS_UL_US_FOOT "Foot_US" /* or "US survey foot" from EPSG */
|
||||
/** Linear unit Foot conversion factor to meter */
|
||||
#define SRS_UL_US_FOOT_CONV "0.3048006096012192"
|
||||
/** Linear unit Nautical Mile */
|
||||
#define SRS_UL_NAUTICAL_MILE "Nautical Mile"
|
||||
/** Linear unit Nautical Mile conversion factor to meter */
|
||||
#define SRS_UL_NAUTICAL_MILE_CONV "1852.0"
|
||||
/** Linear unit Link */
|
||||
#define SRS_UL_LINK "Link" /* Based on US Foot */
|
||||
/** Linear unit Link conversion factor to meter */
|
||||
#define SRS_UL_LINK_CONV "0.20116684023368047"
|
||||
/** Linear unit Chain */
|
||||
#define SRS_UL_CHAIN "Chain" /* based on US Foot */
|
||||
/** Linear unit Chain conversion factor to meter */
|
||||
#define SRS_UL_CHAIN_CONV "20.116684023368047"
|
||||
/** Linear unit Rod */
|
||||
#define SRS_UL_ROD "Rod" /* based on US Foot */
|
||||
/** Linear unit Rod conversion factor to meter */
|
||||
#define SRS_UL_ROD_CONV "5.02921005842012"
|
||||
/** Linear unit Link_Clarke */
|
||||
#define SRS_UL_LINK_Clarke "Link_Clarke"
|
||||
/** Linear unit Link_Clarke conversion factor to meter */
|
||||
#define SRS_UL_LINK_Clarke_CONV "0.2011661949"
|
||||
|
||||
/** Linear unit Kilometer */
|
||||
#define SRS_UL_KILOMETER "Kilometer"
|
||||
/** Linear unit Kilometer conversion factor to meter */
|
||||
#define SRS_UL_KILOMETER_CONV "1000."
|
||||
/** Linear unit Decimeter */
|
||||
#define SRS_UL_DECIMETER "Decimeter"
|
||||
/** Linear unit Decimeter conversion factor to meter */
|
||||
#define SRS_UL_DECIMETER_CONV "0.1"
|
||||
/** Linear unit Decimeter */
|
||||
#define SRS_UL_CENTIMETER "Centimeter"
|
||||
/** Linear unit Decimeter conversion factor to meter */
|
||||
#define SRS_UL_CENTIMETER_CONV "0.01"
|
||||
/** Linear unit Millimeter */
|
||||
#define SRS_UL_MILLIMETER "Millimeter"
|
||||
/** Linear unit Millimeter conversion factor to meter */
|
||||
#define SRS_UL_MILLIMETER_CONV "0.001"
|
||||
/** Linear unit Nautical_Mile_International */
|
||||
#define SRS_UL_INTL_NAUT_MILE "Nautical_Mile_International"
|
||||
/** Linear unit Nautical_Mile_International conversion factor to meter */
|
||||
#define SRS_UL_INTL_NAUT_MILE_CONV "1852.0"
|
||||
/** Linear unit Inch_International */
|
||||
#define SRS_UL_INTL_INCH "Inch_International"
|
||||
/** Linear unit Inch_International conversion factor to meter */
|
||||
#define SRS_UL_INTL_INCH_CONV "0.0254"
|
||||
/** Linear unit Foot_International */
|
||||
#define SRS_UL_INTL_FOOT "Foot_International"
|
||||
/** Linear unit Foot_International conversion factor to meter */
|
||||
#define SRS_UL_INTL_FOOT_CONV "0.3048"
|
||||
/** Linear unit Yard_International */
|
||||
#define SRS_UL_INTL_YARD "Yard_International"
|
||||
/** Linear unit Yard_International conversion factor to meter */
|
||||
#define SRS_UL_INTL_YARD_CONV "0.9144"
|
||||
/** Linear unit Statute_Mile_International */
|
||||
#define SRS_UL_INTL_STAT_MILE "Statute_Mile_International"
|
||||
/** Linear unit Statute_Mile_Internationalconversion factor to meter */
|
||||
#define SRS_UL_INTL_STAT_MILE_CONV "1609.344"
|
||||
/** Linear unit Fathom_International */
|
||||
#define SRS_UL_INTL_FATHOM "Fathom_International"
|
||||
/** Linear unit Fathom_International conversion factor to meter */
|
||||
#define SRS_UL_INTL_FATHOM_CONV "1.8288"
|
||||
/** Linear unit Chain_International */
|
||||
#define SRS_UL_INTL_CHAIN "Chain_International"
|
||||
/** Linear unit Chain_International conversion factor to meter */
|
||||
#define SRS_UL_INTL_CHAIN_CONV "20.1168"
|
||||
/** Linear unit Link_International */
|
||||
#define SRS_UL_INTL_LINK "Link_International"
|
||||
/** Linear unit Link_International conversion factor to meter */
|
||||
#define SRS_UL_INTL_LINK_CONV "0.201168"
|
||||
/** Linear unit Inch_US_Surveyor */
|
||||
#define SRS_UL_US_INCH "Inch_US_Surveyor"
|
||||
/** Linear unit Inch_US_Surveyor conversion factor to meter */
|
||||
#define SRS_UL_US_INCH_CONV "0.025400050800101603"
|
||||
/** Linear unit Yard_US_Surveyor */
|
||||
#define SRS_UL_US_YARD "Yard_US_Surveyor"
|
||||
/** Linear unit Yard_US_Surveyor conversion factor to meter */
|
||||
#define SRS_UL_US_YARD_CONV "0.914401828803658"
|
||||
/** Linear unit Chain_US_Surveyor */
|
||||
#define SRS_UL_US_CHAIN "Chain_US_Surveyor"
|
||||
/** Linear unit Chain_US_Surveyor conversion factor to meter */
|
||||
#define SRS_UL_US_CHAIN_CONV "20.11684023368047"
|
||||
/** Linear unit Statute_Mile_US_Surveyor */
|
||||
#define SRS_UL_US_STAT_MILE "Statute_Mile_US_Surveyor"
|
||||
/** Linear unit Statute_Mile_US_Surveyor conversion factor to meter */
|
||||
#define SRS_UL_US_STAT_MILE_CONV "1609.347218694437"
|
||||
/** Linear unit Yard_Indian */
|
||||
#define SRS_UL_INDIAN_YARD "Yard_Indian"
|
||||
/** Linear unit Yard_Indian conversion factor to meter */
|
||||
#define SRS_UL_INDIAN_YARD_CONV "0.91439523"
|
||||
/** Linear unit Foot_Indian */
|
||||
#define SRS_UL_INDIAN_FOOT "Foot_Indian"
|
||||
/** Linear unit Foot_Indian conversion factor to meter */
|
||||
#define SRS_UL_INDIAN_FOOT_CONV "0.30479841"
|
||||
/** Linear unit Chain_Indian */
|
||||
#define SRS_UL_INDIAN_CHAIN "Chain_Indian"
|
||||
/** Linear unit Chain_Indian conversion factor to meter */
|
||||
#define SRS_UL_INDIAN_CHAIN_CONV "20.11669506"
|
||||
|
||||
/** Angular unit degree */
|
||||
#define SRS_UA_DEGREE "degree"
|
||||
/** Angular unit degree conversion factor to radians */
|
||||
#define SRS_UA_DEGREE_CONV "0.0174532925199433"
|
||||
/** Angular unit radian */
|
||||
#define SRS_UA_RADIAN "radian"
|
||||
|
||||
/** Prime meridian Greenwich */
|
||||
#define SRS_PM_GREENWICH "Greenwich"
|
||||
|
||||
/** North_American_Datum_1927 datum name */
|
||||
#define SRS_DN_NAD27 "North_American_Datum_1927"
|
||||
/** North_American_Datum_1983 datum name */
|
||||
#define SRS_DN_NAD83 "North_American_Datum_1983"
|
||||
/** WGS_1972 datum name */
|
||||
#define SRS_DN_WGS72 "WGS_1972"
|
||||
/** WGS_1984 datum name */
|
||||
#define SRS_DN_WGS84 "WGS_1984"
|
||||
|
||||
/** Semi-major axis of the WGS84 ellipsoid */
|
||||
#define SRS_WGS84_SEMIMAJOR 6378137.0
|
||||
/** Inverse flattening of the WGS84 ellipsoid */
|
||||
#define SRS_WGS84_INVFLATTENING 298.257223563
|
||||
|
||||
#ifndef SWIG
|
||||
@@ -303,19 +469,22 @@ typedef enum {
|
||||
/* C Wrappers for C++ objects and methods. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
#ifndef DEFINED_OGRSpatialReferenceH
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#define DEFINED_OGRSpatialReferenceH
|
||||
/*! @endcond */
|
||||
|
||||
#ifdef DEBUG
|
||||
typedef struct OGRSpatialReferenceHS *OGRSpatialReferenceH;
|
||||
typedef struct OGRCoordinateTransformationHS *OGRCoordinateTransformationH;
|
||||
#else
|
||||
/** Opaque type for a Spatial Reference object */
|
||||
typedef void *OGRSpatialReferenceH;
|
||||
/** Opaque type for a coordinate transformation object */
|
||||
typedef void *OGRCoordinateTransformationH;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
OGRSpatialReferenceH CPL_DLL CPL_STDCALL
|
||||
OSRNewSpatialReference( const char * /* = NULL */);
|
||||
OGRSpatialReferenceH CPL_DLL CPL_STDCALL OSRCloneGeogCS( OGRSpatialReferenceH );
|
||||
@@ -626,6 +795,8 @@ OGRErr CPL_DLL OSRSetMercator( OGRSpatialReferenceH hSRS,
|
||||
double dfCenterLat, double dfCenterLong,
|
||||
double dfScale,
|
||||
double dfFalseEasting, double dfFalseNorthing );
|
||||
|
||||
/** Mercator 2SP */
|
||||
OGRErr CPL_DLL OSRSetMercator2SP( OGRSpatialReferenceH hSRS,
|
||||
double dfStdP1,
|
||||
double dfCenterLat, double dfCenterLong,
|
||||
@@ -717,6 +888,7 @@ OGRErr CPL_DLL OSRSetTMSO( OGRSpatialReferenceH hSRS,
|
||||
double dfScale,
|
||||
double dfFalseEasting, double dfFalseNorthing );
|
||||
|
||||
/** TPED (Two Point Equi Distant) */
|
||||
OGRErr CPL_DLL OSRSetTPED( OGRSpatialReferenceH hSRS,
|
||||
double dfLat1, double dfLong1,
|
||||
double dfLat2, double dfLong2,
|
||||
@@ -742,7 +914,6 @@ OGRErr CPL_DLL OSRSetSCH( OGRSpatialReferenceH hSRS,
|
||||
double dfPegLat, double dfPegLong,
|
||||
double dfPegHeading, double dfPegHgt);
|
||||
|
||||
|
||||
double CPL_DLL OSRCalcInvFlattening( double dfSemiMajor, double dfSemiMinor );
|
||||
double CPL_DLL OSRCalcSemiMinorFromInvFlattening( double dfSemiMajor, double dfInvFlattening );
|
||||
|
||||
@@ -766,10 +937,12 @@ OCTTransformEx( OGRCoordinateTransformationH hCT,
|
||||
int nCount, double *x, double *y, double *z,
|
||||
int *pabSuccess );
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/* this is really private to OGR. */
|
||||
char *OCTProj4Normalize( const char *pszProj4Src );
|
||||
|
||||
void OCTCleanupProjMutex( void );
|
||||
/*! @endcond */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Projection transform dictionary query. */
|
||||
|
||||
@@ -120,8 +120,6 @@ static const char * const apszGcsNameMappingBasedOnProjCS[] = {
|
||||
"MONREF_1997_UTM_Zone_47N", "GCS_ITRF_2000", "GCS_MONREF_1997",
|
||||
NULL, NULL, NULL};
|
||||
|
||||
|
||||
|
||||
static const char * const apszGcsNameMappingBasedOnUnit[] = {
|
||||
"Voirol_Unifie_1960", "Degree", "GCS_Voirol_Unifie_1960_Degree",
|
||||
"Voirol_1960", "Degree", "GCS_Voirol_Unifie_1960_Degree",
|
||||
@@ -202,7 +200,7 @@ static const char * const apszParamValueMapping[] = {
|
||||
"Lambert_Conformal_Conic", "central_meridian", "-76.83333333333334", "-76.83333333333333",
|
||||
"Krovak", "longitude_of_center", "24.83333333333334", "24.83333333333333",
|
||||
"Hotine_Oblique_Mercator_Azimuth_Center", "longitude_of_center", "7.439583333333334", "7.439583333333333",
|
||||
"Hotine_Oblique_Mercator_Azimuth_Center", "latitude_of_center", "46.95240555555557", "46.95240555555556",
|
||||
"Hotine_Oblique_Mercator_Azimuth_Center", "latitude_of_center", "46.95240555555557", "46.95240555555556",
|
||||
NULL, NULL, NULL, NULL};
|
||||
|
||||
static const char * const apszParamNameMapping[] = {
|
||||
@@ -291,7 +289,7 @@ static const int statePlaneZoneMapping[] = {
|
||||
4451, -1, 2403,
|
||||
4476, 32100, 2500,
|
||||
4476, -1, 2501,
|
||||
4701, 32111, 2900,
|
||||
4701, 32111, 2900,
|
||||
4801, 2260, 3101,
|
||||
4801, 32115, 3101,
|
||||
4526, -1, 2503,
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/******************************************************************************
|
||||
* Project: OGR
|
||||
* Purpose: Convenience functions for parsing with Xerces-C library
|
||||
* Author: Even Rouault, <even.rouault at spatialys.com>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2016, Even Rouault <even.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_XERCES_INCLUDED
|
||||
#define OGR_XERCES_INCLUDED
|
||||
|
||||
// Must be first for DEBUG_BOOL case
|
||||
#ifdef HAVE_XERCES
|
||||
#include "ogr_xerces_headers.h"
|
||||
#endif
|
||||
|
||||
#include "cpl_port.h"
|
||||
#include "cpl_string.h"
|
||||
|
||||
#ifdef HAVE_XERCES
|
||||
|
||||
/* All those functions are for in-tree drivers use only ! */
|
||||
|
||||
/* Thread-safe initialization/de-initialization. Calls should be paired */
|
||||
bool CPL_DLL OGRInitializeXerces(void);
|
||||
void CPL_DLL OGRDeinitializeXerces(void);
|
||||
|
||||
namespace OGR
|
||||
{
|
||||
CPLString CPL_DLL transcode( const XMLCh *panXMLString, int nLimitingChars = -1 );
|
||||
CPLString CPL_DLL &transcode( const XMLCh *panXMLString, CPLString& osRet,
|
||||
int nLimitingChars = -1 );
|
||||
}
|
||||
|
||||
#ifndef OGR_USING
|
||||
using OGR::transcode;
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_XERCES */
|
||||
|
||||
void OGRCleanupXercesMutex(void);
|
||||
|
||||
#endif /* OGR_XERCES_INCLUDED */
|
||||
@@ -0,0 +1,42 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: Includes Xerces-C headers
|
||||
* Author: Even Rouault <even dot rouault at spatialys dot com>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2016, Even Rouault <even dot rouault at spatialys dot 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_XERCES_HEADERS_H
|
||||
#define OGR_XERCES_HEADERS_H
|
||||
|
||||
#if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) && !defined(_MSC_VER))
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#include <util/PlatformUtils.hpp>
|
||||
|
||||
#ifdef XERCES_CPP_NAMESPACE_USE
|
||||
XERCES_CPP_NAMESPACE_USE
|
||||
#endif
|
||||
|
||||
#endif /* OGR_XERCES_HEADERS_H */
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: ograpispy.h 33631 2016-03-04 06:28:09Z goatbar $
|
||||
* $Id: ograpispy.h 35912 2016-10-24 16:41:45Z goatbar $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: OGR C API "Spy"
|
||||
@@ -61,7 +61,6 @@
|
||||
* @since GDAL 2.0
|
||||
*/
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#define OGRAPISPY_ENABLED
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogrpgeogeometry.h 33631 2016-03-04 06:28:09Z goatbar $
|
||||
* $Id: ogrpgeogeometry.h 36883 2016-12-15 13:31:12Z rouault $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: Implements decoder of shapebin geometry for PGeo
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
#define SHPT_NULL 0
|
||||
|
||||
#ifndef SHPT_POINT
|
||||
#define SHPT_POINT 1
|
||||
#define SHPT_POINTM 21
|
||||
#define SHPT_POINTZM 11
|
||||
@@ -57,6 +58,7 @@
|
||||
|
||||
#define SHPT_MULTIPATCHM 31
|
||||
#define SHPT_MULTIPATCH 32
|
||||
#endif // SHPT_POINT
|
||||
|
||||
#define SHPT_GENERALPOLYLINE 50
|
||||
#define SHPT_GENERALPOLYGON 51
|
||||
@@ -73,13 +75,13 @@
|
||||
#define ESRI_LAYERGEOMTYPE_POLYGON 4
|
||||
#define ESRI_LAYERGEOMTYPE_MULTIPATCH 9
|
||||
|
||||
void OGRCreateFromMultiPatchPart(OGRMultiPolygon *poMP,
|
||||
OGRPolygon*& poLastPoly,
|
||||
int nPartType,
|
||||
int nPartPoints,
|
||||
double* padfX,
|
||||
double* padfY,
|
||||
double* padfZ);
|
||||
OGRGeometry* OGRCreateFromMultiPatch( int nParts,
|
||||
const GInt32* panPartStart,
|
||||
const GInt32* panPartType,
|
||||
int nPoints,
|
||||
const double* padfX,
|
||||
const double* padfY,
|
||||
const double* padfZ );
|
||||
|
||||
OGRErr CPL_DLL OGRCreateFromShapeBin( GByte *pabyShape,
|
||||
OGRGeometry **ppoGeom,
|
||||
@@ -89,6 +91,15 @@ OGRErr CPL_DLL OGRWriteToShapeBin( OGRGeometry *poGeom,
|
||||
GByte **ppabyShape,
|
||||
int *pnBytes );
|
||||
|
||||
OGRErr OGRCreateMultiPatch( OGRGeometry *poGeom,
|
||||
int bAllowSHPTTriangle,
|
||||
int& nParts,
|
||||
int*& panPartStart,
|
||||
int*& panPartType,
|
||||
int& nPoints,
|
||||
OGRRawPoint*& poPoints,
|
||||
double*& padfZ );
|
||||
|
||||
OGRErr CPL_DLL OGRWriteMultiPatchToShapeBin( OGRGeometry *poGeom,
|
||||
GByte **ppabyShape,
|
||||
int *pnBytes );
|
||||
|
||||
@@ -1,427 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id: ogrsf_frmts.h 33631 2016-03-04 06:28:09Z goatbar $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: Classes related to format registration, and file opening.
|
||||
* Author: Frank Warmerdam, warmerda@home.com
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 1999, Les Technologies SoftMap Inc.
|
||||
* Copyright (c) 2007-2014, Even Rouault <even dot rouault at mines-paris dot org>
|
||||
*
|
||||
* 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 OGRSF_FRMTS_H_INCLUDED
|
||||
#define OGRSF_FRMTS_H_INCLUDED
|
||||
|
||||
#include "cpl_progress.h"
|
||||
#include "ogr_feature.h"
|
||||
#include "ogr_featurestyle.h"
|
||||
#include "gdal_priv.h"
|
||||
|
||||
/**
|
||||
* \file ogrsf_frmts.h
|
||||
*
|
||||
* Classes related to registration of format support, and opening datasets.
|
||||
*/
|
||||
|
||||
#if !defined(GDAL_COMPILATION) && !defined(SUPPRESS_DEPRECATION_WARNINGS)
|
||||
#define OGR_DEPRECATED(x) CPL_WARN_DEPRECATED(x)
|
||||
#else
|
||||
#define OGR_DEPRECATED(x)
|
||||
#endif
|
||||
|
||||
class OGRLayerAttrIndex;
|
||||
class OGRSFDriver;
|
||||
|
||||
/************************************************************************/
|
||||
/* OGRLayer */
|
||||
/************************************************************************/
|
||||
|
||||
/**
|
||||
* This class represents a layer of simple features, with access methods.
|
||||
*
|
||||
*/
|
||||
|
||||
/* Note: any virtual method added to this class must also be added in the */
|
||||
/* OGRLayerDecorator and OGRMutexedLayer classes. */
|
||||
|
||||
class CPL_DLL OGRLayer : public GDALMajorObject
|
||||
{
|
||||
private:
|
||||
void ConvertGeomsIfNecessary( OGRFeature *poFeature );
|
||||
|
||||
protected:
|
||||
int m_bFilterIsEnvelope;
|
||||
OGRGeometry *m_poFilterGeom;
|
||||
OGRPreparedGeometry *m_pPreparedFilterGeom; /* m_poFilterGeom compiled as a prepared geometry */
|
||||
OGREnvelope m_sFilterEnvelope;
|
||||
int m_iGeomFieldFilter; // specify the index on which the spatial
|
||||
// filter is active.
|
||||
|
||||
int FilterGeometry( OGRGeometry * );
|
||||
//int FilterGeometry( OGRGeometry *, OGREnvelope* psGeometryEnvelope);
|
||||
int InstallFilter( OGRGeometry * );
|
||||
|
||||
OGRErr GetExtentInternal(int iGeomField, OGREnvelope *psExtent, int bForce );
|
||||
|
||||
virtual OGRErr ISetFeature( OGRFeature *poFeature ) CPL_WARN_UNUSED_RESULT;
|
||||
virtual OGRErr ICreateFeature( OGRFeature *poFeature ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
public:
|
||||
OGRLayer();
|
||||
virtual ~OGRLayer();
|
||||
|
||||
virtual OGRGeometry *GetSpatialFilter();
|
||||
virtual void SetSpatialFilter( OGRGeometry * );
|
||||
virtual void SetSpatialFilterRect( double dfMinX, double dfMinY,
|
||||
double dfMaxX, double dfMaxY );
|
||||
|
||||
virtual void SetSpatialFilter( int iGeomField, OGRGeometry * );
|
||||
virtual void SetSpatialFilterRect( int iGeomField,
|
||||
double dfMinX, double dfMinY,
|
||||
double dfMaxX, double dfMaxY );
|
||||
|
||||
virtual OGRErr SetAttributeFilter( const char * );
|
||||
|
||||
virtual void ResetReading() = 0;
|
||||
virtual OGRFeature *GetNextFeature() CPL_WARN_UNUSED_RESULT = 0;
|
||||
virtual OGRErr SetNextByIndex( GIntBig nIndex );
|
||||
virtual OGRFeature *GetFeature( GIntBig nFID ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
OGRErr SetFeature( OGRFeature *poFeature ) CPL_WARN_UNUSED_RESULT;
|
||||
OGRErr CreateFeature( OGRFeature *poFeature ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
virtual OGRErr DeleteFeature( GIntBig nFID ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
virtual const char *GetName();
|
||||
virtual OGRwkbGeometryType GetGeomType();
|
||||
virtual OGRFeatureDefn *GetLayerDefn() = 0;
|
||||
virtual int FindFieldIndex( const char *pszFieldName, int bExactMatch );
|
||||
|
||||
virtual OGRSpatialReference *GetSpatialRef();
|
||||
|
||||
virtual GIntBig GetFeatureCount( int bForce = TRUE );
|
||||
virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE) CPL_WARN_UNUSED_RESULT;
|
||||
virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent,
|
||||
int bForce = TRUE) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
virtual int TestCapability( const char * ) = 0;
|
||||
|
||||
virtual OGRErr CreateField( OGRFieldDefn *poField,
|
||||
int bApproxOK = TRUE );
|
||||
virtual OGRErr DeleteField( int iField );
|
||||
virtual OGRErr ReorderFields( int* panMap );
|
||||
virtual OGRErr AlterFieldDefn( int iField, OGRFieldDefn* poNewFieldDefn, int nFlagsIn );
|
||||
|
||||
virtual OGRErr CreateGeomField( OGRGeomFieldDefn *poField,
|
||||
int bApproxOK = TRUE );
|
||||
|
||||
virtual OGRErr SyncToDisk();
|
||||
|
||||
virtual OGRStyleTable *GetStyleTable();
|
||||
virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable );
|
||||
|
||||
virtual void SetStyleTable(OGRStyleTable *poStyleTable);
|
||||
|
||||
virtual OGRErr StartTransaction() CPL_WARN_UNUSED_RESULT;
|
||||
virtual OGRErr CommitTransaction() CPL_WARN_UNUSED_RESULT;
|
||||
virtual OGRErr RollbackTransaction();
|
||||
|
||||
virtual const char *GetFIDColumn();
|
||||
virtual const char *GetGeometryColumn();
|
||||
|
||||
virtual OGRErr SetIgnoredFields( const char **papszFields );
|
||||
|
||||
OGRErr Intersection( OGRLayer *pLayerMethod,
|
||||
OGRLayer *pLayerResult,
|
||||
char** papszOptions = NULL,
|
||||
GDALProgressFunc pfnProgress = NULL,
|
||||
void * pProgressArg = NULL );
|
||||
OGRErr Union( OGRLayer *pLayerMethod,
|
||||
OGRLayer *pLayerResult,
|
||||
char** papszOptions = NULL,
|
||||
GDALProgressFunc pfnProgress = NULL,
|
||||
void * pProgressArg = NULL );
|
||||
OGRErr SymDifference( OGRLayer *pLayerMethod,
|
||||
OGRLayer *pLayerResult,
|
||||
char** papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
OGRErr Identity( OGRLayer *pLayerMethod,
|
||||
OGRLayer *pLayerResult,
|
||||
char** papszOptions = NULL,
|
||||
GDALProgressFunc pfnProgress = NULL,
|
||||
void * pProgressArg = NULL );
|
||||
OGRErr Update( OGRLayer *pLayerMethod,
|
||||
OGRLayer *pLayerResult,
|
||||
char** papszOptions = NULL,
|
||||
GDALProgressFunc pfnProgress = NULL,
|
||||
void * pProgressArg = NULL );
|
||||
OGRErr Clip( OGRLayer *pLayerMethod,
|
||||
OGRLayer *pLayerResult,
|
||||
char** papszOptions = NULL,
|
||||
GDALProgressFunc pfnProgress = NULL,
|
||||
void * pProgressArg = NULL );
|
||||
OGRErr Erase( OGRLayer *pLayerMethod,
|
||||
OGRLayer *pLayerResult,
|
||||
char** papszOptions = NULL,
|
||||
GDALProgressFunc pfnProgress = NULL,
|
||||
void * pProgressArg = NULL );
|
||||
|
||||
int Reference();
|
||||
int Dereference();
|
||||
int GetRefCount() const;
|
||||
|
||||
GIntBig GetFeaturesRead();
|
||||
|
||||
/* non virtual : convenience wrapper for ReorderFields() */
|
||||
OGRErr ReorderField( int iOldFieldPos, int iNewFieldPos );
|
||||
|
||||
int AttributeFilterEvaluationNeedsGeometry();
|
||||
|
||||
/* consider these private */
|
||||
OGRErr InitializeIndexSupport( const char * );
|
||||
OGRLayerAttrIndex *GetIndex() { return m_poAttrIndex; }
|
||||
|
||||
protected:
|
||||
OGRStyleTable *m_poStyleTable;
|
||||
OGRFeatureQuery *m_poAttrQuery;
|
||||
char *m_pszAttrQueryString;
|
||||
OGRLayerAttrIndex *m_poAttrIndex;
|
||||
|
||||
int m_nRefCount;
|
||||
|
||||
GIntBig m_nFeaturesRead;
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
/* OGRDataSource */
|
||||
/************************************************************************/
|
||||
|
||||
/**
|
||||
* LEGACY class. Use GDALDataset in your new code ! This class may be
|
||||
* removed in a later release.
|
||||
*
|
||||
* This class represents a data source. A data source potentially
|
||||
* consists of many layers (OGRLayer). A data source normally consists
|
||||
* of one, or a related set of files, though the name doesn't have to be
|
||||
* a real item in the file system.
|
||||
*
|
||||
* When an OGRDataSource is destroyed, all it's associated OGRLayers objects
|
||||
* are also destroyed.
|
||||
*
|
||||
* NOTE: Starting with GDAL 2.0, it is *NOT* safe to cast the handle of
|
||||
* a C function that returns a OGRDataSourceH to a OGRDataSource*. If a C++ object
|
||||
* is needed, the handle should be cast to GDALDataset*.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
|
||||
class CPL_DLL OGRDataSource : public GDALDataset
|
||||
{
|
||||
public:
|
||||
OGRDataSource();
|
||||
|
||||
virtual const char *GetName() OGR_DEPRECATED("Use GDALDataset class instead") = 0;
|
||||
|
||||
static void DestroyDataSource( OGRDataSource * ) OGR_DEPRECATED("Use GDALDataset class instead");
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
/* OGRSFDriver */
|
||||
/************************************************************************/
|
||||
|
||||
/**
|
||||
* LEGACY class. Use GDALDriver in your new code ! This class may be
|
||||
* removed in a later release.
|
||||
*
|
||||
* Represents an operational format driver.
|
||||
*
|
||||
* One OGRSFDriver derived class will normally exist for each file format
|
||||
* registered for use, regardless of whether a file has or will be opened.
|
||||
* The list of available drivers is normally managed by the
|
||||
* OGRSFDriverRegistrar.
|
||||
*
|
||||
* NOTE: Starting with GDAL 2.0, it is *NOT* safe to cast the handle of
|
||||
* a C function that returns a OGRSFDriverH to a OGRSFDriver*. If a C++ object
|
||||
* is needed, the handle should be cast to GDALDriver*.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
|
||||
class CPL_DLL OGRSFDriver : public GDALDriver
|
||||
{
|
||||
public:
|
||||
virtual ~OGRSFDriver();
|
||||
|
||||
virtual const char *GetName() OGR_DEPRECATED("Use GDALDriver class instead") = 0;
|
||||
|
||||
virtual OGRDataSource *Open( const char *pszName, int bUpdate=FALSE ) OGR_DEPRECATED("Use GDALDriver class instead") = 0;
|
||||
|
||||
virtual int TestCapability( const char *pszCap ) OGR_DEPRECATED("Use GDALDriver class instead") = 0;
|
||||
|
||||
virtual OGRDataSource *CreateDataSource( const char *pszName,
|
||||
char ** = NULL ) OGR_DEPRECATED("Use GDALDriver class instead");
|
||||
virtual OGRErr DeleteDataSource( const char *pszName ) OGR_DEPRECATED("Use GDALDriver class instead");
|
||||
};
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/* OGRSFDriverRegistrar */
|
||||
/************************************************************************/
|
||||
|
||||
/**
|
||||
* LEGACY class. Use GDALDriverManager in your new code ! This class may be
|
||||
* removed in a later release.
|
||||
*
|
||||
* Singleton manager for OGRSFDriver instances that will be used to try
|
||||
* and open datasources. Normally the registrar is populated with
|
||||
* standard drivers using the OGRRegisterAll() function and does not need
|
||||
* to be directly accessed. The driver registrar and all registered drivers
|
||||
* may be cleaned up on shutdown using OGRCleanupAll().
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
|
||||
class CPL_DLL OGRSFDriverRegistrar
|
||||
{
|
||||
|
||||
OGRSFDriverRegistrar();
|
||||
~OGRSFDriverRegistrar();
|
||||
|
||||
static GDALDataset* OpenWithDriverArg(GDALDriver* poDriver,
|
||||
GDALOpenInfo* poOpenInfo);
|
||||
static GDALDataset* CreateVectorOnly( GDALDriver* poDriver,
|
||||
const char * pszName,
|
||||
char ** papszOptions );
|
||||
static CPLErr DeleteDataSource( GDALDriver* poDriver,
|
||||
const char * pszName );
|
||||
|
||||
public:
|
||||
|
||||
static OGRSFDriverRegistrar *GetRegistrar() OGR_DEPRECATED("Use GDALDriverManager class instead");
|
||||
|
||||
void RegisterDriver( OGRSFDriver * poDriver ) OGR_DEPRECATED("Use GDALDriverManager class instead");
|
||||
|
||||
int GetDriverCount( void ) OGR_DEPRECATED("Use GDALDriverManager class instead");
|
||||
GDALDriver *GetDriver( int iDriver ) OGR_DEPRECATED("Use GDALDriverManager class instead");
|
||||
GDALDriver *GetDriverByName( const char * ) OGR_DEPRECATED("Use GDALDriverManager class instead");
|
||||
|
||||
int GetOpenDSCount() OGR_DEPRECATED("Use GDALDriverManager class instead");
|
||||
OGRDataSource *GetOpenDS( int ) OGR_DEPRECATED("Use GDALDriverManager class instead");
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Various available registration methods. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
CPL_C_START
|
||||
void CPL_DLL OGRRegisterAll();
|
||||
void OGRRegisterAllInternal();
|
||||
|
||||
void CPL_DLL RegisterOGRFileGDB();
|
||||
void CPL_DLL RegisterOGRShape();
|
||||
void CPL_DLL RegisterOGRDB2();
|
||||
void CPL_DLL RegisterOGRNTF();
|
||||
void CPL_DLL RegisterOGRFME();
|
||||
void CPL_DLL RegisterOGRSDTS();
|
||||
void CPL_DLL RegisterOGRTiger();
|
||||
void CPL_DLL RegisterOGRS57();
|
||||
void CPL_DLL RegisterOGRTAB();
|
||||
void CPL_DLL RegisterOGRMIF();
|
||||
void CPL_DLL RegisterOGROGDI();
|
||||
void CPL_DLL RegisterOGRODBC();
|
||||
void CPL_DLL RegisterOGRWAsP();
|
||||
void CPL_DLL RegisterOGRPG();
|
||||
void CPL_DLL RegisterOGRMSSQLSpatial();
|
||||
void CPL_DLL RegisterOGRMySQL();
|
||||
void CPL_DLL RegisterOGROCI();
|
||||
void CPL_DLL RegisterOGRDGN();
|
||||
void CPL_DLL RegisterOGRGML();
|
||||
void CPL_DLL RegisterOGRLIBKML();
|
||||
void CPL_DLL RegisterOGRKML();
|
||||
void CPL_DLL RegisterOGRGeoJSON();
|
||||
void CPL_DLL RegisterOGRAVCBin();
|
||||
void CPL_DLL RegisterOGRAVCE00();
|
||||
void CPL_DLL RegisterOGRREC();
|
||||
void CPL_DLL RegisterOGRMEM();
|
||||
void CPL_DLL RegisterOGRVRT();
|
||||
void CPL_DLL RegisterOGRDODS();
|
||||
void CPL_DLL RegisterOGRSQLite();
|
||||
void CPL_DLL RegisterOGRCSV();
|
||||
void CPL_DLL RegisterOGRILI1();
|
||||
void CPL_DLL RegisterOGRILI2();
|
||||
void CPL_DLL RegisterOGRGRASS();
|
||||
void CPL_DLL RegisterOGRPGeo();
|
||||
void CPL_DLL RegisterOGRDXFDWG();
|
||||
void CPL_DLL RegisterOGRDXF();
|
||||
void CPL_DLL RegisterOGRDWG();
|
||||
void CPL_DLL RegisterOGRSDE();
|
||||
void CPL_DLL RegisterOGRIDB();
|
||||
void CPL_DLL RegisterOGRGMT();
|
||||
void CPL_DLL RegisterOGRBNA();
|
||||
void CPL_DLL RegisterOGRGPX();
|
||||
void CPL_DLL RegisterOGRGeoconcept();
|
||||
void CPL_DLL RegisterOGRIngres();
|
||||
void CPL_DLL RegisterOGRXPlane();
|
||||
void CPL_DLL RegisterOGRNAS();
|
||||
void CPL_DLL RegisterOGRGeoRSS();
|
||||
void CPL_DLL RegisterOGRGTM();
|
||||
void CPL_DLL RegisterOGRVFK();
|
||||
void CPL_DLL RegisterOGRPGDump();
|
||||
void CPL_DLL RegisterOGROSM();
|
||||
void CPL_DLL RegisterOGRGPSBabel();
|
||||
void CPL_DLL RegisterOGRSUA();
|
||||
void CPL_DLL RegisterOGROpenAir();
|
||||
void CPL_DLL RegisterOGRPDS();
|
||||
void CPL_DLL RegisterOGRWFS();
|
||||
void CPL_DLL RegisterOGRSOSI();
|
||||
void CPL_DLL RegisterOGRHTF();
|
||||
void CPL_DLL RegisterOGRAeronavFAA();
|
||||
void CPL_DLL RegisterOGRGeomedia();
|
||||
void CPL_DLL RegisterOGRMDB();
|
||||
void CPL_DLL RegisterOGREDIGEO();
|
||||
void CPL_DLL RegisterOGRGFT();
|
||||
void CPL_DLL RegisterOGRSVG();
|
||||
void CPL_DLL RegisterOGRCouchDB();
|
||||
void CPL_DLL RegisterOGRCloudant();
|
||||
void CPL_DLL RegisterOGRIdrisi();
|
||||
void CPL_DLL RegisterOGRARCGEN();
|
||||
void CPL_DLL RegisterOGRSEGUKOOA();
|
||||
void CPL_DLL RegisterOGRSEGY();
|
||||
void CPL_DLL RegisterOGRXLS();
|
||||
void CPL_DLL RegisterOGRODS();
|
||||
void CPL_DLL RegisterOGRXLSX();
|
||||
void CPL_DLL RegisterOGRElastic();
|
||||
void CPL_DLL RegisterOGRGeoPackage();
|
||||
void CPL_DLL RegisterOGRWalk();
|
||||
void CPL_DLL RegisterOGRCartoDB();
|
||||
void CPL_DLL RegisterOGRAmigoCloud();
|
||||
void CPL_DLL RegisterOGRSXF();
|
||||
void CPL_DLL RegisterOGROpenFileGDB();
|
||||
void CPL_DLL RegisterOGRSelafin();
|
||||
void CPL_DLL RegisterOGRJML();
|
||||
void CPL_DLL RegisterOGRPLSCENES();
|
||||
void CPL_DLL RegisterOGRCSW();
|
||||
void CPL_DLL RegisterOGRMongoDB();
|
||||
void CPL_DLL RegisterOGRVDV();
|
||||
CPL_C_END
|
||||
|
||||
#endif /* ndef OGRSF_FRMTS_H_INCLUDED */
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: osr_cs_wkt.h 31777 2015-11-26 14:14:41Z rouault $
|
||||
* $Id: osr_cs_wkt.h 34921 2016-08-04 22:26:31Z rouault $
|
||||
*
|
||||
* Project: OpenGIS Simple Features Reference Implementation
|
||||
* Purpose: CS WKT parser
|
||||
@@ -30,6 +30,8 @@
|
||||
#ifndef OSR_CS_WKT_H_INCLUDED_
|
||||
#define OSR_CS_WKT_H_INCLUDED_
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -52,4 +54,6 @@ int osr_cs_wkt_parse(osr_cs_wkt_parse_context *context);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* OSR_CS_WKT_H_INCLUDED_ */
|
||||
|
||||
@@ -82,8 +82,6 @@ typedef int YYSTYPE;
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
int osr_cs_wkt_parse (osr_cs_wkt_parse_context *context);
|
||||
|
||||
#endif /* !YY_OSR_CS_WKT_OSR_CS_WKT_PARSER_H_INCLUDED */
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id: rawdataset.h 33673 2016-03-07 20:40:54Z goatbar $
|
||||
*
|
||||
* Project: Raw Translator
|
||||
* Purpose: Implementation of RawDataset class. Intended to be subclassed
|
||||
* by other raw formats.
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 1999, Frank Warmerdam
|
||||
* Copyright (c) 2008-2014, Even Rouault <even dot rouault at mines-paris dot org>
|
||||
*
|
||||
* 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 GDAL_FRMTS_RAW_RAWDATASET_H_INCLUDED
|
||||
#define GDAL_FRMTS_RAW_RAWDATASET_H_INCLUDED
|
||||
|
||||
#include "gdal_pam.h"
|
||||
|
||||
/************************************************************************/
|
||||
/* ==================================================================== */
|
||||
/* RawDataset */
|
||||
/* ==================================================================== */
|
||||
/************************************************************************/
|
||||
|
||||
class RawRasterBand;
|
||||
|
||||
/**
|
||||
* \brief Abstract Base Class dedicated to define new raw dataset types.
|
||||
*/
|
||||
class CPL_DLL RawDataset : public GDALPamDataset
|
||||
{
|
||||
friend class RawRasterBand;
|
||||
|
||||
protected:
|
||||
virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
int, int *,
|
||||
GSpacing nPixelSpace, GSpacing nLineSpace,
|
||||
GSpacing nBandSpace,
|
||||
GDALRasterIOExtraArg* psExtraArg );
|
||||
public:
|
||||
RawDataset();
|
||||
~RawDataset() = 0;
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(RawDataset);
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
/* ==================================================================== */
|
||||
/* RawRasterBand */
|
||||
/* ==================================================================== */
|
||||
/************************************************************************/
|
||||
|
||||
/**
|
||||
* \brief Abstract Base Class dedicated to define raw datasets.
|
||||
* \note It is not defined an Abstract Base Class, but it's advised to
|
||||
* consider it as such and not use it directly in client's code.
|
||||
*/
|
||||
class CPL_DLL RawRasterBand : public GDALPamRasterBand
|
||||
{
|
||||
protected:
|
||||
friend class RawDataset;
|
||||
|
||||
FILE *fpRaw;
|
||||
VSILFILE *fpRawL;
|
||||
int bIsVSIL;
|
||||
|
||||
vsi_l_offset nImgOffset;
|
||||
int nPixelOffset;
|
||||
int nLineOffset;
|
||||
int nLineSize;
|
||||
int bNativeOrder;
|
||||
|
||||
int nLoadedScanline;
|
||||
void *pLineBuffer;
|
||||
void *pLineStart;
|
||||
int bDirty;
|
||||
|
||||
GDALColorTable *poCT;
|
||||
GDALColorInterp eInterp;
|
||||
|
||||
char **papszCategoryNames;
|
||||
|
||||
int bOwnsFP;
|
||||
|
||||
int Seek( vsi_l_offset, int );
|
||||
size_t Read( void *, size_t, size_t );
|
||||
size_t Write( void *, size_t, size_t );
|
||||
|
||||
CPLErr AccessBlock( vsi_l_offset nBlockOff, size_t nBlockSize,
|
||||
void * pData );
|
||||
int IsSignificantNumberOfLinesLoaded( int nLineOff, int nLines );
|
||||
void Initialize();
|
||||
|
||||
virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
GSpacing nPixelSpace, GSpacing nLineSpace,
|
||||
GDALRasterIOExtraArg* psExtraArg );
|
||||
|
||||
int CanUseDirectIO(int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
GDALDataType eBufType);
|
||||
|
||||
public:
|
||||
|
||||
RawRasterBand( GDALDataset *poDS, int nBand, void * fpRaw,
|
||||
vsi_l_offset nImgOffset, int nPixelOffset,
|
||||
int nLineOffset,
|
||||
GDALDataType eDataType, int bNativeOrder,
|
||||
int bIsVSIL = FALSE, int bOwnsFP = FALSE );
|
||||
|
||||
RawRasterBand( void * fpRaw,
|
||||
vsi_l_offset nImgOffset, int nPixelOffset,
|
||||
int nLineOffset,
|
||||
GDALDataType eDataType, int bNativeOrder,
|
||||
int nXSize, int nYSize, int bIsVSIL = FALSE, int bOwnsFP = FALSE );
|
||||
|
||||
~RawRasterBand() /* = 0 */ ;
|
||||
|
||||
// should override RasterIO eventually.
|
||||
|
||||
virtual CPLErr IReadBlock( int, int, void * );
|
||||
virtual CPLErr IWriteBlock( int, int, void * );
|
||||
|
||||
virtual GDALColorTable *GetColorTable();
|
||||
virtual GDALColorInterp GetColorInterpretation();
|
||||
virtual CPLErr SetColorTable( GDALColorTable * );
|
||||
virtual CPLErr SetColorInterpretation( GDALColorInterp );
|
||||
|
||||
virtual char **GetCategoryNames();
|
||||
virtual CPLErr SetCategoryNames( char ** );
|
||||
|
||||
virtual CPLErr FlushCache();
|
||||
|
||||
virtual CPLVirtualMem *GetVirtualMemAuto( GDALRWFlag eRWFlag,
|
||||
int *pnPixelSpace,
|
||||
GIntBig *pnLineSpace,
|
||||
char **papszOptions );
|
||||
|
||||
CPLErr AccessLine( int iLine );
|
||||
|
||||
void SetAccess( GDALAccess eAccess );
|
||||
|
||||
// this is deprecated.
|
||||
void StoreNoDataValue( double );
|
||||
|
||||
// Query methods for internal data.
|
||||
vsi_l_offset GetImgOffset() { return nImgOffset; }
|
||||
int GetPixelOffset() { return nPixelOffset; }
|
||||
int GetLineOffset() { return nLineOffset; }
|
||||
int GetNativeOrder() { return bNativeOrder; }
|
||||
int GetIsVSIL() { return bIsVSIL; }
|
||||
FILE *GetFP() { return (bIsVSIL) ? reinterpret_cast<FILE *>( fpRawL ) : fpRaw; }
|
||||
VSILFILE *GetFPL() { CPLAssert(bIsVSIL); return fpRawL; }
|
||||
int GetOwnsFP() { return bOwnsFP; }
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(RawRasterBand);
|
||||
};
|
||||
|
||||
#endif // GDAL_FRMTS_RAW_RAWDATASET_H_INCLUDED
|
||||
@@ -21,14 +21,22 @@
|
||||
#ifndef SWQ_H_INCLUDED_
|
||||
#define SWQ_H_INCLUDED_
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#include "cpl_conv.h"
|
||||
#include "cpl_string.h"
|
||||
#include "ogr_core.h"
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
#if defined(_WIN32) && !defined(strcasecmp)
|
||||
# define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
// Used for swq_summary.oSetDistinctValues and oVectorDistinctValues
|
||||
#define SZ_OGR_NULL "__OGR_NULL__"
|
||||
|
||||
typedef enum {
|
||||
SWQ_OR,
|
||||
SWQ_AND,
|
||||
@@ -84,7 +92,6 @@ typedef enum {
|
||||
SNT_OPERATION
|
||||
} swq_node_type;
|
||||
|
||||
|
||||
class swq_field_list;
|
||||
class swq_expr_node;
|
||||
class swq_select;
|
||||
@@ -113,6 +120,7 @@ public:
|
||||
~swq_expr_node();
|
||||
|
||||
void Initialize();
|
||||
void MarkAsTimestamp();
|
||||
CPLString UnparseOperationFromUnparsedSubExpr(char** apszSubExpr);
|
||||
char *Unparse( swq_field_list *, char chColumnQuote );
|
||||
void Dump( FILE *fp, int depth );
|
||||
@@ -174,7 +182,6 @@ class swq_custom_func_registrar
|
||||
virtual const swq_operation *GetOperator( const char * ) = 0;
|
||||
};
|
||||
|
||||
|
||||
typedef struct {
|
||||
char *data_source;
|
||||
char *table_name;
|
||||
@@ -283,16 +290,30 @@ typedef struct {
|
||||
swq_expr_node *expr;
|
||||
} swq_col_def;
|
||||
|
||||
typedef struct {
|
||||
class swq_summary {
|
||||
public:
|
||||
struct Comparator
|
||||
{
|
||||
bool bSortAsc;
|
||||
swq_field_type eType;
|
||||
|
||||
Comparator() : bSortAsc(true), eType(SWQ_STRING) {}
|
||||
|
||||
bool operator() (const CPLString&, const CPLString &) const;
|
||||
};
|
||||
|
||||
GIntBig count;
|
||||
|
||||
char **distinct_list; /* items of the list can be NULL */
|
||||
std::vector<CPLString> oVectorDistinctValues;
|
||||
std::set<CPLString, Comparator> oSetDistinctValues;
|
||||
double sum;
|
||||
double min;
|
||||
double max;
|
||||
char szMin[32];
|
||||
char szMax[32];
|
||||
} swq_summary;
|
||||
CPLString osMin;
|
||||
CPLString osMax;
|
||||
|
||||
swq_summary() : count(0), sum(0.0), min(0.0), max(0.0) {}
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
char *table_name;
|
||||
@@ -341,7 +362,7 @@ public:
|
||||
int distinct_flag = FALSE );
|
||||
int result_columns;
|
||||
swq_col_def *column_defs;
|
||||
swq_summary *column_summary;
|
||||
std::vector<swq_summary> column_summary;
|
||||
|
||||
int PushTableDef( const char *pszDataSource,
|
||||
const char *pszTableName,
|
||||
@@ -359,6 +380,12 @@ public:
|
||||
int order_specs;
|
||||
swq_order_def *order_defs;
|
||||
|
||||
void SetLimit( GIntBig nLimit );
|
||||
GIntBig limit;
|
||||
|
||||
void SetOffset( GIntBig nOffset );
|
||||
GIntBig offset;
|
||||
|
||||
swq_select *poOtherSelect;
|
||||
void PushUnionAll( swq_select* poOtherSelectIn );
|
||||
|
||||
@@ -377,7 +404,6 @@ CPLErr swq_select_parse( swq_select *select_info,
|
||||
swq_field_list *field_list,
|
||||
int parse_flags );
|
||||
|
||||
const char *swq_select_finish_summarize( swq_select *select_info );
|
||||
const char *swq_select_summarize( swq_select *select_info,
|
||||
int dest_column,
|
||||
const char *value );
|
||||
@@ -386,4 +412,6 @@ int swq_is_reserved_keyword(const char* pszStr);
|
||||
|
||||
char* OGRHStoreGetValue(const char* pszHStore, const char* pszSearchedKey);
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* def SWQ_H_INCLUDED_ */
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
/* A Bison parser, made by GNU Bison 3.0.4. */
|
||||
|
||||
/* Bison interface for Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
|
||||
|
||||
This program 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* As a special exception, you may create a larger work that contains
|
||||
part or all of the Bison parser skeleton and distribute that work
|
||||
under terms of your choice, so long as that work isn't itself a
|
||||
parser generator using the skeleton or a modified version thereof
|
||||
as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
the parser skeleton itself, you may (at your option) remove this
|
||||
special exception, which will cause the skeleton and the resulting
|
||||
Bison output files to be licensed under the GNU General Public
|
||||
License without this special exception.
|
||||
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
#ifndef YY_SWQ_SWQ_PARSER_HPP_INCLUDED
|
||||
# define YY_SWQ_SWQ_PARSER_HPP_INCLUDED
|
||||
/* Debug traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG 0
|
||||
#endif
|
||||
#if YYDEBUG
|
||||
extern int swqdebug;
|
||||
#endif
|
||||
|
||||
/* Token type. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
enum yytokentype
|
||||
{
|
||||
END = 0,
|
||||
SWQT_INTEGER_NUMBER = 258,
|
||||
SWQT_FLOAT_NUMBER = 259,
|
||||
SWQT_STRING = 260,
|
||||
SWQT_IDENTIFIER = 261,
|
||||
SWQT_IN = 262,
|
||||
SWQT_LIKE = 263,
|
||||
SWQT_ESCAPE = 264,
|
||||
SWQT_BETWEEN = 265,
|
||||
SWQT_NULL = 266,
|
||||
SWQT_IS = 267,
|
||||
SWQT_SELECT = 268,
|
||||
SWQT_LEFT = 269,
|
||||
SWQT_JOIN = 270,
|
||||
SWQT_WHERE = 271,
|
||||
SWQT_ON = 272,
|
||||
SWQT_ORDER = 273,
|
||||
SWQT_BY = 274,
|
||||
SWQT_FROM = 275,
|
||||
SWQT_AS = 276,
|
||||
SWQT_ASC = 277,
|
||||
SWQT_DESC = 278,
|
||||
SWQT_DISTINCT = 279,
|
||||
SWQT_CAST = 280,
|
||||
SWQT_UNION = 281,
|
||||
SWQT_ALL = 282,
|
||||
SWQT_LIMIT = 283,
|
||||
SWQT_OFFSET = 284,
|
||||
SWQT_VALUE_START = 285,
|
||||
SWQT_SELECT_START = 286,
|
||||
SWQT_NOT = 287,
|
||||
SWQT_OR = 288,
|
||||
SWQT_AND = 289,
|
||||
SWQT_UMINUS = 290,
|
||||
SWQT_RESERVED_KEYWORD = 291
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Value type. */
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef int YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
int swqparse (swq_parse_context *context);
|
||||
|
||||
#endif /* !YY_SWQ_SWQ_PARSER_HPP_INCLUDED */
|
||||
@@ -1,188 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id: thinplatespline.h 33715 2016-03-13 08:52:06Z goatbar $
|
||||
*
|
||||
* Project: GDAL Warp API
|
||||
* Purpose: Declarations for 2D Thin Plate Spline transformer.
|
||||
* Author: VIZRT Development Team.
|
||||
*
|
||||
* This code was provided by Gilad Ronnen (gro at visrt dot com) with
|
||||
* permission to reuse under the following license.
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2004, VIZRT Inc.
|
||||
*
|
||||
* 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.
|
||||
****************************************************************************/
|
||||
|
||||
#include "gdal_alg.h"
|
||||
#include "cpl_conv.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
VIZ_GEOREF_SPLINE_ZERO_POINTS,
|
||||
VIZ_GEOREF_SPLINE_ONE_POINT,
|
||||
VIZ_GEOREF_SPLINE_TWO_POINTS,
|
||||
VIZ_GEOREF_SPLINE_ONE_DIMENSIONAL,
|
||||
VIZ_GEOREF_SPLINE_FULL,
|
||||
|
||||
VIZ_GEOREF_SPLINE_POINT_WAS_ADDED,
|
||||
VIZ_GEOREF_SPLINE_POINT_WAS_DELETED
|
||||
|
||||
} vizGeorefInterType;
|
||||
|
||||
//#define VIZ_GEOREF_SPLINE_MAX_POINTS 40
|
||||
#define VIZGEOREF_MAX_VARS 2
|
||||
|
||||
class VizGeorefSpline2D
|
||||
{
|
||||
bool grow_points();
|
||||
|
||||
public:
|
||||
|
||||
VizGeorefSpline2D(int nof_vars = 1) :
|
||||
type(VIZ_GEOREF_SPLINE_ZERO_POINTS),
|
||||
_nof_vars(nof_vars),
|
||||
_nof_points(0),
|
||||
_max_nof_points(0),
|
||||
_nof_eqs(0),
|
||||
#if 0
|
||||
_tx(0.0),
|
||||
_ty(0.0),
|
||||
_ta(10.0),
|
||||
#endif
|
||||
_dx(0.0),
|
||||
_dy(0.0),
|
||||
x(NULL),
|
||||
y(NULL),
|
||||
u(NULL),
|
||||
unused(NULL),
|
||||
index(NULL)
|
||||
{
|
||||
for( int i = 0; i < VIZGEOREF_MAX_VARS; i++ )
|
||||
{
|
||||
rhs[i] = NULL;
|
||||
coef[i] = NULL;
|
||||
}
|
||||
|
||||
grow_points();
|
||||
}
|
||||
|
||||
~VizGeorefSpline2D() {
|
||||
CPLFree( x );
|
||||
CPLFree( y );
|
||||
CPLFree( u );
|
||||
CPLFree( unused );
|
||||
CPLFree( index );
|
||||
for( int i = 0; i < _nof_vars; i++ )
|
||||
{
|
||||
CPLFree( rhs[i] );
|
||||
CPLFree( coef[i] );
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
int get_nof_points(){
|
||||
return _nof_points;
|
||||
}
|
||||
|
||||
void set_toler( double tx, double ty ){
|
||||
_tx = tx;
|
||||
_ty = ty;
|
||||
}
|
||||
|
||||
void get_toler( double& tx, double& ty) {
|
||||
tx = _tx;
|
||||
ty = _ty;
|
||||
}
|
||||
|
||||
vizGeorefInterType get_interpolation_type ( ){
|
||||
return type;
|
||||
}
|
||||
|
||||
void dump_data_points()
|
||||
{
|
||||
for ( int i = 0; i < _nof_points; i++ )
|
||||
{
|
||||
fprintf(stderr, "X = %f Y = %f Vars = ", x[i], y[i]);
|
||||
for ( int v = 0; v < _nof_vars; v++ )
|
||||
fprintf(stderr, "%f ", rhs[v][i+3]);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
int delete_list()
|
||||
{
|
||||
_nof_points = 0;
|
||||
type = VIZ_GEOREF_SPLINE_ZERO_POINTS;
|
||||
if ( _AA )
|
||||
{
|
||||
CPLFree(_AA);
|
||||
_AA = NULL;
|
||||
}
|
||||
if ( _Ainv )
|
||||
{
|
||||
CPLFree(_Ainv);
|
||||
_Ainv = NULL;
|
||||
}
|
||||
return _nof_points;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool add_point( const double Px, const double Py, const double *Pvars );
|
||||
int get_point( const double Px, const double Py, double *Pvars );
|
||||
#if 0
|
||||
int delete_point(const double Px, const double Py );
|
||||
bool get_xy(int index, double& x, double& y);
|
||||
bool change_point(int index, double x, double y, double* Pvars);
|
||||
void reset(void) { _nof_points = 0; }
|
||||
#endif
|
||||
int solve(void);
|
||||
|
||||
private:
|
||||
|
||||
vizGeorefInterType type;
|
||||
|
||||
const int _nof_vars;
|
||||
int _nof_points;
|
||||
int _max_nof_points;
|
||||
int _nof_eqs;
|
||||
|
||||
#if 0
|
||||
// Disabled because the methods that use there is disabled.
|
||||
double _tx, _ty;
|
||||
double _ta;
|
||||
#endif
|
||||
|
||||
double _dx, _dy;
|
||||
|
||||
double *x; // [VIZ_GEOREF_SPLINE_MAX_POINTS+3];
|
||||
double *y; // [VIZ_GEOREF_SPLINE_MAX_POINTS+3];
|
||||
|
||||
// double rhs[VIZ_GEOREF_SPLINE_MAX_POINTS+3][VIZGEOREF_MAX_VARS];
|
||||
// double coef[VIZ_GEOREF_SPLINE_MAX_POINTS+3][VIZGEOREF_MAX_VARS];
|
||||
double *rhs[VIZGEOREF_MAX_VARS];
|
||||
double *coef[VIZGEOREF_MAX_VARS];
|
||||
|
||||
double *u; // [VIZ_GEOREF_SPLINE_MAX_POINTS];
|
||||
int *unused; // [VIZ_GEOREF_SPLINE_MAX_POINTS];
|
||||
int *index; // [VIZ_GEOREF_SPLINE_MAX_POINTS];
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(VizGeorefSpline2D);
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
Binary file not shown.
@@ -152,3 +152,6 @@
|
||||
7421,"NTF (Paris) / Lambert zone II + NGF-IGN69 height",27572,5720,1,0
|
||||
7422,"NTF (Paris) / Lambert zone III + NGF-IGN69 height",27573,5720,1,0
|
||||
7423,"ETRS89 + EVRF2007 height",4258,5621,1,0
|
||||
7954,"Astro DOS 71 / UTM zone 30S + Jamestown 1971 height",7878,7888,1,0
|
||||
7955,"St. Helena Tritan / UTM zone 30S + Tritan 2011 height",7883,7889,1,0
|
||||
7956,"SHMG2015 + SHVD2015 height",7887,7890,1,0
|
||||
|
||||
|
@@ -31,9 +31,21 @@ coord_sys_code,coord_axis_name_code,coord_axis_orientation,coord_axis_abbreviati
|
||||
1038,9907,South along 75°W,Y,9001,2
|
||||
1039,9906,east,E,9002,1
|
||||
1039,9907,north,N,9002,2
|
||||
1040,1024,Ahead,x,9001,1
|
||||
1040,1025,Starboard,y,9001,2
|
||||
1040,1026,Upward,z,9001,3
|
||||
1041,1024,Ahead,x,9001,1
|
||||
1041,1025,Starboard,y,9001,2
|
||||
1041,1027,Downward,z,9001,3
|
||||
1042,1024,Ahead,y,9001,2
|
||||
1042,1025,Starboard,x,9001,1
|
||||
1042,1026,Upward,z,9001,3
|
||||
1043,9905,down,D,9003,1
|
||||
1044,9906,North along 90°W,E,9001,2
|
||||
1044,9907,North along 180°E,N,9001,1
|
||||
1045,1024,Ahead,y,9001,2
|
||||
1045,1025,Starboard,x,9001,1
|
||||
1045,1027,Downward,z,9001,3
|
||||
4400,9906,east,E,9001,1
|
||||
4400,9907,north,N,9001,2
|
||||
4401,9906,east,E,9062,1
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1,5 +1,6 @@
|
||||
ellipsoid_code,ellipsoid_name,semi_major_axis,uom_code,inv_flattening,semi_minor_axis,ellipsoid_shape,remarks,information_source,data_source,revision_date,change_id,deprecated
|
||||
1024,CGCS2000,6378137,9001,298.257222101,,1,"Defining parameters semi-major axis, flattening and angular velocity are same as for GRS 1980 (ellipsoid code 7019); GM = 3986004.4e8 m*m*m/s/s (from NASA 1986 Lageos determination).",Chinese Academy of Surveying and Mapping.,OGP,2009/11/12,2009.084,0
|
||||
1025,GSK-2011,6378136.5,9001,298.2564151,,1,,"Parametry Zemli 1990 Reference Document, Military Topgraphic Department (VTU) of the General Staff of Armed Forces of the Russian Federation.",IOGP,2016/01/25,2015.055,0
|
||||
7001,Airy 1830,6377563.396,9001,299.3249646,,1,"Original definition is a=20923713, b=20853810 feet of 1796. 1/f is given to 7 decimal places. For the 1936 retriangulation OSGB defines the relationship of 10 feet of 1796 to the International metre through ([10^0.48401603]/10) exactly = 0.3048007491...",Ordnance Survey of Great Britain.,OGP,2006/11/27,1998.321 1998.340 2006.932,0
|
||||
7002,Airy Modified 1849,6377340.189,9001,299.3249646,,1,OSGB Airy 1830 figure (ellipsoid code 7001) rescaled by 0.999965 to best fit the scale of the 19th century primary triangulation of Ireland.,"""The Irish Grid - A Description of the Co-ordinate Reference System"" published by Ordnance Survey of Ireland, Dublin and Ordnance Survey of Northern Ireland, Belfast.",OGP,2003/06/27,1998.321 2002.622,0
|
||||
7003,Australian National Spheroid,6378160,9001,298.25,,1,Based on the GRS 1967 figure but with 1/f taken to 2 decimal places exactly. The dimensions are also used as the GRS 1967 Modified ellipsoid (see code 7050).,"""Australian Map Grid Technical Manual""; National Mapping Council of Australia Special Publication #7; 1972",OGP,2008/08/11,2002.500 2008.017,0
|
||||
@@ -46,7 +47,7 @@ ellipsoid_code,ellipsoid_name,semi_major_axis,uom_code,inv_flattening,semi_minor
|
||||
7051,Danish 1876,6377019.27,9001,300,,1,Semi-major axis originally given as 3271883.25 toise. Uses toise to French metre ratio of 1.94903631 to two decimal place precision. An alternative ratio with the German legal metre of 1.9490622 giving 6377104m has not been used in Danish work.,"Kort og Matrikelstyrelsen (KMS), Copenhagen.",OGP,2003/06/27,,0
|
||||
7052,Clarke 1866 Authalic Sphere,6370997,9001,,6370997,0,Authalic sphere derived from Clarke 1866 ellipsoid (code 7008).,OGP,OGP,2004/04/27,,0
|
||||
7053,Hough 1960,6378270,9001,297,,1,,DMA / NIMA / NGA TR8350.2,OGP,2006/01/26,,0
|
||||
7054,PZ-90,6378136,9001,298.257839303,,1,,"Geodeziya i Katografiya, 1993.",OGP,2006/02/03,,0
|
||||
7054,PZ-90,6378136,9001,298.257839303,,1,"Earth's angular velocity ? = 7.292115e-5 rad/sec; gravitational constant GM = 3986004.418e8 m*m*m/s/s.","Parametry Zemli 1990 Reference Document, Military Topgraphic Department (VTU) of the General Staff of Armed Forces of the Russian Federation.",IOGP,2016/12/15,2015.055,0
|
||||
7055,Clarke 1880 (international foot),20926202,9002,,20854895,1,Clark'es 1880 definition in feet assumed for the purposes of metric conversion to be international foot. a = 6378306.370…metres. 1/f derived from a and b = 293.4663077… Used in Fiji.,"Department of Lands and Survey, Fiji.",OGP,2006/07/14,,0
|
||||
7056,Everest 1830 (RSO 1969),6377295.664,9001,300.8017,,1,Adopted for 1969 metrication of peninsula Malaysia RSO grid. Uses Sears 1922 yard-metre ratio truncated to 6 significant figures applied to Everest 1830 original definition of a and 1/f but with a taken to be in British rather than Indian feet.,Defence Geographic Centre,OGP,2006/07/24,,0
|
||||
7057,International 1924 Authalic Sphere,6371228,9001,,6371228,0,Authalic sphere derived from International 1924 ellipsoid (code 7022).,OGP,OGP,2006/09/22,,0
|
||||
|
||||
|
@@ -80,7 +80,7 @@
|
||||
4146,Kalianpur 1975,6146,Kalianpur 1975,6146,9122,7045,8901,1,0,6422,1156,0,9603,295,736,257,,,,
|
||||
4147,Hanoi 1972,6147,Hanoi 1972,6147,9122,7024,8901,1,0,6422,1544,0,9603,-17.51,-108.32,-62.39,,,,
|
||||
4148,Hartebeesthoek94,6148,Hartebeesthoek94,6148,9122,7030,8901,1,0,6422,1505,0,9603,0,0,0,,,,
|
||||
4149,CH1903,6149,CH1903,6149,9122,7004,8901,1,0,6422,1766,1,9603,674.4,15.1,405.3,,,,
|
||||
4149,CH1903,6149,CH1903,6149,9122,7004,8901,1,0,6422,1510,1,9603,674.374,15.056,405.346,,,,
|
||||
4150,"CH1903+",6150,"CH1903+",6150,9122,7004,8901,1,0,6422,1676,0,9603,674.374,15.056,405.346,,,,
|
||||
4151,CHTRF95,6151,Swiss Terrestrial Reference Frame 1995,6151,9122,7019,8901,1,0,6422,1511,0,9603,0,0,0,,,,
|
||||
4152,"NAD83(HARN)",6152,"NAD83 (High Accuracy Reference Network)",6152,9122,7019,8901,1,0,6422,1580,1,9603,0,0,0,,,,
|
||||
@@ -119,7 +119,7 @@
|
||||
4188,OSNI 1952,6188,OSNI 1952,6188,9122,7001,8901,1,0,6422,1955,0,9606,482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15
|
||||
4189,REGVEN,6189,Red Geodesica Venezolana,6189,9122,7019,8901,1,0,6422,1768,0,9603,0,0,0,,,,
|
||||
4190,POSGAR 98,6190,Posiciones Geodesicas Argentinas 1998,6190,9122,7019,8901,1,0,6422,1773,1,9603,0,0,0,,,,
|
||||
4191,Albanian 1987,6191,Albanian 1987,6191,9122,7024,8901,1,0,6422,6964,0,9607,-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703
|
||||
4191,Albanian 1987,6191,Albanian 1987,6191,9122,7024,8901,1,0,6422,7834,1,9607,-44.183,-0.58,-38.489,-2.3867,-2.7072,3.5196,-8.2703
|
||||
4192,Douala 1948,6192,Douala 1948,6192,9122,7022,8901,1,0,6422,15873,0,9603,-206.1,-174.7,-87.7,,,,
|
||||
4193,Manoca 1962,6193,Manoca 1962,6193,9122,7011,8901,1,0,6422,1796,0,9603,-70.9,-151.8,-41.4,,,,
|
||||
4194,Qornoq 1927,6194,Qornoq 1927,6194,9122,7022,8901,1,0,6422,1797,1,9603,164,138,-189,,,,
|
||||
@@ -216,7 +216,7 @@
|
||||
4286,Qatar 1948,6286,Qatar 1948,6286,9122,7020,8901,1,0,6422,,0,,,,,,,,
|
||||
4287,Qornoq,6287,Qornoq,6287,9108,7022,8901,1,1,6402,1211,0,9603,164,138,-189,,,,
|
||||
4288,Loma Quintana,6288,Loma Quintana,6288,9122,7022,8901,1,0,6422,,0,,,,,,,,
|
||||
4289,Amersfoort,6289,Amersfoort,6289,9122,7004,8901,1,0,6422,4833,1,9607,565.4171,50.3319,465.5524,0.398957,-0.343988,1.87740,4.0725
|
||||
4289,Amersfoort,6289,Amersfoort,6289,9122,7004,8901,1,0,6422,15934,1,9607,565.2369,50.0087,465.658,0.406857,-0.350733,1.87035,4.0812
|
||||
4291,SAD69,6291,South American Datum 1969,6291,9108,7036,8901,1,1,6402,1212,1,9603,-57,1,-41,,,,
|
||||
4292,Sapper Hill 1943,6292,Sapper Hill 1943,6292,9122,7022,8901,1,0,6422,1225,0,9603,-355,21,72,,,,
|
||||
4293,Schwarzeck,6293,Schwarzeck,6293,9122,7046,8901,1,0,6422,1226,1,9603,616,97,-251,,,,
|
||||
@@ -355,7 +355,7 @@
|
||||
4707,Tern Island 1961,6707,Tern Island 1961,6707,9122,7022,8901,1,0,6422,15795,0,9603,114,-116,-333,,,,
|
||||
4708,Cocos Islands 1965,6708,Cocos Islands 1965,6708,9122,7003,8901,1,0,6422,15794,0,9603,-491,-22,435,,,,
|
||||
4709,Iwo Jima 1945,6709,Iwo Jima 1945,6709,9122,7022,8901,1,0,6422,15796,0,9603,145,75,-272,,,,
|
||||
4710,St. Helena 1971,6710,St. Helena 1971,6710,9122,7022,8901,1,0,6422,15798,0,9603,-320,550,-494,,,,
|
||||
4710,Astro DOS 71,6710,Astro DOS 71,6710,9122,7022,8901,1,0,6422,15798,1,9603,-320,550,-494,,,,
|
||||
4711,Marcus Island 1952,6711,Marcus Island 1952,6711,9122,7022,8901,1,0,6422,15799,0,9603,124,-234,-25,,,,
|
||||
4712,Ascension Island 1958,6712,Ascension Island 1958,6712,9122,7022,8901,1,0,6422,15797,0,9603,-205,107,53,,,,
|
||||
4713,Ayabelle Lighthouse,6713,Ayabelle Lighthouse,6713,9122,7012,8901,1,0,6422,6907,1,9603,-77,-128,142,,,,
|
||||
@@ -385,7 +385,7 @@
|
||||
4737,Korea 2000,6737,Geocentric datum of Korea,6737,9122,7019,8901,1,0,6422,15831,0,9603,0,0,0,,,,
|
||||
4738,Hong Kong 1963,6738,Hong Kong 1963,6738,9122,7007,8901,1,0,6422,,0,,,,,,,,
|
||||
4739,"Hong Kong 1963(67)",6739,"Hong Kong 1963(67)",6739,9122,7022,8901,1,0,6422,15842,0,9603,-156,-271,-189,,,,
|
||||
4740,PZ-90,6740,Parametrop Zemp 1990,6740,9122,7054,8901,1,0,6422,15843,1,9607,0,0,1.5,0,0,-0.076,0
|
||||
4740,PZ-90,6740,Parametry Zemli 1990,6740,9122,7054,8901,1,0,6422,15843,1,9607,0,0,1.5,0,0,-0.076,0
|
||||
4741,FD54,6741,Faroe Datum 1954,6741,9122,7022,8901,1,0,6422,,0,,,,,,,,
|
||||
4742,GDM2000,6742,Geodetic Datum of Malaysia 2000,6742,9122,7019,8901,1,0,6422,,0,,,,,,,,
|
||||
4743,Karbala 1979,6743,Karbala 1979,6743,9122,7012,8901,1,0,6422,5078,1,9603,70.995,-335.916,262.898,,,,
|
||||
@@ -411,7 +411,7 @@
|
||||
4763,Pitcairn 2006,6763,Pitcairn 2006,6763,9122,7030,8901,1,0,6422,15972,0,9603,0,0,0,,,,
|
||||
4764,RSRGD2000,6764,Ross Sea Region Geodetic Datum 2000,6764,9122,7019,8901,1,0,6422,15974,0,9603,0,0,0,,,,
|
||||
4765,Slovenia 1996,6765,Slovenia Geodetic Datum 1996,6765,9122,7019,8901,1,0,6422,15976,0,9603,0,0,0,,,,
|
||||
4801,"Bern 1898 (Bern)",6801,"CH1903 (Bern)",6149,9122,7004,8907,1,0,6422,1766,1,9603,674.4,15.1,405.3,,,,
|
||||
4801,"Bern 1898 (Bern)",6801,"CH1903 (Bern)",6149,9122,7004,8907,1,0,6422,1510,1,9603,674.374,15.056,405.346,,,,
|
||||
4802,"Bogota 1975 (Bogota)",6802,"Bogota 1975 (Bogota)",6218,9122,7022,8904,1,0,6422,1125,1,9603,307,304,-318,,,,
|
||||
4803,"Lisbon (Lisbon)",6803,"Lisbon 1937 (Lisbon)",6207,9122,7022,8902,1,0,6422,1984,1,9603,-304.046,-60.576,103.64,,,,
|
||||
4804,"Makassar (Jakarta)",6804,"Makassar (Jakarta)",6257,9122,7004,8908,1,0,6422,1837,0,9603,-587.8,519.75,145.76,,,,
|
||||
@@ -447,7 +447,7 @@
|
||||
5264,DRUKREF 03,1058,Bhutan National Geodetic Datum,1058,9122,7019,8901,1,0,6422,5267,0,9603,0,0,0,,,,
|
||||
5324,ISN2004,1060,Islands Net 2004,1060,9122,7019,8901,1,0,6422,5327,0,9603,0,0,0,,,,
|
||||
5340,POSGAR 2007,1062,Posiciones Geodesicas Argentinas 2007,1062,9122,7019,8901,1,0,6422,5351,0,9603,0,0,0,,,,
|
||||
5354,MARGEN,1063,Marco Geodesico Nacional,1063,9122,7019,8901,1,0,6422,5374,0,9603,0,0,0,,,,
|
||||
5354,MARGEN,1063,Marco Geodesico Nacional de Bolivia,1063,9122,7019,8901,1,0,6422,5374,0,9603,0,0,0,,,,
|
||||
5360,SIRGAS-Chile,1064,SIRGAS-Chile,1064,9122,7019,8901,1,0,6422,5375,0,9603,0,0,0,,,,
|
||||
5365,CR05,1065,Costa Rica 2005,1065,9122,7030,8901,1,0,6422,5376,0,9603,0,0,0,,,,
|
||||
5371,MACARIO SOLIS,1066,Sistema Geodesico Nacional de Panama MACARIO SOLIS,1066,9122,7019,8901,1,0,6422,5377,0,9603,0,0,0,,,,
|
||||
@@ -467,7 +467,7 @@
|
||||
5886,TGD2005,1095,Tonga Geodetic Datum 2005,1095,9122,7019,8901,1,0,6422,,0,,,,,,,,
|
||||
6135,CIGD11,1100,Cayman Islands Geodetic Datum 2011,1100,9122,7019,8901,1,0,6422,6177,0,9603,0,0,0,,,,
|
||||
6207,Nepal 1981,1111,Nepal 1981,1111,9122,7015,8901,1,0,6422,6208,0,9603,293.17,726.18,245.36,,,,
|
||||
6311,CGRS93,1112,Cyprus Geodetic Reference System 1993,1112,9122,7030,8901,1,0,6422,7445,0,9606,8.846,-4.394,-1.122,0.00237,0.146528,-0.130428,0.783926
|
||||
6311,CGRS93,1112,Cyprus Geodetic Reference System 1993,1112,9122,7030,8901,1,0,6422,7721,1,9607,8.846,-4.394,-1.122,0.00237,0.146528,-0.130428,0.783926
|
||||
6318,"NAD83(2011)",1116,"NAD83 (National Spatial Reference System 2011)",1116,9122,7019,8901,1,0,6422,,0,,,,,,,,
|
||||
6322,"NAD83(PA11)",1117,"NAD83 (National Spatial Reference System PA11)",1117,9122,7019,8901,1,0,6422,,0,,,,,,,,
|
||||
6325,"NAD83(MA11)",1118,"NAD83 (National Spatial Reference System MA11)",1118,9122,7019,8901,1,0,6422,,0,,,,,,,,
|
||||
@@ -496,3 +496,9 @@
|
||||
7136,IGD05,1114,Israeli Geodetic Datum 2005,1114,9122,7030,8901,1,0,6422,,0,,,,,,,,
|
||||
7139,"IGD05/12",1115,"Israeli Geodetic Datum 2005(2012)",1115,9122,7030,8901,1,0,6422,,0,,,,,,,,
|
||||
7373,ONGD14,1147,Oman National Geodetic Datum 2014,1147,9122,7019,8901,1,0,6422,7443,0,9603,0,0,0,,,,
|
||||
7683,GSK-2011,1159,Geodezicheskaya Sistema Koordinat 2011,1159,9122,1025,8901,1,0,6422,,0,,,,,,,,
|
||||
7686,Kyrg-06,1160,Kyrgyzstan Geodetic Datum 2006,1160,9122,7019,8901,1,0,6422,,0,,,,,,,,
|
||||
7798,BGS2005,1167,Bulgaria Geodetic System 2005,1167,9122,7019,8901,1,0,6422,,0,,,,,,,,
|
||||
7844,GDA2020,1168,Geocentric Datum of Australia 2020,1168,9122,7019,8901,1,0,6422,,0,,,,,,,,
|
||||
7881,St. Helena Tritan,1173,St. Helena Tritan,1173,9122,7030,8901,1,0,6422,7898,0,9603,-0.077,0.079,0.086,,,,
|
||||
7886,SHGD2015,1174,St. Helena Geodetic Datum 2015,1174,9122,7019,8901,1,0,6422,7892,0,9603,0,0,0,,,,
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user