From 6ff6ff1aceda55eed947647d786e5c4b60653c6a Mon Sep 17 00:00:00 2001 From: Kalle Bladin Date: Tue, 19 Apr 2016 18:42:25 -0400 Subject: [PATCH] Smallest patch of clipmap is rendered separately. --- .../ext/gdal/include/cpl_atomic_ops.h | 106 ++ .../globebrowsing/ext/gdal/include/cpl_aws.h | 136 ++ .../ext/gdal/include/cpl_config.h | 121 ++ .../ext/gdal/include/cpl_config_extras.h | 40 + .../globebrowsing/ext/gdal/include/cpl_conv.h | 307 ++++ .../globebrowsing/ext/gdal/include/cpl_csv.h | 76 + .../ext/gdal/include/cpl_error.h | 179 +++ .../ext/gdal/include/cpl_hash_set.h | 94 ++ .../globebrowsing/ext/gdal/include/cpl_http.h | 105 ++ .../globebrowsing/ext/gdal/include/cpl_list.h | 72 + .../ext/gdal/include/cpl_minixml.h | 181 +++ .../ext/gdal/include/cpl_minizip_ioapi.h | 82 + .../ext/gdal/include/cpl_minizip_unzip.h | 381 +++++ .../ext/gdal/include/cpl_minizip_zip.h | 259 +++ .../ext/gdal/include/cpl_multiproc.h | 234 +++ .../globebrowsing/ext/gdal/include/cpl_odbc.h | 281 ++++ .../globebrowsing/ext/gdal/include/cpl_port.h | 974 +++++++++++ .../ext/gdal/include/cpl_progress.h | 47 + .../ext/gdal/include/cpl_quad_tree.h | 100 ++ .../ext/gdal/include/cpl_sha256.h | 68 + .../ext/gdal/include/cpl_spawn.h | 78 + .../ext/gdal/include/cpl_string.h | 433 +++++ .../globebrowsing/ext/gdal/include/cpl_time.h | 41 + .../ext/gdal/include/cpl_virtualmem.h | 390 +++++ .../globebrowsing/ext/gdal/include/cpl_vsi.h | 311 ++++ .../ext/gdal/include/cpl_vsi_error.h | 67 + .../ext/gdal/include/cpl_vsi_virtual.h | 208 +++ .../ext/gdal/include/cpl_vsil_curl_priv.h | 49 + .../ext/gdal/include/cpl_worker_thread_pool.h | 103 ++ .../ext/gdal/include/cplkeywordparser.h | 66 + modules/globebrowsing/ext/gdal/include/gdal.h | 1153 +++++++++++++ .../globebrowsing/ext/gdal/include/gdal_alg.h | 603 +++++++ .../ext/gdal/include/gdal_alg_priv.h | 209 +++ .../globebrowsing/ext/gdal/include/gdal_csv.h | 41 + .../ext/gdal/include/gdal_frmts.h | 191 +++ .../ext/gdal/include/gdal_mdreader.h | 207 +++ .../globebrowsing/ext/gdal/include/gdal_pam.h | 324 ++++ .../ext/gdal/include/gdal_priv.h | 1423 +++++++++++++++++ .../ext/gdal/include/gdal_proxy.h | 396 +++++ .../globebrowsing/ext/gdal/include/gdal_rat.h | 362 +++++ .../ext/gdal/include/gdal_simplesurf.h | 554 +++++++ .../ext/gdal/include/gdal_utils.h | 214 +++ .../ext/gdal/include/gdal_version.h | 29 + .../globebrowsing/ext/gdal/include/gdal_vrt.h | 104 ++ .../globebrowsing/ext/gdal/include/gdalexif.h | 235 +++ .../ext/gdal/include/gdalgeorefpamdataset.h | 57 + .../globebrowsing/ext/gdal/include/gdalgrid.h | 137 ++ .../ext/gdal/include/gdalgrid_priv.h | 106 ++ .../ext/gdal/include/gdaljp2abstractdataset.h | 60 + .../ext/gdal/include/gdaljp2metadata.h | 196 +++ .../gdal/include/gdaljp2metadatagenerator.h | 40 + .../ext/gdal/include/gdalpansharpen.h | 270 ++++ .../ext/gdal/include/gdalsse_priv.h | 855 ++++++++++ .../ext/gdal/include/gdalwarper.h | 459 ++++++ .../ext/gdal/include/gdalwarpkernel_opencl.h | 197 +++ .../globebrowsing/ext/gdal/include/gvgcpfit.h | 94 ++ .../ext/gdal/include/internal_qhull_headers.h | 1006 ++++++++++++ .../ext/gdal/include/memdataset.h | 184 +++ .../globebrowsing/ext/gdal/include/ogr_api.h | 655 ++++++++ .../ext/gdal/include/ogr_attrind.h | 93 ++ .../globebrowsing/ext/gdal/include/ogr_core.h | 910 +++++++++++ .../ext/gdal/include/ogr_expat.h | 58 + .../ext/gdal/include/ogr_feature.h | 490 ++++++ .../ext/gdal/include/ogr_featurestyle.h | 466 ++++++ .../ext/gdal/include/ogr_geocoding.h | 63 + .../ext/gdal/include/ogr_geometry.h | 1400 ++++++++++++++++ .../globebrowsing/ext/gdal/include/ogr_geos.h | 49 + .../globebrowsing/ext/gdal/include/ogr_p.h | 182 +++ .../ext/gdal/include/ogr_spatialref.h | 636 ++++++++ .../ext/gdal/include/ogr_srs_api.h | 791 +++++++++ .../ext/gdal/include/ogr_srs_esri_names.h | 717 +++++++++ .../ext/gdal/include/ograpispy.h | 173 ++ .../ext/gdal/include/ogrgeomediageometry.h | 43 + .../ext/gdal/include/ogrpgeogeometry.h | 96 ++ .../ext/gdal/include/ogrsf_frmts.h | 427 +++++ .../ext/gdal/include/osr_cs_wkt.h | 55 + .../ext/gdal/include/osr_cs_wkt_parser.h | 89 ++ .../ext/gdal/include/rawdataset.h | 179 +++ modules/globebrowsing/ext/gdal/include/swq.h | 389 +++++ .../ext/gdal/include/thinplatespline.h | 188 +++ .../ext/gdal/include/vrtdataset.h | 1052 ++++++++++++ .../globebrowsing/ext/gdal/lib/gdal201.dll | Bin 0 -> 12026880 bytes modules/globebrowsing/ext/gdal/lib/gdal_i.lib | Bin 0 -> 1550046 bytes .../globebrowsing/rendering/clipmapglobe.cpp | 14 +- .../globebrowsing/rendering/clipmapglobe.h | 1 + .../globebrowsing/rendering/patchrenderer.cpp | 4 +- .../globebrowsing/rendering/patchrenderer.h | 2 +- .../rendering/renderableglobe.cpp | 4 +- .../globebrowsing/rendering/texturetileset.h | 2 +- 89 files changed, 24515 insertions(+), 8 deletions(-) create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_atomic_ops.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_aws.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_config.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_config_extras.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_conv.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_csv.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_error.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_hash_set.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_http.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_list.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_minixml.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_minizip_ioapi.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_minizip_unzip.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_minizip_zip.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_multiproc.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_odbc.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_port.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_progress.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_quad_tree.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_sha256.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_spawn.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_string.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_time.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_virtualmem.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_vsi.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_vsi_error.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_vsi_virtual.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_vsil_curl_priv.h create mode 100644 modules/globebrowsing/ext/gdal/include/cpl_worker_thread_pool.h create mode 100644 modules/globebrowsing/ext/gdal/include/cplkeywordparser.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdal.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdal_alg.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdal_alg_priv.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdal_csv.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdal_frmts.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdal_mdreader.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdal_pam.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdal_priv.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdal_proxy.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdal_rat.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdal_simplesurf.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdal_utils.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdal_version.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdal_vrt.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdalexif.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdalgeorefpamdataset.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdalgrid.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdalgrid_priv.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdaljp2abstractdataset.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdaljp2metadata.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdaljp2metadatagenerator.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdalpansharpen.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdalsse_priv.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdalwarper.h create mode 100644 modules/globebrowsing/ext/gdal/include/gdalwarpkernel_opencl.h create mode 100644 modules/globebrowsing/ext/gdal/include/gvgcpfit.h create mode 100644 modules/globebrowsing/ext/gdal/include/internal_qhull_headers.h create mode 100644 modules/globebrowsing/ext/gdal/include/memdataset.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogr_api.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogr_attrind.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogr_core.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogr_expat.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogr_feature.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogr_featurestyle.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogr_geocoding.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogr_geometry.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogr_geos.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogr_p.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogr_spatialref.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogr_srs_api.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogr_srs_esri_names.h create mode 100644 modules/globebrowsing/ext/gdal/include/ograpispy.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogrgeomediageometry.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogrpgeogeometry.h create mode 100644 modules/globebrowsing/ext/gdal/include/ogrsf_frmts.h create mode 100644 modules/globebrowsing/ext/gdal/include/osr_cs_wkt.h create mode 100644 modules/globebrowsing/ext/gdal/include/osr_cs_wkt_parser.h create mode 100644 modules/globebrowsing/ext/gdal/include/rawdataset.h create mode 100644 modules/globebrowsing/ext/gdal/include/swq.h create mode 100644 modules/globebrowsing/ext/gdal/include/thinplatespline.h create mode 100644 modules/globebrowsing/ext/gdal/include/vrtdataset.h create mode 100644 modules/globebrowsing/ext/gdal/lib/gdal201.dll create mode 100644 modules/globebrowsing/ext/gdal/lib/gdal_i.lib diff --git a/modules/globebrowsing/ext/gdal/include/cpl_atomic_ops.h b/modules/globebrowsing/ext/gdal/include/cpl_atomic_ops.h new file mode 100644 index 0000000000..ed3eadaec9 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_atomic_ops.h @@ -0,0 +1,106 @@ +/********************************************************************** + * $Id$ + * + * Name: cpl_atomic_ops.h + * Project: CPL - Common Portability Library + * Purpose: Atomic operation functions. + * Author: Even Rouault, + * + ********************************************************************** + * Copyright (c) 2009-2010, Even Rouault + * + * 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_ATOMIC_OPS_INCLUDED +#define CPL_ATOMIC_OPS_INCLUDED + +#include "cpl_port.h" + +CPL_C_START + +/** Add a value to a pointed integer in a thread and SMP-safe way + * and return the resulting value of the operation. + * + * This function, which in most cases is implemented by a few + * efficient machine instructions, guarantees that the value pointed + * by ptr will be incremented in a thread and SMP-safe way. + * The variables for this function must be aligned on a 32-bit boundary. + * + * Depending on the platforms, this function can also act as a + * memory barrier, but this should not be assumed. + * + * Current platforms/architectures where an efficient implementation + * exists are MacOSX, MS Windows, i386/x86_64 with GCC and platforms + * 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... + * + * @param ptr a pointer to an integer to increment + * @param increment the amount to add to the pointed integer + * @return the pointed value AFTER the result of the addition + */ +int CPL_DLL CPLAtomicAdd(volatile int* ptr, int increment); + +/** Increment of 1 the pointed integer in a thread and SMP-safe way + * and return the resulting value of the operation. + * + * @see CPLAtomicAdd for the details and guarantees of this atomic + * operation + * + * @param ptr a pointer to an integer to increment + * @return the pointed value AFTER the operation: *ptr + 1 + */ +#define CPLAtomicInc(ptr) CPLAtomicAdd(ptr, 1) + +/** Decrement of 1 the pointed integer in a thread and SMP-safe way + * and return the resulting value of the operation. + * + * @see CPLAtomicAdd for the details and guarantees of this atomic + * operation + * + * @param ptr a pointer to an integer to decrement + * @return the pointed value AFTER the operation: *ptr - 1 + */ +#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. + * + * Current platforms/architectures where an efficient implementation + * exists are MacOSX, MS Windows, i386/x86_64 with GCC and platforms + * 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... + * + * @param ptr a pointer to an integer (aligned on 32bit boundary). + * @param oldval old value + * @param newval new value + * @return TRUE if the exchange has been done + */ +int CPLAtomicCompareAndExchange(volatile int* ptr, int oldval, int newval); + +CPL_C_END + +#endif /* CPL_ATOMIC_OPS_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_aws.h b/modules/globebrowsing/ext/gdal/include/cpl_aws.h new file mode 100644 index 0000000000..3d968ba750 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_aws.h @@ -0,0 +1,136 @@ +/********************************************************************** + * $Id$ + * + * Name: cpl_aws.h + * Project: CPL - Common Portability Library + * Purpose: Amazon Web Services routines + * Author: Even Rouault + * + ********************************************************************** + * Copyright (c) 2015, Even Rouault + * + * 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_AWS_INCLUDED_H +#define CPL_AWS_INCLUDED_H + +#include "cpl_string.h" + +CPLString CPLGetAWS_SIGN4_Authorization(const CPLString& osSecretAccessKey, + const CPLString& osAccessKeyId, + const CPLString& osAccessToken, + const CPLString& osAWSRegion, + const CPLString& osService, + const CPLString& osVerb, + const CPLString& osHost, + const CPLString& osCanonicalURI, + const CPLString& osCanonicalQueryString, + const CPLString& osXAMZContentSHA256, + const CPLString& osTimestamp); + +CPLString CPLGetLowerCaseHexSHA256( const void *pabyData, size_t nBytes ); +CPLString CPLGetLowerCaseHexSHA256( const CPLString& osStr ); + +CPLString CPLGetAWS_SIGN4_Timestamp(); + +CPLString CPLAWSURLEncode(const CPLString& osURL, bool bEncodeSlash = true); + +#ifdef HAVE_CURL + +#include +#include + +class VSIS3HandleHelper +{ + CPLString m_osURL; + CPLString m_osSecretAccessKey; + CPLString m_osAccessKeyId; + CPLString m_osSessionToken; + CPLString m_osAWSS3Endpoint; + CPLString m_osAWSRegion; + CPLString m_osBucket; + CPLString m_osObjectKey; + bool m_bUseHTTPS; + bool m_bUseVirtualHosting; + std::map m_oMapQueryParameters; + + static bool GetBucketAndObjectKey(const char* pszURI, const char* pszFSPrefix, + bool bAllowNoObject, + CPLString &osBucketOut, CPLString &osObjectKeyOut); + void RebuildURL(); + + protected: + + public: + VSIS3HandleHelper(const CPLString& osSecretAccessKey, + const CPLString& osAccessKeyId, + const CPLString& osSessionToken, + const CPLString& osAWSS3Endpoint, + const CPLString& osAWSRegion, + const CPLString& osBucket, + const CPLString& osObjectKey, + bool bUseHTTPS, bool bUseVirtualHosting); + ~VSIS3HandleHelper(); + + static VSIS3HandleHelper* BuildFromURI(const char* pszURI, const char* pszFSPrefix, + bool bAllowNoObject); + static CPLString BuildURL(const CPLString& osAWSS3Endpoint, + const CPLString& osBucket, + const CPLString& osObjectKey, + bool bUseHTTPS, bool bUseVirtualHosting); + + void ResetQueryParameters(); + void AddQueryParameter(const CPLString& osKey, const CPLString& osValue); + struct curl_slist* GetCurlHeaders(const CPLString& osVerb, + const void *pabyDataContent = NULL, + size_t nBytesContent = 0); + bool CanRestartOnError(const char* pszErrorMsg) { return CanRestartOnError(pszErrorMsg, false); } + bool CanRestartOnError(const char*, bool bSetError); + + const CPLString& GetURL() const { return m_osURL; } + const CPLString& GetBucket() const { return m_osBucket; } + const CPLString& GetObjectKey() const { return m_osObjectKey; } + const CPLString& GetAWSS3Endpoint()const { return m_osAWSS3Endpoint; } + const CPLString& GetAWSRegion() const { return m_osAWSRegion; } + bool GetVirtualHosting() const { return m_bUseVirtualHosting; } + void SetAWSS3Endpoint(const CPLString &osStr); + void SetAWSRegion(const CPLString &osStr); + void SetVirtualHosting(bool b); + void SetObjectKey(const CPLString &osStr); +}; + +class VSIS3UpdateParams +{ + public: + CPLString m_osAWSRegion; + CPLString m_osAWSS3Endpoint; + bool m_bUseVirtualHosting; + + VSIS3UpdateParams(const CPLString& osAWSRegion = "", + const CPLString& osAWSS3Endpoint = "", + bool bUseVirtualHosting = false) : + m_osAWSRegion(osAWSRegion), + m_osAWSS3Endpoint(osAWSS3Endpoint), + m_bUseVirtualHosting(bUseVirtualHosting) {} +}; + +#endif /* HAVE_CURL */ + +#endif /* CPL_AWS_INCLUDED_H */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_config.h b/modules/globebrowsing/ext/gdal/include/cpl_config.h new file mode 100644 index 0000000000..fe7b82a8a2 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_config.h @@ -0,0 +1,121 @@ + +/* We define this here in general so that a VC++ build will publicly + declare STDCALL interfaces even if an application is built against it + using MinGW */ + +#ifndef CPL_DISABLE_STDCALL +# define CPL_STDCALL __stdcall +#endif + +/* Define if you don't have vprintf but do have _doprnt. */ +#undef HAVE_DOPRNT + +/* Define if you have the vprintf function. */ +#define HAVE_VPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SNPRINTF 1 +#if defined(_MSC_VER) && (_MSC_VER < 1500) +# define vsnprintf _vsnprintf +#endif +#if defined(_MSC_VER) && (_MSC_VER < 1900) +# define snprintf _snprintf +#endif + +#define HAVE_GETCWD 1 +/* gmt_notunix.h from GMT project also redefines getcwd. See #3138 */ +#ifndef getcwd +#define getcwd _getcwd +#endif + +/* Define if you have the ANSI C header files. */ +#ifndef STDC_HEADERS +# define STDC_HEADERS 1 +#endif + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +#undef HAVE_LIBDL + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +#define HAVE_FLOAT_H 1 + +#define HAVE_ERRNO_H 1 + +#define HAVE_SEARCH_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DIRECT_H + +/* Define to 1 if you have the `localtime_r' function. */ +#undef HAVE_LOCALTIME_R + +#undef HAVE_DLFCN_H +#undef HAVE_DBMALLOC_H +#undef HAVE_LIBDBMALLOC +#undef WORDS_BIGENDIAN + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of a `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of a `unsigned long', as computed by sizeof. */ +#define SIZEOF_UNSIGNED_LONG 4 + +/* The size of `void*', as computed by sizeof. */ +#ifdef _WIN64 +# define SIZEOF_VOIDP 8 +#else +# define SIZEOF_VOIDP 4 +#endif + +/* Set the native cpu bit order */ +#define HOST_FILLORDER FILLORDER_LSB2MSB + +/* Define as 0 or 1 according to the floating point format supported by the + machine */ +#define HAVE_IEEEFP 1 + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +# ifndef inline +# define inline __inline +# endif +#endif + +#define lfind _lfind + +#if defined(_MSC_VER) && (_MSC_VER < 1310) +# define VSI_STAT64 _stat +# define VSI_STAT64_T _stat +#else +# define VSI_STAT64 _stat64 +# define VSI_STAT64_T __stat64 +#endif + +/* VC6 doesn't known intptr_t */ +#if defined(_MSC_VER) && (_MSC_VER <= 1200) + typedef int intptr_t; +#endif + +#pragma warning(disable: 4786) + +/* #define CPL_DISABLE_DLL */ + diff --git a/modules/globebrowsing/ext/gdal/include/cpl_config_extras.h b/modules/globebrowsing/ext/gdal/include/cpl_config_extras.h new file mode 100644 index 0000000000..654f2fcad6 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_config_extras.h @@ -0,0 +1,40 @@ + +#ifndef INCLUDED_CPL_CONFIG_EXTRAS +#define INCLUDED_CPL_CONFIG_EXTRAS + +#if defined(__APPLE__) + +#ifdef __BIG_ENDIAN__ + #define HOST_FILLORDER FILLORDER_MSB2LSB +#else + #define HOST_FILLORDER FILLORDER_LSB2MSB +#endif + + +#ifdef __LP64__ + #define SIZEOF_UNSIGNED_LONG 8 +#else + #define SIZEOF_UNSIGNED_LONG 4 +#endif + +#ifdef __LP64__ + #define SIZEOF_VOIDP 8 +#else + #define SIZEOF_VOIDP 4 +#endif + +#ifdef __BIG_ENDIAN__ + #define WORDS_BIGENDIAN 1 +#else + #undef WORDS_BIGENDIAN +#endif + +#undef VSI_STAT64 +#undef VSI_STAT64_T + +#define VSI_STAT64 stat +#define VSI_STAT64_T stat + +#endif // APPLE + +#endif //INCLUDED_CPL_CONFIG_EXTRAS diff --git a/modules/globebrowsing/ext/gdal/include/cpl_conv.h b/modules/globebrowsing/ext/gdal/include/cpl_conv.h new file mode 100644 index 0000000000..ace573f8e6 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_conv.h @@ -0,0 +1,307 @@ +/****************************************************************************** + * $Id$ + * + * Project: CPL - Common Portability Library + * Purpose: Convenience functions declarations. + * This is intended to remain light weight. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 1998, Frank Warmerdam + * Copyright (c) 2007-2013, Even Rouault + * + * 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_CONV_H_INCLUDED +#define CPL_CONV_H_INCLUDED + +#include "cpl_port.h" +#include "cpl_vsi.h" +#include "cpl_error.h" + +/** + * \file cpl_conv.h + * + * Various convenience functions for CPL. + * + */ + +/* -------------------------------------------------------------------- */ +/* Runtime check of various configuration items. */ +/* -------------------------------------------------------------------- */ +CPL_C_START + +void CPL_DLL CPLVerifyConfiguration(void); + +const char CPL_DLL * CPL_STDCALL +CPLGetConfigOption( const char *, const char * ) CPL_WARN_UNUSED_RESULT; +const char CPL_DLL * CPL_STDCALL +CPLGetThreadLocalConfigOption( const char *, const char * ) CPL_WARN_UNUSED_RESULT; +void CPL_DLL CPL_STDCALL CPLSetConfigOption( const char *, const char * ); +void CPL_DLL CPL_STDCALL CPLSetThreadLocalConfigOption( const char *pszKey, + const char *pszValue ); +void CPL_DLL CPL_STDCALL CPLFreeConfig(void); + +/* -------------------------------------------------------------------- */ +/* Safe malloc() API. Thin cover over VSI functions with fatal */ +/* error reporting if memory allocation fails. */ +/* -------------------------------------------------------------------- */ +void CPL_DLL *CPLMalloc( size_t ) CPL_WARN_UNUSED_RESULT; +void CPL_DLL *CPLCalloc( size_t, size_t ) CPL_WARN_UNUSED_RESULT; +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 *); + +#define CPLFree VSIFree + +/* -------------------------------------------------------------------- */ +/* Read a line from a text file, and strip of CR/LF. */ +/* -------------------------------------------------------------------- */ +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); + +/* -------------------------------------------------------------------- */ +/* Convert ASCII string to floating point number */ +/* (THESE FUNCTIONS ARE NOT LOCALE AWARE!). */ +/* -------------------------------------------------------------------- */ +double CPL_DLL CPLAtof(const char *); +double CPL_DLL CPLAtofDelim(const char *, char); +double CPL_DLL CPLStrtod(const char *, char **); +double CPL_DLL CPLStrtodDelim(const char *, char **, char); +float CPL_DLL CPLStrtof(const char *, char **); +float CPL_DLL CPLStrtofDelim(const char *, char **, char); + +/* -------------------------------------------------------------------- */ +/* Convert number to string. This function is locale agnostic */ +/* (i.e. it will support "," or "." regardless of current locale) */ +/* -------------------------------------------------------------------- */ +double CPL_DLL CPLAtofM(const char *); + +/* -------------------------------------------------------------------- */ +/* Read a numeric value from an ASCII character string. */ +/* -------------------------------------------------------------------- */ +char CPL_DLL *CPLScanString( const char *, int, int, int ); +double CPL_DLL CPLScanDouble( const char *, int ); +long CPL_DLL CPLScanLong( const char *, int ); +unsigned long CPL_DLL CPLScanULong( const char *, int ); +GUIntBig CPL_DLL CPLScanUIntBig( const char *, int ); +GIntBig CPL_DLL CPLAtoGIntBig( const char* pszString ); +GIntBig CPL_DLL CPLAtoGIntBigEx( const char* pszString, int bWarn, int *pbOverflow ); +void CPL_DLL *CPLScanPointer( const char *, int ); + +/* -------------------------------------------------------------------- */ +/* Print a value to an ASCII character string. */ +/* -------------------------------------------------------------------- */ +int CPL_DLL CPLPrintString( char *, const char *, int ); +int CPL_DLL CPLPrintStringFill( char *, const char *, int ); +int CPL_DLL CPLPrintInt32( char *, GInt32 , int ); +int CPL_DLL CPLPrintUIntBig( char *, GUIntBig , int ); +int CPL_DLL CPLPrintDouble( char *, const char *, double, const char * ); +int CPL_DLL CPLPrintTime( char *, int , const char *, const struct tm *, + const char * ); +int CPL_DLL CPLPrintPointer( char *, void *, int ); + +/* -------------------------------------------------------------------- */ +/* Fetch a function from DLL / so. */ +/* -------------------------------------------------------------------- */ + +void CPL_DLL *CPLGetSymbol( const char *, const char * ); + +/* -------------------------------------------------------------------- */ +/* Fetch executable path. */ +/* -------------------------------------------------------------------- */ +int CPL_DLL CPLGetExecPath( char *pszPathBuf, int nMaxLength ); + +/* -------------------------------------------------------------------- */ +/* Filename handling functions. */ +/* -------------------------------------------------------------------- */ +const char CPL_DLL *CPLGetPath( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; +const char CPL_DLL *CPLGetDirname( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; +const char CPL_DLL *CPLGetFilename( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; +const char CPL_DLL *CPLGetBasename( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; +const char CPL_DLL *CPLGetExtension( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; +char CPL_DLL *CPLGetCurrentDir(void); +const char CPL_DLL *CPLFormFilename( const char *pszPath, + const char *pszBasename, + const char *pszExtension ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; +const char CPL_DLL *CPLFormCIFilename( const char *pszPath, + const char *pszBasename, + const char *pszExtension ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; +const char CPL_DLL *CPLResetExtension( const char *, const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; +const char CPL_DLL *CPLProjectRelativeFilename( const char *pszProjectDir, + const char *pszSecondaryFilename ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; +int CPL_DLL CPLIsFilenameRelative( const char *pszFilename ); +const char CPL_DLL *CPLExtractRelativePath(const char *, const char *, int *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; +const char CPL_DLL *CPLCleanTrailingSlash( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; +char CPL_DLL **CPLCorrespondingPaths( const char *pszOldFilename, + const char *pszNewFilename, + char **papszFileList ) CPL_WARN_UNUSED_RESULT; +int CPL_DLL CPLCheckForFile( char *pszFilename, char **papszSiblingList ); + +const char CPL_DLL *CPLGenerateTempFilename( const char *pszStem ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; + +/* -------------------------------------------------------------------- */ +/* Find File Function */ +/* -------------------------------------------------------------------- */ +typedef const char *(*CPLFileFinder)(const char *, const char *); + +const char CPL_DLL *CPLFindFile(const char *pszClass, + const char *pszBasename); +const char CPL_DLL *CPLDefaultFindFile(const char *pszClass, + const char *pszBasename); +void CPL_DLL CPLPushFileFinder( CPLFileFinder pfnFinder ); +CPLFileFinder CPL_DLL CPLPopFileFinder(void); +void CPL_DLL CPLPushFinderLocation( const char * ); +void CPL_DLL CPLPopFinderLocation(void); +void CPL_DLL CPLFinderClean(void); + +/* -------------------------------------------------------------------- */ +/* Safe version of stat() that works properly on stuff like "C:". */ +/* -------------------------------------------------------------------- */ +int CPL_DLL CPLStat( const char *, VSIStatBuf * ) CPL_WARN_UNUSED_RESULT; + +/* -------------------------------------------------------------------- */ +/* Reference counted file handle manager. Makes sharing file */ +/* handles more practical. */ +/* -------------------------------------------------------------------- */ +typedef struct { + FILE *fp; + int nRefCount; + int bLarge; + char *pszFilename; + char *pszAccess; +} 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 * ); +void CPL_DLL CPLCleanupSharedFileMutex( void ); + +/* -------------------------------------------------------------------- */ +/* DMS to Dec to DMS conversion. */ +/* -------------------------------------------------------------------- */ +double CPL_DLL CPLDMSToDec( const char *is ); +const char CPL_DLL *CPLDecToDMS( double dfAngle, const char * pszAxis, + int nPrecision ); +double CPL_DLL CPLPackedDMSToDec( double ); +double CPL_DLL CPLDecToPackedDMS( double dfDec ); + +void CPL_DLL CPLStringToComplex( const char *pszString, + double *pdfReal, double *pdfImag ); + +/* -------------------------------------------------------------------- */ +/* Misc other functions. */ +/* -------------------------------------------------------------------- */ +int CPL_DLL CPLUnlinkTree( const char * ); +int CPL_DLL CPLCopyFile( const char *pszNewPath, const char *pszOldPath ); +int CPL_DLL CPLCopyTree( const char *pszNewPath, const char *pszOldPath ); +int CPL_DLL CPLMoveFile( const char *pszNewPath, const char *pszOldPath ); +int CPL_DLL CPLSymlink( const char* pszOldPath, const char* pszNewPath, char** papszOptions ); + +/* -------------------------------------------------------------------- */ +/* ZIP Creation. */ +/* -------------------------------------------------------------------- */ +#define CPL_ZIP_API_OFFERED +void CPL_DLL *CPLCreateZip( const char *pszZipFilename, char **papszOptions ); +CPLErr CPL_DLL CPLCreateFileInZip( void *hZip, const char *pszFilename, + char **papszOptions ); +CPLErr CPL_DLL CPLWriteFileInZip( void *hZip, const void *pBuffer, int nBufferSize ); +CPLErr CPL_DLL CPLCloseFileInZip( void *hZip ); +CPLErr CPL_DLL CPLCloseZip( void *hZip ); + +/* -------------------------------------------------------------------- */ +/* ZLib compression */ +/* -------------------------------------------------------------------- */ + +void CPL_DLL *CPLZLibDeflate( const void* ptr, size_t nBytes, int nLevel, + void* outptr, size_t nOutAvailableBytes, + size_t* pnOutBytes ); +void CPL_DLL *CPLZLibInflate( const void* ptr, size_t nBytes, + void* outptr, size_t nOutAvailableBytes, + size_t* pnOutBytes ); + +/* -------------------------------------------------------------------- */ +/* XML validation. */ +/* -------------------------------------------------------------------- */ +int CPL_DLL CPLValidateXML(const char* pszXMLFilename, + const char* pszXSDFilename, + char** papszOptions); + +/* -------------------------------------------------------------------- */ +/* Locale handling. Prevents parallel executions of setlocale(). */ +/* -------------------------------------------------------------------- */ +char* CPLsetlocale (int category, const char* locale); +void CPLCleanupSetlocaleMutex(void); + +CPL_C_END + +/* -------------------------------------------------------------------- */ +/* C++ object for temporarily forcing a LC_NUMERIC locale to "C". */ +/* -------------------------------------------------------------------- */ + +#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) + +class CPL_DLL CPLLocaleC +{ +public: + CPLLocaleC(); + ~CPLLocaleC(); + +private: + char *pszOldLocale; + + /* Make it non-copyable */ + CPLLocaleC(const CPLLocaleC&); + CPLLocaleC& operator=(const CPLLocaleC&); +}; + +// Does the same as CPLLocaleC except that, when available, it tries to +// only affect the current thread. But code that would be dependent of +// setlocale(LC_NUMERIC, NULL) returning "C", such as current proj.4 versions, +// will not work depending on the actual implementation +class CPL_DLL CPLThreadLocaleC +{ +public: + CPLThreadLocaleC(); + ~CPLThreadLocaleC(); + +private: +#ifdef HAVE_USELOCALE + locale_t nNewLocale; + locale_t nOldLocale; +#else +#if defined(_MSC_VER) + int nOldValConfigThreadLocale; +#endif + char *pszOldLocale; +#endif + + /* Make it non-copyable */ + CPLThreadLocaleC(const CPLThreadLocaleC&); + CPLThreadLocaleC& operator=(const CPLThreadLocaleC&); +}; + +#endif /* def __cplusplus */ + + +#endif /* ndef CPL_CONV_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_csv.h b/modules/globebrowsing/ext/gdal/include/cpl_csv.h new file mode 100644 index 0000000000..b1d2ebb903 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_csv.h @@ -0,0 +1,76 @@ +/****************************************************************************** + * $Id$ + * + * Project: Common Portability Library + * Purpose: Functions for reading and scanning CSV (comma separated, + * variable length text files holding tables) files. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 1999, 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 CPL_CSV_H_INCLUDED +#define CPL_CSV_H_INCLUDED + +#include "cpl_conv.h" +#include "cpl_string.h" +#include "cpl_vsi.h" + +CPL_C_START + +typedef enum { + CC_ExactString, + CC_ApproxString, + CC_Integer +} CSVCompareCriteria; + +const char CPL_DLL *CSVFilename( const char * ); + +char CPL_DLL CSVDetectSeperator( const char *pszLine ); + +char CPL_DLL **CSVReadParseLine( FILE *fp); +char CPL_DLL **CSVReadParseLine2( FILE *fp, char chDelimiter ); + +char CPL_DLL **CSVReadParseLineL( VSILFILE *fp); +char CPL_DLL **CSVReadParseLine2L( VSILFILE *fp, char chDelimiter ); + +char CPL_DLL **CSVScanLines( FILE *, int, const char *, CSVCompareCriteria ); +char CPL_DLL **CSVScanLinesL( VSILFILE *, int, const char *, CSVCompareCriteria ); +char CPL_DLL **CSVScanFile( const char *, int, const char *, + CSVCompareCriteria ); +char CPL_DLL **CSVScanFileByName( const char *, const char *, const char *, + CSVCompareCriteria ); +char CPL_DLL **CSVGetNextLine( const char * ); +int CPL_DLL CSVGetFieldId( FILE *, const char * ); +int CPL_DLL CSVGetFieldIdL( VSILFILE *, const char * ); +int CPL_DLL CSVGetFileFieldId( const char *, const char * ); + +void CPL_DLL CSVDeaccess( const char * ); + +const char CPL_DLL *CSVGetField( const char *, const char *, const char *, + CSVCompareCriteria, const char * ); + +void CPL_DLL SetCSVFilenameHook( const char *(*)(const char *) ); + +CPL_C_END + +#endif /* ndef CPL_CSV_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_error.h b/modules/globebrowsing/ext/gdal/include/cpl_error.h new file mode 100644 index 0000000000..a43f1a32e2 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_error.h @@ -0,0 +1,179 @@ +/********************************************************************** + * $Id$ + * + * Name: cpl_error.h + * Project: CPL - Common Portability Library + * Purpose: CPL Error handling + * Author: Daniel Morissette, danmo@videotron.ca + * + ********************************************************************** + * Copyright (c) 1998, Daniel Morissette + * + * 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_ERROR_H_INCLUDED +#define CPL_ERROR_H_INCLUDED + +#include "cpl_port.h" + +/*===================================================================== + Error handling functions (cpl_error.c) + =====================================================================*/ + +/** + * \file cpl_error.h + * + * CPL error handling services. + */ + +CPL_C_START + +typedef enum +{ + CE_None = 0, + CE_Debug = 1, + CE_Warning = 2, + CE_Failure = 3, + CE_Fatal = 4 +} CPLErr; + +/* ==================================================================== */ +/* Well known error codes. */ +/* ==================================================================== */ + +#ifdef STRICT_CPLERRORNUM_TYPE + +/* This is not appropriate for the general case, as there are parts */ +/* of GDAL which use custom error codes, but this can help diagnose confusions */ +/* between CPLErr and CPLErrorNum */ +typedef enum +{ + CPLE_None, + CPLE_AppDefined, + CPLE_OutOfMemory, + CPLE_FileIO, + CPLE_OpenFailed, + CPLE_IllegalArg, + CPLE_NotSupported, + CPLE_AssertionFailed, + CPLE_NoWriteAccess, + CPLE_UserInterrupt, + CPLE_ObjectNull, + CPLE_HttpResponse, + CPLE_HttpResponse, + CPLE_AWSBucketNotFound, + CPLE_AWSObjectNotFound, + CPLE_AWSAccessDenied, + CPLE_AWSInvalidCredentials, + CPLE_AWSSignatureDoesNotMatch, +} CPLErrorNum; + +#else + +typedef int CPLErrorNum; + +#define CPLE_None 0 +#define CPLE_AppDefined 1 +#define CPLE_OutOfMemory 2 +#define CPLE_FileIO 3 +#define CPLE_OpenFailed 4 +#define CPLE_IllegalArg 5 +#define CPLE_NotSupported 6 +#define CPLE_AssertionFailed 7 +#define CPLE_NoWriteAccess 8 +#define CPLE_UserInterrupt 9 +#define CPLE_ObjectNull 10 + +/* + * Filesystem-specific errors + */ +#define CPLE_HttpResponse 11 +#define CPLE_AWSBucketNotFound 12 +#define CPLE_AWSObjectNotFound 13 +#define CPLE_AWSAccessDenied 14 +#define CPLE_AWSInvalidCredentials 15 +#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 CPLErrorV(CPLErr, CPLErrorNum, const char *, va_list ); +void CPL_DLL CPLEmergencyError( const char * ) CPL_NO_RETURN; +void CPL_DLL CPL_STDCALL CPLErrorReset( void ); +CPLErrorNum CPL_DLL CPL_STDCALL CPLGetLastErrorNo( void ); +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 ); +void CPL_DLL CPLCleanupErrorMutex( void ); + +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 ); + +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); +void CPL_DLL CPL_STDCALL _CPLAssert( const char *, const char *, int ) CPL_NO_RETURN; + +#ifdef DEBUG +# define CPLAssert(expr) ((expr) ? (void)(0) : _CPLAssert(#expr,__FILE__,__LINE__)) +#else +# define CPLAssert(expr) +#endif + +CPL_C_END + +/* + * Helper macros used for input parameters validation. + */ +#ifdef DEBUG +# define VALIDATE_POINTER_ERR CE_Fatal +#else +# define VALIDATE_POINTER_ERR CE_Failure +#endif + +#define VALIDATE_POINTER0(ptr, func) \ + do { if( NULL == ptr ) \ + { \ + CPLErr const ret = VALIDATE_POINTER_ERR; \ + CPLError( ret, CPLE_ObjectNull, \ + "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func)); \ + return; }} while(0) + +#define VALIDATE_POINTER1(ptr, func, rc) \ + do { if( NULL == ptr ) \ + { \ + CPLErr const ret = VALIDATE_POINTER_ERR; \ + CPLError( ret, CPLE_ObjectNull, \ + "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func)); \ + return (rc); }} while(0) + +#endif /* CPL_ERROR_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_hash_set.h b/modules/globebrowsing/ext/gdal/include/cpl_hash_set.h new file mode 100644 index 0000000000..a0d8e296e2 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_hash_set.h @@ -0,0 +1,94 @@ +/********************************************************************** + * $Id$ + * + * Name: cpl_hash_set.h + * Project: CPL - Common Portability Library + * Purpose: Hash set functions. + * Author: Even Rouault, + * + ********************************************************************** + * Copyright (c) 2008-2009, Even Rouault + * + * 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_HASH_SET_H_INCLUDED +#define CPL_HASH_SET_H_INCLUDED + +#include "cpl_port.h" + +/** + * \file cpl_hash_set.h + * + * Hash set implementation. + * + * An hash set is a data structure that holds elements that are unique + * according to a comparison function. Operations on the hash set, such as + * insertion, removal or lookup, are supposed to be fast if an efficient + * "hash" function is provided. + */ + +CPL_C_START + +/* Types */ + +typedef struct _CPLHashSet CPLHashSet; + +typedef unsigned long (*CPLHashSetHashFunc)(const void* elt); + +typedef int (*CPLHashSetEqualFunc)(const void* elt1, const void* elt2); + +typedef void (*CPLHashSetFreeEltFunc)(void* elt); + +typedef int (*CPLHashSetIterEltFunc)(void* elt, void* user_data); + +/* Functions */ + +CPLHashSet CPL_DLL * CPLHashSetNew(CPLHashSetHashFunc fnHashFunc, + CPLHashSetEqualFunc fnEqualFunc, + CPLHashSetFreeEltFunc fnFreeEltFunc); + +void CPL_DLL CPLHashSetDestroy(CPLHashSet* set); + +void CPL_DLL CPLHashSetClear(CPLHashSet* set); + +int CPL_DLL CPLHashSetSize(const CPLHashSet* set); + +void CPL_DLL CPLHashSetForeach(CPLHashSet* set, + CPLHashSetIterEltFunc fnIterFunc, + void* user_data); + +int CPL_DLL CPLHashSetInsert(CPLHashSet* set, void* elt); + +void CPL_DLL * CPLHashSetLookup(CPLHashSet* set, const void* elt); + +int CPL_DLL CPLHashSetRemove(CPLHashSet* set, const void* elt); +int CPL_DLL CPLHashSetRemoveDeferRehash(CPLHashSet* set, const void* elt); + +unsigned long CPL_DLL CPLHashSetHashPointer(const void* elt); + +int CPL_DLL CPLHashSetEqualPointer(const void* elt1, const void* elt2); + +unsigned long CPL_DLL CPLHashSetHashStr(const void * pszStr); + +int CPL_DLL CPLHashSetEqualStr(const void* pszStr1, const void* pszStr2); + +CPL_C_END + +#endif /* CPL_HASH_SET_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_http.h b/modules/globebrowsing/ext/gdal/include/cpl_http.h new file mode 100644 index 0000000000..44500d1a55 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_http.h @@ -0,0 +1,105 @@ +/****************************************************************************** + * $Id$ + * + * Project: Common Portability Library + * Purpose: Function wrapper for libcurl HTTP access. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 2006, Frank Warmerdam + * Copyright (c) 2009, Even Rouault + * + * 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_HTTP_H_INCLUDED +#define CPL_HTTP_H_INCLUDED + +#include "cpl_conv.h" +#include "cpl_string.h" +#include "cpl_vsi.h" + +/** + * \file cpl_http.h + * + * Interface for downloading HTTP, FTP documents + */ + +CPL_C_START + +/*! Describe a part of a multipart message */ +typedef struct { + /*! NULL terminated array of headers */ char **papszHeaders; + + /*! Buffer with data of the part */ GByte *pabyData; + /*! Buffer length */ int nDataLen; +} CPLMimePart; + +/*! Describe the result of a CPLHTTPFetch() call */ +typedef struct { + /*! cURL error code : 0=success, non-zero if request failed */ + int nStatus; + + /*! Content-Type of the response */ + char *pszContentType; + + /*! Error message from curl, or NULL */ + char *pszErrBuf; + + /*! Length of the pabyData buffer */ + int nDataLen; + int nDataAlloc; + + /*! Buffer with downloaded data */ + GByte *pabyData; + + /*! Headers returned */ + char **papszHeaders; + + /*! Number of parts in a multipart message */ + int nMimePartCount; + + /*! Array of parts (resolved by CPLHTTPParseMultipartMime()) */ + CPLMimePart *pasMimePart; + +} CPLHTTPResult; + +int CPL_DLL CPLHTTPEnabled( void ); +CPLHTTPResult CPL_DLL *CPLHTTPFetch( const char *pszURL, char **papszOptions); +void CPL_DLL CPLHTTPCleanup( void ); +void CPL_DLL CPLHTTPDestroyResult( CPLHTTPResult *psResult ); +int CPL_DLL CPLHTTPParseMultipartMime( CPLHTTPResult *psResult ); + +/* -------------------------------------------------------------------- */ +/* The following is related to OAuth2 authorization around */ +/* google services like fusion tables, and potentially others */ +/* in the future. Code in cpl_google_oauth2.cpp. */ +/* */ +/* These services are built on CPL HTTP services. */ +/* -------------------------------------------------------------------- */ + +char CPL_DLL *GOA2GetAuthorizationURL( const char *pszScope ); +char CPL_DLL *GOA2GetRefreshToken( const char *pszAuthToken, + const char *pszScope ); +char CPL_DLL *GOA2GetAccessToken( const char *pszRefreshToken, + const char *pszScope ); + +CPL_C_END + +#endif /* ndef CPL_HTTP_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_list.h b/modules/globebrowsing/ext/gdal/include/cpl_list.h new file mode 100644 index 0000000000..a8a433458f --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_list.h @@ -0,0 +1,72 @@ +/********************************************************************** + * $Id$ + * + * Name: cpl_list.h + * Project: CPL - Common Portability Library + * Purpose: List functions. + * Author: Andrey Kiselev, dron@remotesensing.org + * + ********************************************************************** + * Copyright (c) 2003, Andrey Kiselev + * + * 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_LIST_H_INCLUDED +#define CPL_LIST_H_INCLUDED + +#include "cpl_port.h" + +/** + * \file cpl_list.h + * + * Simplest list implementation. List contains only pointers to stored + * objects, not objects itself. All operations regarding allocation and + * freeing memory for objects should be performed by the caller. + * + */ + +CPL_C_START + +/** List element structure. */ +typedef struct _CPLList +{ + /*! Pointer to the data object. Should be allocated and freed by the + * caller. + * */ + void *pData; + /*! Pointer to the next element in list. NULL, if current element is the + * last one. + */ + struct _CPLList *psNext; +} CPLList; + +CPLList CPL_DLL *CPLListAppend( CPLList *psList, void * pData ); +CPLList CPL_DLL *CPLListInsert( CPLList *psList, void * pData, int nPosition ); +CPLList CPL_DLL *CPLListGetLast( CPLList *psList ); +CPLList CPL_DLL *CPLListGet( CPLList * const psList, int nPosition ); +int CPL_DLL CPLListCount( const CPLList *psList ); +CPLList CPL_DLL *CPLListRemove( CPLList *psList, int nPosition ); +void CPL_DLL CPLListDestroy( CPLList *psList ); +CPLList CPL_DLL *CPLListGetNext( const CPLList *psElement ); +void CPL_DLL *CPLListGetData( const CPLList *psElement ); + +CPL_C_END + +#endif /* CPL_LIST_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_minixml.h b/modules/globebrowsing/ext/gdal/include/cpl_minixml.h new file mode 100644 index 0000000000..fe199034e3 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_minixml.h @@ -0,0 +1,181 @@ +/********************************************************************** + * $Id$ + * + * Project: CPL - Common Portability Library + * Purpose: Declarations for MiniXML Handler. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ********************************************************************** + * Copyright (c) 2001, 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 CPL_MINIXML_H_INCLUDED +#define CPL_MINIXML_H_INCLUDED + +#include "cpl_port.h" + +/** + * \file cpl_minixml.h + * + * Definitions for CPL mini XML Parser/Serializer. + */ + +CPL_C_START + +typedef enum +{ + /*! Node is an element */ CXT_Element = 0, + /*! Node is a raw text value */ CXT_Text = 1, + /*! Node is attribute */ CXT_Attribute = 2, + /*! Node is an XML comment. */ CXT_Comment = 3, + /*! Node is a special literal */ CXT_Literal = 4 +} CPLXMLNodeType; + +/** + * Document node structure. + * + * This C structure is used to hold a single text fragment representing a + * component of the document when parsed. It should be allocated with the + * appropriate CPL function, and freed with CPLDestroyXMLNode(). The structure + * contents should not normally be altered by application code, but may be + * freely examined by application code. + * + * Using the psChild and psNext pointers, a hierarchical tree structure + * for a document can be represented as a tree of CPLXMLNode structures. + */ + +typedef struct CPLXMLNode +{ + /** + * \brief Node type + * + * One of CXT_Element, CXT_Text, CXT_Attribute, CXT_Comment, + * or CXT_Literal. + */ + CPLXMLNodeType eType; + + /** + * \brief Node value + * + * For CXT_Element this is the name of the element, without the angle + * brackets. Note there is a single CXT_Element even when the document + * contains a start and end element tag. The node represents the pair. + * All text or other elements between the start and end tag will appear + * as children nodes of this CXT_Element node. + * + * For CXT_Attribute the pszValue is the attribute name. The value of + * the attribute will be a CXT_Text child. + * + * For CXT_Text this is the text itself (value of an attribute, or a + * text fragment between an element start and end tags. + * + * For CXT_Literal it is all the literal text. Currently this is just + * used for !DOCTYPE lines, and the value would be the entire line. + * + * For CXT_Comment the value is all the literal text within the comment, + * but not including the comment start/end indicators ("<--" and "-->"). + */ + char *pszValue; + + /** + * \brief Next sibling. + * + * Pointer to next sibling, that is the next node appearing after this + * one that has the same parent as this node. NULL if this node is the + * last child of the parent element. + */ + struct CPLXMLNode *psNext; + + /** + * \brief Child node. + * + * Pointer to first child node, if any. Only CXT_Element and CXT_Attribute + * nodes should have children. For CXT_Attribute it should be a single + * CXT_Text value node, while CXT_Element can have any kind of child. + * The full list of children for a node are identified by walking the + * psNext's starting with the psChild node. + */ + + struct CPLXMLNode *psChild; +} CPLXMLNode; + + +CPLXMLNode CPL_DLL *CPLParseXMLString( const char * ); +void CPL_DLL CPLDestroyXMLNode( CPLXMLNode * ); +CPLXMLNode CPL_DLL *CPLGetXMLNode( CPLXMLNode *poRoot, + const char *pszPath ); +CPLXMLNode CPL_DLL *CPLSearchXMLNode( CPLXMLNode *poRoot, + const char *pszTarget ); +const char CPL_DLL *CPLGetXMLValue( CPLXMLNode *poRoot, + const char *pszPath, + const char *pszDefault ); +CPLXMLNode CPL_DLL *CPLCreateXMLNode( CPLXMLNode *poParent, + CPLXMLNodeType eType, + const char *pszText ); +char CPL_DLL *CPLSerializeXMLTree( const CPLXMLNode *psNode ); +void CPL_DLL CPLAddXMLChild( CPLXMLNode *psParent, + CPLXMLNode *psChild ); +int CPL_DLL CPLRemoveXMLChild( CPLXMLNode *psParent, + CPLXMLNode *psChild ); +void CPL_DLL CPLAddXMLSibling( CPLXMLNode *psOlderSibling, + CPLXMLNode *psNewSibling ); +CPLXMLNode CPL_DLL *CPLCreateXMLElementAndValue( CPLXMLNode *psParent, + const char *pszName, + const char *pszValue ); +void CPL_DLL CPLAddXMLAttributeAndValue( CPLXMLNode *psParent, + const char *pszName, + const char *pszValue ); +CPLXMLNode CPL_DLL *CPLCloneXMLTree( CPLXMLNode *psTree ); +int CPL_DLL CPLSetXMLValue( CPLXMLNode *psRoot, const char *pszPath, + const char *pszValue ); +void CPL_DLL CPLStripXMLNamespace( CPLXMLNode *psRoot, + const char *pszNameSpace, + int bRecurse ); +void CPL_DLL CPLCleanXMLElementName( char * ); + +CPLXMLNode CPL_DLL *CPLParseXMLFile( const char *pszFilename ); +int CPL_DLL CPLSerializeXMLTreeToFile( const CPLXMLNode *psTree, + const char *pszFilename ); + +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. +class CPLXMLTreeCloser { + public: + explicit CPLXMLTreeCloser(CPLXMLNode* data) { the_data_ = data; } + + ~CPLXMLTreeCloser() { + if (the_data_) CPLDestroyXMLNode(the_data_); + } + + // Modifying the contents pointed to by the return is allowed. + CPLXMLNode* get() const { return the_data_; } + + CPLXMLNode* operator->() const { return get(); } + + private: + CPLXMLNode* the_data_; +}; +#endif /* __cplusplus */ + +#endif /* CPL_MINIXML_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_minizip_ioapi.h b/modules/globebrowsing/ext/gdal/include/cpl_minizip_ioapi.h new file mode 100644 index 0000000000..15f188d5a5 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_minizip_ioapi.h @@ -0,0 +1,82 @@ +/* Modified version by Even Rouault. : + - change fill_fopen_filefunc to cpl_fill_fopen_filefunc + - Add support for ZIP64 + + * Copyright (c) 2008-2012, Even Rouault + + Original licence available in port/LICENCE_minizip +*/ + +/* ioapi.h -- IO base function header for compress/uncompress .zip + files using zlib + zip or unzip API + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant +*/ + +#ifndef CPL_MINIZIP_IOAPI_H_INCLUDED +#define CPL_MINIZIP_IOAPI_H_INCLUDED + +#include "cpl_vsi.h" +#define uLong64 vsi_l_offset + +#define ZLIB_FILEFUNC_SEEK_CUR (1) +#define ZLIB_FILEFUNC_SEEK_END (2) +#define ZLIB_FILEFUNC_SEEK_SET (0) + +#define ZLIB_FILEFUNC_MODE_READ (1) +#define ZLIB_FILEFUNC_MODE_WRITE (2) +#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) + +#define ZLIB_FILEFUNC_MODE_EXISTING (4) +#define ZLIB_FILEFUNC_MODE_CREATE (8) + +#ifndef ZCALLBACK + +#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) +#define ZCALLBACK CALLBACK +#else +#define ZCALLBACK +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef voidpf (ZCALLBACK *open_file_func) (voidpf opaque, const char* filename, int mode); +typedef uLong (ZCALLBACK *read_file_func) (voidpf opaque, voidpf stream, void* buf, uLong size); +typedef uLong (ZCALLBACK *write_file_func) (voidpf opaque, voidpf stream, const void* buf, uLong size); +typedef uLong64 (ZCALLBACK *tell_file_func) (voidpf opaque, voidpf stream); +typedef long (ZCALLBACK *seek_file_func) (voidpf opaque, voidpf stream, uLong64 offset, int origin); +typedef int (ZCALLBACK *close_file_func) (voidpf opaque, voidpf stream); +typedef int (ZCALLBACK *testerror_file_func) (voidpf opaque, voidpf stream); + +typedef struct zlib_filefunc_def_s +{ + open_file_func zopen_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell_file_func ztell_file; + seek_file_func zseek_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc_def; + +void cpl_fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def); + +#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) +#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) +#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) +#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) +#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) +#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) + + +#ifdef __cplusplus +} +#endif + +#endif /* CPL_MINIZIP_IOAPI_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_minizip_unzip.h b/modules/globebrowsing/ext/gdal/include/cpl_minizip_unzip.h new file mode 100644 index 0000000000..b02d830a03 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_minizip_unzip.h @@ -0,0 +1,381 @@ +/* Modified version by Even Rouault. : + - Addition of cpl_unzGetCurrentFileZStreamPos + - Decoration of symbol names unz* -> cpl_unz* + - Undef EXPORT so that we are sure the symbols are not exported + - Add support for ZIP64 + + * Copyright (c) 2008, Even Rouault + + Original licence available in port/LICENCE_minizip +*/ + +/* unzip.h -- IO for uncompress .zip files using zlib + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g + WinZip, InfoZip tools and compatible. + + Multi volume ZipFile (span) are not supported. + 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 + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 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 + http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip + http://www.info-zip.org/pub/infozip/doc/ + PkWare has also a specification at : + ftp://ftp.pkware.com/probdesc.zip +*/ + +#ifndef CPL_MINIZIP_UNZIP_H_INCLUDED +#define CPL_MINIZIP_UNZIP_H_INCLUDED + +#include "cpl_vsi.h" +#define uLong64 vsi_l_offset + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include +#endif + +#ifndef CPL_MINIZIP_IOAPI_H_INCLUDED +#include "cpl_minizip_ioapi.h" +#endif + +/* GDAL addition */ +#define NOUNCRYPT +#undef ZEXPORT +#define ZEXPORT + +#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagunzFile__ { int unused; } unzFile__; +typedef unzFile__ *unzFile; +#else +typedef voidp unzFile; +#endif + + +#define UNZ_OK (0) +#define UNZ_END_OF_LIST_OF_FILE (-100) +#define UNZ_ERRNO (Z_ERRNO) +#define UNZ_EOF (0) +#define UNZ_PARAMERROR (-102) +#define UNZ_BADZIPFILE (-103) +#define UNZ_INTERNALERROR (-104) +#define UNZ_CRCERROR (-105) + +/* tm_unz contain date/time info */ +typedef struct tm_unz_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_unz; + +/* unz_global_info structure contain global data about the ZIPfile + These data comes from the end of central dir */ +typedef struct unz_global_info_s +{ + uLong64 number_entry; /* total number of entries in + the central dir on this disk */ + 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 +{ + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + uLong64 compressed_size; /* compressed size 4 bytes */ + uLong64 uncompressed_size; /* uncompressed size 4 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ + + tm_unz tmu_date; +} unz_file_info; + +extern int ZEXPORT cpl_unzStringFileNameCompare (const char* fileName1, + const char* fileName2, + int iCaseSensitivity); +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is default of your operating system + (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, + on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer + "zlib/zlib113.zip". + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ + +extern unzFile ZEXPORT cpl_unzOpen2 (const char *path, + zlib_filefunc_def* pzlib_filefunc_def); +/* + Open a Zip file, like unzOpen, but provide a set of file low level API + for read/write the zip file (see ioapi.h) +*/ + +extern int ZEXPORT cpl_unzClose (unzFile file); +/* + Close a ZipFile opened with unzipOpen. + If there is files inside the .Zip opened with unzOpenCurrentFile (see later), + these files MUST be closed with unzipCloseCurrentFile before call unzipClose. + return UNZ_OK if there is no problem. */ + +extern int ZEXPORT cpl_unzGetGlobalInfo (unzFile file, + unz_global_info *pglobal_info); +/* + Write info about the ZipFile in the *pglobal_info structure. + 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); +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ + + +/***************************************************************************/ +/* Unzip package allow you browse the directory of the zipfile */ + +extern int ZEXPORT cpl_unzGoToFirstFile (unzFile file); +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ + +extern int ZEXPORT cpl_unzGoToNextFile (unzFile file); +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ + +extern int ZEXPORT cpl_unzLocateFile (unzFile file, + const char *szFileName, + int iCaseSensitivity); +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current 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 */ +typedef struct unz_file_pos_s +{ + uLong64 pos_in_zip_directory; /* offset in zip file directory */ + uLong64 num_of_file; /* # of file */ +} unz_file_pos; + +extern int ZEXPORT cpl_unzGetFilePos( + unzFile file, + unz_file_pos* file_pos); + +extern int ZEXPORT cpl_unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos); + +/* ****************************************** */ + +extern int ZEXPORT cpl_unzGetCurrentFileInfo (unzFile file, + unz_file_info *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize); +/* + Get Info about the current file + if pfile_info!=NULL, the *pfile_info structure will contain some info about + the current file + if szFileName!=NULL, the filename string will be copied in szFileName + (fileNameBufferSize is the size of the buffer) + if extraField!=NULL, the extra field information will be copied in extraField + (extraFieldBufferSize is the size of the buffer). + This is the Central-header version of the extra field + if szComment!=NULL, the comment string of the file will be copied in szComment + (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) + */ + +extern int ZEXPORT cpl_unzOpenCurrentFile (unzFile file); +/* + Open for reading data the current file in the zipfile. + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT cpl_unzOpenCurrentFilePassword (unzFile file, + const char* password); +/* + Open for reading data the current file in the zipfile. + password is a crypting password + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT cpl_unzOpenCurrentFile2 (unzFile file, + int* method, + int* level, + int raw); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + +extern int ZEXPORT cpl_unzOpenCurrentFile3 (unzFile file, + int* method, + int* level, + int raw, + const char* password); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + + +extern int ZEXPORT cpl_unzCloseCurrentFile (unzFile file); +/* + Close the file in zip opened with unzOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ + +extern int ZEXPORT cpl_unzReadCurrentFile (unzFile file, + voidp buf, + unsigned len); +/* + Read bytes from the current file (opened by unzOpenCurrentFile) + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if some bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ + +extern z_off_t ZEXPORT cpl_unztell (unzFile file); +/* + Give the current position in uncompressed data +*/ + +extern int ZEXPORT cpl_unzeof (unzFile file); +/* + return 1 if the end of file was reached, 0 elsewhere +*/ + +extern int ZEXPORT cpl_unzGetLocalExtrafield (unzFile file, + voidp buf, + unsigned len); +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ + +/***************************************************************************/ + +/* Get the current file offset */ +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 /* CPL_MINIZIP_UNZIP_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_minizip_zip.h b/modules/globebrowsing/ext/gdal/include/cpl_minizip_zip.h new file mode 100644 index 0000000000..93a652e2cf --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_minizip_zip.h @@ -0,0 +1,259 @@ +/****************************************************************************** + * $Id$ + * + * Project: CPL - Common Portability Library + * Author: Frank Warmerdam, warmerdam@pobox.com + * Purpose: Adjusted minizip "zip.h" include file for zip services. + * + * Modified version by Even Rouault. : + * - Decoration of symbol names unz* -> cpl_unz* + * - Undef EXPORT so that we are sure the symbols are not exported + * - Remove old C style function prototypes + * - Added CPL* simplified API at bottom. + * + * Original licence available in port/LICENCE_minizip + * + *****************************************************************************/ + +/* zip.h -- IO for compress .zip files using zlib + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This unzip package allow creates .ZIP file, compatible with PKZip 2.04g + WinZip, InfoZip tools and compatible. + Multi volume ZipFile (span) are not supported. + Encryption compatible with pkzip 2.04g only supported + Old compressions used by old PKZip 1.x are not supported + + 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 + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 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 + http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip + http://www.info-zip.org/pub/infozip/doc/ + PkWare has also a specification at : + ftp://ftp.pkware.com/probdesc.zip +*/ + +#ifndef CPL_MINIZIP_ZIP_H_INCLUDED +#define CPL_MINIZIP_ZIP_H_INCLUDED + +#include "cpl_vsi.h" +#define uLong64 vsi_l_offset + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef CPL_MINIZIP_IOAPI_H_INCLUDED +#include "cpl_minizip_ioapi.h" +#endif + +#define NOCRYPT +#undef ZEXPORT +#define ZEXPORT + +#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagzipFile__ { int unused; } zipFile__; +typedef zipFile__ *zipFile; +#else +typedef voidp zipFile; +#endif + +#define ZIP_OK (0) +#define ZIP_EOF (0) +#define ZIP_ERRNO (Z_ERRNO) +#define ZIP_PARAMERROR (-102) +#define ZIP_BADZIPFILE (-103) +#define ZIP_INTERNALERROR (-104) + +#ifndef DEF_MEM_LEVEL +# if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +# else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +# endif +#endif +/* default memLevel */ + +/* tm_zip contain date/time info */ +typedef struct tm_zip_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_zip; + +typedef struct +{ + tm_zip tmz_date; /* date in understandable format */ + uLong dosDate; /* if dos_date == 0, tmu_date is used */ +/* uLong flag; */ /* general purpose bit flag 2 bytes */ + + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ +} zip_fileinfo; + +typedef const char* zipcharpc; + + +#define APPEND_STATUS_CREATE (0) +#define APPEND_STATUS_CREATEAFTER (1) +#define APPEND_STATUS_ADDINZIP (2) + +extern zipFile ZEXPORT cpl_zipOpen (const char *pathname, int append); +/* + Create a zipfile. + pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on + an Unix computer "zlib/zlib113.zip". + if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip + will be created at the end of the file. + (useful if the file contain a self extractor code) + if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will + add files in existing zip (be sure you don't add file that doesn't exist) + If the zipfile cannot be opened, the return value is NULL. + Else, the return value is a zipFile Handle, usable with other function + of this zip package. +*/ + +/* Note : there is no delete function for a zipfile. + If you want delete file in a zipfile, you must open a zipfile, and create another. + Of course, you can use RAW reading and writing to copy the file you did not want delete. +*/ + +extern zipFile ZEXPORT cpl_zipOpen2 (const char *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc_def* pzlib_filefunc_def); + +extern int ZEXPORT cpl_zipOpenNewFileInZip (zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level); +/* + Open a file in the ZIP for writing. + filename : the filename in zip (if NULL, '-' without quote will be used + *zipfi contain supplemental information + if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local + contains the extrafield data the local header + if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global + contains the extrafield data the local header + if comment != NULL, comment contain the comment string + method contain the compression method (0 for store, Z_DEFLATED for deflate) + 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, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw); + +/* + Same than zipOpenNewFileInZip, except if raw=1, we write raw file + */ + +extern int ZEXPORT cpl_zipOpenNewFileInZip3 (zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCtypting); + +/* + Same than zipOpenNewFileInZip2, except + windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 + password : crypting password (NULL for no crypting) + crcForCtypting : crc of file to compress (needed for crypting) + */ + + +extern int ZEXPORT cpl_zipWriteInFileInZip (zipFile file, + const void* buf, + unsigned len); +/* + Write data in the zipfile +*/ + +extern int ZEXPORT cpl_zipCloseFileInZip (zipFile file); +/* + Close the current file in the zipfile +*/ + +extern int ZEXPORT cpl_zipCloseFileInZipRaw (zipFile file, + uLong uncompressed_size, + uLong crc32); +/* + Close the current file in the zipfile, for file opened with + parameter raw=1 in zipOpenNewFileInZip2 + uncompressed_size and crc32 are value for the uncompressed size +*/ + +extern int ZEXPORT cpl_zipClose (zipFile file, + const char* global_comment); +/* + Close the zipfile +*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _zip_H */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_multiproc.h b/modules/globebrowsing/ext/gdal/include/cpl_multiproc.h new file mode 100644 index 0000000000..d07841dd49 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_multiproc.h @@ -0,0 +1,234 @@ +/********************************************************************** + * $Id$ + * + * Project: CPL - Common Portability Library + * Purpose: CPL Multi-Threading, and process handling portability functions. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ********************************************************************** + * Copyright (c) 2002, Frank Warmerdam + * Copyright (c) 2008-2013, Even Rouault + * + * 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_MULTIPROC_H_INCLUDED_ +#define CPL_MULTIPROC_H_INCLUDED_ + +#include "cpl_port.h" + +/* +** There are three primary implementations of the multi-process support +** controlled by one of CPL_MULTIPROC_WIN32, CPL_MULTIPROC_PTHREAD or +** CPL_MULTIPROC_STUB being defined. If none are defined, the stub +** implementation will be used. +*/ + +#if defined(WIN32) && !defined(CPL_MULTIPROC_STUB) +# define CPL_MULTIPROC_WIN32 +/* MinGW can have pthread support, so disable it to avoid issues */ +/* in cpl_multiproc.cpp */ +# undef CPL_MULTIPROC_PTHREAD +#endif + +#if !defined(CPL_MULTIPROC_WIN32) && !defined(CPL_MULTIPROC_PTHREAD) \ + && !defined(CPL_MULTIPROC_STUB) && !defined(CPL_MULTIPROC_NONE) +# define CPL_MULTIPROC_STUB +#endif + +CPL_C_START + +typedef void (*CPLThreadFunc)(void *); + +void CPL_DLL *CPLLockFile( const char *pszPath, double dfWaitInSeconds ); +void CPL_DLL CPLUnlockFile( void *hLock ); + +#ifdef DEBUG +typedef struct _CPLMutex CPLMutex; +typedef struct _CPLCond CPLCond; +typedef struct _CPLJoinableThread CPLJoinableThread; +#else +#define CPLMutex void +#define CPLCond void +#define CPLJoinableThread void +#endif + +/* Options for CPLCreateMutexEx() and CPLCreateOrAcquireMutexEx() */ +#define CPL_MUTEX_RECURSIVE 0 +#define CPL_MUTEX_ADAPTIVE 1 +#define CPL_MUTEX_REGULAR 2 + +CPLMutex CPL_DLL *CPLCreateMutex( void ); /* returned acquired */ +CPLMutex CPL_DLL *CPLCreateMutexEx( int nOptions ); /* returned acquired */ +int CPL_DLL CPLCreateOrAcquireMutex( CPLMutex **, double dfWaitInSeconds ); +int CPL_DLL CPLCreateOrAcquireMutexEx( CPLMutex **, double dfWaitInSeconds, int nOptions ); +int CPL_DLL CPLAcquireMutex( CPLMutex *hMutex, double dfWaitInSeconds ); +void CPL_DLL CPLReleaseMutex( CPLMutex *hMutex ); +void CPL_DLL CPLDestroyMutex( CPLMutex *hMutex ); +void CPL_DLL CPLCleanupMasterMutex( void ); + +CPLCond CPL_DLL *CPLCreateCond( void ); +void CPL_DLL CPLCondWait( CPLCond *hCond, CPLMutex* hMutex ); +void CPL_DLL CPLCondSignal( CPLCond *hCond ); +void CPL_DLL CPLCondBroadcast( CPLCond *hCond ); +void CPL_DLL CPLDestroyCond( CPLCond *hCond ); + +/** Contrary to what its name suggests, CPLGetPID() actually returns the thread id */ +GIntBig CPL_DLL CPLGetPID( void ); +int CPL_DLL CPLGetCurrentProcessID( void ); +int CPL_DLL CPLCreateThread( CPLThreadFunc pfnMain, void *pArg ); +CPLJoinableThread CPL_DLL* CPLCreateJoinableThread( CPLThreadFunc pfnMain, void *pArg ); +void CPL_DLL CPLJoinThread(CPLJoinableThread* hJoinableThread); +void CPL_DLL CPLSleep( double dfWaitInSeconds ); + +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 */ +/* on systems with pthread_spinlock API (so not MacOsX). If a requested type */ +/* isn't available, it fallbacks to LOCK_RECURSIVE_MUTEX */ +typedef enum +{ + LOCK_RECURSIVE_MUTEX, + LOCK_ADAPTIVE_MUTEX, + LOCK_SPIN +} CPLLockType; + +CPLLock CPL_DLL *CPLCreateLock( CPLLockType eType ); /* returned NON acquired */ +int CPL_DLL CPLCreateOrAcquireLock( CPLLock**, CPLLockType eType ); +int CPL_DLL CPLAcquireLock( CPLLock* ); +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 + +/* Instantiates the mutex if not already done. The parameter x should be a (void**). */ +#define CPLMutexHolderD(x) CPLMutexHolder oHolder(x,1000.0,__FILE__,__LINE__); + +/* Instantiates the mutex with options if not already done. */ +/* The parameter x should be a (void**). */ +#define CPLMutexHolderExD(x, nOptions) CPLMutexHolder oHolder(x,1000.0,__FILE__,__LINE__,nOptions); + +/* This variant assumes the mutex has already been created. If not, it will */ +/* be a no-op. The parameter x should be a (void*) */ +#define CPLMutexHolderOptionalLockD(x) CPLMutexHolder oHolder(x,1000.0,__FILE__,__LINE__); + +class CPL_DLL CPLMutexHolder +{ + private: + CPLMutex *hMutex; + const char *pszFile; + int nLine; + + public: + + /* 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 */ + CPLMutexHolder( CPLMutex* hMutex, double dfWaitInSeconds = 1000.0, + const char *pszFile = __FILE__, + int nLine = __LINE__ ); + + ~CPLMutexHolder(); +}; + +/* Instantiates the lock if not already done. The parameter x should be a (CPLLock**). */ +#define CPLLockHolderD(x, eType) CPLLockHolder oHolder(x,eType,__FILE__,__LINE__); + +/* This variant assumes the lock has already been created. If not, it will */ +/* be a no-op. The parameter should be (CPLLock*) */ +#define CPLLockHolderOptionalLockD(x) CPLLockHolder oHolder(x,__FILE__,__LINE__); + +class CPL_DLL CPLLockHolder +{ + private: + CPLLock *hLock; + const char *pszFile; + int nLine; + + public: + + /* 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 */ + CPLLockHolder( CPLLock* hSpin, + const char *pszFile = __FILE__, + int nLine = __LINE__ ); + + ~CPLLockHolder(); +}; + + +#endif /* def __cplusplus */ + +/* -------------------------------------------------------------------- */ +/* Thread local storage. */ +/* -------------------------------------------------------------------- */ + +#define CTLS_RLBUFFERINFO 1 /* cpl_conv.cpp */ +#define CTLS_WIN32_COND 2 /* cpl_multiproc.cpp */ +#define CTLS_CSVTABLEPTR 3 /* cpl_csv.cpp */ +#define CTLS_CSVDEFAULTFILENAME 4 /* cpl_csv.cpp */ +#define CTLS_ERRORCONTEXT 5 /* cpl_error.cpp */ +#define CTLS_GDALDATASET_REC_PROTECT_MAP 6 /* gdaldataset.cpp */ +#define CTLS_PATHBUF 7 /* cpl_path.cpp */ +#define CTLS_UNUSED3 8 +#define CTLS_UNUSED4 9 +#define CTLS_CPLSPRINTF 10 /* cpl_string.h */ +#define CTLS_RESPONSIBLEPID 11 /* gdaldataset.cpp */ +#define CTLS_VERSIONINFO 12 /* gdal_misc.cpp */ +#define CTLS_VERSIONINFO_LICENCE 13 /* gdal_misc.cpp */ +#define CTLS_CONFIGOPTIONS 14 /* cpl_conv.cpp */ +#define CTLS_FINDFILE 15 /* cpl_findfile.cpp */ +#define CTLS_VSIERRORCONTEXT 16 /* cpl_vsi_error.cpp */ + +#define CTLS_MAX 32 + +CPL_C_START +void CPL_DLL * CPLGetTLS( int nIndex ); +void CPL_DLL * CPLGetTLSEx( int nIndex, int* pbMemoryErrorOccurred ); +void CPL_DLL CPLSetTLS( int nIndex, void *pData, int bFreeOnExit ); + +/* Warning : the CPLTLSFreeFunc must not in any case directly or indirectly */ +/* use or fetch any TLS data, or a terminating thread will hang ! */ +typedef void (*CPLTLSFreeFunc)( void* pData ); +void CPL_DLL CPLSetTLSWithFreeFunc( int nIndex, void *pData, CPLTLSFreeFunc pfnFree ); +void CPL_DLL CPLSetTLSWithFreeFuncEx( int nIndex, void *pData, CPLTLSFreeFunc pfnFree, int* pbMemoryErrorOccurred ); + +void CPL_DLL CPLCleanupTLS( void ); +CPL_C_END + +#endif /* CPL_MULTIPROC_H_INCLUDED_ */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_odbc.h b/modules/globebrowsing/ext/gdal/include/cpl_odbc.h new file mode 100644 index 0000000000..cf47b8687c --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_odbc.h @@ -0,0 +1,281 @@ +/****************************************************************************** + * $Id$ + * + * Project: OGR ODBC Driver + * Purpose: Declarations for ODBC Access Cover API. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 2003, 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 CPL_ODBC_H_INCLUDED +#define CPL_ODBC_H_INCLUDED + +#include "cpl_port.h" + +#ifdef WIN32 +# include +#endif + +#include +#include +#include +#include "cpl_string.h" + +#ifdef PATH_MAX +# define ODBC_FILENAME_MAX PATH_MAX +#else +# define ODBC_FILENAME_MAX (255 + 1) /* Max path length */ +#endif + + +/** + * \file cpl_odbc.h + * + * ODBC Abstraction Layer (C++). + */ + +/** + * A class providing functions to install or remove ODBC driver. + */ +class CPL_DLL CPLODBCDriverInstaller +{ + char m_szPathOut[ODBC_FILENAME_MAX]; + char m_szError[SQL_MAX_MESSAGE_LENGTH]; + DWORD m_nErrorCode; + DWORD m_nUsageCount; + + public: + + // Default constructor. + CPLODBCDriverInstaller(); + + + /** + * Installs ODBC driver or updates definition of already installed driver. + * Interanally, it calls ODBC's SQLInstallDriverEx function. + * + * @param pszDriver - The driver definition as a list of keyword-value + * pairs describing the driver (See ODBC API Reference). + * + * @param pszPathIn - Full path of the target directory of the installation, + * or a null pointer (for unixODBC, NULL is passed). + * + * @param fRequest - The fRequest argument must contain one of + * the following values: + * ODBC_INSTALL_COMPLETE - (default) complete the installation request + * ODBC_INSTALL_INQUIRY - inquire about where a driver can be installed + * + * @return TRUE indicates success, FALSE if it fails. + */ + int InstallDriver( const char* pszDriver, const char* pszPathIn, + WORD fRequest = ODBC_INSTALL_COMPLETE ); + + /** + * Removes or changes information about the driver from + * the Odbcinst.ini entry in the system information. + * + * @param pszDriverName - The name of the driver as registered in + * the Odbcinst.ini key of the system information. + * + * @param fRemoveDSN - TRUE: Remove DSNs associated with the driver + * specified in lpszDriver. FALSE: Do not remove DSNs associated + * with the driver specified in lpszDriver. + * + * @return The function returns TRUE if it is successful, + * FALSE if it fails. If no entry exists in the system information + * when this function is called, the function returns FALSE. + * In order to obtain usage count value, call GetUsageCount(). + */ + int RemoveDriver( const char* pszDriverName, int fRemoveDSN = FALSE ); + + + // 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 + 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. + 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. + DWORD GetLastErrorCode() const { return m_nErrorCode; } +}; + +class CPLODBCStatement; + +/* On MSVC SQLULEN is missing in some cases (i.e. VC6) +** but it is always a #define so test this way. On Unix +** it is a typedef so we can't always do this. +*/ +#if defined(_MSC_VER) && !defined(SQLULEN) && !defined(_WIN64) +# define MISSING_SQLULEN +#endif + +#if !defined(MISSING_SQLULEN) +/* ODBC types to support 64 bit compilation */ +# define CPL_SQLULEN SQLULEN +# define CPL_SQLLEN SQLLEN +#else +# define CPL_SQLULEN SQLUINTEGER +# define CPL_SQLLEN SQLINTEGER +#endif /* ifdef SQLULEN */ + + +/** + * A class representing an ODBC database session. + * + * Includes error collection services. + */ + +class CPL_DLL CPLODBCSession { + char m_szLastError[SQL_MAX_MESSAGE_LENGTH + 1]; + HENV m_hEnv; + HDBC m_hDBC; + int m_bInTransaction; + int m_bAutoCommit; + + public: + CPLODBCSession(); + ~CPLODBCSession(); + + int EstablishSession( const char *pszDSN, + const char *pszUserid, + const char *pszPassword ); + const char *GetLastError(); + + // Transaction handling + + int ClearTransaction(); + int BeginTransaction(); + int CommitTransaction(); + int RollbackTransaction(); + int IsInTransaction() { return m_bInTransaction; } + + // Essentially internal. + + int CloseSession(); + + int Failed( int, HSTMT = NULL ); + HDBC GetConnection() { return m_hDBC; } + HENV GetEnvironment() { return m_hEnv; } +}; + +/** + * Abstraction for statement, and resultset. + * + * Includes methods for executing an SQL statement, and for accessing the + * resultset from that statement. Also provides for executing other ODBC + * requests that produce results sets such as SQLColumns() and SQLTables() + * requests. + */ + +class CPL_DLL CPLODBCStatement { + + CPLODBCSession *m_poSession; + HSTMT m_hStmt; + + SQLSMALLINT m_nColCount; + char **m_papszColNames; + SQLSMALLINT *m_panColType; + char **m_papszColTypeNames; + CPL_SQLULEN *m_panColSize; + SQLSMALLINT *m_panColPrecision; + SQLSMALLINT *m_panColNullable; + char **m_papszColColumnDef; + + char **m_papszColValues; + CPL_SQLLEN *m_panColValueLengths; + + int Failed( int ); + + char *m_pszStatement; + size_t m_nStatementMax; + size_t m_nStatementLen; + + public: + CPLODBCStatement( CPLODBCSession * ); + ~CPLODBCStatement(); + + HSTMT GetStatement() { return m_hStmt; } + + // Command buffer related. + void Clear(); + void AppendEscaped( const char * ); + void Append( const char * ); + void Append( int ); + void Append( double ); + int Appendf( const char *, ... ) CPL_PRINT_FUNC_FORMAT (2, 3); + const char *GetCommand() { return m_pszStatement; } + + int ExecuteSQL( const char * = NULL ); + + // Results fetching + int Fetch( int nOrientation = SQL_FETCH_NEXT, + int nOffset = 0 ); + void ClearColumnData(); + + int GetColCount(); + const char *GetColName( int ); + short GetColType( int ); + const char *GetColTypeName( int ); + short GetColSize( int ); + short GetColPrecision( int ); + short GetColNullable( int ); + const char *GetColColumnDef( int ); + + int GetColId( const char * ); + const char *GetColData( int, const char * = NULL ); + const char *GetColData( const char *, const char * = NULL ); + int GetColDataLength( int ); + int GetRowCountAffected(); + + // Fetch special metadata. + int GetColumns( const char *pszTable, + const char *pszCatalog = NULL, + const char *pszSchema = NULL ); + int GetPrimaryKeys( const char *pszTable, + const char *pszCatalog = NULL, + const char *pszSchema = NULL ); + + int GetTables( const char *pszCatalog = NULL, + const char *pszSchema = NULL ); + + void DumpResult( FILE *fp, int bShowSchema = FALSE ); + + static CPLString GetTypeName( int ); + static SQLSMALLINT GetTypeMapping( SQLSMALLINT ); + + int CollectResultsInfo(); +}; + +#endif diff --git a/modules/globebrowsing/ext/gdal/include/cpl_port.h b/modules/globebrowsing/ext/gdal/include/cpl_port.h new file mode 100644 index 0000000000..221a0f6de6 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_port.h @@ -0,0 +1,974 @@ +/****************************************************************************** + * $Id$ + * + * Project: CPL - Common Portability Library + * Author: Frank Warmerdam, warmerdam@pobox.com + * Purpose: Include file providing low level portability services for CPL. + * This should be the first include file for any CPL based code. + * + ****************************************************************************** + * Copyright (c) 1998, 2005, Frank Warmerdam + * Copyright (c) 2008-2013, Even Rouault + * + * 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_BASE_H_INCLUDED +#define CPL_BASE_H_INCLUDED + +/** + * \file cpl_port.h + * + * Core portability definitions for CPL. + * + */ + +/* ==================================================================== */ +/* We will use WIN32 as a standard windows define. */ +/* ==================================================================== */ +#if defined(_WIN32) && !defined(WIN32) +# define WIN32 +#endif + +#if defined(_WINDOWS) && !defined(WIN32) +# define WIN32 +#endif + +/* -------------------------------------------------------------------- */ +/* The following apparently allow you to use strcpy() and other */ +/* functions judged "unsafe" by microsoft in VS 8 (2005). */ +/* -------------------------------------------------------------------- */ +#ifdef _MSC_VER +# ifndef _CRT_SECURE_NO_DEPRECATE +# define _CRT_SECURE_NO_DEPRECATE +# endif +# ifndef _CRT_NONSTDC_NO_DEPRECATE +# define _CRT_NONSTDC_NO_DEPRECATE +# endif +#endif + +#include "cpl_config.h" + +/* ==================================================================== */ +/* A few sanity checks, mainly to detect problems that sometimes */ +/* arise with bad configured cross-compilation. */ +/* ==================================================================== */ + +#if !defined(SIZEOF_INT) || SIZEOF_INT != 4 +#error "Unexpected value for SIZEOF_INT" +#endif + +#if !defined(SIZEOF_UNSIGNED_LONG) || (SIZEOF_UNSIGNED_LONG != 4 && SIZEOF_UNSIGNED_LONG != 8) +#error "Unexpected value for SIZEOF_UNSIGNED_LONG" +#endif + +#if !defined(SIZEOF_VOIDP) || (SIZEOF_VOIDP != 4 && SIZEOF_VOIDP != 8) +#error "Unexpected value for SIZEOF_VOIDP" +#endif + + +/* ==================================================================== */ +/* This will disable most WIN32 stuff in a Cygnus build which */ +/* defines unix to 1. */ +/* ==================================================================== */ + +#ifdef unix +# undef WIN32 +#endif + +#if defined(VSI_NEED_LARGEFILE64_SOURCE) && !defined(_LARGEFILE64_SOURCE) +# define _LARGEFILE64_SOURCE 1 +#endif + +/* ==================================================================== */ +/* If iconv() is available use extended recoding module. */ +/* Stub implementation is always compiled in, because it works */ +/* faster than iconv() for encodings it supports. */ +/* ==================================================================== */ + +#if defined(HAVE_ICONV) +# define CPL_RECODE_ICONV +#endif + +#define CPL_RECODE_STUB + +/* ==================================================================== */ +/* MinGW stuff */ +/* ==================================================================== */ + +/* We need __MSVCRT_VERSION__ >= 0x0601 to have "struct __stat64" */ +/* 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 +#endif +#endif + +/* ==================================================================== */ +/* Standard include files. */ +/* ==================================================================== */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#if defined(HAVE_ERRNO_H) +# include +#endif + +#ifdef HAVE_LOCALE_H +# include +#endif + +#ifdef HAVE_DIRECT_H +# include +#endif + +#if !defined(WIN32) +# include +#endif + +#if defined(HAVE_LIBDBMALLOC) && defined(HAVE_DBMALLOC_H) && defined(DEBUG) +# define DBMALLOC +# include +#endif + +#if !defined(DBMALLOC) && defined(HAVE_DMALLOC_H) +# define USE_DMALLOC +# include +#endif + +/* ==================================================================== */ +/* Base portability stuff ... this stuff may need to be */ +/* modified for new platforms. */ +/* ==================================================================== */ + +/* -------------------------------------------------------------------- */ +/* Which versions of C++ are available. */ +/* -------------------------------------------------------------------- */ + +#ifdef __cplusplus +# if __cplusplus >= 201103L +# define HAVE_CXX11 1 +# endif +/* TODO(schwehr): What are the correct tests for C++ 14 and 17? */ +#endif /* __cpluscplus */ + +/*--------------------------------------------------------------------- + * types for 16 and 32 bits integers, etc... + *--------------------------------------------------------------------*/ +#if UINT_MAX == 65535 +typedef long GInt32; +typedef unsigned long GUInt32; +#else +typedef int GInt32; +typedef unsigned int GUInt32; +#endif + +typedef short GInt16; +typedef unsigned short GUInt16; +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 +#define CPL_GBOOL_DEFINED +typedef int GBool; +#endif + +/* -------------------------------------------------------------------- */ +/* 64bit support */ +/* -------------------------------------------------------------------- */ + +#if defined(WIN32) && defined(_MSC_VER) + +#define VSI_LARGE_API_SUPPORTED +typedef __int64 GIntBig; +typedef unsigned __int64 GUIntBig; + +#define GINTBIG_MIN ((GIntBig)(0x80000000) << 32) +#define GINTBIG_MAX (((GIntBig)(0x7FFFFFFF) << 32) | 0xFFFFFFFFU) +#define GUINTBIG_MAX (((GUIntBig)(0xFFFFFFFFU) << 32) | 0xFFFFFFFFU) + +#elif HAVE_LONG_LONG + +typedef long long GIntBig; +typedef unsigned long long GUIntBig; + +#define GINTBIG_MIN ((GIntBig)(0x80000000) << 32) +#define GINTBIG_MAX (((GIntBig)(0x7FFFFFFF) << 32) | 0xFFFFFFFFU) +#define GUINTBIG_MAX (((GUIntBig)(0xFFFFFFFFU) << 32) | 0xFFFFFFFFU) + +#else + +typedef long GIntBig; +typedef unsigned long GUIntBig; + +#define GINTBIG_MIN INT_MIN +#define GINTBIG_MAX INT_MAX +#define GUINTBIG_MAX UINT_MAX +#endif + +#if SIZEOF_VOIDP == 8 +typedef GIntBig GPtrDiff_t; +#else +typedef int GPtrDiff_t; +#endif + +#if defined(__MSVCRT__) || (defined(WIN32) && defined(_MSC_VER)) + #define CPL_FRMT_GB_WITHOUT_PREFIX "I64" +#elif HAVE_LONG_LONG + #define CPL_FRMT_GB_WITHOUT_PREFIX "ll" +#else + #define CPL_FRMT_GB_WITHOUT_PREFIX "l" +#endif + +#define CPL_FRMT_GIB "%" CPL_FRMT_GB_WITHOUT_PREFIX "d" +#define CPL_FRMT_GUIB "%" CPL_FRMT_GB_WITHOUT_PREFIX "u" + +/* 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 + +#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 + +/* ==================================================================== */ +/* Other standard services. */ +/* ==================================================================== */ +#ifdef __cplusplus +# define CPL_C_START extern "C" { +# define CPL_C_END } +#else +# define CPL_C_START +# define CPL_C_END +#endif + +#ifndef CPL_DLL +#if defined(_MSC_VER) && !defined(CPL_DISABLE_DLL) +# define CPL_DLL __declspec(dllexport) +#else +# if defined(USE_GCC_VISIBILITY_FLAG) +# define CPL_DLL __attribute__ ((visibility("default"))) +# else +# define CPL_DLL +# endif +#endif +#endif + +/* Should optional (normally private) interfaces be exported? */ +#ifdef CPL_OPTIONAL_APIS +# define CPL_ODLL CPL_DLL +#else +# define CPL_ODLL +#endif + +#ifndef CPL_STDCALL +#if defined(_MSC_VER) && !defined(CPL_DISABLE_STDCALL) +# define CPL_STDCALL __stdcall +#else +# define CPL_STDCALL +#endif +#endif + +#ifdef _MSC_VER +# define FORCE_CDECL __cdecl +#else +# define FORCE_CDECL +#endif + +/* TODO : support for other compilers needed */ +#if (defined(__GNUC__) && !defined(__NO_INLINE__)) || defined(_MSC_VER) +#define HAS_CPL_INLINE 1 +#define CPL_INLINE __inline +#elif defined(__SUNPRO_CC) +#define HAS_CPL_INLINE 1 +#define CPL_INLINE inline +#else +#define CPL_INLINE +#endif + +// 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 + +#ifdef __GNUC__ +// We need to include all that bunch of system headers, otherwise +// as they include with __need_NULL, this overrides our #define NULL nullptr +// with #define NULL __null +#include +#include +#include +#ifdef HAVE_ICONV +#include +#endif +#ifdef HAVE_MMAP +#include +#endif +#include +#ifndef _WIN32 +#include +#include +#include +#endif + +extern "C++" { +#include +#include +#include +#include +#include +#include +#include +#include +} +#endif /* __GNUC__ */ + +#undef NULL +#define NULL nullptr +#else /* defined(NULL_AS_NULLPTR) && HAVE_CXX11 */ +#ifndef NULL +# define NULL 0 +#endif +#endif /* defined(NULL_AS_NULLPTR) && HAVE_CXX11 */ + + +#ifndef MAX +# define MIN(a,b) ((ab) ? a : b) +#endif + +#ifndef ABS +# define ABS(x) ((x<0) ? (-1*(x)) : x) +#endif + +#ifndef M_PI +# define M_PI 3.14159265358979323846 +/* 3.1415926535897932384626433832795 */ +#endif + +/* -------------------------------------------------------------------- */ +/* Macro to test equality of two floating point values. */ +/* We use fabs() function instead of ABS() macro to avoid side */ +/* effects. */ +/* -------------------------------------------------------------------- */ +#ifndef CPLIsEqual +# define CPLIsEqual(x,y) (fabs((x) - (y)) < 0.0000000000001) +#endif + +/* -------------------------------------------------------------------- */ +/* Provide macros for case insensitive string comparisons. */ +/* -------------------------------------------------------------------- */ +#ifndef EQUAL + +#if defined(AFL_FRIENDLY) && defined(__GNUC__) + +static inline int CPL_afl_friendly_memcmp(const void* ptr1, const void* ptr2, size_t len) + __attribute__((always_inline)); + +static inline int CPL_afl_friendly_memcmp(const void* ptr1, const void* ptr2, size_t len) +{ + const unsigned char* bptr1 = (const unsigned char*)ptr1; + const unsigned char* bptr2 = (const unsigned char*)ptr2; + while( len-- ) + { + unsigned char b1 = *(bptr1++); + unsigned char b2 = *(bptr2++); + if( b1 != b2 ) return b1 - b2; + } + return 0; +} + +static inline int CPL_afl_friendly_strcmp(const char* ptr1, const char* ptr2) + __attribute__((always_inline)); + +static inline int CPL_afl_friendly_strcmp(const char* ptr1, const char* ptr2) +{ + const unsigned char* usptr1 = (const unsigned char*)ptr1; + const unsigned char* usptr2 = (const unsigned char*)ptr2; + while( 1 ) + { + unsigned char ch1 = *(usptr1++); + unsigned char ch2 = *(usptr2++); + if( ch1 == 0 || ch1 != ch2 ) return ch1 - ch2; + } +} + +static inline int CPL_afl_friendly_strncmp(const char* ptr1, const char* ptr2, size_t len) + __attribute__((always_inline)); + +static inline int CPL_afl_friendly_strncmp(const char* ptr1, const char* ptr2, size_t len) +{ + const unsigned char* usptr1 = (const unsigned char*)ptr1; + const unsigned char* usptr2 = (const unsigned char*)ptr2; + while( len -- ) + { + unsigned char ch1 = *(usptr1++); + unsigned char ch2 = *(usptr2++); + if( ch1 == 0 || ch1 != ch2 ) return ch1 - ch2; + } + return 0; +} + +static inline int CPL_afl_friendly_strcasecmp(const char* ptr1, const char* ptr2) + __attribute__((always_inline)); + +static inline int CPL_afl_friendly_strcasecmp(const char* ptr1, const char* ptr2) +{ + const unsigned char* usptr1 = (const unsigned char*)ptr1; + const unsigned char* usptr2 = (const unsigned char*)ptr2; + while( 1 ) + { + unsigned char ch1 = *(usptr1++); + unsigned char ch2 = *(usptr2++); + ch1 = (unsigned char)toupper(ch1); + ch2 = (unsigned char)toupper(ch2); + if( ch1 == 0 || ch1 != ch2 ) return ch1 - ch2; + } +} + +static inline int CPL_afl_friendly_strncasecmp(const char* ptr1, const char* ptr2, size_t len) + __attribute__((always_inline)); + +static inline int CPL_afl_friendly_strncasecmp(const char* ptr1, const char* ptr2, size_t len) +{ + const unsigned char* usptr1 = (const unsigned char*)ptr1; + const unsigned char* usptr2 = (const unsigned char*)ptr2; + while( len-- ) + { + unsigned char ch1 = *(usptr1++); + unsigned char ch2 = *(usptr2++); + ch1 = (unsigned char)toupper(ch1); + ch2 = (unsigned char)toupper(ch2); + if( ch1 == 0 || ch1 != ch2 ) return ch1 - ch2; + } + return 0; +} + +static inline char* CPL_afl_friendly_strstr(const char* haystack, const char* needle) + __attribute__((always_inline)); + +static inline char* CPL_afl_friendly_strstr(const char* haystack, const char* needle) +{ + const char* ptr_haystack = haystack; + while( 1 ) + { + const char* ptr_haystack2 = ptr_haystack; + const char* ptr_needle = needle; + while( 1 ) + { + char ch1 = *(ptr_haystack2++); + char ch2 = *(ptr_needle++); + if( ch2 == 0 ) + return (char*)ptr_haystack; + if( ch1 != ch2 ) + break; + } + if( *ptr_haystack == 0 ) + return NULL; + ptr_haystack ++; + } +} + +#undef strcmp +#undef strncmp +#define memcmp CPL_afl_friendly_memcmp +#define strcmp CPL_afl_friendly_strcmp +#define strncmp CPL_afl_friendly_strncmp +#define strcasecmp CPL_afl_friendly_strcasecmp +#define strncasecmp CPL_afl_friendly_strncasecmp +#define strstr CPL_afl_friendly_strstr + +#endif /* defined(AFL_FRIENDLY) && defined(__GNUC__) */ + +# if defined(WIN32) +# define STRCASECMP(a,b) (stricmp(a,b)) +# define STRNCASECMP(a,b,n) (strnicmp(a,b,n)) +# else +# define STRCASECMP(a,b) (strcasecmp(a,b)) +# define STRNCASECMP(a,b,n) (strncasecmp(a,b,n)) +# endif +# define EQUALN(a,b,n) (STRNCASECMP(a,b,n)==0) +# define EQUAL(a,b) (STRCASECMP(a,b)==0) +#endif + +/*--------------------------------------------------------------------- + * Does a string "a" start with string "b". Search is case-sensitive or, + * with CI, it is a case-insensitive comparison. + *--------------------------------------------------------------------- */ +#ifndef STARTS_WITH_CI +#define STARTS_WITH(a,b) (strncmp(a,b,strlen(b)) == 0) +#define STARTS_WITH_CI(a,b) EQUALN(a,b,strlen(b)) +#endif + +#ifndef CPL_THREADLOCAL +# define CPL_THREADLOCAL +#endif + +/* -------------------------------------------------------------------- */ +/* Handle isnan() and isinf(). Note that isinf() and isnan() */ +/* are supposed to be macros according to C99, defined in math.h */ +/* Some systems (i.e. Tru64) don't have isinf() at all, so if */ +/* the macro is not defined we just assume nothing is infinite. */ +/* This may mean we have no real CPLIsInf() on systems with isinf()*/ +/* function but no corresponding macro, but I can live with */ +/* that since it isn't that important a test. */ +/* -------------------------------------------------------------------- */ +#ifdef _MSC_VER +# include +# define CPLIsNan(x) _isnan(x) +# define CPLIsInf(x) (!_isnan(x) && !_finite(x)) +# define CPLIsFinite(x) _finite(x) +#else +# define CPLIsNan(x) isnan(x) +# ifdef isinf +# define CPLIsInf(x) isinf(x) +# define CPLIsFinite(x) (!isnan(x) && !isinf(x)) +# elif defined(__sun__) +# include +# define CPLIsInf(x) (!finite(x) && !isnan(x)) +# define CPLIsFinite(x) finite(x) +# else +# define CPLIsInf(x) (0) +# define CPLIsFinite(x) (!isnan(x)) +# endif +#endif + +/*--------------------------------------------------------------------- + * CPL_LSB and CPL_MSB + * Only one of these 2 macros should be defined and specifies the byte + * ordering for the current platform. + * This should be defined in the Makefile, but if it is not then + * the default is CPL_LSB (Intel ordering, LSB first). + *--------------------------------------------------------------------*/ +#if defined(WORDS_BIGENDIAN) && !defined(CPL_MSB) && !defined(CPL_LSB) +# define CPL_MSB +#endif + +#if ! ( defined(CPL_LSB) || defined(CPL_MSB) ) +#define CPL_LSB +#endif + +#if defined(CPL_LSB) +# define CPL_IS_LSB 1 +#else +# define CPL_IS_LSB 0 +#endif + +#ifdef __cplusplus + +extern "C++" { + +template struct CPLStaticAssert {}; +template<> struct CPLStaticAssert +{ + static void my_function() {} +}; + +} /* extern "C++" */ + +#define CPL_STATIC_ASSERT(x) CPLStaticAssert::my_function() +#define CPL_STATIC_ASSERT_IF_AVAILABLE(x) CPL_STATIC_ASSERT(x) + +#else /* __cplusplus */ + +#define CPL_STATIC_ASSERT_IF_AVAILABLE(x) + +#endif /* __cplusplus */ + +/*--------------------------------------------------------------------- + * Little endian <==> big endian byte swap macros. + *--------------------------------------------------------------------*/ + +#define CPL_SWAP16(x) \ + ((GUInt16)( \ + (((GUInt16)(x) & 0x00ffU) << 8) | \ + (((GUInt16)(x) & 0xff00U) >> 8) )) + +#define CPL_SWAP16PTR(x) \ +{ \ + GByte byTemp, *_pabyDataT = (GByte *) (x); \ + CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 2); \ + \ + byTemp = _pabyDataT[0]; \ + _pabyDataT[0] = _pabyDataT[1]; \ + _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) )) + +#define CPL_SWAP32PTR(x) \ +{ \ + GByte byTemp, *_pabyDataT = (GByte *) (x); \ + CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 4); \ + \ + byTemp = _pabyDataT[0]; \ + _pabyDataT[0] = _pabyDataT[3]; \ + _pabyDataT[3] = byTemp; \ + byTemp = _pabyDataT[1]; \ + _pabyDataT[1] = _pabyDataT[2]; \ + _pabyDataT[2] = byTemp; \ +} + +#define CPL_SWAP64PTR(x) \ +{ \ + GByte byTemp, *_pabyDataT = (GByte *) (x); \ + CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 8); \ + \ + byTemp = _pabyDataT[0]; \ + _pabyDataT[0] = _pabyDataT[7]; \ + _pabyDataT[7] = byTemp; \ + byTemp = _pabyDataT[1]; \ + _pabyDataT[1] = _pabyDataT[6]; \ + _pabyDataT[6] = byTemp; \ + byTemp = _pabyDataT[2]; \ + _pabyDataT[2] = _pabyDataT[5]; \ + _pabyDataT[5] = byTemp; \ + byTemp = _pabyDataT[3]; \ + _pabyDataT[3] = _pabyDataT[4]; \ + _pabyDataT[4] = byTemp; \ +} + + +/* 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) )) +*/ + +#define CPL_SWAPDOUBLE(p) CPL_SWAP64PTR(p) + +#ifdef CPL_MSB +# define CPL_MSBWORD16(x) (x) +# define CPL_LSBWORD16(x) CPL_SWAP16(x) +# define CPL_MSBWORD32(x) (x) +# define CPL_LSBWORD32(x) CPL_SWAP32(x) +# define CPL_MSBPTR16(x) CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 2) +# define CPL_LSBPTR16(x) CPL_SWAP16PTR(x) +# define CPL_MSBPTR32(x) CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 4) +# define CPL_LSBPTR32(x) CPL_SWAP32PTR(x) +# define CPL_MSBPTR64(x) CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 8) +# define CPL_LSBPTR64(x) CPL_SWAP64PTR(x) +#else +# define CPL_LSBWORD16(x) (x) +# define CPL_MSBWORD16(x) CPL_SWAP16(x) +# define CPL_LSBWORD32(x) (x) +# define CPL_MSBWORD32(x) CPL_SWAP32(x) +# define CPL_LSBPTR16(x) CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 2) +# define CPL_MSBPTR16(x) CPL_SWAP16PTR(x) +# define CPL_LSBPTR32(x) CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 4) +# define CPL_MSBPTR32(x) CPL_SWAP32PTR(x) +# define CPL_LSBPTR64(x) CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 8) +# define CPL_MSBPTR64(x) CPL_SWAP64PTR(x) +#endif + +/** Return a Int16 from the 2 bytes ordered in LSB order at address x */ +#define CPL_LSBINT16PTR(x) ((*(GByte*)(x)) | (*(((GByte*)(x))+1) << 8)) + +/** Return a Int32 from the 4 bytes ordered in LSB order at address x */ +#define CPL_LSBINT32PTR(x) ((*(GByte*)(x)) | (*(((GByte*)(x))+1) << 8) | \ + (*(((GByte*)(x))+2) << 16) | (*(((GByte*)(x))+3) << 24)) + +/** Return a signed Int16 from the 2 bytes ordered in LSB order at address x */ +#define CPL_LSBSINT16PTR(x) ((GInt16) CPL_LSBINT16PTR(x)) + +/** Return a unsigned Int16 from the 2 bytes ordered in LSB order at address x */ +#define CPL_LSBUINT16PTR(x) ((GUInt16)CPL_LSBINT16PTR(x)) + +/** Return a signed Int32 from the 4 bytes ordered in LSB order at address x */ +#define CPL_LSBSINT32PTR(x) ((GInt32) CPL_LSBINT32PTR(x)) + +/** Return a unsigned Int32 from the 4 bytes ordered in LSB order at address x */ +#define CPL_LSBUINT32PTR(x) ((GUInt32)CPL_LSBINT32PTR(x)) + + +/* Utility macro to explicitly mark intentionally unreferenced parameters. */ +#ifndef UNREFERENCED_PARAM +# ifdef UNREFERENCED_PARAMETER /* May be defined by Windows API */ +# define UNREFERENCED_PARAM(param) UNREFERENCED_PARAMETER(param) +# else +# define UNREFERENCED_PARAM(param) ((void)param) +# endif /* UNREFERENCED_PARAMETER */ +#endif /* UNREFERENCED_PARAM */ + +/*********************************************************************** + * Define CPL_CVSID() macro. It can be disabled during a build by + * defining DISABLE_CVSID in the compiler options. + * + * The cvsid_aw() function is just there to prevent reports of cpl_cvsid() + * being unused. + */ + +#ifndef DISABLE_CVSID +#if defined(__GNUC__) && __GNUC__ >= 4 +# define CPL_CVSID(string) static const char cpl_cvsid[] __attribute__((used)) = string; +#else +# define CPL_CVSID(string) static const char cpl_cvsid[] = string; \ +static const char *cvsid_aw() { return( cvsid_aw() ? NULL : cpl_cvsid ); } +#endif +#else +# define CPL_CVSID(string) +#endif + +/* 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) +# define CPL_NULL_TERMINATED __attribute__((__sentinel__)) +#else +# define CPL_NULL_TERMINATED +#endif + +#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(DOXYGEN_SKIP) +#define CPL_PRINT_FUNC_FORMAT( format_idx, arg_idx ) __attribute__((__format__ (__printf__, format_idx, arg_idx))) +#define CPL_SCAN_FUNC_FORMAT( format_idx, arg_idx ) __attribute__((__format__ (__scanf__, format_idx, arg_idx))) +#else +#define CPL_PRINT_FUNC_FORMAT( format_idx, arg_idx ) +#define CPL_SCAN_FUNC_FORMAT( format_idx, arg_idx ) +#endif + +#if defined(__GNUC__) && __GNUC__ >= 4 && !defined(DOXYGEN_SKIP) +#define CPL_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +#define CPL_WARN_UNUSED_RESULT +#endif + +#if defined(__GNUC__) && __GNUC__ >= 4 +# define CPL_UNUSED __attribute((__unused__)) +#else +/* TODO: add cases for other compilers */ +# define CPL_UNUSED +#endif + +#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(DOXYGEN_SKIP) +#define CPL_NO_RETURN __attribute__((noreturn)) +#else +#define CPL_NO_RETURN +#endif + +/* 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) +# define CPL_RETURNS_NONNULL __attribute__((returns_nonnull)) +#else +# define CPL_RETURNS_NONNULL +#endif + + +#if defined(__GNUC__) && __GNUC__ >= 4 && !defined(DOXYGEN_SKIP) +#define CPL_RESTRICT __restrict__ +#else +#define CPL_RESTRICT +#endif + +/* 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 +# define CPL_FINAL +# define CPL_DISALLOW_COPY_ASSIGN(ClassName) \ + ClassName( const ClassName & ); \ + ClassName &operator=( const ClassName & ); +#endif /* HAVE_CXX11 */ + +#endif /* __cplusplus */ + +#if !defined(DOXYGEN_SKIP) +#if defined(__has_extension) + #if __has_extension(attribute_deprecated_with_message) + /* Clang extension */ + #define CPL_WARN_DEPRECATED(x) __attribute__ ((deprecated(x))) + #else + #define CPL_WARN_DEPRECATED(x) + #endif +#elif defined(__GNUC__) + #define CPL_WARN_DEPRECATED(x) __attribute__ ((deprecated)) +#else + #define CPL_WARN_DEPRECATED(x) +#endif +#endif + +#if !defined(_MSC_VER) && !defined(__APPLE__) +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 +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)) +#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) ) +#endif + +#ifdef __cplusplus +/* The size of C style arrays. */ +#define CPL_ARRAYSIZE(array) \ + ((sizeof(array) / sizeof(*(array))) / \ + static_cast(!(sizeof(array) % sizeof(*(array))))) + +extern "C++" { +template static void CPL_IGNORE_RET_VAL(T) {} +inline static bool CPL_TO_BOOL(int x) { return x != 0; } +} /* extern "C++" */ + +#endif /* __cplusplus */ + +#if (((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || (defined(__clang__) && __clang_major__ >= 3)) && !defined(_MSC_VER)) +#define HAVE_GCC_DIAGNOSTIC_PUSH +#endif + +#if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) && !defined(_MSC_VER)) +#define HAVE_GCC_SYSTEM_HEADER +#endif + +#if defined(__clang__) +# define CPL_FALLTHROUGH [[clang::fallthrough]]; +#else +# define CPL_FALLTHROUGH +#endif + +// 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 +// at runtime for unknown reasons (crash in MongoDB driver for example) +#if defined(__cplusplus) && defined(DEBUG_BOOL) && !defined(DO_NOT_USE_DEBUG_BOOL) +extern "C++" { +class MSVCPedanticBool +{ + + friend bool operator== (const bool& one, const MSVCPedanticBool& other); + friend bool operator!= (const bool& one, const MSVCPedanticBool& other); + + bool b; + MSVCPedanticBool(int bIn); + + public: + /* b not initialized on purpose in default ctor to flag use. */ + /* cppcheck-suppress uninitMemberVar */ + MSVCPedanticBool() {} + MSVCPedanticBool(bool bIn) : b(bIn) {} + MSVCPedanticBool(const MSVCPedanticBool& other) : b(other.b) {} + + MSVCPedanticBool& operator= (const MSVCPedanticBool& other) { b = other.b; return *this; } + MSVCPedanticBool& operator&= (const MSVCPedanticBool& other) { b &= other.b; return *this; } + MSVCPedanticBool& operator|= (const MSVCPedanticBool& other) { b |= other.b; return *this; } + + bool operator== (const bool& other) const { return b == other; } + bool operator!= (const bool& other) const { return b != other; } + bool operator== (const MSVCPedanticBool& other) const { return b == other.b; } + bool operator!= (const MSVCPedanticBool& other) const { return b != other.b; } + + bool operator! () const { return !b; } + operator bool() const { return b; } + operator int() const { return b; } +}; + +inline bool operator== (const bool& one, const MSVCPedanticBool& other) { return one == other.b; } +inline bool operator!= (const bool& one, const MSVCPedanticBool& other) { return one != other.b; } + +/* We must include all C++ stuff before to avoid issues with templates that use bool */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +} /* extern C++ */ + +#undef FALSE +#define FALSE false +#undef TRUE +#define TRUE true + +/* In the very few cases we really need a "simple" type, fallback to bool */ +#define EMULATED_BOOL int + +/* Use our class instead of bool */ +#define bool MSVCPedanticBool + +/* "volatile bool" with the below substitution doesn't really work. */ +/* Just for the sake of the debug, we don't really need volatile */ +#define VOLATILE_BOOL bool + +#else /* defined(__cplusplus) && defined(DEBUG_BOOL) */ + +#ifndef FALSE +# define FALSE 0 +#endif + +#ifndef TRUE +# define TRUE 1 +#endif + +#define EMULATED_BOOL bool +#define VOLATILE_BOOL volatile bool + +#endif /* defined(__cplusplus) && defined(DEBUG_BOOL) */ + +#endif /* ndef CPL_BASE_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_progress.h b/modules/globebrowsing/ext/gdal/include/cpl_progress.h new file mode 100644 index 0000000000..aa5fe523cc --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_progress.h @@ -0,0 +1,47 @@ +/****************************************************************************** + * $Id$ + * + * Project: CPL - Common Portability Library + * Author: Frank Warmerdam, warmerdam@pobox.com + * Purpose: Prototypes and definitions for progress functions. + * + ****************************************************************************** + * Copyright (c) 2013, 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 CPL_PROGRESS_H_INCLUDED +#define CPL_PROGRESS_H_INCLUDED + +#include "cpl_port.h" + +CPL_C_START + +typedef int (CPL_STDCALL *GDALProgressFunc)(double dfComplete, const char *pszMessage, void *pProgressArg); + +int CPL_DLL CPL_STDCALL GDALDummyProgress( double, const char *, void *); +int CPL_DLL CPL_STDCALL GDALTermProgress( double, const char *, void *); +int CPL_DLL CPL_STDCALL GDALScaledProgress( double, const char *, void *); +void CPL_DLL * CPL_STDCALL GDALCreateScaledProgress( double, double, + GDALProgressFunc, void * ); +void CPL_DLL CPL_STDCALL GDALDestroyScaledProgress( void * ); +CPL_C_END + +#endif /* ndef CPL_PROGRESS_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_quad_tree.h b/modules/globebrowsing/ext/gdal/include/cpl_quad_tree.h new file mode 100644 index 0000000000..3d95f4f085 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_quad_tree.h @@ -0,0 +1,100 @@ +/********************************************************************** + * $Id$ + * + * Project: CPL - Common Portability Library + * Purpose: Implementation of quadtree building and searching functions. + * Derived from shapelib and mapserver implementations + * Author: Frank Warmerdam, warmerdam@pobox.com + * Even Rouault, + * + ****************************************************************************** + * Copyright (c) 1999-2008, Frank Warmerdam + * Copyright (c) 2008-2014, Even Rouault + * + * 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_QUAD_TREE_H_INCLUDED +#define CPL_QUAD_TREE_H_INCLUDED + +#include "cpl_port.h" + +/** + * \file cpl_quad_tree.h + * + * Quad tree implementation. + * + * A quadtree is a tree data structure in which each internal node + * has up to four children. Quadtrees are most often used to partition + * a two dimensional space by recursively subdividing it into four + * quadrants or regions + */ + +CPL_C_START + +/* Types */ + +typedef struct { + double minx, miny, maxx, maxy; +} CPLRectObj; + +typedef struct _CPLQuadTree CPLQuadTree; + +typedef void (*CPLQuadTreeGetBoundsFunc)(const void* hFeature, CPLRectObj* pBounds); +typedef int (*CPLQuadTreeForeachFunc)(void* pElt, void* pUserData); +typedef void (*CPLQuadTreeDumpFeatureFunc)(const void* hFeature, int nIndentLevel, void* pUserData); + +/* Functions */ + +CPLQuadTree CPL_DLL *CPLQuadTreeCreate(const CPLRectObj* pGlobalBounds, + CPLQuadTreeGetBoundsFunc pfnGetBounds); +void CPL_DLL CPLQuadTreeDestroy(CPLQuadTree *hQuadtree); + +void CPL_DLL CPLQuadTreeSetBucketCapacity(CPLQuadTree *hQuadtree, + int nBucketCapacity); +int CPL_DLL CPLQuadTreeGetAdvisedMaxDepth(int nExpectedFeatures); +void CPL_DLL CPLQuadTreeSetMaxDepth(CPLQuadTree *hQuadtree, + int nMaxDepth); + +void CPL_DLL CPLQuadTreeInsert(CPLQuadTree *hQuadtree, + void* hFeature); +void CPL_DLL CPLQuadTreeInsertWithBounds(CPLQuadTree *hQuadtree, + void* hFeature, + const CPLRectObj* psBounds); + +void CPL_DLL **CPLQuadTreeSearch(const CPLQuadTree *hQuadtree, + const CPLRectObj* pAoi, + int* pnFeatureCount); + +void CPL_DLL CPLQuadTreeForeach(const CPLQuadTree *hQuadtree, + CPLQuadTreeForeachFunc pfnForeach, + void* pUserData); + +void CPL_DLL CPLQuadTreeDump(const CPLQuadTree *hQuadtree, + CPLQuadTreeDumpFeatureFunc pfnDumpFeatureFunc, + void* pUserData); +void CPL_DLL CPLQuadTreeGetStats(const CPLQuadTree *hQuadtree, + int* pnFeatureCount, + int* pnNodeCount, + int* pnMaxDepth, + int* pnMaxBucketCapacity); + +CPL_C_END + +#endif diff --git a/modules/globebrowsing/ext/gdal/include/cpl_sha256.h b/modules/globebrowsing/ext/gdal/include/cpl_sha256.h new file mode 100644 index 0000000000..a2f3989b7a --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_sha256.h @@ -0,0 +1,68 @@ +/* $Id$ */ + +/* The MIT License + + Copyright (C) 2011 Zilong Tan (tzlloch@gmail.com) + Copyright (C) 2015 Even Rouault + + 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_SHA256_INCLUDED_H +#define CPL_SHA256_INCLUDED_H + +#include "cpl_port.h" + +#define CPL_SHA256_HASH_SIZE 32 /* 256 bit */ +#define CPL_SHA256_HASH_WORDS 8 + +#ifndef GUInt64 +#define GUInt64 GUIntBig +#endif + +CPL_C_START + +struct _CPL_SHA256Context { + GUInt64 totalLength; + GUInt32 hash[CPL_SHA256_HASH_WORDS]; + GUInt32 bufferLength; + union { + GUInt32 words[16]; + GByte bytes[64]; + } buffer; +}; +typedef struct _CPL_SHA256Context CPL_SHA256Context; + +void CPL_DLL CPL_SHA256Init(CPL_SHA256Context * sc); + +void CPL_DLL CPL_SHA256Update(CPL_SHA256Context * sc, const void *data, size_t len); + +void CPL_DLL CPL_SHA256Final(CPL_SHA256Context * sc, GByte hash[CPL_SHA256_HASH_SIZE]); + +void CPL_DLL CPL_SHA256(const void *data, size_t len, GByte hash[CPL_SHA256_HASH_SIZE]); + +void CPL_DLL CPL_HMAC_SHA256(const void *pKey, size_t nKeyLen, + const void *pabyMessage, size_t nMessageLen, + GByte abyDigest[CPL_SHA256_HASH_SIZE]); + +CPL_C_END + +#endif /* CPL_SHA256_INCLUDED_H */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_spawn.h b/modules/globebrowsing/ext/gdal/include/cpl_spawn.h new file mode 100644 index 0000000000..84c28112fc --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_spawn.h @@ -0,0 +1,78 @@ +/********************************************************************** + * $Id$ + * + * Project: CPL - Common Portability Library + * Purpose: Implement CPLSystem(). + * Author: Even Rouault, + * + ********************************************************************** + * Copyright (c) 2013, Even Rouault + * + * 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_SPAWN_H_INCLUDED +#define CPL_SPAWN_H_INCLUDED + +#include "cpl_vsi.h" + +CPL_C_START + +/* -------------------------------------------------------------------- */ +/* Spawn a process. */ +/* -------------------------------------------------------------------- */ + +int CPL_DLL CPLSpawn( const char * const papszArgv[], VSILFILE* fin, VSILFILE* fout, + int bDisplayErr ); + +#ifdef WIN32 +#include +typedef HANDLE CPL_FILE_HANDLE; +#define CPL_FILE_INVALID_HANDLE NULL +typedef DWORD CPL_PID; +#else +#include +typedef int CPL_FILE_HANDLE; +#define CPL_FILE_INVALID_HANDLE -1 +typedef pid_t CPL_PID; +#endif + +typedef struct _CPLSpawnedProcess CPLSpawnedProcess; + +CPLSpawnedProcess CPL_DLL* CPLSpawnAsync( int (*pfnMain)(CPL_FILE_HANDLE, CPL_FILE_HANDLE), + const char * const papszArgv[], + int bCreateInputPipe, + int bCreateOutputPipe, + int bCreateErrorPipe, + char** papszOptions ); +CPL_PID CPL_DLL CPLSpawnAsyncGetChildProcessId(CPLSpawnedProcess* p); +int CPL_DLL CPLSpawnAsyncFinish(CPLSpawnedProcess* p, int bWait, int bKill); +CPL_FILE_HANDLE CPL_DLL CPLSpawnAsyncGetInputFileHandle(CPLSpawnedProcess* p); +CPL_FILE_HANDLE CPL_DLL CPLSpawnAsyncGetOutputFileHandle(CPLSpawnedProcess* p); +CPL_FILE_HANDLE CPL_DLL CPLSpawnAsyncGetErrorFileHandle(CPLSpawnedProcess* p); +void CPL_DLL CPLSpawnAsyncCloseInputFileHandle(CPLSpawnedProcess* p); +void CPL_DLL CPLSpawnAsyncCloseOutputFileHandle(CPLSpawnedProcess* p); +void CPL_DLL CPLSpawnAsyncCloseErrorFileHandle(CPLSpawnedProcess* p); + +int CPL_DLL CPLPipeRead(CPL_FILE_HANDLE fin, void* data, int length); +int CPL_DLL CPLPipeWrite(CPL_FILE_HANDLE fout, const void* data, int length); + +CPL_C_END + +#endif // CPL_SPAWN_H_INCLUDED diff --git a/modules/globebrowsing/ext/gdal/include/cpl_string.h b/modules/globebrowsing/ext/gdal/include/cpl_string.h new file mode 100644 index 0000000000..161a6204bd --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_string.h @@ -0,0 +1,433 @@ +/********************************************************************** + * $Id$ + * + * Name: cpl_string.h + * Project: CPL - Common Portability Library + * Purpose: String and StringList functions. + * Author: Daniel Morissette, dmorissette@mapgears.com + * + ********************************************************************** + * Copyright (c) 1998, Daniel Morissette + * Copyright (c) 2008-2014, Even Rouault + * + * 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_STRING_H_INCLUDED +#define CPL_STRING_H_INCLUDED + +#include "cpl_error.h" +#include "cpl_conv.h" +#include "cpl_vsi.h" + +/** + * \file cpl_string.h + * + * Various convenience functions for working with strings and string lists. + * + * A StringList is just an array of strings with the last pointer being + * NULL. An empty StringList may be either a NULL pointer, or a pointer to + * a pointer memory location with a NULL value. + * + * A common convention for StringLists is to use them to store name/value + * lists. In this case the contents are treated like a dictionary of + * name/value pairs. The actual data is formatted with each string having + * the format ":" (though "=" is also an acceptable separator). + * A number of the functions in the file operate on name/value style + * string lists (such as CSLSetNameValue(), and CSLFetchNameValue()). + * + * To some extent the CPLStringList C++ class can be used to abstract + * managing string lists a bit but still be able to return them from C + * functions. + * + */ + +CPL_C_START + +char CPL_DLL **CSLAddString(char **papszStrList, + const char *pszNewString) CPL_WARN_UNUSED_RESULT; +char CPL_DLL **CSLAddStringMayFail( + char **papszStrList, const char *pszNewString) CPL_WARN_UNUSED_RESULT; +#ifdef __cplusplus + int CPL_DLL CSLCount(const char * const *papszStrList); +#else + int CPL_DLL CSLCount(char **papszStrList); +#endif +const char CPL_DLL *CSLGetField( char **, int ); +void CPL_DLL CPL_STDCALL CSLDestroy(char **papszStrList); +char CPL_DLL **CSLDuplicate(char **papszStrList) CPL_WARN_UNUSED_RESULT; +char CPL_DLL **CSLMerge( char **papszOrig, + char **papszOverride ) CPL_WARN_UNUSED_RESULT; + +char CPL_DLL **CSLTokenizeString(const char *pszString ) CPL_WARN_UNUSED_RESULT; +char CPL_DLL **CSLTokenizeStringComplex( + const char *pszString, const char *pszDelimiter, int bHonourStrings, + int bAllowEmptyTokens ) CPL_WARN_UNUSED_RESULT; +char CPL_DLL **CSLTokenizeString2( const char *pszString, + const char *pszDelimiter, + int nCSLTFlags ) CPL_WARN_UNUSED_RESULT; + +#define CSLT_HONOURSTRINGS 0x0001 +#define CSLT_ALLOWEMPTYTOKENS 0x0002 +#define CSLT_PRESERVEQUOTES 0x0004 +#define CSLT_PRESERVEESCAPES 0x0008 +#define CSLT_STRIPLEADSPACES 0x0010 +#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; +int CPL_DLL CSLSave(char **papszStrList, const char *pszFname); + +char CPL_DLL **CSLInsertStrings(char **papszStrList, int nInsertAtLineNo, + char **papszNewLines) CPL_WARN_UNUSED_RESULT; +char CPL_DLL **CSLInsertString(char **papszStrList, int nInsertAtLineNo, + const char *pszNewLine) CPL_WARN_UNUSED_RESULT; +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 ); +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 ); +int CPL_DLL CPLTestBoolean( const char *pszValue ); + +#ifdef __cplusplus +#ifdef DO_NOT_USE_DEBUG_BOOL +#define CPLTestBool(x) CPL_TO_BOOL(CPLTestBoolean(x)) +#else +/* Prefer these for C++ code. */ +#ifdef DEBUG_BOOL +extern "C++" { +#endif +bool CPL_DLL CPLTestBool( const char *pszValue ); +#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 ); +const char CPL_DLL * + CSLFetchNameValue(char **papszStrList, const char *pszName); +const char CPL_DLL * + CSLFetchNameValueDef(char **papszStrList, const char *pszName, + const char *pszDefault ); +char CPL_DLL ** + CSLFetchNameValueMultiple(char **papszStrList, const char *pszName); +char CPL_DLL ** + CSLAddNameValue(char **papszStrList, + const char *pszName, + const char *pszValue) CPL_WARN_UNUSED_RESULT; +char CPL_DLL ** + CSLSetNameValue(char **papszStrList, + const char *pszName, + const char *pszValue) CPL_WARN_UNUSED_RESULT; +void CPL_DLL CSLSetNameValueSeparator( char ** papszStrList, + const char *pszSeparator ); + +char CPL_DLL ** CSLParseCommandLine(const char* pszCommandLine); + +#define CPLES_BackslashQuotable 0 +#define CPLES_XML 1 +#define CPLES_URL 2 +#define CPLES_SQL 3 +#define CPLES_CSV 4 +#define CPLES_XML_BUT_QUOTES 5 + +char CPL_DLL *CPLEscapeString( const char *pszString, int nLength, + int nScheme ) CPL_WARN_UNUSED_RESULT; +char CPL_DLL *CPLUnescapeString( const char *pszString, int *pnLength, + int nScheme ) CPL_WARN_UNUSED_RESULT; + +char CPL_DLL *CPLBinaryToHex( int nBytes, + const GByte *pabyData ) CPL_WARN_UNUSED_RESULT; +GByte CPL_DLL *CPLHexToBinary( const char *pszHex, + int *pnBytes ) CPL_WARN_UNUSED_RESULT; + +char CPL_DLL *CPLBase64Encode( int nBytes, + const GByte *pabyData ) CPL_WARN_UNUSED_RESULT; +int CPL_DLL CPLBase64DecodeInPlace( GByte* pszBase64 ); + +typedef enum +{ + CPL_VALUE_STRING, + CPL_VALUE_REAL, + CPL_VALUE_INTEGER +} CPLValueType; + +CPLValueType CPL_DLL CPLGetValueType(const char* pszValue); + +size_t CPL_DLL CPLStrlcpy(char* pszDest, const char* pszSrc, size_t nDestSize); +size_t CPL_DLL CPLStrlcat(char* pszDest, const char* pszSrc, size_t nDestSize); +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"); +#else +int CPL_DLL CPLsprintf(char *str, 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); + +const char CPL_DLL *CPLSPrintf(const char *fmt, ...) + CPL_PRINT_FUNC_FORMAT(1, 2) CPL_WARN_UNUSED_RESULT; +char CPL_DLL **CSLAppendPrintf(char **papszStrList, 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 ) + CPL_PRINT_FUNC_FORMAT(2, 0); + +/* -------------------------------------------------------------------- */ +/* RFC 23 character set conversion/recoding API (cpl_recode.cpp). */ +/* -------------------------------------------------------------------- */ +#define CPL_ENC_LOCALE "" +#define CPL_ENC_UTF8 "UTF-8" +#define CPL_ENC_UTF16 "UTF-16" +#define CPL_ENC_UCS2 "UCS-2" +#define CPL_ENC_UCS4 "UCS-4" +#define CPL_ENC_ASCII "ASCII" +#define CPL_ENC_ISO8859_1 "ISO-8859-1" + +int CPL_DLL CPLEncodingCharSize( const char *pszEncoding ); +void CPL_DLL CPLClearRecodeWarningFlags( void ); +char CPL_DLL *CPLRecode( + const char *pszSource, const char *pszSrcEncoding, + const char *pszDstEncoding ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; +char CPL_DLL *CPLRecodeFromWChar( + const wchar_t *pwszSource, const char *pszSrcEncoding, + const char *pszDstEncoding ) CPL_WARN_UNUSED_RESULT; +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); +char CPL_DLL *CPLForceToASCII( + const char* pabyData, int nLen, + char chReplacementChar) CPL_WARN_UNUSED_RESULT; +int CPL_DLL CPLStrlenUTF8(const char *pszUTF8Str); + +CPL_C_END + +/************************************************************************/ +/* CPLString */ +/************************************************************************/ + +#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) + +#include + +/* + * 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 +{ +public: + + CPLString(void) {} + CPLString( const std::string &oStr ) : gdal_std_string( oStr ) {} + CPLString( const char *pszStr ) : gdal_std_string( pszStr ) {} + + operator const char* (void) const { return c_str(); } + + char& operator[](std::string::size_type i) + { + return gdal_std_string::operator[](i); + } + + const char& operator[](std::string::size_type i) const + { + return gdal_std_string::operator[](i); + } + + char& operator[](int i) + { + return gdal_std_string::operator[]( + static_cast(i)); + } + + const char& operator[](int i) const + { + return gdal_std_string::operator[]( + static_cast(i)); + } + + void Clear() { resize(0); } + + // NULL safe assign and free. + void Seize(char *pszValue) + { + if (pszValue == NULL ) + Clear(); + else + { + *this = pszValue; + CPLFree(pszValue); + } + } + + /* 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); + CPLString &vPrintf( + 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 ); + + /* case insensitive find alternates */ + size_t ifind( const std::string & str, size_t pos = 0 ) const; + size_t ifind( const char * s, size_t pos = 0 ) const; + CPLString &toupper( void ); + 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); + +/* -------------------------------------------------------------------- */ +/* URL processing functions, here since they depend on CPLString. */ +/* -------------------------------------------------------------------- */ +CPLString CPL_DLL CPLURLGetValue(const char* pszURL, const char* pszKey); +CPLString CPL_DLL CPLURLAddKVP(const char* pszURL, const char* pszKey, + const char* pszValue); + +/************************************************************************/ +/* CPLStringList */ +/************************************************************************/ + +//! String list class designed around our use of C "char**" string lists. +class CPL_DLL CPLStringList +{ + char **papszList; + mutable int nCount; + mutable int nAllocation; + bool bOwnList; + bool bIsSorted; + + void Initialize(); + void MakeOurOwnCopy(); + void EnsureAllocation( int nMaxLength ); + int FindSortedInsertionPoint( const char *pszLine ); + + public: + CPLStringList(); + CPLStringList( char **papszList, int bTakeOwnership=TRUE ); + CPLStringList( const CPLStringList& oOther ); + ~CPLStringList(); + + CPLStringList &Clear(); + + int size() const { return Count(); } + int Count() const; + + CPLStringList &AddString( const char *pszNewString ); + CPLStringList &AddStringDirectly( char *pszNewString ); + + CPLStringList &InsertString( int nInsertAtLineNo, const char *pszNewLine ) + { return InsertStringDirectly( nInsertAtLineNo, CPLStrdup(pszNewLine) ); } + CPLStringList &InsertStringDirectly( int nInsertAtLineNo, char *pszNewLine); + + // CPLStringList &InsertStrings( int nInsertAtLineNo, char **papszNewLines ); + // CPLStringList &RemoveStrings( int nFirstLineToDelete, int nNumToRemove=1 ); + + int FindString( const char *pszTarget ) const + { return CSLFindString( papszList, pszTarget ); } + int PartialFindString( const char *pszNeedle ) const + { return CSLPartialFindString( papszList, pszNeedle ); } + + int FindName( const char *pszName ) const; + bool FetchBool( const char *pszKey, bool bDefault ) const; + // Deprecated. + int FetchBoolean( const char *pszKey, int bDefault ) const; + const char *FetchNameValue( const char *pszKey ) const; + const char *FetchNameValueDef( + const char *pszKey, const char *pszDefault ) const; + CPLStringList &AddNameValue( const char *pszKey, const char *pszValue ); + CPLStringList &SetNameValue( const char *pszKey, const char *pszValue ); + + CPLStringList &Assign( char **papszListIn, int bTakeOwnership=TRUE ); + CPLStringList &operator=(char **papszListIn) { + return Assign( papszListIn, TRUE ); } + CPLStringList &operator=(const CPLStringList& oOther); + + char * operator[](int i); + char * operator[](size_t i) { return (*this)[static_cast(i)]; } + const char * operator[](int i) const; + const char * operator[](size_t i) const { + return (*this)[static_cast(i)]; } + + char **List() { return papszList; } + char **StealList(); + + CPLStringList &Sort(); + int IsSorted() const { return bIsSorted; } + + operator char**(void) { return List(); } +}; + +#endif /* def __cplusplus && !CPL_SUPRESS_CPLUSPLUS */ + +#endif /* CPL_STRING_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_time.h b/modules/globebrowsing/ext/gdal/include/cpl_time.h new file mode 100644 index 0000000000..4a60cb3f86 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_time.h @@ -0,0 +1,41 @@ +/********************************************************************** + * $Id$ + * + * Name: cpl_time.h + * Project: CPL - Common Portability Library + * Purpose: Time functions. + * Author: Even Rouault, + * + ********************************************************************** + * Copyright (c) 2009, Even Rouault + * + * 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_TIME_H_INCLUDED +#define CPL_TIME_H_INCLUDED + +#include + +#include "cpl_port.h" + +struct tm CPL_DLL * CPLUnixTimeToYMDHMS(GIntBig unixTime, struct tm* pRet); +GIntBig CPL_DLL CPLYMDHMSToUnixTime(const struct tm *brokendowntime); + +#endif // CPL_TIME_H_INCLUDED diff --git a/modules/globebrowsing/ext/gdal/include/cpl_virtualmem.h b/modules/globebrowsing/ext/gdal/include/cpl_virtualmem.h new file mode 100644 index 0000000000..eaf42e3129 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_virtualmem.h @@ -0,0 +1,390 @@ +/********************************************************************** + * $Id$ + * + * Name: cpl_virtualmem.h + * Project: CPL - Common Portability Library + * Purpose: Virtual memory + * Author: Even Rouault, + * + ********************************************************************** + * Copyright (c) 2014, Even Rouault + * + * 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_VIRTUAL_MEM_INCLUDED +#define CPL_VIRTUAL_MEM_INCLUDED + +#include "cpl_port.h" +#include "cpl_vsi.h" + +CPL_C_START + +/** + * \file cpl_virtualmem.h + * + * Virtual memory management. + * + * This file provides mechanism to define virtual memory mappings, whose content + * is allocated transparently and filled on-the-fly. Those virtual memory mappings + * can be much larger than the available RAM, but only parts of the virtual + * memory mapping, in the limit of the allowed the cache size, will actually be + * physically allocated. + * + * This exploits low-level mechanisms of the operating system (virtual memory + * allocation, page protection and handler of virtual memory exceptions). + * + * It is also possible to create a virtual memory mapping from a file or part + * of a file. + * + * The current implementation is Linux only. + */ + +/** Opaque type that represents a virtual memory mapping. */ +typedef struct CPLVirtualMem CPLVirtualMem; + +/** Callback triggered when a still unmapped page of virtual memory is accessed. + * The callback has the responsibility of filling the page with relevant values + * + * @param ctxt virtual memory handle. + * @param nOffset offset of the page in the memory mapping. + * @param pPageToFill address of the page to fill. Note that the address might + * be a temporary location, and not at CPLVirtualMemGetAddr() + nOffset. + * @param nToFill number of bytes of the page. + * @param pUserData user data that was passed to CPLVirtualMemNew(). + */ +typedef void (*CPLVirtualMemCachePageCbk)(CPLVirtualMem* ctxt, + size_t nOffset, + void* pPageToFill, + size_t nToFill, + void* pUserData); + +/** Callback triggered when a dirty mapped page is going to be freed. + * (saturation of cache, or termination of the virtual memory mapping). + * + * @param ctxt virtual memory handle. + * @param nOffset offset of the page in the memory mapping. + * @param pPageToBeEvicted address of the page that will be flushed. Note that the address might + * be a temporary location, and not at CPLVirtualMemGetAddr() + nOffset. + * @param nToBeEvicted number of bytes of the page. + * @param pUserData user data that was passed to CPLVirtualMemNew(). + */ +typedef void (*CPLVirtualMemUnCachePageCbk)(CPLVirtualMem* ctxt, + size_t nOffset, + const void* pPageToBeEvicted, + size_t nToBeEvicted, + void* pUserData); + +/** Callback triggered when a virtual memory mapping is destroyed. + * @param pUserData user data that was passed to CPLVirtualMemNew(). + */ +typedef void (*CPLVirtualMemFreeUserData)(void* pUserData); + +/** Access mode of a virtual memory mapping. */ +typedef enum +{ + /*! The mapping is meant at being read-only, but writes will not be prevented. + Note that any content written will be lost. */ + VIRTUALMEM_READONLY, + /*! The mapping is meant at being read-only, and this will be enforced + through the operating system page protection mechanism. */ + VIRTUALMEM_READONLY_ENFORCED, + /*! The mapping is meant at being read-write, and modified pages can be saved + thanks to the pfnUnCachePage callback */ + VIRTUALMEM_READWRITE +} CPLVirtualMemAccessMode; + + +/** Return the size of a page of virtual memory. + * + * @return the page size. + * + * @since GDAL 1.11 + */ +size_t CPL_DLL CPLGetPageSize(void); + +/** Create a new virtual memory mapping. + * + * This will reserve an area of virtual memory of size nSize, whose size + * might be potentially much larger than the physical memory available. Initially, + * no physical memory will be allocated. As soon as memory pages will be accessed, + * they will be allocated transparently and filled with the pfnCachePage callback. + * When the allowed cache size is reached, the least recently used pages will + * be unallocated. + * + * On Linux AMD64 platforms, the maximum value for nSize is 128 TB. + * On Linux x86 platforms, the maximum value for nSize is 2 GB. + * + * Only supported on Linux for now. + * + * Note that on Linux, this function will install a SIGSEGV handler. The + * original handler will be restored by CPLVirtualMemManagerTerminate(). + * + * @param nSize size in bytes of the virtual memory mapping. + * @param nCacheSize size in bytes of the maximum memory that will be really + * allocated (must ideally fit into RAM). + * @param nPageSizeHint hint for the page size. Must be a multiple of the + * system page size, returned by CPLGetPageSize(). + * Minimum value is generally 4096. Might be set to 0 to + * let the function determine a default page size. + * @param bSingleThreadUsage set to TRUE if there will be no concurrent threads + * that will access the virtual memory mapping. This can + * optimize performance a bit. + * @param eAccessMode permission to use for the virtual memory mapping. + * @param pfnCachePage callback triggered when a still unmapped page of virtual + * memory is accessed. The callback has the responsibility + * of filling the page with relevant values. + * @param pfnUnCachePage callback triggered when a dirty mapped page is going to + * be freed (saturation of cache, or termination of the + * virtual memory mapping). Might be NULL. + * @param pfnFreeUserData callback that can be used to free pCbkUserData. Might be + * NULL + * @param pCbkUserData user data passed to pfnCachePage and pfnUnCachePage. + * + * @return a virtual memory object that must be freed by CPLVirtualMemFree(), + * or NULL in case of failure. + * + * @since GDAL 1.11 + */ + +CPLVirtualMem CPL_DLL *CPLVirtualMemNew(size_t nSize, + size_t nCacheSize, + size_t nPageSizeHint, + int bSingleThreadUsage, + CPLVirtualMemAccessMode eAccessMode, + CPLVirtualMemCachePageCbk pfnCachePage, + CPLVirtualMemUnCachePageCbk pfnUnCachePage, + 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. + * @since GDAL 1.11 + */ +int CPL_DLL CPLIsVirtualMemFileMapAvailable(void); + +/** Create a new virtual memory mapping from a file. + * + * The file must be a "real" file recognized by the operating system, and not + * a VSI extended virtual file. + * + * In VIRTUALMEM_READWRITE mode, updates to the memory mapping will be written + * in the file. + * + * On Linux AMD64 platforms, the maximum value for nLength is 128 TB. + * On Linux x86 platforms, the maximum value for nLength is 2 GB. + * + * Supported on Linux only in GDAL <= 2.0, and all POSIX systems supporting + * mmap() in GDAL >= 2.1 + * + * @param fp Virtual file handle. + * @param nOffset Offset in the file to start the mapping from. + * @param nLength Length of the portion of the file to map into memory. + * @param eAccessMode Permission to use for the virtual memory mapping. This must + * be consistent with how the file has been opened. + * @param pfnFreeUserData callback that is called when the object is destroyed. + * @param pCbkUserData user data passed to pfnFreeUserData. + * @return a virtual memory object that must be freed by CPLVirtualMemFree(), + * or NULL in case of failure. + * + * @since GDAL 1.11 + */ +CPLVirtualMem CPL_DLL *CPLVirtualMemFileMapNew( VSILFILE* fp, + vsi_l_offset nOffset, + vsi_l_offset nLength, + CPLVirtualMemAccessMode eAccessMode, + CPLVirtualMemFreeUserData pfnFreeUserData, + void *pCbkUserData ); + +/** Create a new virtual memory mapping derived from an other virtual memory + * mapping. + * + * This may be useful in case of creating mapping for pixel interleaved data. + * + * The new mapping takes a reference on the base mapping. + * + * @param pVMemBase Base virtual memory mapping + * @param nOffset Offset in the base virtual memory mapping from which to start + * the new mapping. + * @param nSize Size of the base virtual memory mapping to expose in the + * the new mapping. + * @param pfnFreeUserData callback that is called when the object is destroyed. + * @param pCbkUserData user data passed to pfnFreeUserData. + * @return a virtual memory object that must be freed by CPLVirtualMemFree(), + * or NULL in case of failure. + * + * @since GDAL 1.11 + */ +CPLVirtualMem CPL_DLL *CPLVirtualMemDerivedNew(CPLVirtualMem* pVMemBase, + vsi_l_offset nOffset, + vsi_l_offset nSize, + CPLVirtualMemFreeUserData pfnFreeUserData, + void *pCbkUserData); + +/** Free a virtual memory mapping. + * + * The pointer returned by CPLVirtualMemGetAddr() will no longer be valid. + * If the virtual memory mapping was created with read/write permissions and that + * they are dirty (i.e. modified) pages, they will be flushed through the + * pfnUnCachePage callback before being freed. + * + * @param ctxt context returned by CPLVirtualMemNew(). + * + * @since GDAL 1.11 + */ +void CPL_DLL CPLVirtualMemFree(CPLVirtualMem* ctxt); + +/** Return the pointer to the start of a virtual memory mapping. + * + * The bytes in the range [p:p+CPLVirtualMemGetSize()-1] where p is the pointer + * returned by this function will be valid, until CPLVirtualMemFree() is called. + * + * Note that if a range of bytes used as an argument of a system call + * (such as read() or write()) contains pages that have not been "realized", the + * system call will fail with EFAULT. CPLVirtualMemPin() can be used to work + * around this issue. + * + * @param ctxt context returned by CPLVirtualMemNew(). + * @return the pointer to the start of a virtual memory mapping. + * + * @since GDAL 1.11 + */ +void CPL_DLL *CPLVirtualMemGetAddr(CPLVirtualMem* ctxt); + +/** Return the size of the virtual memory mapping. + * + * @param ctxt context returned by CPLVirtualMemNew(). + * @return the size of the virtual memory mapping. + * + * @since GDAL 1.11 + */ +size_t CPL_DLL CPLVirtualMemGetSize(CPLVirtualMem* ctxt); + +/** Return if the virtual memory mapping is a direct file mapping. + * + * @param ctxt context returned by CPLVirtualMemNew(). + * @return TRUE if the virtual memory mapping is a direct file mapping. + * + * @since GDAL 1.11 + */ +int CPL_DLL CPLVirtualMemIsFileMapping(CPLVirtualMem* ctxt); + +/** Return the access mode of the virtual memory mapping. + * + * @param ctxt context returned by CPLVirtualMemNew(). + * @return the access mode of the virtual memory mapping. + * + * @since GDAL 1.11 + */ +CPLVirtualMemAccessMode CPL_DLL CPLVirtualMemGetAccessMode(CPLVirtualMem* ctxt); + +/** Return the page size associated to a virtual memory mapping. + * + * The value returned will be at least CPLGetPageSize(), but potentially + * larger. + * + * @param ctxt context returned by CPLVirtualMemNew(). + * @return the page size + * + * @since GDAL 1.11 + */ +size_t CPL_DLL CPLVirtualMemGetPageSize(CPLVirtualMem* ctxt); + +/** Return TRUE if this memory mapping can be accessed safely from concurrent + * threads. + * + * The situation that can cause problems is when several threads try to access + * a page of the mapping that is not yet mapped. + * + * The return value of this function depends on whether bSingleThreadUsage has + * been set of not in CPLVirtualMemNew() and/or the implementation. + * + * On Linux, this will always return TRUE if bSingleThreadUsage = FALSE. + * + * @param ctxt context returned by CPLVirtualMemNew(). + * @return TRUE if this memory mapping can be accessed safely from concurrent + * threads. + * + * @since GDAL 1.11 + */ +int CPL_DLL CPLVirtualMemIsAccessThreadSafe(CPLVirtualMem* ctxt); + +/** Declare that a thread will access a virtual memory mapping. + * + * This function must be called by a thread that wants to access the + * content of a virtual memory mapping, except if the virtual memory mapping has + * been created with bSingleThreadUsage = TRUE. + * + * This function must be paired with CPLVirtualMemUnDeclareThread(). + * + * @param ctxt context returned by CPLVirtualMemNew(). + * + * @since GDAL 1.11 + */ +void CPL_DLL CPLVirtualMemDeclareThread(CPLVirtualMem* ctxt); + +/** Declare that a thread will stop accessing a virtual memory mapping. + * + * This function must be called by a thread that will no longer access the + * content of a virtual memory mapping, except if the virtual memory mapping has + * been created with bSingleThreadUsage = TRUE. + * + * This function must be paired with CPLVirtualMemDeclareThread(). + * + * @param ctxt context returned by CPLVirtualMemNew(). + * + * @since GDAL 1.11 + */ +void CPL_DLL CPLVirtualMemUnDeclareThread(CPLVirtualMem* ctxt); + +/** Make sure that a region of virtual memory will be realized. + * + * Calling this function is not required, but might be useful when debugging + * a process with tools like gdb or valgrind that do not naturally like + * segmentation fault signals. + * + * It is also needed when wanting to provide part of virtual memory mapping + * to a system call such as read() or write(). If read() or write() is called + * on a memory region not yet realized, the call will fail with EFAULT. + * + * @param ctxt context returned by CPLVirtualMemNew(). + * @param pAddr the memory region to pin. + * @param nSize the size of the memory region. + * @param bWriteOp set to TRUE if the memory are will be accessed in write mode. + * + * @since GDAL 1.11 + */ +void CPL_DLL CPLVirtualMemPin(CPLVirtualMem* ctxt, + void* pAddr, size_t nSize, int bWriteOp); + +/** Cleanup any resource and handlers related to virtual memory. + * + * This function must be called after the last CPLVirtualMem object has + * been freed. + * + * @since GDAL 2.0 + */ +void CPL_DLL CPLVirtualMemManagerTerminate(void); + + +CPL_C_END + +#endif /* CPL_VIRTUAL_MEM_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_vsi.h b/modules/globebrowsing/ext/gdal/include/cpl_vsi.h new file mode 100644 index 0000000000..405a8bc4f7 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_vsi.h @@ -0,0 +1,311 @@ +/****************************************************************************** + * $Id$ + * + * Project: CPL - Common Portability Library + * Author: Frank Warmerdam, warmerdam@pobox.com + * Purpose: Include file defining Virtual File System (VSI) functions, a + * layer over POSIX file and other system services. + * + ****************************************************************************** + * Copyright (c) 1998, Frank Warmerdam + * Copyright (c) 2008-2014, Even Rouault + * + * 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_VSI_H_INCLUDED +#define CPL_VSI_H_INCLUDED + +#include "cpl_port.h" +/** + * \file cpl_vsi.h + * + * Standard C Covers + * + * The VSI functions are intended to be hookable aliases for Standard C + * I/O, memory allocation and other system functions. They are intended + * to allow virtualization of disk I/O so that non file data sources + * can be made to appear as files, and so that additional error trapping + * and reporting can be interested. The memory access API is aliased + * so that special application memory management services can be used. + * + * It is intended that each of these functions retains exactly the same + * calling pattern as the original Standard C functions they relate to. + * This means we don't have to provide custom documentation, and also means + * that the default implementation is very simple. + */ + +/* -------------------------------------------------------------------- */ +/* We need access to ``struct stat''. */ +/* -------------------------------------------------------------------- */ + +/* Unix */ +#if !defined(_WIN32) +# include +#endif + +/* Windows */ +#include + +CPL_C_START + +#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 + +/* ==================================================================== */ +/* stdio file access functions. These may not support large */ +/* files, and don't necessarily go through the virtualization */ +/* API. */ +/* ==================================================================== */ + +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; +long CPL_DLL VSIFTell( FILE * ) CPL_WARN_UNUSED_RESULT; +void CPL_DLL VSIRewind( FILE * ); +void CPL_DLL VSIFFlush( FILE * ); + +size_t CPL_DLL VSIFRead( void *, size_t, size_t, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT; +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 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; + +/* ==================================================================== */ +/* VSIStat() related. */ +/* ==================================================================== */ + +typedef struct stat VSIStatBuf; +int CPL_DLL VSIStat( const char *, VSIStatBuf * ) CPL_WARN_UNUSED_RESULT; + +#ifdef _WIN32 +# define VSI_ISLNK(x) ( 0 ) /* N/A on Windows */ +# define VSI_ISREG(x) ((x) & S_IFREG) +# define VSI_ISDIR(x) ((x) & S_IFDIR) +# define VSI_ISCHR(x) ((x) & S_IFCHR) +# define VSI_ISBLK(x) ( 0 ) /* N/A on Windows */ +#else +# define VSI_ISLNK(x) S_ISLNK(x) +# define VSI_ISREG(x) S_ISREG(x) +# define VSI_ISDIR(x) S_ISDIR(x) +# define VSI_ISCHR(x) S_ISCHR(x) +# define VSI_ISBLK(x) S_ISBLK(x) +#endif + +/* ==================================================================== */ +/* 64bit stdio file access functions. If we have a big size */ +/* defined, then provide prototypes for the large file API, */ +/* otherwise redefine to use the regular api. */ +/* ==================================================================== */ +typedef GUIntBig vsi_l_offset; +#define VSI_L_OFFSET_MAX GUINTBIG_MAX + +/* Make VSIL_STRICT_ENFORCE active in DEBUG builds */ +#ifdef DEBUG +#define VSIL_STRICT_ENFORCE +#endif + +#ifdef VSIL_STRICT_ENFORCE +typedef struct _VSILFILE VSILFILE; +#else +typedef FILE VSILFILE; +#endif + +VSILFILE CPL_DLL * VSIFOpenL( const char *, const char * ) CPL_WARN_UNUSED_RESULT; +VSILFILE CPL_DLL * VSIFOpenExL( const char *, const char *, int ) CPL_WARN_UNUSED_RESULT; +int CPL_DLL VSIFCloseL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT; +int CPL_DLL VSIFSeekL( VSILFILE *, vsi_l_offset, int ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT; +vsi_l_offset CPL_DLL VSIFTellL( VSILFILE * ) CPL_WARN_UNUSED_RESULT; +void CPL_DLL VSIRewindL( VSILFILE * ); +size_t CPL_DLL VSIFReadL( void *, size_t, size_t, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT; +int CPL_DLL VSIFReadMultiRangeL( int nRanges, void ** ppData, const vsi_l_offset* panOffsets, const size_t* panSizes, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT; +size_t CPL_DLL VSIFWriteL( const void *, size_t, size_t, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT; +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 VSIFPutcL( int, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT; + +int CPL_DLL VSIIngestFile( VSILFILE* fp, + const char* pszFilename, + GByte** ppabyRet, + vsi_l_offset* pnSize, + GIntBig nMaxSize ) CPL_WARN_UNUSED_RESULT; + +#if defined(VSI_STAT64_T) +typedef struct VSI_STAT64_T VSIStatBufL; +#else +#define VSIStatBufL VSIStatBuf +#endif + +int CPL_DLL VSIStatL( const char *, VSIStatBufL * ) CPL_WARN_UNUSED_RESULT; + +#define VSI_STAT_EXISTS_FLAG 0x1 +#define VSI_STAT_NATURE_FLAG 0x2 +#define VSI_STAT_SIZE_FLAG 0x4 +#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 ); + +void CPL_DLL *VSIFGetNativeFileDescriptorL( VSILFILE* ); + +/* ==================================================================== */ +/* Memory allocation */ +/* ==================================================================== */ + +void CPL_DLL *VSICalloc( size_t, size_t ) CPL_WARN_UNUSED_RESULT; +void CPL_DLL *VSIMalloc( size_t ) CPL_WARN_UNUSED_RESULT; +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; + +/** + VSIMalloc2 allocates (nSize1 * nSize2) bytes. + In case of overflow of the multiplication, or if memory allocation fails, a + NULL pointer is returned and a CE_Failure error is raised with CPLError(). + If nSize1 == 0 || nSize2 == 0, a NULL pointer will also be returned. + CPLFree() or VSIFree() can be used to free memory allocated by this function. +*/ +void CPL_DLL *VSIMalloc2( size_t nSize1, size_t nSize2 ) CPL_WARN_UNUSED_RESULT; + +/** + VSIMalloc3 allocates (nSize1 * nSize2 * nSize3) bytes. + In case of overflow of the multiplication, or if memory allocation fails, a + NULL pointer is returned and a CE_Failure error is raised with CPLError(). + If nSize1 == 0 || nSize2 == 0 || nSize3 == 0, a NULL pointer will also be returned. + CPLFree() or VSIFree() can be used to free memory allocated by this function. +*/ +void CPL_DLL *VSIMalloc3( size_t nSize1, size_t nSize2, size_t nSize3 ) CPL_WARN_UNUSED_RESULT; + + +void CPL_DLL *VSIMallocVerbose( size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT; +#define VSI_MALLOC_VERBOSE( size ) VSIMallocVerbose(size,__FILE__,__LINE__) + +void CPL_DLL *VSIMalloc2Verbose( size_t nSize1, size_t nSize2, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT; +#define VSI_MALLOC2_VERBOSE( nSize1, nSize2 ) VSIMalloc2Verbose(nSize1,nSize2,__FILE__,__LINE__) + +void CPL_DLL *VSIMalloc3Verbose( size_t nSize1, size_t nSize2, size_t nSize3, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT; +#define VSI_MALLOC3_VERBOSE( nSize1, nSize2, nSize3 ) VSIMalloc3Verbose(nSize1,nSize2,nSize3,__FILE__,__LINE__) + +void CPL_DLL *VSICallocVerbose( size_t nCount, size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT; +#define VSI_CALLOC_VERBOSE( nCount, nSize ) VSICallocVerbose(nCount,nSize,__FILE__,__LINE__) + +void CPL_DLL *VSIReallocVerbose( void* pOldPtr, size_t nNewSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT; +#define VSI_REALLOC_VERBOSE( pOldPtr, nNewSize ) VSIReallocVerbose(pOldPtr,nNewSize,__FILE__,__LINE__) + +char CPL_DLL *VSIStrdupVerbose( const char* pszStr, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT; +#define VSI_STRDUP_VERBOSE( pszStr ) VSIStrdupVerbose(pszStr,__FILE__,__LINE__) + + +GIntBig CPL_DLL CPLGetPhysicalRAM(void); +GIntBig CPL_DLL CPLGetUsablePhysicalRAM(void); + +/* ==================================================================== */ +/* Other... */ +/* ==================================================================== */ + +#define CPLReadDir VSIReadDir +char CPL_DLL **VSIReadDir( const char * ); +char CPL_DLL **VSIReadDirRecursive( const char *pszPath ); +char CPL_DLL **VSIReadDirEx( const char *pszPath, int nMaxFiles ); +int CPL_DLL VSIMkdir( const char * pathname, long mode ); +int CPL_DLL VSIRmdir( const char * pathname ); +int CPL_DLL VSIUnlink( const char * pathname ); +int CPL_DLL VSIRename( const char * oldpath, const char * newpath ); +char CPL_DLL *VSIStrerror( int ); +GIntBig CPL_DLL VSIGetDiskFreeSpace(const char *pszDirname); + +/* ==================================================================== */ +/* Install special file access handlers. */ +/* ==================================================================== */ +void CPL_DLL VSIInstallMemFileHandler(void); +void CPL_DLL VSIInstallLargeFileHandler(void); +void CPL_DLL VSIInstallSubFileHandler(void); +void VSIInstallCurlFileHandler(void); +void VSIInstallCurlStreamingFileHandler(void); +void VSIInstallS3FileHandler(void); +void VSIInstallS3StreamingFileHandler(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 */ +void VSIInstallStdoutHandler(void); /* No reason to export that */ +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); +void CPL_DLL VSICleanupFileManager(void); + +VSILFILE CPL_DLL *VSIFileFromMemBuffer( const char *pszFilename, + GByte *pabyData, + vsi_l_offset nDataLength, + int bTakeOwnership ) CPL_WARN_UNUSED_RESULT; +GByte CPL_DLL *VSIGetMemFileBuffer( const char *pszFilename, + vsi_l_offset *pnDataLength, + int bUnlinkAndSeize ); + +typedef size_t (*VSIWriteFunction)(const void* ptr, size_t size, size_t nmemb, FILE* stream); +void CPL_DLL VSIStdoutSetRedirection( VSIWriteFunction pFct, FILE* stream ); + +/* ==================================================================== */ +/* Time querying. */ +/* ==================================================================== */ + +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 ); + +/* -------------------------------------------------------------------- */ +/* the following can be turned on for detailed logging of */ +/* almost all IO calls. */ +/* -------------------------------------------------------------------- */ +#ifdef VSI_DEBUG + +#ifndef DEBUG +# define DEBUG +#endif + +#include "cpl_error.h" + +#define VSIDebug4(f,a1,a2,a3,a4) CPLDebug( "VSI", f, a1, a2, a3, a4 ); +#define VSIDebug3( f, a1, a2, a3 ) CPLDebug( "VSI", f, a1, a2, a3 ); +#define VSIDebug2( f, a1, a2 ) CPLDebug( "VSI", f, a1, a2 ); +#define VSIDebug1( f, a1 ) CPLDebug( "VSI", f, a1 ); +#else +#define VSIDebug4( f, a1, a2, a3, a4 ) {} +#define VSIDebug3( f, a1, a2, a3 ) {} +#define VSIDebug2( f, a1, a2 ) {} +#define VSIDebug1( f, a1 ) {} +#endif + +CPL_C_END + +#endif /* ndef CPL_VSI_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_vsi_error.h b/modules/globebrowsing/ext/gdal/include/cpl_vsi_error.h new file mode 100644 index 0000000000..3a99b01ab6 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_vsi_error.h @@ -0,0 +1,67 @@ +/****************************************************************************** + * $Id$ + * + * Project: VSI Virtual File System + * Purpose: Implement an error system for reporting file system errors. + * Filesystem errors need to be handled separately from the + * CPLError architecture because they are potentially ignored. + * Author: Rob Emanuele, rdemanuele at gmail.com + * + ****************************************************************************** + * Copyright (c) 2016, Rob Emanuele + * + * 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_VSI_ERROR_H_INCLUDED +#define CPL_VSI_ERROR_H_INCLUDED + +#include "cpl_port.h" +#include "cpl_error.h" + +/* ==================================================================== + Filesystem error codes. + ==================================================================== */ + +CPL_C_START + +typedef int VSIErrorNum; + +#define VSIE_None 0 +#define VSIE_FileError 1 +#define VSIE_HttpError 2 + +#define VSIE_AWSError 5 +#define VSIE_AWSAccessDenied 6 +#define VSIE_AWSBucketNotFound 7 +#define VSIE_AWSObjectNotFound 8 +#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 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); + +CPL_C_END + +#endif /* CPL_VSI_ERROR_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_vsi_virtual.h b/modules/globebrowsing/ext/gdal/include/cpl_vsi_virtual.h new file mode 100644 index 0000000000..7029404441 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_vsi_virtual.h @@ -0,0 +1,208 @@ +/****************************************************************************** + * $Id$ + * + * Project: VSI Virtual File System + * Purpose: Declarations for classes related to the virtual filesystem. + * These would only be normally required by applications implementing + * their own virtual file system classes which should be rare. + * The class interface may be fragile through versions. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 2005, Frank Warmerdam + * Copyright (c) 2010-2014, Even Rouault + * + * 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_VSI_VIRTUAL_H_INCLUDED +#define CPL_VSI_VIRTUAL_H_INCLUDED + +#include "cpl_vsi.h" +#include "cpl_vsi_error.h" +#include "cpl_string.h" +#include "cpl_multiproc.h" + +#include +#include +#include + +/************************************************************************/ +/* VSIVirtualHandle */ +/************************************************************************/ + +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 int Eof() = 0; + virtual int Flush() {return 0;} + virtual int Close() = 0; + virtual int Truncate( CPL_UNUSED vsi_l_offset nNewSize ) { return -1; } + virtual void *GetNativeFileDescriptor() { return NULL; } + virtual ~VSIVirtualHandle() { } +}; + +/************************************************************************/ +/* VSIFilesystemHandler */ +/************************************************************************/ + +class CPL_DLL VSIFilesystemHandler { + +public: + + virtual ~VSIFilesystemHandler() {} + + VSIVirtualHandle *Open( const char *pszFilename, + const char *pszAccess ); + + virtual VSIVirtualHandle *Open( const char *pszFilename, + const char *pszAccess, + bool bSetError ) = 0; + virtual int Stat( const char *pszFilename, VSIStatBufL *pStatBuf, int nFlags) = 0; + virtual int Unlink( const char *pszFilename ) + { (void) pszFilename; errno=ENOENT; return -1; } + virtual int Mkdir( const char *pszDirname, long nMode ) + {(void)pszDirname; (void)nMode; errno=ENOENT; return -1;} + virtual int Rmdir( const char *pszDirname ) + { (void) pszDirname; errno=ENOENT; return -1; } + virtual char **ReadDir( const char *pszDirname ) + { (void) pszDirname; return NULL; } + virtual char **ReadDirEx( const char *pszDirname, int /* nMaxFiles */ ) + { return ReadDir(pszDirname); } + virtual int Rename( const char *oldpath, const char *newpath ) + { (void) oldpath; (void)newpath; errno=ENOENT; return -1; } + virtual int IsCaseSensitive( const char* pszFilename ) + { (void) pszFilename; return TRUE; } + virtual GIntBig GetDiskFreeSpace( const char* /* pszDirname */ ) { return -1; } +}; + +/************************************************************************/ +/* VSIFileManager */ +/************************************************************************/ + +class CPL_DLL VSIFileManager +{ +private: + VSIFilesystemHandler *poDefaultHandler; + std::map oHandlers; + + VSIFileManager(); + + static VSIFileManager *Get(); + +public: + ~VSIFileManager(); + + static VSIFilesystemHandler *GetHandler( const char * ); + static void InstallHandler( const std::string& osPrefix, + VSIFilesystemHandler * ); + /* RemoveHandler is never defined. */ + /* static void RemoveHandler( const std::string& osPrefix ); */ +}; + + +/************************************************************************/ +/* ==================================================================== */ +/* VSIArchiveFilesystemHandler */ +/* ==================================================================== */ +/************************************************************************/ + +class VSIArchiveEntryFileOffset +{ + public: + virtual ~VSIArchiveEntryFileOffset(); +}; + +typedef struct +{ + char *fileName; + vsi_l_offset uncompressed_size; + VSIArchiveEntryFileOffset* file_pos; + int bIsDir; + GIntBig nModifiedTime; +} VSIArchiveEntry; + +class VSIArchiveContent +{ +public: + time_t mTime; + vsi_l_offset nFileSize; + int nEntries; + VSIArchiveEntry* entries; + + VSIArchiveContent() : mTime(0), nFileSize(0), nEntries(0), entries(NULL) {} + ~VSIArchiveContent(); +}; + +class VSIArchiveReader +{ + public: + virtual ~VSIArchiveReader(); + + virtual int GotoFirstFile() = 0; + virtual int GotoNextFile() = 0; + virtual VSIArchiveEntryFileOffset* GetFileOffset() = 0; + virtual GUIntBig GetFileSize() = 0; + virtual CPLString GetFileName() = 0; + virtual GIntBig GetModifiedTime() = 0; + virtual int GotoFileOffset(VSIArchiveEntryFileOffset* pOffset) = 0; +}; + +class VSIArchiveFilesystemHandler : public VSIFilesystemHandler +{ +protected: + CPLMutex* hMutex; + /* We use a cache that contains the list of files contained in a VSIArchive file as */ + /* unarchive.c is quite inefficient in listing them. This speeds up access to VSIArchive files */ + /* containing ~1000 files like a CADRG product */ + std::map oFileList; + + virtual const char* GetPrefix() = 0; + virtual std::vector GetExtensions() = 0; + virtual VSIArchiveReader* CreateReader(const char* pszArchiveFileName) = 0; + +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 const VSIArchiveContent* GetContentOfArchive(const char* archiveFilename, VSIArchiveReader* poReader = NULL); + virtual char* SplitFilename(const char *pszFilename, CPLString &osFileInArchive, int bCheckMainFileExists); + virtual VSIArchiveReader* OpenArchiveFile(const char* archiveFilename, const char* fileInArchiveName); + virtual int FindFileInArchive(const char* archiveFilename, const char* fileInArchiveName, const VSIArchiveEntry** archiveEntry); +}; + +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 *VSICreateGZipWritable( VSIVirtualHandle* poBaseHandle, int bRegularZLibIn, int bAutoCloseBaseHandle ); + +#endif /* ndef CPL_VSI_VIRTUAL_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/cpl_vsil_curl_priv.h b/modules/globebrowsing/ext/gdal/include/cpl_vsil_curl_priv.h new file mode 100644 index 0000000000..e0bc25fcdb --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_vsil_curl_priv.h @@ -0,0 +1,49 @@ +/****************************************************************************** + * $Id$ + * + * Project: CPL - Common Portability Library + * Purpose: Private API for VSICurl + * Author: Even Rouault, even.rouault at mines-paris.org + * + ****************************************************************************** + * Copyright (c) 2012, Even Rouault + * + * 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_VSIL_CURL_PRIV_H_INCLUDED +#define CPL_VSIL_CURL_PRIV_H_INCLUDED + +#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 */ + +/* 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); + +#endif // CPL_VSIL_CURL_PRIV_H_INCLUDED diff --git a/modules/globebrowsing/ext/gdal/include/cpl_worker_thread_pool.h b/modules/globebrowsing/ext/gdal/include/cpl_worker_thread_pool.h new file mode 100644 index 0000000000..7f0c23ba8e --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cpl_worker_thread_pool.h @@ -0,0 +1,103 @@ +/********************************************************************** + * $Id$ + * + * Project: CPL - Common Portability Library + * Purpose: CPL worker thread pool + * Author: Even Rouault, + * + ********************************************************************** + * Copyright (c) 2015, Even Rouault, + * + * 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_WORKER_THREAD_POOL_H_INCLUDED_ +#define CPL_WORKER_THREAD_POOL_H_INCLUDED_ + +#include "cpl_multiproc.h" +#include "cpl_list.h" +#include + +/** + * \file cpl_worker_thread_pool.h + * + * Class to manage a pool of worker threads. + * @since GDAL 2.1 + */ + +class CPLWorkerThreadPool; + +typedef struct +{ + CPLThreadFunc pfnFunc; + void *pData; +} CPLWorkerThreadJob; + +typedef struct +{ + CPLThreadFunc pfnInitFunc; + void *pInitData; + CPLWorkerThreadPool *poTP; + CPLJoinableThread *hThread; + int bMarkedAsWaiting; + //CPLWorkerThreadJob *psNextJob; + + CPLMutex *hMutex; + CPLCond *hCond; +} CPLWorkerThread; + +typedef enum +{ + CPLWTS_OK, + CPLWTS_STOP, + CPLWTS_ERROR +} CPLWorkerThreadState; + +class CPL_DLL CPLWorkerThreadPool +{ + std::vector aWT; + CPLCond* hCond; + CPLMutex* hMutex; + volatile CPLWorkerThreadState eState; + CPLList* psJobQueue; + volatile int nPendingJobs; + + CPLList* psWaitingWorkerThreadsList; + int nWaitingWorkerThreads; + + static void WorkerThreadFunction(void* user_data); + + void DeclareJobFinished(); + CPLWorkerThreadJob* GetNextJob(CPLWorkerThread* psWorkerThread); + + public: + CPLWorkerThreadPool(); + ~CPLWorkerThreadPool(); + + bool Setup(int nThreads, + CPLThreadFunc pfnInitFunc, + void** pasInitData); + bool SubmitJob(CPLThreadFunc pfnFunc, void* pData); + bool SubmitJobs(CPLThreadFunc pfnFunc, const std::vector& apData); + void WaitCompletion(int nMaxRemainingJobs = 0); + + int GetThreadCount() const { return (int)aWT.size(); } +}; + +#endif // CPL_WORKER_THREAD_POOL_H_INCLUDED_ diff --git a/modules/globebrowsing/ext/gdal/include/cplkeywordparser.h b/modules/globebrowsing/ext/gdal/include/cplkeywordparser.h new file mode 100644 index 0000000000..ab627aa893 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/cplkeywordparser.h @@ -0,0 +1,66 @@ +/****************************************************************************** + * $Id$ + * + * Project: Common Portability Library + * Purpose: Implementation of CPLKeywordParser - a class for parsing + * the keyword format used for files like QuickBird .RPB files. + * This is a slight variation on the NASAKeywordParser used for + * the PDS/ISIS2/ISIS3 formats. + * Author: 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 CPL_KEYWORD_PARSER +#define CPL_KEYWORD_PARSER + +#include "cpl_string.h" + +/************************************************************************/ +/* ==================================================================== */ +/* CPLKeywordParser */ +/* ==================================================================== */ +/************************************************************************/ + +class CPLKeywordParser +{ + char **papszKeywordList; + + CPLString osHeaderText; + const char *pszHeaderNext; + + void SkipWhite(); + int ReadWord( CPLString &osWord ); + int ReadPair( CPLString &osName, CPLString &osValue ); + int ReadGroup( const char *pszPathPrefix ); + +public: + CPLKeywordParser(); + ~CPLKeywordParser(); + + int Ingest( VSILFILE *fp ); + + const char *GetKeyword( const char *pszPath, const char *pszDefault=NULL ); + char **GetAllKeywords() { return papszKeywordList; } +}; + +#endif /* def CPL_KEYWORD_PARSER */ diff --git a/modules/globebrowsing/ext/gdal/include/gdal.h b/modules/globebrowsing/ext/gdal/include/gdal.h new file mode 100644 index 0000000000..899c617503 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdal.h @@ -0,0 +1,1153 @@ +/****************************************************************************** + * $Id$ + * + * Project: GDAL Core + * Purpose: GDAL Core C/Public declarations. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 1998, 2002 Frank Warmerdam + * Copyright (c) 2007-2014, Even Rouault + * + * 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_H_INCLUDED +#define GDAL_H_INCLUDED + +/** + * \file gdal.h + * + * Public (C callable) GDAL entry points. + */ + +#ifndef DOXYGEN_SKIP +#include "gdal_version.h" +#include "cpl_port.h" +#include "cpl_error.h" +#include "cpl_progress.h" +#include "cpl_virtualmem.h" +#include "cpl_minixml.h" +#include "ogr_api.h" +#endif + +/* -------------------------------------------------------------------- */ +/* Significant constants. */ +/* -------------------------------------------------------------------- */ + +CPL_C_START + +/*! Pixel data types */ +typedef enum { + /*! Unknown or unspecified type */ GDT_Unknown = 0, + /*! Eight bit unsigned integer */ GDT_Byte = 1, + /*! Sixteen bit unsigned integer */ GDT_UInt16 = 2, + /*! Sixteen bit signed integer */ GDT_Int16 = 3, + /*! Thirty two bit unsigned integer */ GDT_UInt32 = 4, + /*! Thirty two bit signed integer */ GDT_Int32 = 5, + /*! Thirty two bit floating point */ GDT_Float32 = 6, + /*! Sixty four bit floating point */ GDT_Float64 = 7, + /*! Complex Int16 */ GDT_CInt16 = 8, + /*! Complex Int32 */ GDT_CInt32 = 9, + /*! Complex Float32 */ GDT_CFloat32 = 10, + /*! Complex Float64 */ GDT_CFloat64 = 11, + GDT_TypeCount = 12 /* maximum type # + 1 */ +} GDALDataType; + +int CPL_DLL CPL_STDCALL GDALGetDataTypeSize( GDALDataType ); // Deprecated. +int CPL_DLL CPL_STDCALL GDALGetDataTypeSizeBits( GDALDataType eDataType ); +int CPL_DLL CPL_STDCALL GDALGetDataTypeSizeBytes( GDALDataType ); +int CPL_DLL CPL_STDCALL GDALDataTypeIsComplex( GDALDataType ); +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 ); + +/** +* status of the asynchronous stream +*/ +typedef enum +{ + GARIO_PENDING = 0, + GARIO_UPDATE = 1, + GARIO_ERROR = 2, + GARIO_COMPLETE = 3, + GARIO_TypeCount = 4 +} GDALAsyncStatusType; + +const char CPL_DLL * CPL_STDCALL GDALGetAsyncStatusTypeName( GDALAsyncStatusType ); +GDALAsyncStatusType CPL_DLL CPL_STDCALL GDALGetAsyncStatusTypeByName( const char * ); + +/*! Flag indicating read/write, or read-only access to data. */ +typedef enum { + /*! Read only (no update) access */ GA_ReadOnly = 0, + /*! Read/write access. */ GA_Update = 1 +} GDALAccess; + +/*! Read/Write flag for RasterIO() method */ +typedef enum { + /*! Read data */ GF_Read = 0, + /*! Write data */ GF_Write = 1 +} GDALRWFlag; + +/* NOTE: values are selected to be consistent with GDALResampleAlg of alg/gdalwarper.h */ +/** RasterIO() resampling method. + * @since GDAL 2.0 + */ +typedef enum +{ + /*! Nearest neighbour */ GRIORA_NearestNeighbour = 0, + /*! Bilinear (2x2 kernel) */ GRIORA_Bilinear = 1, + /*! Cubic Convolution Approximation (4x4 kernel) */ GRIORA_Cubic = 2, + /*! Cubic B-Spline Approximation (4x4 kernel) */ GRIORA_CubicSpline = 3, + /*! Lanczos windowed sinc interpolation (6x6 kernel) */ GRIORA_Lanczos = 4, + /*! Average */ GRIORA_Average = 5, + /*! Mode (selects the value which appears most often of all the sampled points) */ + GRIORA_Mode = 6, + /*! Gauss blurring */ GRIORA_Gauss = 7 + /* NOTE: values 8 to 12 are reserved for max,min,med,Q1,Q3 */ +} GDALRIOResampleAlg; + +/* NOTE to developers: only add members, and if so edit INIT_RASTERIO_EXTRA_ARG */ +/* and INIT_RASTERIO_EXTRA_ARG */ +/** Structure to pass extra arguments to RasterIO() method + * @since GDAL 2.0 + */ +typedef struct +{ + /*! Version of structure (to allow future extensions of the structure) */ + int nVersion; + + /*! Resampling algorithm */ + GDALRIOResampleAlg eResampleAlg; + + /*! Progress callback */ + GDALProgressFunc pfnProgress; + /*! Progress callback user data */ + void *pProgressData; + + /*! Indicate if dfXOff, dfYOff, dfXSize and dfYSize are set. + Mostly reserved from the VRT driver to communicate a more precise + source window. Must be such that dfXOff - nXOff < 1.0 and + dfYOff - nYOff < 1.0 and nXSize - dfXSize < 1.0 and nYSize - dfYSize < 1.0 */ + int bFloatingPointWindowValidity; + /*! Pixel offset to the top left corner. Only valid if bFloatingPointWindowValidity = TRUE */ + double dfXOff; + /*! Line offset to the top left corner. Only valid if bFloatingPointWindowValidity = TRUE */ + double dfYOff; + /*! Width in pixels of the area of interest. Only valid if bFloatingPointWindowValidity = TRUE */ + double dfXSize; + /*! Height in pixels of the area of interest. Only valid if bFloatingPointWindowValidity = TRUE */ + double dfYSize; +} GDALRasterIOExtraArg; + +#define RASTERIO_EXTRA_ARG_CURRENT_VERSION 1 + +/** Macro to initialize an instance of GDALRasterIOExtraArg structure. + * @since GDAL 2.0 + */ +#define INIT_RASTERIO_EXTRA_ARG(s) \ + do { (s).nVersion = RASTERIO_EXTRA_ARG_CURRENT_VERSION; \ + (s).eResampleAlg = GRIORA_NearestNeighbour; \ + (s).pfnProgress = NULL; \ + (s).pProgressData = NULL; \ + (s).bFloatingPointWindowValidity = FALSE; } while(0) + +/*! Types of color interpretation for raster bands. */ +typedef enum +{ + GCI_Undefined=0, + /*! Greyscale */ GCI_GrayIndex=1, + /*! Paletted (see associated color table) */ GCI_PaletteIndex=2, + /*! Red band of RGBA image */ GCI_RedBand=3, + /*! Green band of RGBA image */ GCI_GreenBand=4, + /*! Blue band of RGBA image */ GCI_BlueBand=5, + /*! Alpha (0=transparent, 255=opaque) */ GCI_AlphaBand=6, + /*! Hue band of HLS image */ GCI_HueBand=7, + /*! Saturation band of HLS image */ GCI_SaturationBand=8, + /*! Lightness band of HLS image */ GCI_LightnessBand=9, + /*! Cyan band of CMYK image */ GCI_CyanBand=10, + /*! Magenta band of CMYK image */ GCI_MagentaBand=11, + /*! Yellow band of CMYK image */ GCI_YellowBand=12, + /*! Black band of CMLY image */ GCI_BlackBand=13, + /*! Y Luminance */ GCI_YCbCr_YBand=14, + /*! Cb Chroma */ GCI_YCbCr_CbBand=15, + /*! Cr Chroma */ GCI_YCbCr_CrBand=16, + /*! Max current value */ GCI_Max=16 +} GDALColorInterp; + +const char CPL_DLL *GDALGetColorInterpretationName( GDALColorInterp ); +GDALColorInterp CPL_DLL GDALGetColorInterpretationByName( const char *pszName ); + +/*! Types of color interpretations for a GDALColorTable. */ +typedef enum +{ + /*! Grayscale (in GDALColorEntry.c1) */ GPI_Gray=0, + /*! Red, Green, Blue and Alpha in (in c1, c2, c3 and c4) */ GPI_RGB=1, + /*! Cyan, Magenta, Yellow and Black (in c1, c2, c3 and c4)*/ GPI_CMYK=2, + /*! Hue, Lightness and Saturation (in c1, c2, and c3) */ GPI_HLS=3 +} GDALPaletteInterp; + +const char CPL_DLL *GDALGetPaletteInterpretationName( GDALPaletteInterp ); + +/* "well known" metadata items. */ + +#define GDALMD_AREA_OR_POINT "AREA_OR_POINT" +# define GDALMD_AOP_AREA "Area" +# define GDALMD_AOP_POINT "Point" + +/* -------------------------------------------------------------------- */ +/* GDAL Specific error codes. */ +/* */ +/* error codes 100 to 299 reserved for GDAL. */ +/* -------------------------------------------------------------------- */ +#define CPLE_WrongFormat (CPLErrorNum)200 + +/* -------------------------------------------------------------------- */ +/* Define handle types related to various internal classes. */ +/* -------------------------------------------------------------------- */ + +/** Opaque type used for the C bindings of the C++ GDALMajorObject class */ +typedef void *GDALMajorObjectH; + +/** Opaque type used for the C bindings of the C++ GDALDataset class */ +typedef void *GDALDatasetH; + +/** Opaque type used for the C bindings of the C++ GDALRasterBand class */ +typedef void *GDALRasterBandH; + +/** Opaque type used for the C bindings of the C++ GDALDriver class */ +typedef void *GDALDriverH; + +/** Opaque type used for the C bindings of the C++ GDALColorTable class */ +typedef void *GDALColorTableH; + +/** Opaque type used for the C bindings of the C++ GDALRasterAttributeTable class */ +typedef void *GDALRasterAttributeTableH; + +/** Opaque type used for the C bindings of the C++ GDALAsyncReader class */ +typedef void *GDALAsyncReaderH; + +/** Type to express pixel, line or band spacing. Signed 64 bit integer. */ +typedef GIntBig GSpacing; + +/* ==================================================================== */ +/* Registration/driver related. */ +/* ==================================================================== */ + +/** Long name of the driver */ +#define GDAL_DMD_LONGNAME "DMD_LONGNAME" + +/** URL (relative to http://gdal.org/) to the help page of the driver */ +#define GDAL_DMD_HELPTOPIC "DMD_HELPTOPIC" + +/** MIME type handled by the driver. */ +#define GDAL_DMD_MIMETYPE "DMD_MIMETYPE" + +/** Extension handled by the driver. */ +#define GDAL_DMD_EXTENSION "DMD_EXTENSION" + +/** Connection prefix to provide as the file name of the open function. + * Typically set for non-file based drivers. Generally used with open options. + * @since GDAL 2.0 + */ +#define GDAL_DMD_CONNECTION_PREFIX "DMD_CONNECTION_PREFIX" + +/** List of (space separated) extensions handled by the driver. + * @since GDAL 2.0 + */ +#define GDAL_DMD_EXTENSIONS "DMD_EXTENSIONS" + +/** XML snippet with creation options. */ +#define GDAL_DMD_CREATIONOPTIONLIST "DMD_CREATIONOPTIONLIST" + +/** XML snippet with open options. + * @since GDAL 2.0 + */ +#define GDAL_DMD_OPENOPTIONLIST "DMD_OPENOPTIONLIST" + +/** List of (space separated) raster data types support by the Create()/CreateCopy() API. */ +#define GDAL_DMD_CREATIONDATATYPES "DMD_CREATIONDATATYPES" + +/** List of (space separated) vector field types support by the CreateField() API. + * @since GDAL 2.0 + * */ +#define GDAL_DMD_CREATIONFIELDDATATYPES "DMD_CREATIONFIELDDATATYPES" + +/** Capability set by a driver that exposes Subdatasets. */ +#define GDAL_DMD_SUBDATASETS "DMD_SUBDATASETS" + +/** Capability set by a driver that implements the Open() API. */ +#define GDAL_DCAP_OPEN "DCAP_OPEN" + +/** Capability set by a driver that implements the Create() API. */ +#define GDAL_DCAP_CREATE "DCAP_CREATE" + +/** Capability set by a driver that implements the CreateCopy() API. */ +#define GDAL_DCAP_CREATECOPY "DCAP_CREATECOPY" + +/** Capability set by a driver that can read/create datasets through the VSI*L API. */ +#define GDAL_DCAP_VIRTUALIO "DCAP_VIRTUALIO" + +/** Capability set by a driver having raster capability. + * @since GDAL 2.0 + */ +#define GDAL_DCAP_RASTER "DCAP_RASTER" + +/** Capability set by a driver having vector capability. + * @since GDAL 2.0 + */ +#define GDAL_DCAP_VECTOR "DCAP_VECTOR" + +/** Capability set by a driver having vector capability. + * @since GDAL 2.1 + */ +#define GDAL_DCAP_GNM "DCAP_GNM" + +/** Capability set by a driver that can create fields with NOT NULL constraint. + * @since GDAL 2.0 + */ +#define GDAL_DCAP_NOTNULL_FIELDS "DCAP_NOTNULL_FIELDS" + +/** Capability set by a driver that can create fields with DEFAULT values. + * @since GDAL 2.0 + */ +#define GDAL_DCAP_DEFAULT_FIELDS "DCAP_DEFAULT_FIELDS" + +/** Capability set by a driver that can create geometry fields with NOT NULL constraint. + * @since GDAL 2.0 + */ +#define GDAL_DCAP_NOTNULL_GEOMFIELDS "DCAP_NOTNULL_GEOMFIELDS" + +void CPL_DLL CPL_STDCALL GDALAllRegister( void ); + +GDALDatasetH CPL_DLL CPL_STDCALL GDALCreate( GDALDriverH hDriver, + const char *, int, int, int, GDALDataType, + char ** ) CPL_WARN_UNUSED_RESULT; +GDALDatasetH CPL_DLL CPL_STDCALL +GDALCreateCopy( GDALDriverH, const char *, GDALDatasetH, + int, char **, GDALProgressFunc, void * ) CPL_WARN_UNUSED_RESULT; + +GDALDriverH CPL_DLL CPL_STDCALL GDALIdentifyDriver( const char * pszFilename, + char ** 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 */ + +/** Open in read-only mode. + * Used by GDALOpenEx(). + * @since GDAL 2.0 + */ +#define GDAL_OF_READONLY 0x00 + +/** Open in update mode. + * Used by GDALOpenEx(). + * @since GDAL 2.0 + */ +#define GDAL_OF_UPDATE 0x01 + +/** Allow raster and vector drivers to be used. + * Used by GDALOpenEx(). + * @since GDAL 2.0 + */ +#define GDAL_OF_ALL 0x00 + +/** Allow raster drivers to be used. + * Used by GDALOpenEx(). + * @since GDAL 2.0 + */ +#define GDAL_OF_RASTER 0x02 + +/** Allow vector drivers to be used. + * Used by GDALOpenEx(). + * @since GDAL 2.0 + */ +#define GDAL_OF_VECTOR 0x04 + + +/** Allow gnm drivers to be used. + * Used by GDALOpenEx(). + * @since GDAL 2.1 + */ +#define GDAL_OF_GNM 0x08 + +/* Some space for GDAL 3.0 new types ;-) */ +/*#define GDAL_OF_OTHER_KIND1 0x08 */ +/*#define GDAL_OF_OTHER_KIND2 0x10 */ +#ifndef DOXYGEN_SKIP +#define GDAL_OF_KIND_MASK 0x1E +#endif + +/** Open in shared mode. + * Used by GDALOpenEx(). + * @since GDAL 2.0 + */ +#define GDAL_OF_SHARED 0x20 + +/** Emit error message in case of failed open. + * Used by GDALOpenEx(). + * @since GDAL 2.0 + */ +#define GDAL_OF_VERBOSE_ERROR 0x40 + +/** Open as internal dataset. Such dataset isn't registered in the global list + * of opened dataset. Cannot be used with GDAL_OF_SHARED. + * + * Used by GDALOpenEx(). + * @since GDAL 2.0 + */ +#define GDAL_OF_INTERNAL 0x80 + +/** Let GDAL decide if a array-based or hashset-based storage strategy for + * cached blocks must be used. + * + * GDAL_OF_DEFAULT_BLOCK_ACCESS, GDAL_OF_ARRAY_BLOCK_ACCESS and + * GDAL_OF_HASHSET_BLOCK_ACCESS are mutually exclusive. + * + * Used by GDALOpenEx(). + * @since GDAL 2.1 + */ +#define GDAL_OF_DEFAULT_BLOCK_ACCESS 0 + +/** Use a array-based storage strategy for cached blocks. + * + * GDAL_OF_DEFAULT_BLOCK_ACCESS, GDAL_OF_ARRAY_BLOCK_ACCESS and + * GDAL_OF_HASHSET_BLOCK_ACCESS are mutually exclusive. + * + * Used by GDALOpenEx(). + * @since GDAL 2.1 + */ +#define GDAL_OF_ARRAY_BLOCK_ACCESS 0x100 + +/** Use a hashset-based storage strategy for cached blocks. + * + * GDAL_OF_DEFAULT_BLOCK_ACCESS, GDAL_OF_ARRAY_BLOCK_ACCESS and + * GDAL_OF_HASHSET_BLOCK_ACCESS are mutually exclusive. + * + * Used by GDALOpenEx(). + * @since GDAL 2.1 + */ +#define GDAL_OF_HASHSET_BLOCK_ACCESS 0x200 + +#define GDAL_OF_RESERVED_1 0x300 +#define GDAL_OF_BLOCK_ACCESS_MASK 0x300 + +GDALDatasetH CPL_DLL CPL_STDCALL GDALOpenEx( const char* pszFilename, + unsigned int nOpenFlags, + const char* const* papszAllowedDrivers, + const char* const* papszOpenOptions, + const char* const* papszSiblingFiles ) CPL_WARN_UNUSED_RESULT; + +int CPL_DLL CPL_STDCALL GDALDumpOpenDatasets( FILE * ); + +GDALDriverH CPL_DLL CPL_STDCALL GDALGetDriverByName( const char * ); +int CPL_DLL CPL_STDCALL GDALGetDriverCount( void ); +GDALDriverH CPL_DLL CPL_STDCALL GDALGetDriver( int ); +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 ); +void CPL_DLL GDALDestroy( void ); +CPLErr CPL_DLL CPL_STDCALL GDALDeleteDataset( GDALDriverH, const char * ); +CPLErr CPL_DLL CPL_STDCALL GDALRenameDataset( GDALDriverH, + const char * pszNewName, + const char * pszOldName ); +CPLErr CPL_DLL CPL_STDCALL GDALCopyDatasetFiles( GDALDriverH, + const char * pszNewName, + const char * pszOldName); +int CPL_DLL CPL_STDCALL GDALValidateCreationOptions( GDALDriverH, + char** papszCreationOptions); + +/* The following are deprecated */ +const char CPL_DLL * CPL_STDCALL GDALGetDriverShortName( GDALDriverH ); +const char CPL_DLL * CPL_STDCALL GDALGetDriverLongName( GDALDriverH ); +const char CPL_DLL * CPL_STDCALL GDALGetDriverHelpTopic( GDALDriverH ); +const char CPL_DLL * CPL_STDCALL GDALGetDriverCreationOptionList( GDALDriverH ); + +/* ==================================================================== */ +/* GDAL_GCP */ +/* ==================================================================== */ + +/** Ground Control Point */ +typedef struct +{ + /** Unique identifier, often numeric */ + char *pszId; + + /** Informational message or "" */ + char *pszInfo; + + /** Pixel (x) location of GCP on raster */ + double dfGCPPixel; + /** Line (y) location of GCP on raster */ + double dfGCPLine; + + /** X position of GCP in georeferenced space */ + double dfGCPX; + + /** Y position of GCP in georeferenced space */ + double dfGCPY; + + /** Elevation of GCP, or zero if not known */ + double dfGCPZ; +} GDAL_GCP; + +void CPL_DLL CPL_STDCALL GDALInitGCPs( int, GDAL_GCP * ); +void CPL_DLL CPL_STDCALL GDALDeinitGCPs( int, GDAL_GCP * ); +GDAL_GCP CPL_DLL * CPL_STDCALL GDALDuplicateGCPs( int, const GDAL_GCP * ); + +int CPL_DLL CPL_STDCALL +GDALGCPsToGeoTransform( int nGCPCount, const GDAL_GCP *pasGCPs, + double *padfGeoTransform, int bApproxOK ) CPL_WARN_UNUSED_RESULT; +int CPL_DLL CPL_STDCALL +GDALInvGeoTransform( double *padfGeoTransformIn, + double *padfInvGeoTransformOut ) CPL_WARN_UNUSED_RESULT; +void CPL_DLL CPL_STDCALL GDALApplyGeoTransform( double *, double, double, + double *, double * ); +void CPL_DLL GDALComposeGeoTransforms(const double *padfGeoTransform1, + const double *padfGeoTransform2, + double *padfGeoTransformOut); + +/* ==================================================================== */ +/* major objects (dataset, and, driver, drivermanager). */ +/* ==================================================================== */ + +char CPL_DLL ** CPL_STDCALL GDALGetMetadataDomainList( GDALMajorObjectH hObject ); +char CPL_DLL ** CPL_STDCALL GDALGetMetadata( GDALMajorObjectH, const char * ); +CPLErr CPL_DLL CPL_STDCALL GDALSetMetadata( GDALMajorObjectH, char **, + const char * ); +const char CPL_DLL * CPL_STDCALL +GDALGetMetadataItem( GDALMajorObjectH, const char *, const char * ); +CPLErr CPL_DLL CPL_STDCALL +GDALSetMetadataItem( GDALMajorObjectH, const char *, const char *, + const char * ); +const char CPL_DLL * CPL_STDCALL GDALGetDescription( GDALMajorObjectH ); +void CPL_DLL CPL_STDCALL GDALSetDescription( GDALMajorObjectH, const char * ); + +/* ==================================================================== */ +/* GDALDataset class ... normally this represents one file. */ +/* ==================================================================== */ + +#define GDAL_DS_LAYER_CREATIONOPTIONLIST "DS_LAYER_CREATIONOPTIONLIST" + +GDALDriverH CPL_DLL CPL_STDCALL GDALGetDatasetDriver( GDALDatasetH ); +char CPL_DLL ** CPL_STDCALL GDALGetFileList( GDALDatasetH ); +void CPL_DLL CPL_STDCALL GDALClose( GDALDatasetH ); +int CPL_DLL CPL_STDCALL GDALGetRasterXSize( GDALDatasetH ); +int CPL_DLL CPL_STDCALL GDALGetRasterYSize( GDALDatasetH ); +int CPL_DLL CPL_STDCALL GDALGetRasterCount( GDALDatasetH ); +GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetRasterBand( GDALDatasetH, int ); + +CPLErr CPL_DLL CPL_STDCALL GDALAddBand( GDALDatasetH hDS, GDALDataType eType, + char **papszOptions ); + +GDALAsyncReaderH CPL_DLL CPL_STDCALL +GDALBeginAsyncReader(GDALDatasetH hDS, int nXOff, int nYOff, + int nXSize, int nYSize, + void *pBuf, int nBufXSize, int nBufYSize, + GDALDataType eBufType, int nBandCount, int* panBandMap, + int nPixelSpace, int nLineSpace, int nBandSpace, + char **papszOptions) CPL_WARN_UNUSED_RESULT; + +void CPL_DLL CPL_STDCALL +GDALEndAsyncReader(GDALDatasetH hDS, GDALAsyncReaderH hAsynchReaderH); + +CPLErr CPL_DLL CPL_STDCALL GDALDatasetRasterIO( + GDALDatasetH hDS, GDALRWFlag eRWFlag, + int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize, + void * pBuffer, int nBXSize, int nBYSize, GDALDataType eBDataType, + int nBandCount, int *panBandCount, + int nPixelSpace, int nLineSpace, int nBandSpace) CPL_WARN_UNUSED_RESULT; + +CPLErr CPL_DLL CPL_STDCALL GDALDatasetRasterIOEx( + GDALDatasetH hDS, GDALRWFlag eRWFlag, + int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize, + void * pBuffer, int nBXSize, int nBYSize, GDALDataType eBDataType, + int nBandCount, int *panBandCount, + GSpacing nPixelSpace, GSpacing nLineSpace, GSpacing nBandSpace, + GDALRasterIOExtraArg* psExtraArg) CPL_WARN_UNUSED_RESULT; + +CPLErr CPL_DLL CPL_STDCALL GDALDatasetAdviseRead( GDALDatasetH hDS, + int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize, + int nBXSize, int nBYSize, GDALDataType eBDataType, + int nBandCount, int *panBandCount, char **papszOptions ); + +const char CPL_DLL * CPL_STDCALL GDALGetProjectionRef( GDALDatasetH ); +CPLErr CPL_DLL CPL_STDCALL GDALSetProjection( GDALDatasetH, const char * ); +CPLErr CPL_DLL CPL_STDCALL GDALGetGeoTransform( GDALDatasetH, double * ); +CPLErr CPL_DLL CPL_STDCALL GDALSetGeoTransform( GDALDatasetH, double * ); + +int CPL_DLL CPL_STDCALL GDALGetGCPCount( GDALDatasetH ); +const char CPL_DLL * CPL_STDCALL GDALGetGCPProjection( GDALDatasetH ); +const GDAL_GCP CPL_DLL * CPL_STDCALL GDALGetGCPs( GDALDatasetH ); +CPLErr CPL_DLL CPL_STDCALL GDALSetGCPs( GDALDatasetH, int, const GDAL_GCP *, + const char * ); + +void CPL_DLL * CPL_STDCALL GDALGetInternalHandle( GDALDatasetH, const char * ); +int CPL_DLL CPL_STDCALL GDALReferenceDataset( GDALDatasetH ); +int CPL_DLL CPL_STDCALL GDALDereferenceDataset( GDALDatasetH ); + +CPLErr CPL_DLL CPL_STDCALL +GDALBuildOverviews( GDALDatasetH, const char *, int, int *, + int, int *, GDALProgressFunc, void * ) CPL_WARN_UNUSED_RESULT; +void CPL_DLL CPL_STDCALL GDALGetOpenDatasets( GDALDatasetH **hDS, int *pnCount ); +int CPL_DLL CPL_STDCALL GDALGetAccess( GDALDatasetH hDS ); +void CPL_DLL CPL_STDCALL GDALFlushCache( GDALDatasetH hDS ); + +CPLErr CPL_DLL CPL_STDCALL + GDALCreateDatasetMaskBand( GDALDatasetH hDS, int nFlags ); + +CPLErr CPL_DLL CPL_STDCALL GDALDatasetCopyWholeRaster( + GDALDatasetH hSrcDS, GDALDatasetH hDstDS, char **papszOptions, + GDALProgressFunc pfnProgress, void *pProgressData ) CPL_WARN_UNUSED_RESULT; + +CPLErr CPL_DLL CPL_STDCALL GDALRasterBandCopyWholeRaster( + GDALRasterBandH hSrcBand, GDALRasterBandH hDstBand, char **papszOptions, + GDALProgressFunc pfnProgress, void *pProgressData ) CPL_WARN_UNUSED_RESULT; + +CPLErr CPL_DLL +GDALRegenerateOverviews( GDALRasterBandH hSrcBand, + int nOverviewCount, GDALRasterBandH *pahOverviewBands, + const char *pszResampling, + GDALProgressFunc pfnProgress, void *pProgressData ); + +int CPL_DLL GDALDatasetGetLayerCount( GDALDatasetH ); +OGRLayerH CPL_DLL GDALDatasetGetLayer( GDALDatasetH, int ); +OGRLayerH CPL_DLL GDALDatasetGetLayerByName( GDALDatasetH, const char * ); +OGRErr CPL_DLL GDALDatasetDeleteLayer( GDALDatasetH, int ); +OGRLayerH CPL_DLL GDALDatasetCreateLayer( GDALDatasetH, const char *, + OGRSpatialReferenceH, OGRwkbGeometryType, + char ** ); +OGRLayerH CPL_DLL GDALDatasetCopyLayer( GDALDatasetH, OGRLayerH, const char *, + char ** ); +int CPL_DLL GDALDatasetTestCapability( GDALDatasetH, const char * ); +OGRLayerH CPL_DLL GDALDatasetExecuteSQL( GDALDatasetH, const char *, + OGRGeometryH, const char * ); +void CPL_DLL GDALDatasetReleaseResultSet( GDALDatasetH, OGRLayerH ); +OGRStyleTableH CPL_DLL GDALDatasetGetStyleTable( GDALDatasetH ); +void CPL_DLL GDALDatasetSetStyleTableDirectly( GDALDatasetH, OGRStyleTableH ); +void CPL_DLL GDALDatasetSetStyleTable( GDALDatasetH, OGRStyleTableH ); +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. */ +/* ==================================================================== */ + +/** + * SRCVAL - Macro which may be used by pixel functions to obtain + * a pixel from a source buffer. + */ +#define SRCVAL(papoSource, eSrcType, ii) \ + (eSrcType == GDT_Byte ? \ + ((GByte *)papoSource)[ii] : \ + (eSrcType == GDT_Float32 ? \ + ((float *)papoSource)[ii] : \ + (eSrcType == GDT_Float64 ? \ + ((double *)papoSource)[ii] : \ + (eSrcType == GDT_Int32 ? \ + ((GInt32 *)papoSource)[ii] : \ + (eSrcType == GDT_UInt16 ? \ + ((GUInt16 *)papoSource)[ii] : \ + (eSrcType == GDT_Int16 ? \ + ((GInt16 *)papoSource)[ii] : \ + (eSrcType == GDT_UInt32 ? \ + ((GUInt32 *)papoSource)[ii] : \ + (eSrcType == GDT_CInt16 ? \ + ((GInt16 *)papoSource)[ii * 2] : \ + (eSrcType == GDT_CInt32 ? \ + ((GInt32 *)papoSource)[ii * 2] : \ + (eSrcType == GDT_CFloat32 ? \ + ((float *)papoSource)[ii * 2] : \ + (eSrcType == GDT_CFloat64 ? \ + ((double *)papoSource)[ii * 2] : 0))))))))))) + +typedef CPLErr +(*GDALDerivedPixelFunc)(void **papoSources, int nSources, void *pData, + 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 GDALRasterAdviseRead( GDALRasterBandH hRB, + int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize, + int nBXSize, int nBYSize, GDALDataType eBDataType, char **papszOptions ); + +CPLErr CPL_DLL CPL_STDCALL +GDALRasterIO( GDALRasterBandH hRBand, GDALRWFlag eRWFlag, + int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize, + void * pBuffer, int nBXSize, int nBYSize,GDALDataType eBDataType, + int nPixelSpace, int nLineSpace ) CPL_WARN_UNUSED_RESULT; +CPLErr CPL_DLL CPL_STDCALL +GDALRasterIOEx( GDALRasterBandH hRBand, GDALRWFlag eRWFlag, + int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize, + void * pBuffer, int nBXSize, int nBYSize,GDALDataType eBDataType, + GSpacing nPixelSpace, GSpacing nLineSpace, + GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT; +CPLErr CPL_DLL CPL_STDCALL GDALReadBlock( GDALRasterBandH, int, int, void * ) CPL_WARN_UNUSED_RESULT; +CPLErr CPL_DLL CPL_STDCALL GDALWriteBlock( GDALRasterBandH, int, int, void * ) CPL_WARN_UNUSED_RESULT; +int CPL_DLL CPL_STDCALL GDALGetRasterBandXSize( GDALRasterBandH ); +int CPL_DLL CPL_STDCALL GDALGetRasterBandYSize( GDALRasterBandH ); +GDALAccess CPL_DLL CPL_STDCALL GDALGetRasterAccess( GDALRasterBandH ); +int CPL_DLL CPL_STDCALL GDALGetBandNumber( GDALRasterBandH ); +GDALDatasetH CPL_DLL CPL_STDCALL GDALGetBandDataset( GDALRasterBandH ); + +GDALColorInterp CPL_DLL CPL_STDCALL +GDALGetRasterColorInterpretation( GDALRasterBandH ); +CPLErr CPL_DLL CPL_STDCALL +GDALSetRasterColorInterpretation( GDALRasterBandH, GDALColorInterp ); +GDALColorTableH CPL_DLL CPL_STDCALL GDALGetRasterColorTable( GDALRasterBandH ); +CPLErr CPL_DLL CPL_STDCALL GDALSetRasterColorTable( GDALRasterBandH, GDALColorTableH ); +int CPL_DLL CPL_STDCALL GDALHasArbitraryOverviews( GDALRasterBandH ); +int CPL_DLL CPL_STDCALL GDALGetOverviewCount( GDALRasterBandH ); +GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetOverview( GDALRasterBandH, int ); +double CPL_DLL CPL_STDCALL GDALGetRasterNoDataValue( GDALRasterBandH, int * ); +CPLErr CPL_DLL CPL_STDCALL GDALSetRasterNoDataValue( GDALRasterBandH, double ); +CPLErr CPL_DLL CPL_STDCALL GDALDeleteRasterNoDataValue( GDALRasterBandH ); +char CPL_DLL ** CPL_STDCALL GDALGetRasterCategoryNames( GDALRasterBandH ); +CPLErr CPL_DLL CPL_STDCALL GDALSetRasterCategoryNames( GDALRasterBandH, char ** ); +double CPL_DLL CPL_STDCALL GDALGetRasterMinimum( GDALRasterBandH, int *pbSuccess ); +double CPL_DLL CPL_STDCALL GDALGetRasterMaximum( GDALRasterBandH, int *pbSuccess ); +CPLErr CPL_DLL CPL_STDCALL GDALGetRasterStatistics( + GDALRasterBandH, int bApproxOK, int bForce, + double *pdfMin, double *pdfMax, double *pdfMean, double *pdfStdDev ); +CPLErr CPL_DLL CPL_STDCALL GDALComputeRasterStatistics( + GDALRasterBandH, int bApproxOK, + double *pdfMin, double *pdfMax, double *pdfMean, double *pdfStdDev, + GDALProgressFunc pfnProgress, void *pProgressData ); +CPLErr CPL_DLL CPL_STDCALL GDALSetRasterStatistics( + GDALRasterBandH hBand, + double dfMin, double dfMax, double dfMean, double dfStdDev ); + +const char CPL_DLL * CPL_STDCALL GDALGetRasterUnitType( GDALRasterBandH ); +CPLErr CPL_DLL CPL_STDCALL GDALSetRasterUnitType( GDALRasterBandH hBand, const char *pszNewValue ); +double CPL_DLL CPL_STDCALL GDALGetRasterOffset( GDALRasterBandH, int *pbSuccess ); +CPLErr CPL_DLL CPL_STDCALL GDALSetRasterOffset( GDALRasterBandH hBand, double dfNewOffset); +double CPL_DLL CPL_STDCALL GDALGetRasterScale( GDALRasterBandH, int *pbSuccess ); +CPLErr CPL_DLL CPL_STDCALL GDALSetRasterScale( GDALRasterBandH hBand, double dfNewOffset ); +void CPL_DLL CPL_STDCALL +GDALComputeRasterMinMax( GDALRasterBandH hBand, int bApproxOK, + double adfMinMax[2] ); +CPLErr CPL_DLL CPL_STDCALL GDALFlushRasterCache( GDALRasterBandH hBand ); +CPLErr CPL_DLL CPL_STDCALL GDALGetRasterHistogram( GDALRasterBandH hBand, + double dfMin, double dfMax, + int nBuckets, int *panHistogram, + int bIncludeOutOfRange, int bApproxOK, + GDALProgressFunc pfnProgress, + void * pProgressData ) CPL_WARN_DEPRECATED("Use GDALGetRasterHistogramEx() instead"); +CPLErr CPL_DLL CPL_STDCALL GDALGetRasterHistogramEx( GDALRasterBandH hBand, + double dfMin, double dfMax, + int nBuckets, GUIntBig *panHistogram, + int bIncludeOutOfRange, int bApproxOK, + GDALProgressFunc pfnProgress, + void * pProgressData ); +CPLErr CPL_DLL CPL_STDCALL GDALGetDefaultHistogram( GDALRasterBandH hBand, + double *pdfMin, double *pdfMax, + int *pnBuckets, int **ppanHistogram, + int bForce, + GDALProgressFunc pfnProgress, + void * pProgressData ) CPL_WARN_DEPRECATED("Use GDALGetDefaultHistogramEx() instead"); +CPLErr CPL_DLL CPL_STDCALL GDALGetDefaultHistogramEx( GDALRasterBandH hBand, + double *pdfMin, double *pdfMax, + int *pnBuckets, GUIntBig **ppanHistogram, + int bForce, + GDALProgressFunc pfnProgress, + void * pProgressData ); +CPLErr CPL_DLL CPL_STDCALL GDALSetDefaultHistogram( GDALRasterBandH hBand, + double dfMin, double dfMax, + int nBuckets, int *panHistogram ) CPL_WARN_DEPRECATED("Use GDALSetDefaultHistogramEx() instead"); +CPLErr CPL_DLL CPL_STDCALL GDALSetDefaultHistogramEx( GDALRasterBandH hBand, + double dfMin, double dfMax, + int nBuckets, GUIntBig *panHistogram ); +int CPL_DLL CPL_STDCALL +GDALGetRandomRasterSample( GDALRasterBandH, int, float * ); +GDALRasterBandH CPL_DLL CPL_STDCALL +GDALGetRasterSampleOverview( GDALRasterBandH, int ); +GDALRasterBandH CPL_DLL CPL_STDCALL +GDALGetRasterSampleOverviewEx( GDALRasterBandH, GUIntBig ); +CPLErr CPL_DLL CPL_STDCALL GDALFillRaster( GDALRasterBandH hBand, + double dfRealValue, double dfImaginaryValue ); +CPLErr CPL_DLL CPL_STDCALL +GDALComputeBandStats( GDALRasterBandH hBand, int nSampleStep, + double *pdfMean, double *pdfStdDev, + GDALProgressFunc pfnProgress, + void *pProgressData ); +CPLErr CPL_DLL GDALOverviewMagnitudeCorrection( GDALRasterBandH hBaseBand, + int nOverviewCount, + GDALRasterBandH *pahOverviews, + GDALProgressFunc pfnProgress, + void *pProgressData ); + +GDALRasterAttributeTableH CPL_DLL CPL_STDCALL GDALGetDefaultRAT( + GDALRasterBandH hBand ); +CPLErr CPL_DLL CPL_STDCALL GDALSetDefaultRAT( GDALRasterBandH, + GDALRasterAttributeTableH ); +CPLErr CPL_DLL CPL_STDCALL GDALAddDerivedBandPixelFunc( const char *pszName, + GDALDerivedPixelFunc pfnPixelFunc ); + +GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetMaskBand( GDALRasterBandH hBand ); +int CPL_DLL CPL_STDCALL GDALGetMaskFlags( GDALRasterBandH hBand ); +CPLErr CPL_DLL CPL_STDCALL + GDALCreateMaskBand( GDALRasterBandH hBand, int nFlags ); + +#define GMF_ALL_VALID 0x01 +#define GMF_PER_DATASET 0x02 +#define GMF_ALPHA 0x04 +#define GMF_NODATA 0x08 + +/* ==================================================================== */ +/* GDALAsyncReader */ +/* ==================================================================== */ + +GDALAsyncStatusType CPL_DLL CPL_STDCALL +GDALARGetNextUpdatedRegion(GDALAsyncReaderH hARIO, double dfTimeout, + int* pnXBufOff, int* pnYBufOff, + int* pnXBufSize, int* pnYBufSize ); +int CPL_DLL CPL_STDCALL GDALARLockBuffer(GDALAsyncReaderH hARIO, + double dfTimeout); +void CPL_DLL CPL_STDCALL GDALARUnlockBuffer(GDALAsyncReaderH hARIO); + +/* -------------------------------------------------------------------- */ +/* Helper functions. */ +/* -------------------------------------------------------------------- */ +int CPL_DLL CPL_STDCALL GDALGeneralCmdLineProcessor( int nArgc, char ***ppapszArgv, + int nOptions ); +void CPL_DLL CPL_STDCALL GDALSwapWords( void *pData, int nWordSize, int nWordCount, + int nWordSkip ); +void CPL_DLL CPL_STDCALL GDALSwapWordsEx( void *pData, int nWordSize, size_t nWordCount, + int nWordSkip ); + +void CPL_DLL CPL_STDCALL + GDALCopyWords( const void * pSrcData, GDALDataType eSrcType, int nSrcPixelOffset, + void * pDstData, GDALDataType eDstType, int nDstPixelOffset, + int nWordCount ); + +void CPL_DLL +GDALCopyBits( const GByte *pabySrcData, int nSrcOffset, int nSrcStep, + GByte *pabyDstData, int nDstOffset, int nDstStep, + int nBitCount, int nStepCount ); + +int CPL_DLL CPL_STDCALL GDALLoadWorldFile( const char *, double * ); +int CPL_DLL CPL_STDCALL GDALReadWorldFile( const char *, const char *, + double * ); +int CPL_DLL CPL_STDCALL GDALWriteWorldFile( const char *, const char *, + double * ); +int CPL_DLL CPL_STDCALL GDALLoadTabFile( const char *, double *, char **, + int *, GDAL_GCP ** ); +int CPL_DLL CPL_STDCALL GDALReadTabFile( const char *, double *, char **, + int *, GDAL_GCP ** ); +int CPL_DLL CPL_STDCALL GDALLoadOziMapFile( const char *, double *, char **, + int *, GDAL_GCP ** ); +int CPL_DLL CPL_STDCALL GDALReadOziMapFile( const char *, double *, + char **, int *, GDAL_GCP ** ); + +const char CPL_DLL * CPL_STDCALL GDALDecToDMS( double, const char *, int ); +double CPL_DLL CPL_STDCALL GDALPackedDMSToDec( double ); +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 +#define GDAL_VERSION_INFO_DEFINED +const char CPL_DLL * CPL_STDCALL GDALVersionInfo( const char * ); +#endif + +#ifndef GDAL_CHECK_VERSION + +int CPL_DLL CPL_STDCALL GDALCheckVersion( int nVersionMajor, int nVersionMinor, + const char* pszCallingComponentName); + +/** Helper macro for GDALCheckVersion() + @see GDALCheckVersion() + */ +#define GDAL_CHECK_VERSION(pszCallingComponentName) \ + GDALCheckVersion(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, pszCallingComponentName) + +#endif + +typedef struct { + double dfLINE_OFF; + double dfSAMP_OFF; + double dfLAT_OFF; + double dfLONG_OFF; + double dfHEIGHT_OFF; + + double dfLINE_SCALE; + double dfSAMP_SCALE; + double dfLAT_SCALE; + double dfLONG_SCALE; + double dfHEIGHT_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; + +} GDALRPCInfo; + +int CPL_DLL CPL_STDCALL GDALExtractRPCInfo( char **, GDALRPCInfo * ); + +/* ==================================================================== */ +/* Color tables. */ +/* ==================================================================== */ + +/** Color tuple */ +typedef struct +{ + /*! gray, red, cyan or hue */ + short c1; + + /*! green, magenta, or lightness */ + short c2; + + /*! blue, yellow, or saturation */ + short c3; + + /*! alpha or blackband */ + short c4; +} GDALColorEntry; + +GDALColorTableH CPL_DLL CPL_STDCALL GDALCreateColorTable( GDALPaletteInterp ) CPL_WARN_UNUSED_RESULT; +void CPL_DLL CPL_STDCALL GDALDestroyColorTable( GDALColorTableH ); +GDALColorTableH CPL_DLL CPL_STDCALL GDALCloneColorTable( GDALColorTableH ); +GDALPaletteInterp CPL_DLL CPL_STDCALL GDALGetPaletteInterpretation( GDALColorTableH ); +int CPL_DLL CPL_STDCALL GDALGetColorEntryCount( GDALColorTableH ); +const GDALColorEntry CPL_DLL * CPL_STDCALL GDALGetColorEntry( GDALColorTableH, int ); +int CPL_DLL CPL_STDCALL GDALGetColorEntryAsRGB( GDALColorTableH, int, GDALColorEntry *); +void CPL_DLL CPL_STDCALL GDALSetColorEntry( GDALColorTableH, int, const GDALColorEntry * ); +void CPL_DLL CPL_STDCALL GDALCreateColorRamp( GDALColorTableH hTable, + int nStartIndex, const GDALColorEntry *psStartColor, + int nEndIndex, const GDALColorEntry *psEndColor ); + +/* ==================================================================== */ +/* Raster Attribute Table */ +/* ==================================================================== */ + +/** Field type of raster attribute table */ +typedef enum { + /*! Integer field */ GFT_Integer, + /*! Floating point (double) field */ GFT_Real, + /*! String field */ GFT_String +} GDALRATFieldType; + +/** Field usage of raster attribute table */ +typedef enum { + /*! General purpose field. */ GFU_Generic = 0, + /*! Histogram pixel count */ GFU_PixelCount = 1, + /*! Class name */ GFU_Name = 2, + /*! Class range minimum */ GFU_Min = 3, + /*! Class range maximum */ GFU_Max = 4, + /*! Class value (min=max) */ GFU_MinMax = 5, + /*! Red class color (0-255) */ GFU_Red = 6, + /*! Green class color (0-255) */ GFU_Green = 7, + /*! Blue class color (0-255) */ GFU_Blue = 8, + /*! Alpha (0=transparent,255=opaque)*/ GFU_Alpha = 9, + /*! Color Range Red Minimum */ GFU_RedMin = 10, + /*! Color Range Green Minimum */ GFU_GreenMin = 11, + /*! Color Range Blue Minimum */ GFU_BlueMin = 12, + /*! Color Range Alpha Minimum */ GFU_AlphaMin = 13, + /*! Color Range Red Maximum */ GFU_RedMax = 14, + /*! Color Range Green Maximum */ GFU_GreenMax = 15, + /*! Color Range Blue Maximum */ GFU_BlueMax = 16, + /*! Color Range Alpha Maximum */ GFU_AlphaMax = 17, + /*! Maximum GFU value */ GFU_MaxCount +} GDALRATFieldUsage; + +GDALRasterAttributeTableH CPL_DLL CPL_STDCALL + GDALCreateRasterAttributeTable(void) CPL_WARN_UNUSED_RESULT; +void CPL_DLL CPL_STDCALL GDALDestroyRasterAttributeTable( + GDALRasterAttributeTableH ); + +int CPL_DLL CPL_STDCALL GDALRATGetColumnCount( GDALRasterAttributeTableH ); + +const char CPL_DLL * CPL_STDCALL GDALRATGetNameOfCol( + GDALRasterAttributeTableH, int ); +GDALRATFieldUsage CPL_DLL CPL_STDCALL GDALRATGetUsageOfCol( + GDALRasterAttributeTableH, int ); +GDALRATFieldType CPL_DLL CPL_STDCALL GDALRATGetTypeOfCol( + GDALRasterAttributeTableH, int ); + +int CPL_DLL CPL_STDCALL GDALRATGetColOfUsage( GDALRasterAttributeTableH, + GDALRATFieldUsage ); +int CPL_DLL CPL_STDCALL GDALRATGetRowCount( GDALRasterAttributeTableH ); + +const char CPL_DLL * CPL_STDCALL GDALRATGetValueAsString( + GDALRasterAttributeTableH, int, int); +int CPL_DLL CPL_STDCALL GDALRATGetValueAsInt( + GDALRasterAttributeTableH, int, int); +double CPL_DLL CPL_STDCALL GDALRATGetValueAsDouble( + GDALRasterAttributeTableH, int, int); + +void CPL_DLL CPL_STDCALL GDALRATSetValueAsString( GDALRasterAttributeTableH, int, int, + const char * ); +void CPL_DLL CPL_STDCALL GDALRATSetValueAsInt( GDALRasterAttributeTableH, int, int, + int ); +void CPL_DLL CPL_STDCALL GDALRATSetValueAsDouble( GDALRasterAttributeTableH, int, int, + double ); + +int CPL_DLL CPL_STDCALL GDALRATChangesAreWrittenToFile( GDALRasterAttributeTableH hRAT ); + +CPLErr CPL_DLL CPL_STDCALL GDALRATValuesIOAsDouble( GDALRasterAttributeTableH hRAT, GDALRWFlag eRWFlag, + int iField, int iStartRow, int iLength, double *pdfData ); +CPLErr CPL_DLL CPL_STDCALL GDALRATValuesIOAsInteger( GDALRasterAttributeTableH hRAT, GDALRWFlag eRWFlag, + int iField, int iStartRow, int iLength, int *pnData); +CPLErr CPL_DLL CPL_STDCALL GDALRATValuesIOAsString( GDALRasterAttributeTableH hRAT, GDALRWFlag eRWFlag, + int iField, int iStartRow, int iLength, char **papszStrList); + +void CPL_DLL CPL_STDCALL GDALRATSetRowCount( GDALRasterAttributeTableH, + int ); +CPLErr CPL_DLL CPL_STDCALL GDALRATCreateColumn( GDALRasterAttributeTableH, + const char *, + GDALRATFieldType, + GDALRATFieldUsage ); +CPLErr CPL_DLL CPL_STDCALL GDALRATSetLinearBinning( GDALRasterAttributeTableH, + double, double ); +int CPL_DLL CPL_STDCALL GDALRATGetLinearBinning( GDALRasterAttributeTableH, + double *, double * ); +CPLErr CPL_DLL CPL_STDCALL GDALRATInitializeFromColorTable( + GDALRasterAttributeTableH, GDALColorTableH ); +GDALColorTableH CPL_DLL CPL_STDCALL GDALRATTranslateToColorTable( + GDALRasterAttributeTableH, int nEntryCount ); +void CPL_DLL CPL_STDCALL GDALRATDumpReadable( GDALRasterAttributeTableH, + FILE * ); +GDALRasterAttributeTableH CPL_DLL CPL_STDCALL + GDALRATClone( GDALRasterAttributeTableH ); + +void CPL_DLL* CPL_STDCALL + GDALRATSerializeJSON( GDALRasterAttributeTableH ) CPL_WARN_UNUSED_RESULT; + +int CPL_DLL CPL_STDCALL GDALRATGetRowOfValue( GDALRasterAttributeTableH, double ); + + +/* ==================================================================== */ +/* GDAL Cache Management */ +/* ==================================================================== */ + +void CPL_DLL CPL_STDCALL GDALSetCacheMax( int nBytes ); +int CPL_DLL CPL_STDCALL GDALGetCacheMax(void); +int CPL_DLL CPL_STDCALL GDALGetCacheUsed(void); +void CPL_DLL CPL_STDCALL GDALSetCacheMax64( GIntBig nBytes ); +GIntBig CPL_DLL CPL_STDCALL GDALGetCacheMax64(void); +GIntBig CPL_DLL CPL_STDCALL GDALGetCacheUsed64(void); + +int CPL_DLL CPL_STDCALL GDALFlushCacheBlock(void); + +/* ==================================================================== */ +/* GDAL virtual memory */ +/* ==================================================================== */ + +CPLVirtualMem CPL_DLL* GDALDatasetGetVirtualMem( GDALDatasetH hDS, + GDALRWFlag eRWFlag, + int nXOff, int nYOff, + int nXSize, int nYSize, + int nBufXSize, int nBufYSize, + GDALDataType eBufType, + int nBandCount, int* panBandMap, + int nPixelSpace, + GIntBig nLineSpace, + GIntBig nBandSpace, + size_t nCacheSize, + size_t nPageSizeHint, + int bSingleThreadUsage, + char **papszOptions ) CPL_WARN_UNUSED_RESULT; + +CPLVirtualMem CPL_DLL* GDALRasterBandGetVirtualMem( GDALRasterBandH hBand, + GDALRWFlag eRWFlag, + int nXOff, int nYOff, + int nXSize, int nYSize, + int nBufXSize, int nBufYSize, + GDALDataType eBufType, + int nPixelSpace, + GIntBig nLineSpace, + size_t nCacheSize, + size_t nPageSizeHint, + int bSingleThreadUsage, + char **papszOptions ) CPL_WARN_UNUSED_RESULT; + +CPLVirtualMem CPL_DLL* GDALGetVirtualMemAuto( GDALRasterBandH hBand, + GDALRWFlag eRWFlag, + int *pnPixelSpace, + GIntBig *pnLineSpace, + char **papszOptions ) CPL_WARN_UNUSED_RESULT; + +typedef enum +{ + /*! Tile Interleaved by Pixel: tile (0,0) with internal band interleaved by pixel organization, tile (1, 0), ... */ + GTO_TIP, + /*! Band Interleaved by Tile : tile (0,0) of first band, tile (0,0) of second band, ... tile (1,0) of first band, tile (1,0) of second band, ... */ + GTO_BIT, + /*! Band SeQuential : all the tiles of first band, all the tiles of following band... */ + GTO_BSQ +} GDALTileOrganization; + +CPLVirtualMem CPL_DLL* GDALDatasetGetTiledVirtualMem( GDALDatasetH hDS, + GDALRWFlag eRWFlag, + int nXOff, int nYOff, + int nXSize, int nYSize, + int nTileXSize, int nTileYSize, + GDALDataType eBufType, + int nBandCount, int* panBandMap, + GDALTileOrganization eTileOrganization, + size_t nCacheSize, + int bSingleThreadUsage, + char **papszOptions ) CPL_WARN_UNUSED_RESULT; + +CPLVirtualMem CPL_DLL* GDALRasterBandGetTiledVirtualMem( GDALRasterBandH hBand, + GDALRWFlag eRWFlag, + int nXOff, int nYOff, + int nXSize, int nYSize, + int nTileXSize, int nTileYSize, + GDALDataType eBufType, + size_t nCacheSize, + int bSingleThreadUsage, + char **papszOptions ) CPL_WARN_UNUSED_RESULT; + +/* ==================================================================== */ +/* VRTPansharpenedDataset class. */ +/* ==================================================================== */ + +GDALDatasetH CPL_DLL GDALCreatePansharpenedVRT( const char* pszXML, + GDALRasterBandH hPanchroBand, + int nInputSpectralBands, + GDALRasterBandH* pahInputSpectralBands ) CPL_WARN_UNUSED_RESULT; + +/* =================================================================== */ +/* Misc API */ +/* ==================================================================== */ + +CPLXMLNode CPL_DLL* GDALGetJPEG2000Structure(const char* pszFilename, + char** papszOptions) CPL_WARN_UNUSED_RESULT; + +CPL_C_END + +#endif /* ndef GDAL_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/gdal_alg.h b/modules/globebrowsing/ext/gdal/include/gdal_alg.h new file mode 100644 index 0000000000..a75633fbc6 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdal_alg.h @@ -0,0 +1,603 @@ +/****************************************************************************** + * $Id$ + * + * 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 + * + * 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 */ diff --git a/modules/globebrowsing/ext/gdal/include/gdal_alg_priv.h b/modules/globebrowsing/ext/gdal/include/gdal_alg_priv.h new file mode 100644 index 0000000000..93b5a7fbec --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdal_alg_priv.h @@ -0,0 +1,209 @@ +/****************************************************************************** + * $Id$ + * + * 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 + * Copyright (c) 2010-2013, Even Rouault + * + * 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 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 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 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 */ diff --git a/modules/globebrowsing/ext/gdal/include/gdal_csv.h b/modules/globebrowsing/ext/gdal/include/gdal_csv.h new file mode 100644 index 0000000000..ea48f26dcf --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdal_csv.h @@ -0,0 +1,41 @@ +/****************************************************************************** + * $Id$ + * + * Project: Common Portability Library + * Purpose: Functions for reading and scanning CSV (comma separated, + * variable length text files holding tables) files. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 1999, Frank Warmerdam + * Copyright (c) 2010, Even Rouault + * + * 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_CSV_H_INCLUDED +#define GDAL_CSV_H_INCLUDED + +#include "cpl_port.h" + +CPL_C_START +const char * GDALDefaultCSVFilename( const char *pszBasename ); +CPL_C_END + +#endif diff --git a/modules/globebrowsing/ext/gdal/include/gdal_frmts.h b/modules/globebrowsing/ext/gdal/include/gdal_frmts.h new file mode 100644 index 0000000000..8c9bafd96f --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdal_frmts.h @@ -0,0 +1,191 @@ +/****************************************************************************** + * $Id$ + * + * Project: GDAL + * Purpose: Prototypes for all format specific driver initialization. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 2001, Frank Warmerdam + * Copyright (c) 2007-2014, Even Rouault + * + * 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_H_INCLUDED +#define GDAL_FRMTS_H_INCLUDED + +#include "cpl_port.h" + +CPL_C_START +void CPL_DLL GDALRegister_GTiff(void); +void CPL_DLL GDALRegister_GXF(void); +void CPL_DLL GDALRegister_OGDI(void); +void CPL_DLL GDALRegister_HFA(void); +void CPL_DLL GDALRegister_AAIGrid(void); +void CPL_DLL GDALRegister_GRASSASCIIGrid(void); +void CPL_DLL GDALRegister_AIGrid(void); +// void CPL_DLL GDALRegister_AIGrid2(void); +void CPL_DLL GDALRegister_CEOS(void); +void CPL_DLL GDALRegister_SAR_CEOS(void); +void CPL_DLL GDALRegister_SDTS(void); +void CPL_DLL GDALRegister_ELAS(void); +void CPL_DLL GDALRegister_EHdr(void); +void CPL_DLL GDALRegister_GenBin(void); +void CPL_DLL GDALRegister_PAux(void); +void CPL_DLL GDALRegister_ENVI(void); +void CPL_DLL GDALRegister_DOQ1(void); +void CPL_DLL GDALRegister_DOQ2(void); +void CPL_DLL GDALRegister_DTED(void); +void CPL_DLL GDALRegister_MFF(void); +void CPL_DLL GDALRegister_HKV(void); +void CPL_DLL GDALRegister_PNG(void); +void CPL_DLL GDALRegister_DDS(void); +void CPL_DLL GDALRegister_GTA(void); +void CPL_DLL GDALRegister_JPEG(void); +void CPL_DLL GDALRegister_JPEG2000(void); +void CPL_DLL GDALRegister_JP2KAK(void); +void CPL_DLL GDALRegister_JPIPKAK(void); +void CPL_DLL GDALRegister_MEM(void); +void CPL_DLL GDALRegister_JDEM(void); +void CPL_DLL GDALRegister_RASDAMAN(void); +void CPL_DLL GDALRegister_GRASS(void); +void CPL_DLL GDALRegister_PNM(void); +void CPL_DLL GDALRegister_GIF(void); +void CPL_DLL GDALRegister_BIGGIF(void); +void CPL_DLL GDALRegister_Envisat(void); +void CPL_DLL GDALRegister_FITS(void); +void CPL_DLL GDALRegister_ECW(void); +void CPL_DLL GDALRegister_JP2ECW(void); +void CPL_DLL GDALRegister_ECW_JP2ECW(); +void CPL_DLL GDALRegister_FujiBAS(void); +void CPL_DLL GDALRegister_FIT(void); +void CPL_DLL GDALRegister_VRT(void); +void CPL_DLL GDALRegister_USGSDEM(void); +void CPL_DLL GDALRegister_FAST(void); +void CPL_DLL GDALRegister_HDF4(void); +void CPL_DLL GDALRegister_HDF4Image(void); +void CPL_DLL GDALRegister_L1B(void); +void CPL_DLL GDALRegister_LDF(void); +void CPL_DLL GDALRegister_BSB(void); +void CPL_DLL GDALRegister_XPM(void); +void CPL_DLL GDALRegister_BMP(void); +void CPL_DLL GDALRegister_GSC(void); +void CPL_DLL GDALRegister_NITF(void); +void CPL_DLL GDALRegister_RPFTOC(void); +void CPL_DLL GDALRegister_ECRGTOC(void); +void CPL_DLL GDALRegister_MrSID(void); +void CPL_DLL GDALRegister_MG4Lidar(void); +void CPL_DLL GDALRegister_PCIDSK(void); +void CPL_DLL GDALRegister_BT(void); +void CPL_DLL GDALRegister_DODS(void); +void CPL_DLL GDALRegister_GMT(void); +void CPL_DLL GDALRegister_netCDF(void); +void CPL_DLL GDALRegister_LAN(void); +void CPL_DLL GDALRegister_CPG(void); +void CPL_DLL GDALRegister_AirSAR(void); +void CPL_DLL GDALRegister_RS2(void); +void CPL_DLL GDALRegister_ILWIS(void); +void CPL_DLL GDALRegister_PCRaster(void); +void CPL_DLL GDALRegister_IDA(void); +void CPL_DLL GDALRegister_NDF(void); +void CPL_DLL GDALRegister_RMF(void); +void CPL_DLL GDALRegister_BAG(void); +void CPL_DLL GDALRegister_HDF5(void); +void CPL_DLL GDALRegister_HDF5Image(void); +void CPL_DLL GDALRegister_MSGN(void); +void CPL_DLL GDALRegister_MSG(void); +void CPL_DLL GDALRegister_RIK(void); +void CPL_DLL GDALRegister_Leveller(void); +void CPL_DLL GDALRegister_SGI(void); +void CPL_DLL GDALRegister_SRTMHGT(void); +void CPL_DLL GDALRegister_DIPEx(void); +void CPL_DLL GDALRegister_ISIS3(void); +void CPL_DLL GDALRegister_ISIS2(void); +void CPL_DLL GDALRegister_PDS(void); +void CPL_DLL GDALRegister_VICAR(void); +void CPL_DLL GDALRegister_IDRISI(void); +void CPL_DLL GDALRegister_Terragen(void); +void CPL_DLL GDALRegister_WCS(void); +void CPL_DLL GDALRegister_WMS(void); +void CPL_DLL GDALRegister_HTTP(void); +void CPL_DLL GDALRegister_SDE(void); +void CPL_DLL GDALRegister_GSAG(void); +void CPL_DLL GDALRegister_GSBG(void); +void CPL_DLL GDALRegister_GS7BG(void); +void CPL_DLL GDALRegister_GRIB(void); +void CPL_DLL GDALRegister_INGR(void); +void CPL_DLL GDALRegister_ERS(void); +void CPL_DLL GDALRegister_PALSARJaxa(void); +void CPL_DLL GDALRegister_DIMAP(); +void CPL_DLL GDALRegister_GFF(void); +void CPL_DLL GDALRegister_COSAR(void); +void CPL_DLL GDALRegister_TSX(void); +void CPL_DLL GDALRegister_ADRG(void); +void CPL_DLL GDALRegister_SRP(void); +void CPL_DLL GDALRegister_COASP(void); +void CPL_DLL GDALRegister_BLX(void); +void CPL_DLL GDALRegister_LCP(void); +void CPL_DLL GDALRegister_TMS(void); +void CPL_DLL GDALRegister_EIR(void); +void CPL_DLL GDALRegister_GEOR(void); +void CPL_DLL GDALRegister_TIL(void); +void CPL_DLL GDALRegister_R(void); +void CPL_DLL GDALRegister_Rasterlite(void); +void CPL_DLL GDALRegister_EPSILON(void); +void CPL_DLL GDALRegister_PostGISRaster(void); +void CPL_DLL GDALRegister_NWT_GRD(void); +void CPL_DLL GDALRegister_NWT_GRC(void); +void CPL_DLL GDALRegister_SAGA(void); +void CPL_DLL GDALRegister_KMLSUPEROVERLAY(void); +void CPL_DLL GDALRegister_GTX(void); +void CPL_DLL GDALRegister_LOSLAS(void); +void CPL_DLL GDALRegister_Istar(void); +void CPL_DLL GDALRegister_NTv2(void); +void CPL_DLL GDALRegister_CTable2(void); +void CPL_DLL GDALRegister_JP2OpenJPEG(void); +void CPL_DLL GDALRegister_XYZ(void); +void CPL_DLL GDALRegister_HF2(void); +void CPL_DLL GDALRegister_PDF(void); +void CPL_DLL GDALRegister_JPEGLS(void); +void CPL_DLL GDALRegister_MAP(void); +void CPL_DLL GDALRegister_OZI(void); +void CPL_DLL GDALRegister_ACE2(void); +void CPL_DLL GDALRegister_CTG(void); +void CPL_DLL GDALRegister_E00GRID(void); +void CPL_DLL GDALRegister_SNODAS(void); +void CPL_DLL GDALRegister_WEBP(void); +void CPL_DLL GDALRegister_ZMap(void); +void CPL_DLL GDALRegister_NGSGEOID(void); +void CPL_DLL GDALRegister_MBTiles(void); +void CPL_DLL GDALRegister_ARG(void); +void CPL_DLL GDALRegister_IRIS(void); +void CPL_DLL GDALRegister_KRO(void); +void CPL_DLL GDALRegister_KEA(void); +void CPL_DLL GDALRegister_ROIPAC(void); +void CPL_DLL GDALRegister_PLMOSAIC(void); +void CPL_DLL GDALRegister_CALS(void); +void CPL_DLL GDALRegister_ISCE(void); +void CPL_DLL GDALRegister_WMTS(void); +void CPL_DLL GDALRegister_SAFE(void); +void CPL_DLL GDALRegister_SENTINEL2(void); +void CPL_DLL GDALRegister_mrf(void); +CPL_C_END + +#endif /* ndef GDAL_FRMTS_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/gdal_mdreader.h b/modules/globebrowsing/ext/gdal/include/gdal_mdreader.h new file mode 100644 index 0000000000..926cf1281c --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdal_mdreader.h @@ -0,0 +1,207 @@ +/****************************************************************************** + * $Id$ + * + * Project: GDAL Core + * Purpose: Read metadata (mainly the remote sensing imagery) from files of + * different providers like DigitalGlobe, GeoEye etc. + * Author: Dmitry Baryshnikov, polimax@mail.ru + * + ****************************************************************************** + * Copyright (c) 2014-2015, NextGIS info@nextgis.ru + * + * 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_MDREADER_H_INCLUDED +#define GDAL_MDREADER_H_INCLUDED + + +#include "cpl_port.h" +#include "gdal_priv.h" + +#define MD_DOMAIN_IMD "IMD" /**< image metadata section */ +#define MD_DOMAIN_RPC "RPC" /**< rpc metadata section */ +#define MD_DOMAIN_IMAGERY "IMAGERY" /**< imagery metadata section */ +#define MD_DOMAIN_DEFAULT "" /**< default metadata section */ + +#define MD_NAME_ACQDATETIME "ACQUISITIONDATETIME" /**< Acquisition Date Time property name. The time should be in UTC */ +#define MD_NAME_SATELLITE "SATELLITEID" /**< Satellite identificator property name */ +#define MD_NAME_CLOUDCOVER "CLOUDCOVER" /**< Cloud coverage property name. The value between 0 - 100 or 999 if n/a */ +#define MD_NAME_MDTYPE "METADATATYPE" /**< Metadata reader type property name. The reader processed this metadata */ + +#define MD_DATETIMEFORMAT "%Y-%m-%d %H:%M:%S" /**< Date time format */ +#define MD_CLOUDCOVER_NA "999" /**< The value if cloud cover is n/a */ + +/** + * RPC/RPB specific defines + */ + +#define RPC_LINE_OFF "LINE_OFF" +#define RPC_SAMP_OFF "SAMP_OFF" +#define RPC_LAT_OFF "LAT_OFF" +#define RPC_LONG_OFF "LONG_OFF" +#define RPC_HEIGHT_OFF "HEIGHT_OFF" +#define RPC_LINE_SCALE "LINE_SCALE" +#define RPC_SAMP_SCALE "SAMP_SCALE" +#define RPC_LAT_SCALE "LAT_SCALE" +#define RPC_LONG_SCALE "LONG_SCALE" +#define RPC_HEIGHT_SCALE "HEIGHT_SCALE" +#define RPC_LINE_NUM_COEFF "LINE_NUM_COEFF" +#define RPC_LINE_DEN_COEFF "LINE_DEN_COEFF" +#define RPC_SAMP_NUM_COEFF "SAMP_NUM_COEFF" +#define RPC_SAMP_DEN_COEFF "SAMP_DEN_COEFF" + +/** + * Enumerator of metadata readers + */ + +typedef enum { + MDR_None = 0x00000000, /**< no reader */ + MDR_DG = 0x00000001, /**< Digital Globe, METADATATYPE=DG */ + MDR_GE = 0x00000002, /**< Geo Eye, METADATATYPE=GE */ + MDR_OV = 0x00000004, /**< Orb View, METADATATYPE=OV */ + MDR_PLEIADES = 0x00000008, /**< Pleiades, METADATATYPE=DIMAP */ + MDR_SPOT = 0x00000010, /**< Spot, METADATATYPE=DIMAP */ + MDR_RDK1 = 0x00000020, /**< Resurs DK1, METADATATYPE=MSP */ + MDR_LS = 0x00000040, /**< Landsat, METADATATYPE=ODL */ + MDR_RE = 0x00000080, /**< RapidEye, METADATATYPE=RE */ + MDR_KOMPSAT = 0x00000100, /**< Kompsat, METADATATYPE=KARI */ + MDR_EROS = 0x00000200, /**< EROS, METADATATYPE=EROS */ + MDR_ALOS = 0x00000400, /**< ALOS, METADATATYPE=ALOS */ + MDR_ANY = MDR_DG | MDR_GE | MDR_OV | MDR_PLEIADES | MDR_SPOT | MDR_RDK1 | + MDR_LS | MDR_RE | MDR_KOMPSAT | MDR_EROS | MDR_ALOS /**< any reader */ +} MDReaders; + + +/** + * The base class for all metadata readers + */ +class GDALMDReaderBase{ +public: + GDALMDReaderBase(const char *pszPath, char **papszSiblingFiles); + virtual ~GDALMDReaderBase(); + + /** + * @brief Get specified metadata domain + * @param pszDomain The metadata domain to return + * @return List of metadata items + */ + virtual char ** GetMetadataDomain(const char *pszDomain); + /** + * @brief Fill provided metadata store class + * @param poMDMD Metadata store class + * @return true on success or false + */ + virtual bool FillMetadata(GDALMultiDomainMetadata* poMDMD); + /** + * @brief Determine whether the input parameter correspond to the particular + * provider of remote sensing data completely + * @return True if all needed sources files found + */ + virtual bool HasRequiredFiles() const = 0; + /** + * @brief Get metadata file names. The caller become owner of returned list + * and have to free it via CSLDestroy. + * @return A file name list + */ + virtual char** GetMetadataFiles() const = 0; +protected: + /** + * @brief Load metadata to the correspondent IMD, RPB, IMAGERY and DEFAULT + * domains + */ + virtual void LoadMetadata(); + /** + * @brief Convert string like 2012-02-25T00:25:59.9440000Z to time + * @param pszDateTime String to convert + * @return value in time_t + */ + virtual time_t GetAcquisitionTimeFromString(const char* pszDateTime); + /** + * @brief ReadXMLToList Transform xml to list of NULL terminated name=value + * strings + * @param psNode A xml node to process + * @param papszList A list to fill with name=value strings + * @param pszName A name of parent node. For root xml node should be empty. + * If name is not empty, the sibling nodes will not proceed + * @return An input list filled with values + */ + virtual char** ReadXMLToList(CPLXMLNode* psNode, char** papszList, + const char* pszName = ""); + /** + * @brief AddXMLNameValueToList Execute from ReadXMLToList to add name and + * value to list. One can override this function for special + * processing input values before add to list. + * @param papszList A list to fill with name=value strings + * @param pszName A name to add + * @param pszValue A value to add + * @return An input list filled with values + */ + virtual char** AddXMLNameValueToList(char** papszList, const char *pszName, + const char *pszValue); +protected: + char **m_papszIMDMD; + char **m_papszRPCMD; + char **m_papszIMAGERYMD; + char **m_papszDEFAULTMD; + bool m_bIsMetadataLoad; +}; + +/** + * The metadata reader main class. + * The main purpose of this class is to provide an correspondent reader + * for provided path. + */ +class CPL_DLL GDALMDReaderManager{ +public: + GDALMDReaderManager(); + virtual ~GDALMDReaderManager(); + + /** + * @brief Try to detect metadata reader correspondent to the provided + * datasource path + * @param pszPath a path to GDALDataset + * @param papszSiblingFiles file list for metadata search purposes + * @param nType a preferable reader type (may be the OR of MDReaders) + * @return an appropriate reader or NULL if no such reader or error. + * The pointer delete by the GDALMDReaderManager, so the user have not + * delete it. + */ + virtual GDALMDReaderBase* GetReader(const char *pszPath, + char **papszSiblingFiles, + GUInt32 nType = MDR_ANY); +protected: + GDALMDReaderBase *m_pReader; +}; + +// misc +CPLString CPLStrip(const CPLString& osString, const char cChar); +CPLString CPLStripQuotes(const CPLString& osString); +char** GDALLoadRPBFile( const CPLString& osFilePath ); +char** GDALLoadRPCFile( const CPLString& osFilePath ); +char** GDALLoadIMDFile( const CPLString& osFilePath ); +bool GDALCheckFileHeader(const CPLString& soFilePath, + const char * pszTestString, + int nBufferSize = 256); + +CPLErr GDALWriteRPBFile( const char *pszFilename, char **papszMD ); +CPLErr GDALWriteRPCTXTFile( const char *pszFilename, char **papszMD ); +CPLErr GDALWriteIMDFile( const char *pszFilename, char **papszMD ); + +#endif //GDAL_MDREADER_H_INCLUDED diff --git a/modules/globebrowsing/ext/gdal/include/gdal_pam.h b/modules/globebrowsing/ext/gdal/include/gdal_pam.h new file mode 100644 index 0000000000..8c342538f7 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdal_pam.h @@ -0,0 +1,324 @@ +/****************************************************************************** + * $Id$ + * + * Project: GDAL Core + * Purpose: Declaration for Peristable Auxiliary Metadata classes. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 2005, 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 GDAL_PAM_H_INCLUDED +#define GDAL_PAM_H_INCLUDED + +#include "gdal_priv.h" + +class GDALPamRasterBand; + +/* Clone Info Flags */ + +#define GCIF_GEOTRANSFORM 0x01 +#define GCIF_PROJECTION 0x02 +#define GCIF_METADATA 0x04 +#define GCIF_GCPS 0x08 + +#define GCIF_NODATA 0x001000 +#define GCIF_CATEGORYNAMES 0x002000 +#define GCIF_MINMAX 0x004000 +#define GCIF_SCALEOFFSET 0x008000 +#define GCIF_UNITTYPE 0x010000 +#define GCIF_COLORTABLE 0x020000 +#define GCIF_COLORINTERP 0x020000 +#define GCIF_BAND_METADATA 0x040000 +#define GCIF_RAT 0x080000 +#define GCIF_MASK 0x100000 +#define GCIF_BAND_DESCRIPTION 0x200000 + +#define GCIF_ONLY_IF_MISSING 0x10000000 +#define GCIF_PROCESS_BANDS 0x20000000 + +#define GCIF_PAM_DEFAULT (GCIF_GEOTRANSFORM | GCIF_PROJECTION | \ + GCIF_METADATA | GCIF_GCPS | \ + GCIF_NODATA | GCIF_CATEGORYNAMES | \ + GCIF_MINMAX | GCIF_SCALEOFFSET | \ + GCIF_UNITTYPE | GCIF_COLORTABLE | \ + GCIF_COLORINTERP | GCIF_BAND_METADATA | \ + GCIF_RAT | GCIF_MASK | \ + GCIF_ONLY_IF_MISSING | GCIF_PROCESS_BANDS|\ + GCIF_BAND_DESCRIPTION) + +/* 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_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. +#define GPF_NOSAVE 0x10 // do not try to save pam info. + +/* ==================================================================== */ +/* GDALDatasetPamInfo */ +/* */ +/* We make these things a separate structure of information */ +/* primarily so we can modify it without altering the size of */ +/* the GDALPamDataset. It is an effort to reduce ABI churn for */ +/* driver plugins. */ +/* ==================================================================== */ +class GDALDatasetPamInfo +{ +public: + char *pszPamFilename; + + char *pszProjection; + + int bHaveGeoTransform; + double adfGeoTransform[6]; + + int nGCPCount; + GDAL_GCP *pasGCPList; + char *pszGCPProjection; + + CPLString osPhysicalFilename; + CPLString osSubdatasetName; + CPLString osAuxFilename; + + int bHasMetadata; +}; + +/* ******************************************************************** */ +/* GDALPamDataset */ +/* ******************************************************************** */ + +class CPL_DLL GDALPamDataset : public GDALDataset +{ + friend class GDALPamRasterBand; + + private: + int IsPamFilenameAPotentialSiblingFile(); + + protected: + GDALPamDataset(void); + + int nPamFlags; + GDALDatasetPamInfo *psPam; + + virtual CPLXMLNode *SerializeToXML( const char *); + virtual CPLErr XMLInit( CPLXMLNode *, const char * ); + + virtual CPLErr TryLoadXML(char **papszSiblingFiles = NULL); + virtual CPLErr TrySaveXML(); + + CPLErr TryLoadAux(char **papszSiblingFiles = NULL); + CPLErr TrySaveAux(); + + virtual const char *BuildPamFilename(); + + void PamInitialize(); + void PamClear(); + + void SetPhysicalFilename( const char * ); + const char *GetPhysicalFilename(); + void SetSubdatasetName( const char *); + const char *GetSubdatasetName(); + + public: + virtual ~GDALPamDataset(); + + virtual void FlushCache(void); + + virtual const char *GetProjectionRef(void); + virtual CPLErr SetProjection( const char * ); + + virtual CPLErr GetGeoTransform( double * ); + virtual CPLErr SetGeoTransform( double * ); + + 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 SetMetadata( char ** papszMetadata, + const char * pszDomain = "" ); + virtual CPLErr SetMetadataItem( const char * pszName, + const char * pszValue, + const char * pszDomain = "" ); + virtual char **GetMetadata( const char * pszDomain = "" ); + virtual const char *GetMetadataItem( const char * pszName, + const char * pszDomain = "" ); + + virtual char **GetFileList(void); + + 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 ); + + + // "semi private" methods. + void MarkPamDirty() { nPamFlags |= GPF_DIRTY; } + GDALDatasetPamInfo *GetPamInfo() { return psPam; } + int GetPamFlags() { return nPamFlags; } + void SetPamFlags(int nValue ) { nPamFlags = nValue; } + + private: + CPL_DISALLOW_COPY_ASSIGN(GDALPamDataset); +}; + +/* ==================================================================== */ +/* GDALRasterBandPamInfo */ +/* */ +/* We make these things a separate structure of information */ +/* primarily so we can modify it without altering the size of */ +/* the GDALPamDataset. It is an effort to reduce ABI churn for */ +/* driver plugins. */ +/* ==================================================================== */ +typedef struct { + GDALPamDataset *poParentDS; + + int bNoDataValueSet; + double dfNoDataValue; + + GDALColorTable *poColorTable; + + GDALColorInterp eColorInterp; + + char *pszUnitType; + char **papszCategoryNames; + + double dfOffset; + double dfScale; + + int bHaveMinMax; + double dfMin; + double dfMax; + + int bHaveStats; + double dfMean; + double dfStdDev; + + CPLXMLNode *psSavedHistograms; + + GDALRasterAttributeTable *poDefaultRAT; + +} GDALRasterBandPamInfo; + +/* ******************************************************************** */ +/* GDALPamRasterBand */ +/* ******************************************************************** */ +class CPL_DLL GDALPamRasterBand : public GDALRasterBand +{ + friend class GDALPamDataset; + + protected: + + virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ); + virtual CPLErr XMLInit( CPLXMLNode *, const char * ); + + void PamInitialize(); + void PamClear(); + + GDALRasterBandPamInfo *psPam; + + public: + GDALPamRasterBand(); + GDALPamRasterBand(int bForceCachedIO); + virtual ~GDALPamRasterBand(); + + virtual void SetDescription( const char * ); + + virtual CPLErr SetNoDataValue( double ); + virtual double GetNoDataValue( int *pbSuccess = NULL ); + virtual CPLErr DeleteNoDataValue(); + + virtual CPLErr SetColorTable( GDALColorTable * ); + virtual GDALColorTable *GetColorTable(); + + virtual CPLErr SetColorInterpretation( GDALColorInterp ); + virtual GDALColorInterp GetColorInterpretation(); + + 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 GetHistogram( double dfMin, double dfMax, + int nBuckets, GUIntBig * panHistogram, + int bIncludeOutOfRange, int bApproxOK, + GDALProgressFunc, void *pProgressData ); + + virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax, + int *pnBuckets, GUIntBig ** ppanHistogram, + int bForce, + GDALProgressFunc, void *pProgressData); + + virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax, + int nBuckets, GUIntBig *panHistogram ); + + virtual CPLErr SetMetadata( char ** papszMetadata, + const char * pszDomain = "" ); + virtual CPLErr SetMetadataItem( const char * pszName, + const char * pszValue, + const char * pszDomain = "" ); + + virtual GDALRasterAttributeTable *GetDefaultRAT(); + virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * ); + + // new in GDALPamRasterBand. + virtual CPLErr CloneInfo( GDALRasterBand *poSrcBand, int nCloneInfoFlags ); + + // "semi private" methods. + GDALRasterBandPamInfo *GetPamInfo() { return psPam; } + + private: + CPL_DISALLOW_COPY_ASSIGN(GDALPamRasterBand); +}; + +// These are mainly helper functions for internal use. +int CPL_DLL PamParseHistogram( CPLXMLNode *psHistItem, + double *pdfMin, double *pdfMax, + int *pnBuckets, GUIntBig **ppanHistogram, + int *pbIncludeOutOfRange, int *pbApproxOK ); +CPLXMLNode CPL_DLL * +PamFindMatchingHistogram( CPLXMLNode *psSavedHistograms, + double dfMin, double dfMax, int nBuckets, + int bIncludeOutOfRange, int bApproxOK ); +CPLXMLNode CPL_DLL * +PamHistogramToXMLTree( double dfMin, double dfMax, + int nBuckets, GUIntBig * panHistogram, + int bIncludeOutOfRange, int bApprox ); + +// For managing the proxy file database. +const char CPL_DLL * PamGetProxy( const char * ); +const char CPL_DLL * PamAllocateProxy( const char * ); +const char CPL_DLL * PamDeallocateProxy( const char * ); +void CPL_DLL PamCleanProxyDB( void ); + +#endif /* ndef GDAL_PAM_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/gdal_priv.h b/modules/globebrowsing/ext/gdal/include/gdal_priv.h new file mode 100644 index 0000000000..71b9ee6ff2 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdal_priv.h @@ -0,0 +1,1423 @@ +/****************************************************************************** + * $Id$ + * + * Name: gdal_priv.h + * Project: GDAL Core + * Purpose: GDAL Core C++/Private declarations. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 1998, Frank Warmerdam + * Copyright (c) 2007-2014, Even Rouault + * + * 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_H_INCLUDED +#define GDAL_PRIV_H_INCLUDED + +/** + * \file gdal_priv.h + * + * C++ GDAL entry points. + */ + +/* -------------------------------------------------------------------- */ +/* Predeclare various classes before pulling in gdal.h, the */ +/* public declarations. */ +/* -------------------------------------------------------------------- */ +class GDALMajorObject; +class GDALDataset; +class GDALRasterBand; +class GDALDriver; +class GDALRasterAttributeTable; +class GDALProxyDataset; +class GDALProxyRasterBand; +class GDALAsyncReader; + +/* -------------------------------------------------------------------- */ +/* Pull in the public declarations. This gets the C apis, and */ +/* also various constants. However, we will still get to */ +/* provide the real class definitions for the GDAL classes. */ +/* -------------------------------------------------------------------- */ + +#include "gdal.h" +#include "gdal_frmts.h" +#include "cpl_vsi.h" +#include "cpl_conv.h" +#include "cpl_string.h" +#include "cpl_minixml.h" +#include "cpl_multiproc.h" +#include "cpl_atomic_ops.h" +#include +#include +#include "ogr_core.h" + +#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 + +/************************************************************************/ +/* GDALMultiDomainMetadata */ +/************************************************************************/ + +class CPL_DLL GDALMultiDomainMetadata +{ +private: + char **papszDomainList; + CPLStringList **papoMetadataLists; + +public: + GDALMultiDomainMetadata(); + ~GDALMultiDomainMetadata(); + + int XMLInit( CPLXMLNode *psMetadata, int bMerge ); + CPLXMLNode *Serialize(); + + char **GetDomainList() { return papszDomainList; } + + char **GetMetadata( const char * pszDomain = "" ); + CPLErr SetMetadata( char ** papszMetadata, + const char * pszDomain = "" ); + const char *GetMetadataItem( const char * pszName, + const char * pszDomain = "" ); + CPLErr SetMetadataItem( const char * pszName, + const char * pszValue, + const char * pszDomain = "" ); + + void Clear(); + + private: + CPL_DISALLOW_COPY_ASSIGN(GDALMultiDomainMetadata); +}; + +/* ******************************************************************** */ +/* GDALMajorObject */ +/* */ +/* Base class providing metadata, description and other */ +/* services shared by major objects. */ +/* ******************************************************************** */ + +//! Object with metadata. + +class CPL_DLL GDALMajorObject +{ + protected: + int nFlags; // GMO_* flags. + CPLString sDescription; + GDALMultiDomainMetadata oMDMD; + + char **BuildMetadataDomainList(char** papszList, int bCheckNonEmpty, ...) CPL_NULL_TERMINATED; + + public: + GDALMajorObject(); + virtual ~GDALMajorObject(); + + int GetMOFlags(); + void SetMOFlags(int nFlagsIn); + + virtual const char *GetDescription() const; + virtual void SetDescription( const char * ); + + virtual char **GetMetadataDomainList(); + + virtual char **GetMetadata( const char * pszDomain = "" ); + virtual CPLErr SetMetadata( char ** papszMetadata, + const char * pszDomain = "" ); + virtual const char *GetMetadataItem( const char * pszName, + const char * pszDomain = "" ); + virtual CPLErr SetMetadataItem( const char * pszName, + const char * pszValue, + const char * pszDomain = "" ); +}; + +/* ******************************************************************** */ +/* GDALDefaultOverviews */ +/* ******************************************************************** */ +class CPL_DLL GDALDefaultOverviews +{ + friend class GDALDataset; + + GDALDataset *poDS; + GDALDataset *poODS; + + CPLString osOvrFilename; + + int bOvrIsAux; + + int bCheckedForMask; + int bOwnMaskDS; + GDALDataset *poMaskDS; + + // 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... + bool bCheckedForOverviews; + void OverviewScan(); + char *pszInitName; + int bInitNameIsOVR; + char **papszInitSiblingFiles; + + public: + GDALDefaultOverviews(); + ~GDALDefaultOverviews(); + + void Initialize( GDALDataset *poDSIn, const char *pszName = NULL, + char **papszSiblingFiles = NULL, + int bNameIsOVR = FALSE ); + + void TransferSiblingFiles(char** papszSiblingFiles); + + int IsInitialized(); + + int CloseDependentDatasets(); + + // Overview Related + + int GetOverviewCount(int); + GDALRasterBand *GetOverview(int,int); + + CPLErr BuildOverviews( const char * pszBasename, + const char * pszResampling, + int nOverviews, int * panOverviewList, + int nBands, int * panBandList, + GDALProgressFunc pfnProgress, + void *pProgressData ); + + CPLErr BuildOverviewsSubDataset( const char * pszPhysicalFile, + const char * pszResampling, + int nOverviews, int * panOverviewList, + int nBands, int * panBandList, + GDALProgressFunc pfnProgress, + void *pProgressData ); + + CPLErr CleanOverviews(); + + // Mask Related + + CPLErr CreateMaskBand( int nFlags, int nBand = -1 ); + GDALRasterBand *GetMaskBand( int nBand ); + int GetMaskFlags( int nBand ); + + int HaveMaskFile( char **papszSiblings = NULL, + const char *pszBasename = NULL ); + + char** GetSiblingFiles() { return papszInitSiblingFiles; } + + private: + CPL_DISALLOW_COPY_ASSIGN(GDALDefaultOverviews); +}; + +/* ******************************************************************** */ +/* GDALOpenInfo */ +/* */ +/* Structure of data about dataset for open functions. */ +/* ******************************************************************** */ + +class CPL_DLL GDALOpenInfo +{ + bool bHasGotSiblingFiles; + char **papszSiblingFiles; + int nHeaderBytesTried; + + public: + GDALOpenInfo( const char * pszFile, int nOpenFlagsIn, + char **papszSiblingFiles = NULL ); + ~GDALOpenInfo( void ); + + char *pszFilename; + char** papszOpenOptions; + + GDALAccess eAccess; + int nOpenFlags; + + int bStatOK; + int bIsDirectory; + + VSILFILE *fpL; + + int nHeaderBytes; + GByte *pabyHeader; + + int TryToIngest(int nBytes); + char **GetSiblingFiles(); + char **StealSiblingFiles(); + bool AreSiblingFilesLoaded() const; + + private: + CPL_DISALLOW_COPY_ASSIGN(GDALOpenInfo); +}; + +/* ******************************************************************** */ +/* GDALDataset */ +/* ******************************************************************** */ + +class OGRLayer; +class OGRGeometry; +class OGRSpatialReference; +class OGRStyleTable; +class swq_select; +class swq_select_parse_options; +typedef struct GDALSQLParseInfo GDALSQLParseInfo; + +#ifdef DETECT_OLD_IRASTERIO +typedef void signature_changed; +#endif + +#ifdef GDAL_COMPILATION +#define OPTIONAL_OUTSIDE_GDAL(val) +#else +#define OPTIONAL_OUTSIDE_GDAL(val) = val +#endif + +//! A set of associated raster bands, usually from one file. + +class CPL_DLL GDALDataset : public GDALMajorObject +{ + friend GDALDatasetH CPL_STDCALL GDALOpenEx( const char* pszFilename, + unsigned int nOpenFlags, + const char* const* papszAllowedDrivers, + const char* const* papszOpenOptions, + const char* const* papszSiblingFiles ); + friend void CPL_STDCALL GDALClose( GDALDatasetH hDS ); + + friend class GDALDriver; + friend class GDALDefaultOverviews; + friend class GDALProxyDataset; + friend class GDALDriverManager; + + void AddToDatasetOpenList(); + + void Init(int bForceCachedIO); + + protected: + GDALDriver *poDriver; + GDALAccess eAccess; + + // Stored raster information. + int nRasterXSize; + int nRasterYSize; + int nBands; + GDALRasterBand **papoBands; + + int nOpenFlags; + + int nRefCount; + GByte bForceCachedIO; + GByte bShared; + GByte bIsInternal; + GByte bSuppressOnClose; + + GDALDataset(void); + GDALDataset(int bForceCachedIO); + + void RasterInitialize( int, int ); + void SetBand( int, GDALRasterBand * ); + + GDALDefaultOverviews oOvManager; + + virtual CPLErr IBuildOverviews( const char *, int, int *, + int, int *, GDALProgressFunc, void * ); + +#ifdef DETECT_OLD_IRASTERIO + virtual signature_changed IRasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + int, int *, int, int, int ) {}; +#endif + + virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + int, int *, GSpacing, GSpacing, GSpacing, + GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT; + + CPLErr BlockBasedRasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + int, int *, GSpacing, GSpacing, GSpacing, + GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT; + void BlockBasedFlushCache(); + + CPLErr BandBasedRasterIO( GDALRWFlag eRWFlag, + int nXOff, int nYOff, int nXSize, int nYSize, + void * pData, int nBufXSize, int nBufYSize, + GDALDataType eBufType, + int nBandCount, int *panBandMap, + GSpacing nPixelSpace, GSpacing nLineSpace, + GSpacing nBandSpace, + GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT; + + CPLErr RasterIOResampled( GDALRWFlag eRWFlag, + int nXOff, int nYOff, int nXSize, int nYSize, + void * pData, int nBufXSize, int nBufYSize, + GDALDataType eBufType, + int nBandCount, int *panBandMap, + GSpacing nPixelSpace, GSpacing nLineSpace, + GSpacing nBandSpace, + GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT; + + CPLErr ValidateRasterIOOrAdviseReadParameters( + const char* pszCallingFunc, + int* pbStopProcessingOnCENone, + int nXOff, int nYOff, int nXSize, int nYSize, + int nBufXSize, int nBufYSize, + int nBandCount, int *panBandMap); + + CPLErr TryOverviewRasterIO( GDALRWFlag eRWFlag, + int nXOff, int nYOff, int nXSize, int nYSize, + void * pData, int nBufXSize, int nBufYSize, + GDALDataType eBufType, + int nBandCount, int *panBandMap, + GSpacing nPixelSpace, GSpacing nLineSpace, + GSpacing nBandSpace, + GDALRasterIOExtraArg* psExtraArg, + int* pbTried); + + virtual int CloseDependentDatasets(); + + int ValidateLayerCreationOptions( const char* const* papszLCO ); + + char **papszOpenOptions; + + friend class GDALRasterBand; + + // The below methods related to read write mutex are fragile logic, and + // should not be used by out-of-tree code if possible. + int EnterReadWrite(GDALRWFlag eRWFlag); + void LeaveReadWrite(); + + void TemporarilyDropReadWriteLock(); + void ReacquireReadWriteLock(); + + void DisableReadWriteMutex(); + + int AcquireMutex(); + void ReleaseMutex(); + + public: + virtual ~GDALDataset(); + + int GetRasterXSize( void ); + int GetRasterYSize( void ); + int GetRasterCount( void ); + GDALRasterBand *GetRasterBand( int ); + + virtual void FlushCache(void); + + virtual const char *GetProjectionRef(void); + virtual CPLErr SetProjection( const char * ); + + virtual CPLErr GetGeoTransform( double * ); + virtual CPLErr SetGeoTransform( double * ); + + virtual CPLErr AddBand( GDALDataType eType, + char **papszOptions=NULL ); + + virtual void *GetInternalHandle( const char * ); + virtual GDALDriver *GetDriver(void); + virtual char **GetFileList(void); + + virtual const char* GetDriverName(); + + 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 AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize, + int nBufXSize, int nBufYSize, + GDALDataType eDT, + int nBandCount, int *panBandList, + char **papszOptions ); + + virtual CPLErr CreateMaskBand( int nFlagsIn ); + + virtual GDALAsyncReader* + BeginAsyncReader(int nXOff, int nYOff, int nXSize, int nYSize, + void *pBuf, int nBufXSize, int nBufYSize, + GDALDataType eBufType, + int nBandCount, int* panBandMap, + int nPixelSpace, int nLineSpace, int nBandSpace, + char **papszOptions); + virtual void EndAsyncReader(GDALAsyncReader *); + + CPLErr RasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + int, int *, GSpacing, GSpacing, GSpacing, + GDALRasterIOExtraArg* psExtraArg +#ifndef DOXYGEN_SKIP + OPTIONAL_OUTSIDE_GDAL(NULL) +#endif + ) CPL_WARN_UNUSED_RESULT; + + int Reference(); + int Dereference(); + GDALAccess GetAccess() const { return eAccess; } + + int GetShared(); + void MarkAsShared(); + + void MarkSuppressOnClose() { bSuppressOnClose = TRUE; } + + char **GetOpenOptions() { return papszOpenOptions; } + + static GDALDataset **GetOpenDatasets( int *pnDatasetCount ); + + CPLErr BuildOverviews( const char *, int, int *, + int, int *, GDALProgressFunc, void * ); + + void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5); + +private: + void *m_hPrivateData; + + OGRLayer* BuildLayerFromSelectInfo(swq_select* psSelectInfo, + OGRGeometry *poSpatialFilter, + const char *pszDialect, + swq_select_parse_options* poSelectParseOptions); + + public: + + virtual int GetLayerCount(); + virtual OGRLayer *GetLayer(int); + virtual OGRLayer *GetLayerByName(const char *); + virtual OGRErr DeleteLayer(int); + + virtual int TestCapability( const char * ); + + virtual OGRLayer *CreateLayer( const char *pszName, + OGRSpatialReference *poSpatialRef = NULL, + OGRwkbGeometryType eGType = wkbUnknown, + char ** papszOptions = NULL ); + virtual OGRLayer *CopyLayer( OGRLayer *poSrcLayer, + const char *pszNewName, + char **papszOptions = NULL ); + + virtual OGRStyleTable *GetStyleTable(); + virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable ); + + virtual void SetStyleTable(OGRStyleTable *poStyleTable); + + virtual OGRLayer * ExecuteSQL( const char *pszStatement, + OGRGeometry *poSpatialFilter, + const char *pszDialect ); + virtual void ReleaseResultSet( OGRLayer * poResultsSet ); + + int GetRefCount() const; + int GetSummaryRefCount() const; + OGRErr Release(); + + virtual OGRErr StartTransaction(int bForce=FALSE); + virtual OGRErr CommitTransaction(); + virtual OGRErr RollbackTransaction(); + + 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 ); + OGRLayer * ExecuteSQL( const char *pszStatement, + OGRGeometry *poSpatialFilter, + const char *pszDialect, + swq_select_parse_options* poSelectParseOptions); + + protected: + + virtual OGRLayer *ICreateLayer( const char *pszName, + OGRSpatialReference *poSpatialRef = NULL, + OGRwkbGeometryType eGType = wkbUnknown, + char ** papszOptions = NULL ); + + OGRErr ProcessSQLCreateIndex( const char * ); + OGRErr ProcessSQLDropIndex( const char * ); + OGRErr ProcessSQLDropTable( const char * ); + OGRErr ProcessSQLAlterTableAddColumn( const char * ); + OGRErr ProcessSQLAlterTableDropColumn( const char * ); + OGRErr ProcessSQLAlterTableAlterColumn( const char * ); + OGRErr ProcessSQLAlterTableRenameColumn( const char * ); + + OGRStyleTable *m_poStyleTable; + + private: + 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 + +class CPL_DLL GDALRasterBlock +{ + friend class GDALAbstractBandBlockCache; + + GDALDataType eType; + + int bDirty; + volatile int nLockCount; + + int nXOff; + int nYOff; + + int nXSize; + int nYSize; + + void *pData; + + GDALRasterBand *poBand; + + GDALRasterBlock *poNext; + GDALRasterBlock *poPrevious; + + int bMustDetach; + + void Detach_unlocked( void ); + void Touch_unlocked( void ); + + void RecycleFor( int nXOffIn, int nYOffIn ); + + public: + GDALRasterBlock( GDALRasterBand *, int, int ); + GDALRasterBlock( int nXOffIn, int nYOffIn ); /* only for lookup purpose */ + virtual ~GDALRasterBlock(); + + CPLErr Internalize( void ); + void Touch( void ); + void MarkDirty( void ); + void MarkClean( void ); + int AddLock( void ) { return CPLAtomicInc(&nLockCount); } + int DropLock( void ) { return CPLAtomicDec(&nLockCount); } + void Detach(); + + CPLErr Write(); + + GDALDataType GetDataType() const { return eType; } + int GetXOff() const { return nXOff; } + int GetYOff() const { return nYOff; } + int GetXSize() const { return nXSize; } + int GetYSize() const { return nYSize; } + int GetDirty() const { return bDirty; } + + void *GetDataRef( void ) { return pData; } + int GetBlockSize() const { + return nXSize * nYSize * GDALGetDataTypeSizeBytes(eType); } + + int TakeLock(); + int DropLockForRemovalFromStorage(); + + /// @brief Accessor to source GDALRasterBand object. + /// @return source raster band of the raster block. + GDALRasterBand *GetBand() { return poBand; } + + static void FlushDirtyBlocks(); + static int FlushCacheBlock(int bDirtyBlocksOnly = FALSE); + static void Verify(); + +#ifdef notdef + static void CheckNonOrphanedBlocks(GDALRasterBand* poBand); + void DumpBlock(); + static void DumpAll(); +#endif + + /* Should only be called by GDALDestroyDriverManager() */ + static void DestroyRBMutex(); + + private: + CPL_DISALLOW_COPY_ASSIGN(GDALRasterBlock); +}; + +/* ******************************************************************** */ +/* GDALColorTable */ +/* ******************************************************************** */ + +/*! A color table / palette. */ + +class CPL_DLL GDALColorTable +{ + GDALPaletteInterp eInterp; + + std::vector aoEntries; + +public: + GDALColorTable( GDALPaletteInterp = GPI_RGB ); + ~GDALColorTable(); + + GDALColorTable *Clone() const; + int IsSame(const GDALColorTable* poOtherCT) const; + + GDALPaletteInterp GetPaletteInterpretation() const; + + int GetColorEntryCount() const; + const GDALColorEntry *GetColorEntry( int ) const; + int GetColorEntryAsRGB( int, GDALColorEntry * ) const; + void SetColorEntry( int, const GDALColorEntry * ); + int CreateColorRamp( int, const GDALColorEntry * , + int, const GDALColorEntry * ); +}; + +/* ******************************************************************** */ +/* GDALAbstractBandBlockCache */ +/* ******************************************************************** */ + +//! 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. + +class CPL_DLL GDALAbstractBandBlockCache +{ + // List of blocks that can be freed or recycled, and its lock + CPLLock *hSpinLock; + GDALRasterBlock *psListBlocksToFree; + + // Band keep alive counter, and its lock & condition + CPLCond *hCond; + CPLMutex *hCondMutex; + volatile int nKeepAliveCounter; + + protected: + GDALRasterBand *poBand; + + void FreeDanglingBlocks(); + void UnreferenceBlockBase(); + void WaitKeepAliveCounter(); + + public: + GDALAbstractBandBlockCache(GDALRasterBand* poBand); + virtual ~GDALAbstractBandBlockCache(); + + GDALRasterBlock* CreateBlock(int nXBlockOff, int nYBlockOff); + void AddBlockToFreeList( GDALRasterBlock * ); + + virtual bool Init() = 0; + virtual bool IsInitOK() = 0; + virtual CPLErr FlushCache() = 0; + virtual CPLErr AdoptBlock( GDALRasterBlock* poBlock ) = 0; + virtual GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff, + int nYBlockYOff ) = 0; + virtual CPLErr UnreferenceBlock( GDALRasterBlock* poBlock ) = 0; + virtual CPLErr FlushBlock( int nXBlockOff, int nYBlockOff, + int bWriteDirtyBlock ) = 0; +}; + +GDALAbstractBandBlockCache* GDALArrayBandBlockCacheCreate(GDALRasterBand* poBand); +GDALAbstractBandBlockCache* GDALHashSetBandBlockCacheCreate(GDALRasterBand* poBand); + +/* ******************************************************************** */ +/* GDALRasterBand */ +/* ******************************************************************** */ + +//! A single raster band (or channel). + +class CPL_DLL GDALRasterBand : public GDALMajorObject +{ + private: + friend class GDALArrayBandBlockCache; + friend class GDALHashSetBandBlockCache; + friend class GDALRasterBlock; + + CPLErr eFlushBlockErr; + GDALAbstractBandBlockCache* poBandBlockCache; + + void SetFlushBlockErr( CPLErr eErr ); + CPLErr UnreferenceBlock( GDALRasterBlock* poBlock ); + + void Init(int bForceCachedIO); + + protected: + GDALDataset *poDS; + int nBand; /* 1 based */ + + int nRasterXSize; + int nRasterYSize; + + GDALDataType eDataType; + GDALAccess eAccess; + + /* stuff related to blocking, and raster cache */ + int nBlockXSize; + int nBlockYSize; + int nBlocksPerRow; + int nBlocksPerColumn; + + int nBlockReads; + int bForceCachedIO; + + GDALRasterBand *poMask; + bool bOwnMask; + int nMaskFlags; + + void InvalidateMaskBand(); + + friend class GDALDataset; + friend class GDALProxyRasterBand; + friend class GDALDefaultOverviews; + + CPLErr RasterIOResampled( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT; + + int EnterReadWrite(GDALRWFlag eRWFlag); + void LeaveReadWrite(); + + protected: + virtual CPLErr IReadBlock( int, int, void * ) = 0; + virtual CPLErr IWriteBlock( int, int, void * ); + +#ifdef DETECT_OLD_IRASTERIO + virtual signature_changed IRasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + int, int ) {}; +#endif + + virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT; + CPLErr OverviewRasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT; + + CPLErr TryOverviewRasterIO( GDALRWFlag eRWFlag, + int nXOff, int nYOff, int nXSize, int nYSize, + void * pData, int nBufXSize, int nBufYSize, + GDALDataType eBufType, + GSpacing nPixelSpace, GSpacing nLineSpace, + GDALRasterIOExtraArg* psExtraArg, + int* pbTried ); + + int InitBlockInfo(); + + CPLErr AdoptBlock( GDALRasterBlock * ); + GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff, int nYBlockYOff ); + void AddBlockToFreeList( GDALRasterBlock * ); + + public: + GDALRasterBand(); + GDALRasterBand(int bForceCachedIO); + + virtual ~GDALRasterBand(); + + int GetXSize(); + int GetYSize(); + int GetBand(); + GDALDataset*GetDataset(); + + GDALDataType GetRasterDataType( void ); + void GetBlockSize( int *, int * ); + GDALAccess GetAccess(); + + CPLErr RasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg +#ifndef DOXYGEN_SKIP + OPTIONAL_OUTSIDE_GDAL(NULL) +#endif + ) CPL_WARN_UNUSED_RESULT; + CPLErr ReadBlock( int, int, void * ) CPL_WARN_UNUSED_RESULT; + + CPLErr WriteBlock( int, int, void * ) CPL_WARN_UNUSED_RESULT; + + GDALRasterBlock *GetLockedBlockRef( int nXBlockOff, int nYBlockOff, + int bJustInitialize = FALSE ) CPL_WARN_UNUSED_RESULT; + CPLErr FlushBlock( int, int, int bWriteDirtyBlock = TRUE ); + + unsigned char* GetIndexColorTranslationTo(/* const */ GDALRasterBand* poReferenceBand, + unsigned char* pTranslationTable = NULL, + int* pApproximateMatching = NULL); + + // New OpengIS CV_SampleDimension stuff. + + 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); + + 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 GetStatistics( int bApproxOK, int bForce, + double *pdfMin, double *pdfMax, + double *pdfMean, double *padfStdDev ); + virtual CPLErr ComputeStatistics( int bApproxOK, + double *pdfMin, double *pdfMax, + double *pdfMean, double *pdfStdDev, + GDALProgressFunc, void *pProgressData ); + virtual CPLErr SetStatistics( double dfMin, double dfMax, + double dfMean, double dfStdDev ); + virtual CPLErr ComputeRasterMinMax( int, double* ); + + 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 AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize, + int nBufXSize, int nBufYSize, + GDALDataType eDT, char **papszOptions ); + + virtual CPLErr GetHistogram( double dfMin, double dfMax, + int nBuckets, GUIntBig * panHistogram, + int bIncludeOutOfRange, int bApproxOK, + GDALProgressFunc, void *pProgressData ); + + virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax, + int *pnBuckets, GUIntBig ** ppanHistogram, + int bForce, + GDALProgressFunc, void *pProgressData); + virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax, + int nBuckets, GUIntBig *panHistogram ); + + virtual GDALRasterAttributeTable *GetDefaultRAT(); + virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * ); + + virtual GDALRasterBand *GetMaskBand(); + virtual int GetMaskFlags(); + virtual CPLErr CreateMaskBand( int nFlagsIn ); + + virtual CPLVirtualMem *GetVirtualMemAuto( GDALRWFlag eRWFlag, + int *pnPixelSpace, + GIntBig *pnLineSpace, + char **papszOptions ) CPL_WARN_UNUSED_RESULT; + + void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5); + +private: + CPL_DISALLOW_COPY_ASSIGN(GDALRasterBand); +}; + +/* ******************************************************************** */ +/* GDALAllValidMaskBand */ +/* ******************************************************************** */ + +class CPL_DLL GDALAllValidMaskBand : public GDALRasterBand +{ + protected: + virtual CPLErr IReadBlock( int, int, void * ); + + public: + GDALAllValidMaskBand( GDALRasterBand * ); + virtual ~GDALAllValidMaskBand(); + + virtual GDALRasterBand *GetMaskBand(); + virtual int GetMaskFlags(); +}; + +/* ******************************************************************** */ +/* GDALNoDataMaskBand */ +/* ******************************************************************** */ + +class CPL_DLL GDALNoDataMaskBand : public GDALRasterBand +{ + double dfNoDataValue; + GDALRasterBand *poParent; + + protected: + virtual CPLErr IReadBlock( int, int, void * ); + virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ); + + public: + GDALNoDataMaskBand( GDALRasterBand * ); + virtual ~GDALNoDataMaskBand(); +}; + +/* ******************************************************************** */ +/* GDALNoDataValuesMaskBand */ +/* ******************************************************************** */ + +class CPL_DLL GDALNoDataValuesMaskBand : public GDALRasterBand +{ + double *padfNodataValues; + + protected: + virtual CPLErr IReadBlock( int, int, void * ); + + public: + GDALNoDataValuesMaskBand( GDALDataset * ); + virtual ~GDALNoDataValuesMaskBand(); +}; + +/* ******************************************************************** */ +/* GDALRescaledAlphaBand */ +/* ******************************************************************** */ + +class GDALRescaledAlphaBand : public GDALRasterBand +{ + GDALRasterBand *poParent; + void *pTemp; + + protected: + virtual CPLErr IReadBlock( int, int, void * ); + virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ); + + public: + GDALRescaledAlphaBand( GDALRasterBand * ); + virtual ~GDALRescaledAlphaBand(); +}; + +/* ******************************************************************** */ +/* GDALIdentifyEnum */ +/* ******************************************************************** */ + +/** + * Enumeration used by GDALDriver::pfnIdentify(). + * + * @since GDAL 2.1 + */ +typedef enum +{ + /** Identify could not determine if the file is recognized or not by the probed driver. */ + GDAL_IDENTIFY_UNKNOWN = -1, + /** Identify determined the file is not recognized by the probed driver. */ + GDAL_IDENTIFY_FALSE = 0, + /** Identify determined the file is recognized by the probed driver. */ + GDAL_IDENTIFY_TRUE = 1 +} GDALIdentifyEnum; + +/* ******************************************************************** */ +/* GDALDriver */ +/* ******************************************************************** */ + + +/** + * \brief Format specific driver. + * + * An instance of this class is created for each supported format, and + * manages information about the format. + * + * This roughly corresponds to a file format, though some + * drivers may be gateways to many formats through a secondary + * multi-library. + */ + +class CPL_DLL GDALDriver : public GDALMajorObject +{ + public: + GDALDriver(); + ~GDALDriver(); + + virtual CPLErr SetMetadataItem( const char * pszName, + const char * pszValue, + const char * pszDomain = "" ); + +/* -------------------------------------------------------------------- */ +/* Public C++ methods. */ +/* -------------------------------------------------------------------- */ + GDALDataset *Create( const char * pszName, + int nXSize, int nYSize, int nBands, + GDALDataType eType, char ** papszOptions ) CPL_WARN_UNUSED_RESULT; + + CPLErr Delete( const char * pszName ); + CPLErr Rename( const char * pszNewName, + const char * pszOldName ); + CPLErr CopyFiles( const char * pszNewName, + const char * pszOldName ); + + GDALDataset *CreateCopy( const char *, GDALDataset *, + int, char **, + GDALProgressFunc pfnProgress, + void * pProgressData ) CPL_WARN_UNUSED_RESULT; + +/* -------------------------------------------------------------------- */ +/* The following are semiprivate, not intended to be accessed */ +/* by anyone but the formats instantiating and populating the */ +/* drivers. */ +/* -------------------------------------------------------------------- */ + GDALDataset *(*pfnOpen)( GDALOpenInfo * ); + + GDALDataset *(*pfnCreate)( const char * pszName, + int nXSize, int nYSize, int nBands, + GDALDataType eType, + char ** papszOptions ); + + CPLErr (*pfnDelete)( const char * pszName ); + + GDALDataset *(*pfnCreateCopy)( const char *, GDALDataset *, + int, char **, + GDALProgressFunc pfnProgress, + void * pProgressData ); + + void *pDriverData; + + void (*pfnUnloadDriver)(GDALDriver *); + + /** Identify() if the file is recognized or not by the driver. + + Return GDAL_IDENTIFY_TRUE (1) if the passed file is certainly recognized by the driver. + Return GDAL_IDENTIFY_FALSE (0) if the passed file is certainly NOT recognized by the driver. + Return GDAL_IDENTIFY_UNKNOWN (-1) if the passed file may be or may not be recognized by the driver, + and that a potentially costly test must be done with pfnOpen. + */ + int (*pfnIdentify)( GDALOpenInfo * ); + + CPLErr (*pfnRename)( const char * pszNewName, + const char * pszOldName ); + CPLErr (*pfnCopyFiles)( const char * pszNewName, + const char * pszOldName ); + + /* For legacy OGR drivers */ + GDALDataset *(*pfnOpenWithDriverArg)( GDALDriver*, GDALOpenInfo * ); + GDALDataset *(*pfnCreateVectorOnly)( GDALDriver*, + const char * pszName, + char ** papszOptions ); + CPLErr (*pfnDeleteDataSource)( GDALDriver*, + const char * pszName ); + +/* -------------------------------------------------------------------- */ +/* Helper methods. */ +/* -------------------------------------------------------------------- */ + GDALDataset *DefaultCreateCopy( const char *, GDALDataset *, + int, char **, + GDALProgressFunc pfnProgress, + void * pProgressData ) CPL_WARN_UNUSED_RESULT; + static CPLErr DefaultCopyMasks( GDALDataset *poSrcDS, + GDALDataset *poDstDS, + int bStrict ); + static CPLErr QuietDelete( const char * pszName ); + + CPLErr DefaultRename( const char * pszNewName, + const char * pszOldName ); + CPLErr DefaultCopyFiles( const char * pszNewName, + const char * pszOldName ); +private: + CPL_DISALLOW_COPY_ASSIGN(GDALDriver); +}; + +/* ******************************************************************** */ +/* GDALDriverManager */ +/* ******************************************************************** */ + +/** + * Class for managing the registration of file format drivers. + * + * Use GetGDALDriverManager() to fetch the global singleton instance of + * this class. + */ + +class CPL_DLL GDALDriverManager : public GDALMajorObject +{ + int nDrivers; + GDALDriver **papoDrivers; + std::map oMapNameToDrivers; + + GDALDriver *GetDriver_unlocked( int iDriver ) + { return (iDriver >= 0 && iDriver < nDrivers) ? papoDrivers[iDriver] : NULL; } + + GDALDriver *GetDriverByName_unlocked( const char * pszName ) + { return oMapNameToDrivers[CPLString(pszName).toupper()]; } + + public: + GDALDriverManager(); + ~GDALDriverManager(); + + int GetDriverCount( void ); + GDALDriver *GetDriver( int ); + GDALDriver *GetDriverByName( const char * ); + + int RegisterDriver( GDALDriver * ); + void DeregisterDriver( GDALDriver * ); + + // AutoLoadDrivers is a no-op if compiled with GDAL_NO_AUTOLOAD defined. + void AutoLoadDrivers(); + void AutoSkipDrivers(); +}; + +CPL_C_START +GDALDriverManager CPL_DLL * GetGDALDriverManager( void ); +CPL_C_END + +/* ******************************************************************** */ +/* GDALAsyncReader */ +/* ******************************************************************** */ + +/** + * Class used as a session object for asynchronous requests. They are + * created with GDALDataset::BeginAsyncReader(), and destroyed with + * GDALDataset::EndAsyncReader(). + */ +class CPL_DLL GDALAsyncReader +{ + protected: + GDALDataset* poDS; + int nXOff; + int nYOff; + int nXSize; + int nYSize; + void * pBuf; + int nBufXSize; + int nBufYSize; + GDALDataType eBufType; + int nBandCount; + int* panBandMap; + int nPixelSpace; + int nLineSpace; + int nBandSpace; + + public: + GDALAsyncReader(); + virtual ~GDALAsyncReader(); + + GDALDataset* GetGDALDataset() {return poDS;} + int GetXOffset() const { return nXOff; } + int GetYOffset() const { return nYOff; } + int GetXSize() const { return nXSize; } + int GetYSize() const { return nYSize; } + void * GetBuffer() {return pBuf;} + int GetBufferXSize() const { return nBufXSize; } + int GetBufferYSize() const { return nBufYSize; } + GDALDataType GetBufferType() const { return eBufType; } + int GetBandCount() const { return nBandCount; } + int* GetBandMap() { return panBandMap; } + int GetPixelSpace() const { return nPixelSpace; } + int GetLineSpace() const { return nLineSpace; } + int GetBandSpace() const { return nBandSpace; } + + virtual GDALAsyncStatusType + GetNextUpdatedRegion(double dfTimeout, + int* pnBufXOff, int* pnBufYOff, + int* pnBufXSize, int* pnBufYSize) = 0; + virtual int LockBuffer( double dfTimeout = -1.0 ); + virtual void UnlockBuffer(); +}; + +/* ==================================================================== */ +/* An assortment of overview related stuff. */ +/* ==================================================================== */ + +/* Only exported for drivers as plugin. Signature may change */ +CPLErr CPL_DLL +GDALRegenerateOverviewsMultiBand(int nBands, GDALRasterBand** papoSrcBands, + int nOverviews, + GDALRasterBand*** papapoOverviewBands, + const char * pszResampling, + GDALProgressFunc pfnProgress, void * pProgressData ); + +typedef CPLErr (*GDALResampleFunction) + ( double dfXRatioDstToSrc, + double dfYRatioDstToSrc, + double dfSrcXDelta, + double dfSrcYDelta, + GDALDataType eWrkDataType, + void * pChunk, + GByte * pabyChunkNodataMask, + int nChunkXOff, int nChunkXSize, + int nChunkYOff, int nChunkYSize, + int nDstXOff, int nDstXOff2, + int nDstYOff, int nDstYOff2, + GDALRasterBand * poOverview, + const char * pszResampling, + int bHasNoData, float fNoDataValue, + GDALColorTable* poColorTable, + GDALDataType eSrcDataType); + +GDALResampleFunction GDALGetResampleFunction(const char* pszResampling, + int* pnRadius); + +#ifdef GDAL_ENABLE_RESAMPLING_MULTIBAND +typedef CPLErr (*GDALResampleFunctionMultiBands) + ( double dfXRatioDstToSrc, + double dfYRatioDstToSrc, + double dfSrcXDelta, + double dfSrcYDelta, + GDALDataType eWrkDataType, + void * pChunk, int nBands, + GByte * pabyChunkNodataMask, + int nChunkXOff, int nChunkXSize, + int nChunkYOff, int nChunkYSize, + int nDstXOff, int nDstXOff2, + int nDstYOff, int nDstYOff2, + GDALRasterBand ** papoDstBands, + const char * pszResampling, + int bHasNoData, float fNoDataValue, + GDALColorTable* poColorTable, + GDALDataType eSrcDataType); + +GDALResampleFunctionMultiBands GDALGetResampleFunctionMultiBands(const char* pszResampling, + int* pnRadius); +#endif + +GDALDataType GDALGetOvrWorkDataType(const char* pszResampling, + GDALDataType eSrcDataType); + +CPL_C_START + +CPLErr CPL_DLL +HFAAuxBuildOverviews( const char *pszOvrFilename, GDALDataset *poParentDS, + GDALDataset **ppoDS, + int nBands, int *panBandList, + int nNewOverviews, int *panNewOverviewList, + const char *pszResampling, + GDALProgressFunc pfnProgress, + void *pProgressData ); + +CPLErr CPL_DLL +GTIFFBuildOverviews( const char * pszFilename, + int nBands, GDALRasterBand **papoBandList, + int nOverviews, int * panOverviewList, + const char * pszResampling, + GDALProgressFunc pfnProgress, void * pProgressData ); + +CPLErr CPL_DLL +GDALDefaultBuildOverviews( GDALDataset *hSrcDS, const char * pszBasename, + const char * pszResampling, + int nOverviews, int * panOverviewList, + int nBands, int * panBandList, + GDALProgressFunc pfnProgress, void * pProgressData); + +int CPL_DLL GDALBandGetBestOverviewLevel(GDALRasterBand* poBand, + int &nXOff, int &nYOff, + int &nXSize, int &nYSize, + int nBufXSize, int nBufYSize) CPL_WARN_DEPRECATED("Use GDALBandGetBestOverviewLevel2 instead"); +int CPL_DLL GDALBandGetBestOverviewLevel2(GDALRasterBand* poBand, + int &nXOff, int &nYOff, + int &nXSize, int &nYSize, + int nBufXSize, int nBufYSize, + GDALRasterIOExtraArg* psExtraArg); + +int CPL_DLL GDALOvLevelAdjust( int nOvLevel, int nXSize ) CPL_WARN_DEPRECATED("Use GDALOvLevelAdjust2 instead"); +int CPL_DLL GDALOvLevelAdjust2( int nOvLevel, int nXSize, int nYSize ); +int CPL_DLL GDALComputeOvFactor( int nOvrXSize, int nRasterXSize, + int nOvrYSize, int nRasterYSize ); + +GDALDataset CPL_DLL * +GDALFindAssociatedAuxFile( const char *pszBasefile, GDALAccess eAccess, + GDALDataset *poDependentDS ); + +/* ==================================================================== */ +/* Misc functions. */ +/* ==================================================================== */ + +CPLErr CPL_DLL GDALParseGMLCoverage( CPLXMLNode *psTree, + int *pnXSize, int *pnYSize, + double *padfGeoTransform, + char **ppszProjection ); + +/* ==================================================================== */ +/* Infrastructure to check that dataset characteristics are valid */ +/* ==================================================================== */ + +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 )) + +/* Internal use only */ + +/* CPL_DLL exported, but only for in-tree drivers that can be built as plugins */ +int CPL_DLL GDALReadWorldFile2( const char *pszBaseFilename, const char *pszExtension, + double *padfGeoTransform, char** papszSiblingFiles, + char** ppszWorldFileNameOut); +int GDALReadTabFile2( const char * pszBaseFilename, + double *padfGeoTransform, char **ppszWKT, + int *pnGCPCount, GDAL_GCP **ppasGCPs, + char** papszSiblingFiles, char** ppszTabFileNameOut ); + +void CPL_DLL GDALCopyRasterIOExtraArg(GDALRasterIOExtraArg* psDestArg, + GDALRasterIOExtraArg* psSrcArg); + +CPL_C_END + +void GDALNullifyOpenDatasetsList(); +CPLMutex** GDALGetphDMMutex(); +CPLMutex** GDALGetphDLMutex(); +void GDALNullifyProxyPoolSingleton(); +GDALDriver* GDALGetAPIPROXYDriver(); +void GDALSetResponsiblePIDForCurrentThread(GIntBig responsiblePID); +GIntBig GDALGetResponsiblePIDForCurrentThread(); + +CPLString GDALFindAssociatedFile( const char *pszBasename, const char *pszExt, + char **papszSiblingFiles, int nFlags ); + +CPLErr EXIFExtractMetadata(char**& papszMetadata, + void *fpL, int nOffset, + int bSwabflag, int nTIFFHEADER, + int& nExifOffset, int& nInterOffset, int& nGPSOffset); + +int GDALValidateOpenOptions( GDALDriverH hDriver, + const char* const* papszOptionOptions); +int GDALValidateOptions( const char* pszOptionList, + const char* const* papszOptionsToValidate, + const char* pszErrorMessageOptionType, + const char* pszErrorMessageContainerName); + +GDALRIOResampleAlg GDALRasterIOGetResampleAlg(const char* pszResampling); +const char* GDALRasterIOGetResampleAlg(GDALRIOResampleAlg eResampleAlg); + +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); + +#define DIV_ROUND_UP(a, b) ( ((a) % (b)) == 0 ? ((a) / (b)) : (((a) / (b)) + 1) ) + +// Number of data samples that will be used to compute approximate statistics +// (minimum value, maximum value, etc.) +#define GDALSTAT_APPROX_NUMSAMPLES 2500 + +CPL_C_START +/* Caution: for technical reason this declaration is duplicated in gdal_crs.c */ +/* so any signature change should be reflected there too */ +void GDALSerializeGCPListToXML( CPLXMLNode* psParentNode, + GDAL_GCP* pasGCPList, + int nGCPCount, + const char* pszGCPProjection ); +void GDALDeserializeGCPListFromXML( CPLXMLNode* psGCPList, + GDAL_GCP** ppasGCPList, + int* pnGCPCount, + char** ppszGCPProjection ); +CPL_C_END + +void GDALSerializeOpenOptionsToXML( CPLXMLNode* psParentNode, char** papszOpenOptions); +char** GDALDeserializeOpenOptionsFromXML( CPLXMLNode* psParentNode ); + +int GDALCanFileAcceptSidecarFile(const char* pszFilename); + +#endif /* ndef GDAL_PRIV_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/gdal_proxy.h b/modules/globebrowsing/ext/gdal/include/gdal_proxy.h new file mode 100644 index 0000000000..561902fc4e --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdal_proxy.h @@ -0,0 +1,396 @@ +/****************************************************************************** + * $Id$ + * + * Project: GDAL Core + * Purpose: GDAL Core C++/Private declarations + * Author: Even Rouault + * + ****************************************************************************** + * Copyright (c) 2008-2014, Even Rouault + * + * 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_PROXY_H_INCLUDED +#define GDAL_PROXY_H_INCLUDED + +#include "gdal.h" + +#ifdef __cplusplus + +#include "gdal_priv.h" +#include "cpl_hash_set.h" + +/* ******************************************************************** */ +/* GDALProxyDataset */ +/* ******************************************************************** */ + +class CPL_DLL GDALProxyDataset : public GDALDataset +{ + protected: + GDALProxyDataset() {}; + + virtual GDALDataset *RefUnderlyingDataset() = 0; + virtual void UnrefUnderlyingDataset(GDALDataset* poUnderlyingDataset); + + virtual CPLErr IBuildOverviews( const char *, int, int *, + int, int *, GDALProgressFunc, void * ); + virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + int, int *, GSpacing, GSpacing, GSpacing, + GDALRasterIOExtraArg* psExtraArg ); + public: + + virtual char **GetMetadataDomainList(); + virtual char **GetMetadata( const char * pszDomain ); + virtual CPLErr SetMetadata( char ** papszMetadata, + const char * pszDomain ); + virtual const char *GetMetadataItem( const char * pszName, + const char * pszDomain ); + virtual CPLErr SetMetadataItem( const char * pszName, + const char * pszValue, + const char * pszDomain ); + + virtual void FlushCache(void); + + virtual const char *GetProjectionRef(void); + virtual CPLErr SetProjection( const char * ); + + virtual CPLErr GetGeoTransform( double * ); + virtual CPLErr SetGeoTransform( double * ); + + virtual void *GetInternalHandle( const char * ); + virtual GDALDriver *GetDriver(void); + virtual char **GetFileList(void); + + 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 AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize, + int nBufXSize, int nBufYSize, + GDALDataType eDT, + int nBandCount, int *panBandList, + char **papszOptions ); + + virtual CPLErr CreateMaskBand( int nFlags ); + + private: + CPL_DISALLOW_COPY_ASSIGN(GDALProxyDataset); +}; + +/* ******************************************************************** */ +/* GDALProxyRasterBand */ +/* ******************************************************************** */ + +class CPL_DLL GDALProxyRasterBand : public GDALRasterBand +{ + protected: + GDALProxyRasterBand() {}; + + virtual GDALRasterBand* RefUnderlyingRasterBand() = 0; + virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand); + + virtual CPLErr IReadBlock( int, int, void * ); + virtual CPLErr IWriteBlock( int, int, void * ); + virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ); + + public: + + virtual char **GetMetadataDomainList(); + virtual char **GetMetadata( const char * pszDomain ); + virtual CPLErr SetMetadata( char ** papszMetadata, + const char * pszDomain ); + virtual const char *GetMetadataItem( const char * pszName, + const char * pszDomain ); + 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); + + 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 GetStatistics( int bApproxOK, int bForce, + double *pdfMin, double *pdfMax, + double *pdfMean, double *padfStdDev ); + virtual CPLErr ComputeStatistics( int bApproxOK, + double *pdfMin, double *pdfMax, + double *pdfMean, double *pdfStdDev, + GDALProgressFunc, void *pProgressData ); + virtual CPLErr SetStatistics( double dfMin, double dfMax, + double dfMean, double dfStdDev ); + virtual CPLErr ComputeRasterMinMax( int, double* ); + + 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 AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize, + int nBufXSize, int nBufYSize, + GDALDataType eDT, char **papszOptions ); + + virtual CPLErr GetHistogram( double dfMin, double dfMax, + int nBuckets, GUIntBig * panHistogram, + int bIncludeOutOfRange, int bApproxOK, + GDALProgressFunc, void *pProgressData ); + + virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax, + int *pnBuckets, GUIntBig ** ppanHistogram, + int bForce, + GDALProgressFunc, void *pProgressData); + virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax, + int nBuckets, GUIntBig *panHistogram ); + + virtual GDALRasterAttributeTable *GetDefaultRAT(); + virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * ); + + virtual GDALRasterBand *GetMaskBand(); + virtual int GetMaskFlags(); + virtual CPLErr CreateMaskBand( int nFlags ); + + virtual CPLVirtualMem *GetVirtualMemAuto( GDALRWFlag eRWFlag, + int *pnPixelSpace, + GIntBig *pnLineSpace, + char **papszOptions ); + private: + CPL_DISALLOW_COPY_ASSIGN(GDALProxyRasterBand); +}; + + +/* ******************************************************************** */ +/* GDALProxyPoolDataset */ +/* ******************************************************************** */ + +typedef struct _GDALProxyPoolCacheEntry GDALProxyPoolCacheEntry; +class GDALProxyPoolRasterBand; + +class CPL_DLL GDALProxyPoolDataset : public GDALProxyDataset +{ + private: + GIntBig responsiblePID; + + char *pszProjectionRef; + double adfGeoTransform[6]; + int bHasSrcProjection; + int bHasSrcGeoTransform; + char *pszGCPProjection; + int nGCPCount; + GDAL_GCP *pasGCPList; + CPLHashSet *metadataSet; + CPLHashSet *metadataItemSet; + + GDALProxyPoolCacheEntry* cacheEntry; + + protected: + virtual GDALDataset *RefUnderlyingDataset(); + virtual void UnrefUnderlyingDataset(GDALDataset* poUnderlyingDataset); + + friend class GDALProxyPoolRasterBand; + + public: + GDALProxyPoolDataset(const char* pszSourceDatasetDescription, + int nRasterXSize, int nRasterYSize, + GDALAccess eAccess = GA_ReadOnly, + int bShared = FALSE, + const char * pszProjectionRef = NULL, + double * padfGeoTransform = NULL); + ~GDALProxyPoolDataset(); + + void SetOpenOptions(char** papszOpenOptions); + void AddSrcBandDescription( GDALDataType eDataType, int nBlockXSize, int nBlockYSize); + + virtual const char *GetProjectionRef(void); + virtual CPLErr SetProjection( const char * ); + + virtual CPLErr GetGeoTransform( double * ); + virtual CPLErr SetGeoTransform( double * ); + + /* 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 const char *GetMetadataItem( const char * pszName, + const char * pszDomain ); + + virtual void *GetInternalHandle( const char * pszRequest ); + + virtual const char *GetGCPProjection(); + virtual const GDAL_GCP *GetGCPs(); + private: + CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolDataset); +}; + +/* ******************************************************************** */ +/* GDALProxyPoolRasterBand */ +/* ******************************************************************** */ + +class GDALProxyPoolOverviewRasterBand; +class GDALProxyPoolMaskBand; + +class CPL_DLL GDALProxyPoolRasterBand : public GDALProxyRasterBand +{ + private: + CPLHashSet *metadataSet; + CPLHashSet *metadataItemSet; + char *pszUnitType; + char **papszCategoryNames; + GDALColorTable *poColorTable; + + int nSizeProxyOverviewRasterBand; + GDALProxyPoolOverviewRasterBand **papoProxyOverviewRasterBand; + GDALProxyPoolMaskBand *poProxyMaskBand; + + void Init(); + + protected: + virtual GDALRasterBand* RefUnderlyingRasterBand(); + virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand); + + friend class GDALProxyPoolOverviewRasterBand; + friend class GDALProxyPoolMaskBand; + + public: + GDALProxyPoolRasterBand(GDALProxyPoolDataset* poDS, int nBand, + GDALDataType eDataType, + int nBlockXSize, int nBlockYSize); + GDALProxyPoolRasterBand(GDALProxyPoolDataset* poDS, + GDALRasterBand* poUnderlyingRasterBand); + ~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 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(); + private: + CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolRasterBand); +}; + +/* ******************************************************************** */ +/* GDALProxyPoolOverviewRasterBand */ +/* ******************************************************************** */ + +class GDALProxyPoolOverviewRasterBand : public GDALProxyPoolRasterBand +{ + private: + GDALProxyPoolRasterBand *poMainBand; + int nOverviewBand; + + GDALRasterBand *poUnderlyingMainRasterBand; + int nRefCountUnderlyingMainRasterBand; + + protected: + virtual GDALRasterBand* RefUnderlyingRasterBand(); + virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand); + + public: + GDALProxyPoolOverviewRasterBand(GDALProxyPoolDataset* poDS, + GDALRasterBand* poUnderlyingOverviewBand, + GDALProxyPoolRasterBand* poMainBand, + int nOverviewBand); + ~GDALProxyPoolOverviewRasterBand(); +}; + +/* ******************************************************************** */ +/* GDALProxyPoolMaskBand */ +/* ******************************************************************** */ + +class GDALProxyPoolMaskBand : public GDALProxyPoolRasterBand +{ + private: + GDALProxyPoolRasterBand *poMainBand; + + GDALRasterBand *poUnderlyingMainRasterBand; + int nRefCountUnderlyingMainRasterBand; + + protected: + virtual GDALRasterBand* RefUnderlyingRasterBand(); + virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand); + + public: + GDALProxyPoolMaskBand(GDALProxyPoolDataset* poDS, + GDALRasterBand* poUnderlyingMaskBand, + GDALProxyPoolRasterBand* poMainBand); + GDALProxyPoolMaskBand(GDALProxyPoolDataset* poDS, + GDALProxyPoolRasterBand* poMainBand, + GDALDataType eDataType, + int nBlockXSize, int nBlockYSize); + ~GDALProxyPoolMaskBand(); +}; + +#endif + + +/* ******************************************************************** */ +/* C types and methods declarations */ +/* ******************************************************************** */ + + +CPL_C_START + +typedef struct GDALProxyPoolDatasetHS *GDALProxyPoolDatasetH; + +GDALProxyPoolDatasetH CPL_DLL GDALProxyPoolDatasetCreate(const char* pszSourceDatasetDescription, + int nRasterXSize, int nRasterYSize, + GDALAccess eAccess, int bShared, + const char * pszProjectionRef, + double * padfGeoTransform); + +void CPL_DLL GDALProxyPoolDatasetDelete(GDALProxyPoolDatasetH hProxyPoolDataset); + +void CPL_DLL GDALProxyPoolDatasetAddSrcBandDescription( GDALProxyPoolDatasetH hProxyPoolDataset, + GDALDataType eDataType, + int nBlockXSize, int nBlockYSize); + +CPL_C_END + +#endif /* GDAL_PROXY_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/gdal_rat.h b/modules/globebrowsing/ext/gdal/include/gdal_rat.h new file mode 100644 index 0000000000..5ceafb9f36 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdal_rat.h @@ -0,0 +1,362 @@ +/****************************************************************************** + * $Id$ + * + * Project: GDAL Core + * Purpose: GDALRasterAttributeTable class declarations. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 2005, 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 GDAL_RAT_H_INCLUDED +#define GDAL_RAT_H_INCLUDED + +#include "cpl_minixml.h" + +// Clone and Serialize are allowed to fail if GetRowCount()*GetColCount() +// greater than this number +#define RAT_MAX_ELEM_FOR_CLONE 1000000 + +/************************************************************************/ +/* GDALRasterAttributeTable */ +/************************************************************************/ + +//! Raster Attribute Table interface. +class GDALDefaultRasterAttributeTable; + +class CPL_DLL GDALRasterAttributeTable +{ +public: + virtual ~GDALRasterAttributeTable(); + /** + * \brief Copy Raster Attribute Table + * + * Creates a new copy of an existing raster attribute table. The new copy + * becomes the responsibility of the caller to destroy. + * May fail (return NULL) if the attribute table is too large to clone + * (GetRowCount() * GetColCount() > RAT_MAX_ELEM_FOR_CLONE) + * + * This method is the same as the C function GDALRATClone(). + * + * @return new copy of the RAT as an in-memory implementation. + */ + virtual GDALDefaultRasterAttributeTable *Clone() const = 0; + + /** + * \brief Fetch table column count. + * + * This method is the same as the C function GDALRATGetColumnCount(). + * + * @return the number of columns. + */ + virtual int GetColumnCount() const = 0; + + /** + * \brief Fetch name of indicated column. + * + * This method is the same as the C function GDALRATGetNameOfCol(). + * + * @param iCol the column index (zero based). + * + * @return the column name or an empty string for invalid column numbers. + */ + virtual const char *GetNameOfCol( int ) const = 0; + + /** + * \brief Fetch column usage value. + * + * This method is the same as the C function GDALRATGetUsageOfCol(). + * + * @param iCol the column index (zero based). + * + * @return the column usage, or GFU_Generic for improper column numbers. + */ + virtual GDALRATFieldUsage GetUsageOfCol( int ) const = 0; + + /** + * \brief Fetch column type. + * + * This method is the same as the C function GDALRATGetTypeOfCol(). + * + * @param iCol the column index (zero based). + * + * @return column type or GFT_Integer if the column index is illegal. + */ + virtual GDALRATFieldType GetTypeOfCol( int ) const = 0; + + /** + * \brief Fetch column index for given usage. + * + * Returns the index of the first column of the requested usage type, or -1 + * if no match is found. + * + * This method is the same as the C function GDALRATGetUsageOfCol(). + * + * @param eUsage usage type to search for. + * + * @return column index, or -1 on failure. + */ + virtual int GetColOfUsage( GDALRATFieldUsage ) const = 0; + + /** + * \brief Fetch row count. + * + * This method is the same as the C function GDALRATGetRowCount(). + * + * @return the number of rows. + */ + virtual int GetRowCount() const = 0; + + /** + * \brief Fetch field value as a string. + * + * The value of the requested column in the requested row is returned + * as a string. If the field is numeric, it is formatted as a string + * using default rules, so some precision may be lost. + * + * The returned string is temporary and cannot be expected to be + * available after the next GDAL call. + * + * This method is the same as the C function GDALRATGetValueAsString(). + * + * @param iRow row to fetch (zero based). + * @param iField column to fetch (zero based). + * + * @return field value. + */ + virtual const char *GetValueAsString( int iRow, int iField ) const = 0; + + /** + * \brief Fetch field value as a integer. + * + * The value of the requested column in the requested row is returned + * as an integer. Non-integer fields will be converted to integer with + * the possibility of data loss. + * + * This method is the same as the C function GDALRATGetValueAsInt(). + * + * @param iRow row to fetch (zero based). + * @param iField column to fetch (zero based). + * + * @return field value + */ + virtual int GetValueAsInt( int iRow, int iField ) const = 0; + + /** + * \brief Fetch field value as a double. + * + * The value of the requested column in the requested row is returned + * as a double. Non double fields will be converted to double with + * the possibility of data loss. + * + * This method is the same as the C function GDALRATGetValueAsDouble(). + * + * @param iRow row to fetch (zero based). + * @param iField column to fetch (zero based). + * + * @return field value + */ + virtual double GetValueAsDouble( int iRow, int iField ) const = 0; + + /** + * \brief Set field value from string. + * + * The indicated field (column) on the indicated row is set from the + * passed value. The value will be automatically converted for other field + * types, with a possible loss of precision. + * + * This method is the same as the C function GDALRATSetValueAsString(). + * + * @param iRow row to fetch (zero based). + * @param iField column to fetch (zero based). + * @param pszValue the value to assign. + */ + virtual void SetValue( int iRow, int iField, + const char *pszValue ) = 0; + + /** + * \brief Set field value from integer. + * + * The indicated field (column) on the indicated row is set from the + * passed value. The value will be automatically converted for other field + * types, with a possible loss of precision. + * + * This method is the same as the C function GDALRATSetValueAsInteger(). + * + * @param iRow row to fetch (zero based). + * @param iField column to fetch (zero based). + * @param nValue the value to assign. + */ + virtual void SetValue( int iRow, int iField, int nValue ) = 0; + + /** + * \brief Set field value from double. + * + * The indicated field (column) on the indicated row is set from the + * passed value. The value will be automatically converted for other field + * types, with a possible loss of precision. + * + * This method is the same as the C function GDALRATSetValueAsDouble(). + * + * @param iRow row to fetch (zero based). + * @param iField column to fetch (zero based). + * @param dfValue the value to assign. + */ + virtual void SetValue( int iRow, int iField, double dfValue) = 0; + + /** + * \brief Determine whether changes made to this RAT are reflected directly + * in the dataset + * + * If this returns FALSE then GDALRasterBand.SetDefaultRAT() should be + * called. Otherwise this is unnecessary since changes to this object are + * reflected in the dataset. + * + * This method is the same as the C function + * GDALRATChangesAreWrittenToFile(). + * + */ + virtual int ChangesAreWrittenToFile() = 0; + + virtual CPLErr ValuesIO( GDALRWFlag eRWFlag, int iField, + int iStartRow, int iLength, + double *pdfData); + virtual CPLErr ValuesIO( GDALRWFlag eRWFlag, int iField, + int iStartRow, int iLength, int *pnData); + virtual CPLErr ValuesIO( GDALRWFlag eRWFlag, int iField, + int iStartRow, int iLength, + char **papszStrList); + + virtual void SetRowCount( int iCount ); + virtual int GetRowOfValue( double dfValue ) const; + virtual int GetRowOfValue( int nValue ) const; + + virtual CPLErr CreateColumn( const char *pszFieldName, + GDALRATFieldType eFieldType, + GDALRATFieldUsage eFieldUsage ); + virtual CPLErr SetLinearBinning( double dfRow0Min, + double dfBinSize ); + virtual int GetLinearBinning( double *pdfRow0Min, + double *pdfBinSize ) const; + + /** + * \brief Serialize + * + * May fail (return NULL) if the attribute table is too large to serialize + * (GetRowCount() * GetColCount() > RAT_MAX_ELEM_FOR_CLONE) + */ + virtual CPLXMLNode *Serialize() const; + virtual void *SerializeJSON() const; + virtual CPLErr XMLInit( CPLXMLNode *, const char * ); + + virtual CPLErr InitializeFromColorTable( const GDALColorTable * ); + virtual GDALColorTable *TranslateToColorTable( int nEntryCount = -1 ); + + virtual void DumpReadable( FILE * = NULL ); +}; + +/************************************************************************/ +/* GDALRasterAttributeField */ +/* */ +/* (private) */ +/************************************************************************/ + +class GDALRasterAttributeField +{ + public: + CPLString sName; + + GDALRATFieldType eType; + + GDALRATFieldUsage eUsage; + + std::vector anValues; + std::vector adfValues; + std::vector aosValues; +}; + +/************************************************************************/ +/* GDALDefaultRasterAttributeTable */ +/************************************************************************/ + +//! Raster Attribute Table container. + +class CPL_DLL GDALDefaultRasterAttributeTable : public GDALRasterAttributeTable +{ + private: + std::vector aoFields; + + int bLinearBinning; // TODO(schwehr): Can this be a bool? + double dfRow0Min; + double dfBinSize; + + void AnalyseColumns(); + int bColumnsAnalysed; // TODO(schwehr): Can this be a bool? + int nMinCol; + int nMaxCol; + + int nRowCount; + + CPLString osWorkingResult; + + public: + GDALDefaultRasterAttributeTable(); + GDALDefaultRasterAttributeTable( const GDALDefaultRasterAttributeTable& ); + ~GDALDefaultRasterAttributeTable(); + + GDALDefaultRasterAttributeTable *Clone() const; + + virtual int GetColumnCount() const; + + virtual const char *GetNameOfCol( int ) const; + virtual GDALRATFieldUsage GetUsageOfCol( int ) const; + virtual GDALRATFieldType GetTypeOfCol( int ) const; + + virtual int GetColOfUsage( GDALRATFieldUsage ) const; + + virtual int GetRowCount() const; + + 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 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 ); + + virtual int ChangesAreWrittenToFile(); + virtual void SetRowCount( int iCount ); + + virtual int GetRowOfValue( double dfValue ) const; + virtual int GetRowOfValue( int nValue ) const; + + virtual CPLErr CreateColumn( const char *pszFieldName, + GDALRATFieldType eFieldType, + GDALRATFieldUsage eFieldUsage ); + virtual CPLErr SetLinearBinning( double dfRow0Min, + double dfBinSize ); + virtual int GetLinearBinning( double *pdfRow0Min, + double *pdfBinSize ) const; +}; + +#endif /* ndef GDAL_RAT_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/gdal_simplesurf.h b/modules/globebrowsing/ext/gdal/include/gdal_simplesurf.h new file mode 100644 index 0000000000..ca262dced6 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdal_simplesurf.h @@ -0,0 +1,554 @@ +/****************************************************************************** + * 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 + +/** + * @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* + 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 *poMatchPairs, + std::vector *poFirstCollect, + std::vector *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 *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_ */ diff --git a/modules/globebrowsing/ext/gdal/include/gdal_utils.h b/modules/globebrowsing/ext/gdal/include/gdal_utils.h new file mode 100644 index 0000000000..1777131a2a --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdal_utils.h @@ -0,0 +1,214 @@ +/****************************************************************************** + * $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 + * 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 */ diff --git a/modules/globebrowsing/ext/gdal/include/gdal_version.h b/modules/globebrowsing/ext/gdal/include/gdal_version.h new file mode 100644 index 0000000000..2995652ca6 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdal_version.h @@ -0,0 +1,29 @@ + +/* -------------------------------------------------------------------- */ +/* GDAL Version Information. */ +/* -------------------------------------------------------------------- */ + +#ifndef GDAL_VERSION_MAJOR +# define GDAL_VERSION_MAJOR 2 +# define GDAL_VERSION_MINOR 1 +# define GDAL_VERSION_REV 0 +# define GDAL_VERSION_BUILD 0 +#endif + +/* GDAL_COMPUTE_VERSION macro introduced in GDAL 1.10 */ +/* Must be used ONLY to compare with version numbers for GDAL >= 1.10 */ +#ifndef GDAL_COMPUTE_VERSION +#define GDAL_COMPUTE_VERSION(maj,min,rev) ((maj)*1000000+(min)*10000+(rev)*100) +#endif + +/* Note: the formula to compute GDAL_VERSION_NUM has changed in GDAL 1.10 */ +#ifndef GDAL_VERSION_NUM +# define GDAL_VERSION_NUM (GDAL_COMPUTE_VERSION(GDAL_VERSION_MAJOR,GDAL_VERSION_MINOR,GDAL_VERSION_REV)+GDAL_VERSION_BUILD) +#endif + +#ifndef GDAL_RELEASE_DATE +# define GDAL_RELEASE_DATE 20160401 +#endif +#ifndef GDAL_RELEASE_NAME +# define GDAL_RELEASE_NAME "2.1.0beta1" +#endif diff --git a/modules/globebrowsing/ext/gdal/include/gdal_vrt.h b/modules/globebrowsing/ext/gdal/include/gdal_vrt.h new file mode 100644 index 0000000000..ca89715476 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdal_vrt.h @@ -0,0 +1,104 @@ +/****************************************************************************** + * $Id$ + * + * 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 + * + * 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_error.h" +#include "cpl_minixml.h" +#include "cpl_port.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 *VRTAveragedSourceH; +typedef void *VRTAverageFilteredSourceH; +typedef void *VRTComplexSourceH; +typedef void *VRTDatasetH; +typedef void *VRTDerivedRasterBandH; +typedef void *VRTDriverH; +typedef void *VRTFilteredSourceH; +typedef void *VRTFuncSourceH; +typedef void *VRTKernelFilteredSourceH; +typedef void *VRTRasterBandH; +typedef void *VRTRawRasterBandH; +typedef void *VRTSimpleSourceH; +typedef void *VRTSourceH; +typedef void *VRTSourcedRasterBandH; +typedef void *VRTWarpedDatasetH; +typedef void *VRTWarpedRasterBandH; + +/* ==================================================================== */ +/* 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 */ diff --git a/modules/globebrowsing/ext/gdal/include/gdalexif.h b/modules/globebrowsing/ext/gdal/include/gdalexif.h new file mode 100644 index 0000000000..247abf6164 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdalexif.h @@ -0,0 +1,235 @@ +/****************************************************************************** + * $Id$ + * + * Project: JPEG JFIF Driver + * Purpose: Implement GDAL JPEG Support based on IJG libjpeg. + * 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. + ****************************************************************************/ + +#ifdef RENAME_INTERNAL_LIBTIFF_SYMBOLS +#include "../frmts/gtiff/libtiff/gdal_libtiff_symbol_rename.h" +#endif + +static const struct gpsname { + GUInt16 tag; + const char* name; +} gpstags [] = { + { 0x00, "EXIF_GPSVersionID" }, + { 0x01, "EXIF_GPSLatitudeRef" }, + { 0x02, "EXIF_GPSLatitude" }, + { 0x03, "EXIF_GPSLongitudeRef" }, + { 0x04, "EXIF_GPSLongitude" }, + { 0x05, "EXIF_GPSAltitudeRef" }, + { 0x06, "EXIF_GPSAltitude" }, + { 0x07, "EXIF_GPSTimeStamp" }, + { 0x08, "EXIF_GPSSatellites" }, + { 0x09, "EXIF_GPSStatus" }, + { 0x0a, "EXIF_GPSMeasureMode" }, + { 0x0b, "EXIF_GPSDOP" }, + { 0x0c, "EXIF_GPSSpeedRef"}, + { 0x0d, "EXIF_GPSSpeed"}, + { 0x0e, "EXIF_GPSTrackRef"}, + { 0x0f, "EXIF_GPSTrack"}, + { 0x10, "EXIF_GPSImgDirectionRef"}, + { 0x11, "EXIF_GPSImgDirection"}, + { 0x12, "EXIF_GPSMapDatum"}, + { 0x13, "EXIF_GPSDestLatitudeRef"}, + { 0x14, "EXIF_GPSDestLatitude"}, + { 0x15, "EXIF_GPSDestLongitudeRef"}, + { 0x16, "EXIF_GPSDestLongitude"}, + { 0x17, "EXIF_GPSDestBearingRef"}, + { 0x18, "EXIF_GPSDestBearing"}, + { 0x19, "EXIF_GPSDestDistanceRef"}, + { 0x1a, "EXIF_GPSDestDistance"}, + { 0x1b, "EXIF_GPSProcessingMethod"}, + { 0x1c, "EXIF_GPSAreaInformation"}, + { 0x1d, "EXIF_GPSDateStamp"}, + { 0x1e, "EXIF_GPSDifferential"}, + { 0xffff, ""} +}; + +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, ""} +}; + + +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"}, + { 0x0000, ""} +}; + +typedef enum { + TIFF_NOTYPE = 0, /* placeholder */ + TIFF_BYTE = 1, /* 8-bit unsigned integer */ + TIFF_ASCII = 2, /* 8-bit bytes w/ last byte null */ + TIFF_SHORT = 3, /* 16-bit unsigned integer */ + TIFF_LONG = 4, /* 32-bit unsigned integer */ + TIFF_RATIONAL = 5, /* 64-bit unsigned fraction */ + TIFF_SBYTE = 6, /* !8-bit signed integer */ + TIFF_UNDEFINED = 7, /* !8-bit untyped data */ + TIFF_SSHORT = 8, /* !16-bit signed integer */ + TIFF_SLONG = 9, /* !32-bit signed integer */ + TIFF_SRATIONAL = 10, /* !64-bit signed fraction */ + TIFF_FLOAT = 11, /* !32-bit IEEE floating point */ + TIFF_DOUBLE = 12, /* !64-bit IEEE floating point */ + TIFF_IFD = 13 /* %32-bit unsigned integer (offset) */ +} GDALEXIFTIFFDataType; + +/* + * TIFF Image File Directories are comprised of a table of field + * descriptors of the form shown below. The table is sorted in + * ascending order by tag. The values associated with each entry are + * disjoint and may appear anywhere in the file (so long as they are + * placed on a word boundary). + * + * If the value is 4 bytes or less, then it is placed in the offset + * field to save space. If the value is less than 4 bytes, it is + * left-justified in the offset field. + */ +typedef struct { + GUInt16 tdir_tag; /* see below */ + GUInt16 tdir_type; /* data type; see below */ + GUInt32 tdir_count; /* number of items; length in spec */ + GUInt32 tdir_offset; /* byte offset to field data */ +} 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); +CPL_C_END diff --git a/modules/globebrowsing/ext/gdal/include/gdalgeorefpamdataset.h b/modules/globebrowsing/ext/gdal/include/gdalgeorefpamdataset.h new file mode 100644 index 0000000000..749cdb89a1 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdalgeorefpamdataset.h @@ -0,0 +1,57 @@ +/****************************************************************************** + * $Id$ + * + * Project: GDAL + * Purpose: GDALPamDataset with internal storage for georeferencing, with + * priority for PAM over internal georeferencing + * Author: Even Rouault + * + ****************************************************************************** + * Copyright (c) 2013, Even Rouault + * + * 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_GEOREF_PAM_DATASET_H_INCLUDED +#define GDAL_GEOREF_PAM_DATASET_H_INCLUDED + +#include "gdal_pam.h" + +class CPL_DLL GDALGeorefPamDataset : public GDALPamDataset +{ + protected: + bool bGeoTransformValid; + double adfGeoTransform[6]; + char *pszProjection; + int nGCPCount; + GDAL_GCP *pasGCPList; + + public: + GDALGeorefPamDataset(); + virtual ~GDALGeorefPamDataset(); + + virtual CPLErr GetGeoTransform( double * ); + virtual const char *GetProjectionRef(); + + virtual int GetGCPCount(); + virtual const char *GetGCPProjection(); + virtual const GDAL_GCP *GetGCPs(); +}; + +#endif /* GDAL_GEOREF_PAM_DATASET_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/gdalgrid.h b/modules/globebrowsing/ext/gdal/include/gdalgrid.h new file mode 100644 index 0000000000..3f3c4c77c9 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdalgrid.h @@ -0,0 +1,137 @@ +/****************************************************************************** + * $Id$ + * + * 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 + * Copyright (c) 2012, Even Rouault + * + * 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 */ diff --git a/modules/globebrowsing/ext/gdal/include/gdalgrid_priv.h b/modules/globebrowsing/ext/gdal/include/gdalgrid_priv.h new file mode 100644 index 0000000000..d54ea41762 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdalgrid_priv.h @@ -0,0 +1,106 @@ +/****************************************************************************** + * $Id$ + * + * Project: GDAL Gridding API. + * Purpose: Prototypes, and definitions for of GDAL scattered data gridder. + * Author: Even Rouault, + * + ****************************************************************************** + * Copyright (c) 2013, Even Rouault + * + * 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 diff --git a/modules/globebrowsing/ext/gdal/include/gdaljp2abstractdataset.h b/modules/globebrowsing/ext/gdal/include/gdaljp2abstractdataset.h new file mode 100644 index 0000000000..2bd5562121 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdaljp2abstractdataset.h @@ -0,0 +1,60 @@ +/****************************************************************************** + * $Id$ + * + * Project: GDAL + * Purpose: GDALGeorefPamDataset with helper to read georeferencing and other + * metadata from JP2Boxes + * Author: Even Rouault + * + ****************************************************************************** + * Copyright (c) 2013, Even Rouault + * + * 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_JP2_ABSTRACT_DATASET_H_INCLUDED +#define GDAL_JP2_ABSTRACT_DATASET_H_INCLUDED + +#include "gdalgeorefpamdataset.h" + +class CPL_DLL GDALJP2AbstractDataset: public GDALGeorefPamDataset +{ + char* pszWldFilename; + + GDALDataset* poMemDS; + char** papszMetadataFiles; + + protected: + virtual int CloseDependentDatasets(); + + public: + GDALJP2AbstractDataset(); + virtual ~GDALJP2AbstractDataset(); + + void LoadJP2Metadata(GDALOpenInfo* poOpenInfo, + const char* pszOverrideFilename = NULL); + void LoadVectorLayers(int bOpenRemoteResources = FALSE); + + virtual char **GetFileList(void); + + virtual int GetLayerCount(); + virtual OGRLayer *GetLayer(int i); +}; + +#endif /* GDAL_JP2_ABSTRACT_DATASET_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/gdaljp2metadata.h b/modules/globebrowsing/ext/gdal/include/gdaljp2metadata.h new file mode 100644 index 0000000000..638bff3cef --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdaljp2metadata.h @@ -0,0 +1,196 @@ +/****************************************************************************** + * $Id$ + * + * Project: GDAL + * Purpose: JP2 Box Reader (and GMLJP2 Interpreter) + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 2005, Frank Warmerdam + * Copyright (c) 2010-2013, Even Rouault + * + * 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_JP2READER_H_INCLUDED +#define GDAL_JP2READER_H_INCLUDED + +#include "cpl_conv.h" +#include "cpl_minixml.h" +#include "cpl_vsi.h" +#include "gdal.h" +#include "gdal_priv.h" + +/************************************************************************/ +/* GDALJP2Box */ +/************************************************************************/ + +class CPL_DLL GDALJP2Box +{ + + VSILFILE *fpVSIL; + + char szBoxType[5]; + + GIntBig nBoxOffset; + GIntBig nBoxLength; + + GIntBig nDataOffset; + + GByte abyUUID[16]; + + GByte *pabyData; + +public: + GDALJP2Box( VSILFILE * = NULL ); + ~GDALJP2Box(); + + int SetOffset( GIntBig nNewOffset ); + int ReadBox(); + + int ReadFirst(); + int ReadNext(); + + int ReadFirstChild( GDALJP2Box *poSuperBox ); + int ReadNextChild( GDALJP2Box *poSuperBox ); + + GIntBig GetBoxOffset() const { return nBoxOffset; } + GIntBig GetBoxLength() const { return nBoxLength; } + + GIntBig GetDataOffset() const { return nDataOffset; } + GIntBig GetDataLength(); + + const char *GetType() { return szBoxType; } + + GByte *ReadBoxData(); + + int IsSuperBox(); + + int DumpReadable( FILE *, int nIndentLevel = 0 ); + + VSILFILE *GetFILE() { return fpVSIL; } + + const GByte *GetUUID() { return abyUUID; } + + // write support + void SetType( const char * ); + void SetWritableData( int nLength, const GByte *pabyData ); + void AppendWritableData( int nLength, const void *pabyDataIn ); + void AppendUInt32( GUInt32 nVal ); + void AppendUInt16( GUInt16 nVal ); + void AppendUInt8( GByte nVal ); + const GByte*GetWritableData() { return pabyData; } + + // factory methods. + static GDALJP2Box *CreateSuperBox( const char* pszType, + int nCount, GDALJP2Box **papoBoxes ); + static GDALJP2Box *CreateAsocBox( int nCount, GDALJP2Box **papoBoxes ); + static GDALJP2Box *CreateLblBox( const char *pszLabel ); + static GDALJP2Box *CreateLabelledXMLAssoc( const char *pszLabel, + const char *pszXML ); + static GDALJP2Box *CreateUUIDBox( const GByte *pabyUUID, + int nDataSize, const GByte *pabyData ); +}; + +/************************************************************************/ +/* GDALJP2Metadata */ +/************************************************************************/ + +typedef struct _GDALJP2GeoTIFFBox GDALJP2GeoTIFFBox; + +class CPL_DLL GDALJP2Metadata + +{ +private: + void CollectGMLData( GDALJP2Box * ); + int GMLSRSLookup( const char *pszURN ); + + int nGeoTIFFBoxesCount; + GDALJP2GeoTIFFBox *pasGeoTIFFBoxes; + + int nMSIGSize; + GByte *pabyMSIGData; + + int GetGMLJP2GeoreferencingInfo( int& nEPSGCode, + double adfOrigin[2], + double adfXVector[2], + double adfYVector[2], + const char*& pszComment, + CPLString& osDictBox, + int& bNeedAxisFlip ); + static CPLXMLNode* CreateGDALMultiDomainMetadataXML( + GDALDataset* poSrcDS, + int bMainMDDomainOnly ); + +public: + char **papszGMLMetadata; + + int bHaveGeoTransform; + double adfGeoTransform[6]; + int bPixelIsPoint; + + char *pszProjection; + + int nGCPCount; + GDAL_GCP *pasGCPList; + + char **papszRPCMD; + + char **papszMetadata; /* TIFFTAG_?RESOLUTION* for now from resd box */ + char *pszXMPMetadata; + char *pszGDALMultiDomainMetadata; /* as serialized XML */ + char *pszXMLIPR; /* if an IPR box with XML content has been found */ + +public: + GDALJP2Metadata(); + ~GDALJP2Metadata(); + + int ReadBoxes( VSILFILE * fpVSIL ); + + int ParseJP2GeoTIFF(); + int ParseMSIG(); + int ParseGMLCoverageDesc(); + + int ReadAndParse( VSILFILE * fpVSIL ); + int ReadAndParse( const char *pszFilename ); + + // Write oriented. + void SetProjection( const char *pszWKT ); + void SetGeoTransform( double * ); + void SetGCPs( int, const GDAL_GCP * ); + void SetRPCMD( char** papszRPCMDIn ); + + GDALJP2Box *CreateJP2GeoTIFF(); + GDALJP2Box *CreateGMLJP2( int nXSize, int nYSize ); + GDALJP2Box *CreateGMLJP2V2( int nXSize, int nYSize, + const char* pszDefFilename, + GDALDataset* poSrcDS ); + + static GDALJP2Box* CreateGDALMultiDomainMetadataXMLBox( + GDALDataset* poSrcDS, + int bMainMDDomainOnly ); + static GDALJP2Box** CreateXMLBoxes( GDALDataset* poSrcDS, + int* pnBoxes ); + static GDALJP2Box *CreateXMPBox ( GDALDataset* poSrcDS ); + static GDALJP2Box *CreateIPRBox ( GDALDataset* poSrcDS ); + static int IsUUID_MSI(const GByte *abyUUID); + static int IsUUID_XMP(const GByte *abyUUID); +}; + +#endif /* ndef GDAL_JP2READER_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/gdaljp2metadatagenerator.h b/modules/globebrowsing/ext/gdal/include/gdaljp2metadatagenerator.h new file mode 100644 index 0000000000..88de9b4c9e --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdaljp2metadatagenerator.h @@ -0,0 +1,40 @@ +/****************************************************************************** + * $Id$ + * + * Project: GDAL + * Purpose: GDALJP2Metadata: metadata generator + * Author: Even Rouault + * + ****************************************************************************** + * Copyright (c) 2015, European Union Satellite Centre + * + * 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_JP2METADATA_GENERATOR_H_INCLUDED +#define GDAL_JP2METADATA_GENERATOR_H_INCLUDED + + +#include "cpl_string.h" +#include "cpl_minixml.h" + +CPLXMLNode* GDALGMLJP2GenerateMetadata(const CPLString& osTemplateFile, + const CPLString& osSourceFile); + +#endif /* GDAL_JP2METADATA_GENERATOR_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/gdalpansharpen.h b/modules/globebrowsing/ext/gdal/include/gdalpansharpen.h new file mode 100644 index 0000000000..f5ae8b74b1 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdalpansharpen.h @@ -0,0 +1,270 @@ +/****************************************************************************** + * $Id$ + * + * Project: GDAL Pansharpening module + * Purpose: Prototypes, and definitions for pansharpening related work. + * Author: Even Rouault + * + ****************************************************************************** + * Copyright (c) 2015, Even Rouault + * + * 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 +#include "gdal_priv.h" +#include "cpl_worker_thread_pool.h" + +#ifdef DEBUG_TIMING +#include +#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 anInputBands; + std::vector aVDS; // to destroy + std::vector 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 void WeightedBroveyWithNoData( + const WorkDataType* pPanBuffer, + const WorkDataType* pUpsampledSpectralBuffer, + OutDataType* pDataBuf, + int nValues, + int nBandValues, + WorkDataType nMaxValue) const; + template void WeightedBrovey3( + const WorkDataType* pPanBuffer, + const WorkDataType* pUpsampledSpectralBuffer, + OutDataType* pDataBuf, + int nValues, + int nBandValues, + WorkDataType nMaxValue) const; + template void WeightedBrovey( + const WorkDataType* pPanBuffer, + const WorkDataType* pUpsampledSpectralBuffer, + OutDataType* pDataBuf, + int nValues, + int nBandValues, + WorkDataType nMaxValue) const; + template CPLErr WeightedBrovey( + const WorkDataType* pPanBuffer, + const WorkDataType* pUpsampledSpectralBuffer, + void *pDataBuf, + GDALDataType eBufDataType, + int nValues, + int nBandValues, + WorkDataType nMaxValue) const; + template 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 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 */ diff --git a/modules/globebrowsing/ext/gdal/include/gdalsse_priv.h b/modules/globebrowsing/ext/gdal/include/gdalsse_priv.h new file mode 100644 index 0000000000..fb0d1b1019 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdalsse_priv.h @@ -0,0 +1,855 @@ +/****************************************************************************** + * $Id$ + * + * Project: GDAL + * Purpose: SSE2 helper + * Author: Even Rouault + * + ****************************************************************************** + * Copyright (c) 2014, Even Rouault + * + * 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 GDALSSE_PRIV_H_INCLUDED +#define GDALSSE_PRIV_H_INCLUDED + +#include "cpl_port.h" + +/* We restrict to 64bit processors because they are guaranteed to have SSE2 */ +/* Could possibly be used too on 32bit, but we would need to check at runtime */ +#if (defined(__x86_64) || defined(_M_X64)) && !defined(USE_SSE2_EMULATION) + +/* Requires SSE2 */ +#include +#include + +class XMMReg2Double +{ + public: + __m128d xmm; + + /* coverity[uninit_member] */ + XMMReg2Double() {} + + XMMReg2Double(double val) { xmm = _mm_load_sd (&val); } + XMMReg2Double(const XMMReg2Double& other) : xmm(other.xmm) {} + + static inline XMMReg2Double Zero() + { + XMMReg2Double reg; + reg.Zeroize(); + return reg; + } + + static inline XMMReg2Double Load1ValHighAndLow(const double* ptr) + { + XMMReg2Double reg; + reg.nsLoad1ValHighAndLow(ptr); + return reg; + } + + static inline XMMReg2Double Load2Val(const double* ptr) + { + XMMReg2Double reg; + reg.nsLoad2Val(ptr); + return reg; + } + + static inline XMMReg2Double Load2Val(const float* ptr) + { + XMMReg2Double reg; + reg.nsLoad2Val(ptr); + return reg; + } + + static inline XMMReg2Double Load2ValAligned(const double* ptr) + { + XMMReg2Double reg; + reg.nsLoad2ValAligned(ptr); + return reg; + } + + static inline XMMReg2Double Load2Val(const unsigned char* ptr) + { + XMMReg2Double reg; + reg.nsLoad2Val(ptr); + return reg; + } + + static inline XMMReg2Double Load2Val(const short* ptr) + { + XMMReg2Double reg; + reg.nsLoad2Val(ptr); + return reg; + } + + static inline XMMReg2Double Load2Val(const unsigned short* ptr) + { + XMMReg2Double reg; + reg.nsLoad2Val(ptr); + return reg; + } + + static inline XMMReg2Double Equals(const XMMReg2Double& expr1, const XMMReg2Double& expr2) + { + XMMReg2Double reg; + reg.xmm = _mm_cmpeq_pd(expr1.xmm, expr2.xmm); + return reg; + } + + static inline XMMReg2Double NotEquals(const XMMReg2Double& expr1, const XMMReg2Double& expr2) + { + XMMReg2Double reg; + reg.xmm = _mm_cmpneq_pd(expr1.xmm, expr2.xmm); + return reg; + } + + static inline XMMReg2Double Greater(const XMMReg2Double& expr1, const XMMReg2Double& expr2) + { + XMMReg2Double reg; + reg.xmm = _mm_cmpgt_pd(expr1.xmm, expr2.xmm); + return reg; + } + + static inline XMMReg2Double And(const XMMReg2Double& expr1, const XMMReg2Double& expr2) + { + XMMReg2Double reg; + reg.xmm = _mm_and_pd(expr1.xmm, expr2.xmm); + return reg; + } + + static inline XMMReg2Double Ternary(const XMMReg2Double& cond, const XMMReg2Double& true_expr, const XMMReg2Double& false_expr) + { + XMMReg2Double reg; + reg.xmm = _mm_or_pd(_mm_and_pd (cond.xmm, true_expr.xmm), _mm_andnot_pd(cond.xmm, false_expr.xmm)); + return reg; + } + + static inline XMMReg2Double Min(const XMMReg2Double& expr1, const XMMReg2Double& expr2) + { + XMMReg2Double reg; + reg.xmm = _mm_min_pd(expr1.xmm, expr2.xmm); + return reg; + } + + inline void nsLoad1ValHighAndLow(const double* ptr) + { + xmm = _mm_load1_pd(ptr); + } + + inline void nsLoad2Val(const double* ptr) + { + xmm = _mm_loadu_pd(ptr); + } + + inline void nsLoad2ValAligned(const double* pval) + { + xmm = _mm_load_pd(pval); + } + + inline void nsLoad2Val(const float* pval) + { + __m128 temp1 = _mm_load_ss(pval); + __m128 temp2 = _mm_load_ss(pval + 1); + temp1 = _mm_shuffle_ps(temp1, temp2, _MM_SHUFFLE(1,0,1,0)); + temp1 = _mm_shuffle_ps(temp1, temp1, _MM_SHUFFLE(3,3,2,0)); + xmm = _mm_cvtps_pd(temp1); + } + + inline void nsLoad2Val(const unsigned char* ptr) + { +#ifdef CPL_CPU_REQUIRES_ALIGNED_ACCESS + unsigned short s; + memcpy(&s, ptr, 2); + __m128i xmm_i = _mm_cvtsi32_si128(s); +#else + __m128i xmm_i = _mm_cvtsi32_si128(*(unsigned short*)(ptr)); +#endif + xmm_i = _mm_unpacklo_epi8(xmm_i, _mm_setzero_si128()); + xmm_i = _mm_unpacklo_epi16(xmm_i, _mm_setzero_si128()); + xmm = _mm_cvtepi32_pd(xmm_i); + } + + inline void nsLoad2Val(const short* ptr) + { + 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_srai_epi32(xmm_i, 16); /* 0|0|0|0|b|b|a|a --> 0|0|0|0|sign(b)|b|sign(a)|a */ + xmm = _mm_cvtepi32_pd(xmm_i); + } + + inline void nsLoad2Val(const unsigned short* ptr) + { + 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 */ + xmm = _mm_cvtepi32_pd(xmm_i); + } + + static inline void Load4Val(const unsigned char* ptr, XMMReg2Double& low, XMMReg2Double& high) + { +#ifdef CPL_CPU_REQUIRES_ALIGNED_ACCESS + int i; + memcpy(&i, ptr, 4); + __m128i xmm_i = _mm_cvtsi32_si128(i); +#else + __m128i xmm_i = _mm_cvtsi32_si128(*(int*)(ptr)); +#endif + xmm_i = _mm_unpacklo_epi8(xmm_i, _mm_setzero_si128()); + xmm_i = _mm_unpacklo_epi16(xmm_i, _mm_setzero_si128()); + low.xmm = _mm_cvtepi32_pd(xmm_i); + high.xmm = _mm_cvtepi32_pd(_mm_shuffle_epi32(xmm_i,_MM_SHUFFLE(3,2,3,2))); + } + + static inline void Load4Val(const short* ptr, XMMReg2Double& low, XMMReg2Double& high) + { + low.nsLoad2Val(ptr); + high.nsLoad2Val(ptr+2); + } + + static inline void Load4Val(const unsigned short* ptr, XMMReg2Double& low, XMMReg2Double& high) + { + low.nsLoad2Val(ptr); + high.nsLoad2Val(ptr+2); + } + + static inline void Load4Val(const double* ptr, XMMReg2Double& low, XMMReg2Double& high) + { + low.nsLoad2Val(ptr); + high.nsLoad2Val(ptr+2); + } + + static inline void Load4Val(const float* ptr, XMMReg2Double& low, XMMReg2Double& high) + { + __m128 temp1 = _mm_loadu_ps(ptr); + __m128 temp2 = _mm_shuffle_ps(temp1, temp1, _MM_SHUFFLE(3,2,3,2)); + low.xmm = _mm_cvtps_pd(temp1); + high.xmm = _mm_cvtps_pd(temp2); + } + + inline void Zeroize() + { + xmm = _mm_setzero_pd(); + } + + inline XMMReg2Double& operator= (const XMMReg2Double& other) + { + xmm = other.xmm; + return *this; + } + + inline XMMReg2Double& operator+= (const XMMReg2Double& other) + { + xmm = _mm_add_pd(xmm, other.xmm); + return *this; + } + + inline XMMReg2Double& operator*= (const XMMReg2Double& other) + { + xmm = _mm_mul_pd(xmm, other.xmm); + return *this; + } + + inline XMMReg2Double operator+ (const XMMReg2Double& other) const + { + XMMReg2Double ret; + ret.xmm = _mm_add_pd(xmm, other.xmm); + return ret; + } + + inline XMMReg2Double operator- (const XMMReg2Double& other) const + { + XMMReg2Double ret; + ret.xmm = _mm_sub_pd(xmm, other.xmm); + return ret; + } + + inline XMMReg2Double operator* (const XMMReg2Double& other) const + { + XMMReg2Double ret; + ret.xmm = _mm_mul_pd(xmm, other.xmm); + return ret; + } + + inline XMMReg2Double operator/ (const XMMReg2Double& other) const + { + XMMReg2Double ret; + ret.xmm = _mm_div_pd(xmm, other.xmm); + return ret; + } + + inline void AddLowAndHigh() + { + __m128d xmm2; + xmm2 = _mm_shuffle_pd(xmm,xmm,_MM_SHUFFLE2(0,1)); /* transfer high word into low word of xmm2 */ + xmm = _mm_add_pd(xmm, xmm2); + } + + inline void Store2Double(double* pval) const + { + _mm_storeu_pd(pval, xmm); + } + + inline void Store2DoubleAligned(double* pval) const + { + _mm_store_pd(pval, xmm); + } + + void Store2Val(unsigned short* ptr) const + { + __m128i tmp = _mm_cvtpd_epi32(xmm); /* Convert the 2 double values to 2 integers */ + ptr[0] = (GUInt16)_mm_extract_epi16(tmp, 0); + ptr[1] = (GUInt16)_mm_extract_epi16(tmp, 2); + } + + inline operator double () const + { + double val; + _mm_store_sd(&val, xmm); + return val; + } +}; + +#else + +#warning "Software emulation of SSE2 !" + +class XMMReg2Double +{ + public: + double low; + double high; + + XMMReg2Double() {} + XMMReg2Double(double val) { low = val; high = 0.0; } + XMMReg2Double(const XMMReg2Double& other) : low(other.low), high(other.high) {} + + static inline XMMReg2Double Zero() + { + XMMReg2Double reg; + reg.Zeroize(); + return reg; + } + + static inline XMMReg2Double Load1ValHighAndLow(const double* ptr) + { + XMMReg2Double reg; + reg.nsLoad1ValHighAndLow(ptr); + return reg; + } + + static inline XMMReg2Double Equals(const XMMReg2Double& expr1, const XMMReg2Double& expr2) + { + XMMReg2Double reg; + + if (expr1.low == expr2.low) + memset(&(reg.low), 0xFF, sizeof(double)); + else + reg.low = 0; + + if (expr1.high == expr2.high) + memset(&(reg.high), 0xFF, sizeof(double)); + else + reg.high = 0; + + return reg; + } + + static inline XMMReg2Double NotEquals(const XMMReg2Double& expr1, const XMMReg2Double& expr2) + { + XMMReg2Double reg; + + if (expr1.low != expr2.low) + memset(&(reg.low), 0xFF, sizeof(double)); + else + reg.low = 0; + + if (expr1.high != expr2.high) + memset(&(reg.high), 0xFF, sizeof(double)); + else + reg.high = 0; + + return reg; + } + + static inline XMMReg2Double Greater(const XMMReg2Double& expr1, const XMMReg2Double& expr2) + { + XMMReg2Double reg; + + if (expr1.low > expr2.low) + memset(&(reg.low), 0xFF, sizeof(double)); + else + reg.low = 0; + + if (expr1.high > expr2.high) + memset(&(reg.high), 0xFF, sizeof(double)); + else + reg.high = 0; + + return reg; + } + + static inline XMMReg2Double And(const XMMReg2Double& expr1, const XMMReg2Double& expr2) + { + XMMReg2Double reg; + int low1[2], high1[2]; + int low2[2], high2[2]; + memcpy(low1, &expr1.low, sizeof(double)); + memcpy(high1, &expr1.high, sizeof(double)); + memcpy(low2, &expr2.low, sizeof(double)); + memcpy(high2, &expr2.high, sizeof(double)); + low1[0] &= low2[0]; + low1[1] &= low2[1]; + high1[0] &= high2[0]; + high1[1] &= high2[1]; + memcpy(®.low, low1, sizeof(double)); + memcpy(®.high, high1, sizeof(double)); + return reg; + } + + static inline XMMReg2Double Ternary(const XMMReg2Double& cond, const XMMReg2Double& true_expr, const XMMReg2Double& false_expr) + { + XMMReg2Double reg; + if( cond.low ) + reg.low = true_expr.low; + else + reg.low = false_expr.low; + if( cond.high ) + reg.high = true_expr.high; + else + reg.high = false_expr.high; + return reg; + } + + static inline XMMReg2Double Min(const XMMReg2Double& expr1, const XMMReg2Double& expr2) + { + XMMReg2Double reg; + reg.low = (expr1.low < expr2.low) ? expr1.low : expr2.high; + reg.high = (expr1.high < expr2.high) ? expr1.high : expr2.low; + return reg; + } + + static inline XMMReg2Double Load2Val(const double* ptr) + { + XMMReg2Double reg; + reg.nsLoad2Val(ptr); + return reg; + } + + static inline XMMReg2Double Load2ValAligned(const double* ptr) + { + XMMReg2Double reg; + reg.nsLoad2ValAligned(ptr); + return reg; + } + + static inline XMMReg2Double Load2Val(const float* ptr) + { + XMMReg2Double reg; + reg.nsLoad2Val(ptr); + return reg; + } + + static inline XMMReg2Double Load2Val(const unsigned char* ptr) + { + XMMReg2Double reg; + reg.nsLoad2Val(ptr); + return reg; + } + + static inline XMMReg2Double Load2Val(const short* ptr) + { + XMMReg2Double reg; + reg.nsLoad2Val(ptr); + return reg; + } + + static inline XMMReg2Double Load2Val(const unsigned short* ptr) + { + XMMReg2Double reg; + reg.nsLoad2Val(ptr); + return reg; + } + + inline void nsLoad1ValHighAndLow(const double* pval) + { + low = pval[0]; + high = pval[0]; + } + + inline void nsLoad2Val(const double* pval) + { + low = pval[0]; + high = pval[1]; + } + + inline void nsLoad2ValAligned(const double* pval) + { + low = pval[0]; + high = pval[1]; + } + + inline void nsLoad2Val(const float* pval) + { + low = pval[0]; + high = pval[1]; + } + + inline void nsLoad2Val(const unsigned char* ptr) + { + low = ptr[0]; + high = ptr[1]; + } + + inline void nsLoad2Val(const short* ptr) + { + low = ptr[0]; + high = ptr[1]; + } + + inline void nsLoad2Val(const unsigned short* ptr) + { + low = ptr[0]; + high = ptr[1]; + } + + static inline void Load4Val(const unsigned char* ptr, XMMReg2Double& low, XMMReg2Double& high) + { + low.low = ptr[0]; + low.high = ptr[1]; + high.low = ptr[2]; + high.high = ptr[3]; + } + + static inline void Load4Val(const short* ptr, XMMReg2Double& low, XMMReg2Double& high) + { + low.nsLoad2Val(ptr); + high.nsLoad2Val(ptr+2); + } + + static inline void Load4Val(const unsigned short* ptr, XMMReg2Double& low, XMMReg2Double& high) + { + low.nsLoad2Val(ptr); + high.nsLoad2Val(ptr+2); + } + + static inline void Load4Val(const double* ptr, XMMReg2Double& low, XMMReg2Double& high) + { + low.nsLoad2Val(ptr); + high.nsLoad2Val(ptr+2); + } + + static inline void Load4Val(const float* ptr, XMMReg2Double& low, XMMReg2Double& high) + { + low.nsLoad2Val(ptr); + high.nsLoad2Val(ptr+2); + } + + inline void Zeroize() + { + low = 0.0; + high = 0.0; + } + + inline XMMReg2Double& operator= (const XMMReg2Double& other) + { + low = other.low; + high = other.high; + return *this; + } + + inline XMMReg2Double& operator+= (const XMMReg2Double& other) + { + low += other.low; + high += other.high; + return *this; + } + + inline XMMReg2Double& operator*= (const XMMReg2Double& other) + { + low *= other.low; + high *= other.high; + return *this; + } + + inline XMMReg2Double operator+ (const XMMReg2Double& other) const + { + XMMReg2Double ret; + ret.low = low + other.low; + ret.high = high + other.high; + return ret; + } + + inline XMMReg2Double operator- (const XMMReg2Double& other) const + { + XMMReg2Double ret; + ret.low = low - other.low; + ret.high = high - other.high; + return ret; + } + + inline XMMReg2Double operator* (const XMMReg2Double& other) const + { + XMMReg2Double ret; + ret.low = low * other.low; + ret.high = high * other.high; + return ret; + } + + inline XMMReg2Double operator/ (const XMMReg2Double& other) const + { + XMMReg2Double ret; + ret.low = low / other.low; + ret.high = high / other.high; + return ret; + } + + inline void AddLowAndHigh() + { + double add = low + high; + low = add; + high = add; + } + + inline void Store2Double(double* pval) const + { + pval[0] = low; + pval[1] = high; + } + + inline void Store2DoubleAligned(double* pval) const + { + pval[0] = low; + pval[1] = high; + } + + void Store2Val(unsigned short* ptr) const + { + ptr[0] = (GUInt16)low; + ptr[1] = (GUInt16)high; + } + + inline operator double () const + { + return low; + } +}; + +#endif /* defined(__x86_64) || defined(_M_X64) */ + +class XMMReg4Double +{ + public: + XMMReg2Double low, high; + + XMMReg4Double() {} + XMMReg4Double(const XMMReg4Double& other) : low(other.low), high(other.high) {} + + static inline XMMReg4Double Zero() + { + XMMReg4Double reg; + reg.low.Zeroize(); + reg.high.Zeroize(); + return reg; + } + + static inline XMMReg4Double Load1ValHighAndLow(const double* ptr) + { + XMMReg4Double reg; + reg.low.nsLoad1ValHighAndLow(ptr); + reg.high = reg.low; + return reg; + } + + static inline XMMReg4Double Load4Val(const unsigned char* ptr) + { + XMMReg4Double reg; + XMMReg2Double::Load4Val(ptr, reg.low, reg.high); + return reg; + } + + static inline XMMReg4Double Load4Val(const short* ptr) + { + XMMReg4Double reg; + reg.low.nsLoad2Val(ptr); + reg.high.nsLoad2Val(ptr+2); + return reg; + } + + static inline XMMReg4Double Load4Val(const unsigned short* ptr) + { + XMMReg4Double reg; + reg.low.nsLoad2Val(ptr); + reg.high.nsLoad2Val(ptr+2); + return reg; + } + + static inline XMMReg4Double Load4Val(const double* ptr) + { + XMMReg4Double reg; + reg.low.nsLoad2Val(ptr); + reg.high.nsLoad2Val(ptr+2); + return reg; + } + + static inline XMMReg4Double Load4ValAligned(const double* ptr) + { + XMMReg4Double reg; + reg.low.nsLoad2ValAligned(ptr); + reg.high.nsLoad2ValAligned(ptr+2); + return reg; + } + + static inline XMMReg4Double Load4Val(const float* ptr) + { + XMMReg4Double reg; + XMMReg2Double::Load4Val(ptr, reg.low, reg.high); + return reg; + } + + static inline XMMReg4Double Equals(const XMMReg4Double& expr1, const XMMReg4Double& expr2) + { + XMMReg4Double reg; + reg.low = XMMReg2Double::Equals(expr1.low, expr2.low); + reg.high = XMMReg2Double::Equals(expr1.high, expr2.high); + return reg; + } + + static inline XMMReg4Double NotEquals(const XMMReg4Double& expr1, const XMMReg4Double& expr2) + { + XMMReg4Double reg; + reg.low = XMMReg2Double::NotEquals(expr1.low, expr2.low); + reg.high = XMMReg2Double::NotEquals(expr1.high, expr2.high); + return reg; + } + + static inline XMMReg4Double Greater(const XMMReg4Double& expr1, const XMMReg4Double& expr2) + { + XMMReg4Double reg; + reg.low = XMMReg2Double::Greater(expr1.low, expr2.low); + reg.high = XMMReg2Double::Greater(expr1.high, expr2.high); + return reg; + } + + static inline XMMReg4Double And(const XMMReg4Double& expr1, const XMMReg4Double& expr2) + { + XMMReg4Double reg; + reg.low = XMMReg2Double::And(expr1.low, expr2.low); + reg.high = XMMReg2Double::And(expr1.high, expr2.high); + return reg; + } + + static inline XMMReg4Double Ternary(const XMMReg4Double& cond, const XMMReg4Double& true_expr, const XMMReg4Double& false_expr) + { + XMMReg4Double reg; + reg.low = XMMReg2Double::Ternary(cond.low, true_expr.low, false_expr.low); + reg.high = XMMReg2Double::Ternary(cond.high, true_expr.high, false_expr.high); + return reg; + } + + static inline XMMReg4Double Min(const XMMReg4Double& expr1, const XMMReg4Double& expr2) + { + XMMReg4Double reg; + reg.low = XMMReg2Double::Min(expr1.low, expr2.low); + reg.high = XMMReg2Double::Min(expr1.high, expr2.high); + return reg; + } + + inline XMMReg4Double& operator= (const XMMReg4Double& other) + { + low = other.low; + high = other.high; + return *this; + } + + inline XMMReg4Double& operator+= (const XMMReg4Double& other) + { + low += other.low; + high += other.high; + return *this; + } + + inline XMMReg4Double& operator*= (const XMMReg4Double& other) + { + low *= other.low; + high *= other.high; + return *this; + } + + inline XMMReg4Double operator+ (const XMMReg4Double& other) const + { + XMMReg4Double ret; + ret.low = low + other.low; + ret.high = high + other.high; + return ret; + } + + inline XMMReg4Double operator- (const XMMReg4Double& other) const + { + XMMReg4Double ret; + ret.low = low - other.low; + ret.high = high - other.high; + return ret; + } + + inline XMMReg4Double operator* (const XMMReg4Double& other) const + { + XMMReg4Double ret; + ret.low = low * other.low; + ret.high = high * other.high; + return ret; + } + + inline XMMReg4Double operator/ (const XMMReg4Double& other) const + { + XMMReg4Double ret; + ret.low = low / other.low; + ret.high = high / other.high; + return ret; + } + + inline void AddLowAndHigh() + { + low = low + high; + low.AddLowAndHigh(); + } + + inline XMMReg2Double& GetLow() + { + return low; + } + + inline XMMReg2Double& GetHigh() + { + return high; + } + + void Store4Val(unsigned short* ptr) const + { + low.Store2Val(ptr); + high.Store2Val(ptr+2); + } +}; + +#endif /* GDALSSE_PRIV_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/gdalwarper.h b/modules/globebrowsing/ext/gdal/include/gdalwarper.h new file mode 100644 index 0000000000..9d88ff8a51 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdalwarper.h @@ -0,0 +1,459 @@ +/****************************************************************************** + * $Id$ + * + * 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 + * + * 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 */ diff --git a/modules/globebrowsing/ext/gdal/include/gdalwarpkernel_opencl.h b/modules/globebrowsing/ext/gdal/include/gdalwarpkernel_opencl.h new file mode 100644 index 0000000000..be3a1b32d7 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gdalwarpkernel_opencl.h @@ -0,0 +1,197 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenCL Image Reprojector + * Purpose: Implementation of the GDALWarpKernel reprojector in OpenCL. + * Author: Seth Price, seth@pricepages.org + * + ****************************************************************************** + * Copyright (c) 2010, Seth Price + * + * 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 +#else +#include +#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) */ diff --git a/modules/globebrowsing/ext/gdal/include/gvgcpfit.h b/modules/globebrowsing/ext/gdal/include/gvgcpfit.h new file mode 100644 index 0000000000..4496c5909c --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/gvgcpfit.h @@ -0,0 +1,94 @@ +#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 */ diff --git a/modules/globebrowsing/ext/gdal/include/internal_qhull_headers.h b/modules/globebrowsing/ext/gdal/include/internal_qhull_headers.h new file mode 100644 index 0000000000..61f2bf1d5b --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/internal_qhull_headers.h @@ -0,0 +1,1006 @@ +/****************************************************************************** + * + * Project: GDAL + * Purpose: Includes internal qhull headers + * Author: Even Rouault + * + ****************************************************************************** + * Copyright (c) 2015, Even Rouault + * + * 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 INTERNAL_QHULL_HEADERS_H +#define INTERNAL_QHULL_HEADERS_H + +#ifdef HAVE_GCC_SYSTEM_HEADER +#pragma GCC system_header +#endif + +#if defined(__MINGW64__) +/* See https://github.com/scipy/scipy/issues/3237 */ +/* This ensures that ptr_intT is a long lon on MinGW 64 */ +#define _MSC_VER 1 +#endif + +// To avoid issue with icc that defines a template in qhull_a.h +#if defined(__INTEL_COMPILER) +#define QHULL_OS_WIN +#endif + +/* Below a lot of renames and static definition of the symbols so as */ +/* to avoid "contaminating" with a potential external qhull */ +typedef struct setT gdal_setT; +typedef struct facetT gdal_facetT; +typedef struct vertexT gdal_vertexT; +typedef struct qhT gdal_qhT; +typedef struct ridgeT gdal_ridgeT; +#define gdal_realT double +#define gdal_pointT double +#define gdal_realT double +#define gdal_coordT double +#define gdal_boolT unsigned int + +#define qhmem gdal_qhmem +#define qh_rand_seed gdal_qh_rand_seed +#define qh_qh gdal_qh_qh +#define qh_qhstat gdal_qh_qhstat +#define qh_version gdal_qh_version +#define qhull_inuse gdal_qhull_inuse + +#define qh_compare_vertexpoint gdal_qh_compare_vertexpoint +static int qh_compare_vertexpoint(); + +#define qh_intcompare gdal_qh_intcompare + +#ifdef notdef + +Generated by the following Python script + manual cleaning of the result + +f = open('headers.txt') +for line in f.readlines(): + line = line[0:-1].strip() + if len(line) > 3 and line[0] != '#' and (line[-2:] == ');' or line[-1:] == ',') and \ + line.find('(') > 0 and line.find('=') < 0 and line.find('typedef') < 0 and line.find('are used by') < 0 and \ + line.find('&') < 0 and line.find('"') < 0 and line.find(' ') < line.find('('): + line = line[0:line.find('(')].strip() + last_star = line.rfind('*') + last_space = line.rfind(' ') + if last_star > last_space: + (type, name) = (line[0:last_star+1], line[last_star+1:]) + else: + (type, name) = (line[0:last_space], line[last_space+1:]) + type = type.strip() + print('#define %s gdal_%s' % (name, name)) + if type.find('void') != 0 and type.find('int') != 0 and type.find('char') != 0 and type.find('double') != 0 and type.find('unsigned') != 0: + type = 'gdal_' + type + print("static %s %s();" % (type, name)) +#endif + +#define qh_backnormal gdal_qh_backnormal +static void qh_backnormal(); +#define qh_distplane gdal_qh_distplane +static void qh_distplane(); +#define qh_findbest gdal_qh_findbest +static gdal_facetT * qh_findbest(); +#define qh_findbesthorizon gdal_qh_findbesthorizon +static gdal_facetT * qh_findbesthorizon(); +#define qh_findbestnew gdal_qh_findbestnew +static gdal_facetT * qh_findbestnew(); +#define qh_gausselim gdal_qh_gausselim +static void qh_gausselim(); +#define qh_getangle gdal_qh_getangle +static gdal_realT qh_getangle(); +#define qh_getcenter gdal_qh_getcenter +static gdal_pointT * qh_getcenter(); +#define qh_getcentrum gdal_qh_getcentrum +static gdal_pointT * qh_getcentrum(); +#define qh_getdistance gdal_qh_getdistance +static gdal_realT qh_getdistance(); +#define qh_normalize gdal_qh_normalize +static void qh_normalize(); +#define qh_normalize2 gdal_qh_normalize2 +static void qh_normalize2(); +#define qh_projectpoint gdal_qh_projectpoint +static gdal_pointT * qh_projectpoint(); +#define qh_setfacetplane gdal_qh_setfacetplane +static void qh_setfacetplane(); +#define qh_sethyperplane_det gdal_qh_sethyperplane_det +static void qh_sethyperplane_det(); +#define qh_sethyperplane_gauss gdal_qh_sethyperplane_gauss +static void qh_sethyperplane_gauss(); +#define qh_sharpnewfacets gdal_qh_sharpnewfacets +static gdal_boolT qh_sharpnewfacets(); +#define qh_copypoints gdal_qh_copypoints +static gdal_coordT * qh_copypoints(); +#define qh_crossproduct gdal_qh_crossproduct +static void qh_crossproduct(); +#define qh_determinant gdal_qh_determinant +static gdal_realT qh_determinant(); +#define qh_detjoggle gdal_qh_detjoggle +static gdal_realT qh_detjoggle(); +#define qh_detroundoff gdal_qh_detroundoff +static void qh_detroundoff(); +#define qh_detsimplex gdal_qh_detsimplex +static gdal_realT qh_detsimplex(); +#define qh_distnorm gdal_qh_distnorm +static gdal_realT qh_distnorm(); +#define qh_distround gdal_qh_distround +static gdal_realT qh_distround(); +#define qh_divzero gdal_qh_divzero +static gdal_realT qh_divzero(); +#define qh_facetarea gdal_qh_facetarea +static gdal_realT qh_facetarea(); +#define qh_facetarea_simplex gdal_qh_facetarea_simplex +static gdal_realT qh_facetarea_simplex(); +#define qh_facetcenter gdal_qh_facetcenter +static gdal_pointT * qh_facetcenter(); +#define qh_findgooddist gdal_qh_findgooddist +static gdal_facetT * qh_findgooddist(); +#define qh_getarea gdal_qh_getarea +static void qh_getarea(); +#define qh_gram_schmidt gdal_qh_gram_schmidt +static gdal_boolT qh_gram_schmidt(); +#define qh_inthresholds gdal_qh_inthresholds +static gdal_boolT qh_inthresholds(); +#define qh_joggleinput gdal_qh_joggleinput +static void qh_joggleinput(); +#define qh_maxabsval gdal_qh_maxabsval +static gdal_realT * qh_maxabsval(); +#define qh_maxmin gdal_qh_maxmin +static gdal_setT * qh_maxmin(); +#define qh_maxouter gdal_qh_maxouter +static gdal_realT qh_maxouter(); +#define qh_maxsimplex gdal_qh_maxsimplex +static void qh_maxsimplex(); +#define qh_minabsval gdal_qh_minabsval +static gdal_realT qh_minabsval(); +#define qh_mindiff gdal_qh_mindiff +static int qh_mindiff(); +#define qh_orientoutside gdal_qh_orientoutside +static gdal_boolT qh_orientoutside(); +#define qh_outerinner gdal_qh_outerinner +static void qh_outerinner(); +#define qh_pointdist gdal_qh_pointdist +static gdal_coordT qh_pointdist(); +#define qh_printmatrix gdal_qh_printmatrix +static void qh_printmatrix(); +#define qh_printpoints gdal_qh_printpoints +static void qh_printpoints(); +#define qh_projectinput gdal_qh_projectinput +static void qh_projectinput(); +#define qh_projectpoints gdal_qh_projectpoints +static void qh_projectpoints(); +#define qh_rotateinput gdal_qh_rotateinput +static void qh_rotateinput(); +#define qh_rotatepoints gdal_qh_rotatepoints +static void qh_rotatepoints(); +#define qh_scaleinput gdal_qh_scaleinput +static void qh_scaleinput(); +#define qh_scalelast gdal_qh_scalelast +static void qh_scalelast(); +#define qh_scalepoints gdal_qh_scalepoints +static void qh_scalepoints(); +#define qh_sethalfspace gdal_qh_sethalfspace +static gdal_boolT qh_sethalfspace(); +#define qh_sethalfspace_all gdal_qh_sethalfspace_all +static gdal_coordT * qh_sethalfspace_all(); +#define qh_voronoi_center gdal_qh_voronoi_center +static gdal_pointT * qh_voronoi_center(); +#define dfacet gdal_dfacet +static void dfacet(); +#define dvertex gdal_dvertex +static void dvertex(); +#define qh_compare_facetarea gdal_qh_compare_facetarea +static int qh_compare_facetarea(); +#define qh_compare_facetmerge gdal_qh_compare_facetmerge +static int qh_compare_facetmerge(); +#define qh_compare_facetvisit gdal_qh_compare_facetvisit +static int qh_compare_facetvisit(); +#define qh_copyfilename gdal_qh_copyfilename +static void qh_copyfilename(); +#define qh_countfacets gdal_qh_countfacets +static void qh_countfacets(); +#define qh_detvnorm gdal_qh_detvnorm +static gdal_pointT * qh_detvnorm(); +#define qh_detvridge gdal_qh_detvridge +static gdal_setT * qh_detvridge(); +#define qh_detvridge3 gdal_qh_detvridge3 +static gdal_setT * qh_detvridge3(); +#define qh_eachvoronoi gdal_qh_eachvoronoi +static int qh_eachvoronoi(); +#define qh_eachvoronoi_all gdal_qh_eachvoronoi_all +static int qh_eachvoronoi_all(); +#define qh_facet2point gdal_qh_facet2point +static void qh_facet2point(); +#define qh_facetvertices gdal_qh_facetvertices +static gdal_setT * qh_facetvertices(); +#define qh_geomplanes gdal_qh_geomplanes +static void qh_geomplanes(); +#define qh_markkeep gdal_qh_markkeep +static void qh_markkeep(); +#define qh_markvoronoi gdal_qh_markvoronoi +static gdal_setT * qh_markvoronoi(); +#define qh_order_vertexneighbors gdal_qh_order_vertexneighbors +static void qh_order_vertexneighbors(); +#define qh_prepare_output gdal_qh_prepare_output +static void qh_prepare_output(); +#define qh_printafacet gdal_qh_printafacet +static void qh_printafacet(); +#define qh_printbegin gdal_qh_printbegin +static void qh_printbegin(); +#define qh_printcenter gdal_qh_printcenter +static void qh_printcenter(); +#define qh_printcentrum gdal_qh_printcentrum +static void qh_printcentrum(); +#define qh_printend gdal_qh_printend +static void qh_printend(); +#define qh_printend4geom gdal_qh_printend4geom +static void qh_printend4geom(); +#define qh_printextremes gdal_qh_printextremes +static void qh_printextremes(); +#define qh_printextremes_2d gdal_qh_printextremes_2d +static void qh_printextremes_2d(); +#define qh_printextremes_d gdal_qh_printextremes_d +static void qh_printextremes_d(); +#define qh_printfacet gdal_qh_printfacet +static void qh_printfacet(); +#define qh_printfacet2math gdal_qh_printfacet2math +static void qh_printfacet2math(); +#define qh_printfacet2geom gdal_qh_printfacet2geom +static void qh_printfacet2geom(); +#define qh_printfacet2geom_points gdal_qh_printfacet2geom_points +static void qh_printfacet2geom_points(); +#define qh_printfacet3math gdal_qh_printfacet3math +static void qh_printfacet3math(); +#define qh_printfacet3geom_nonsimplicial gdal_qh_printfacet3geom_nonsimplicial +static void qh_printfacet3geom_nonsimplicial(); +#define qh_printfacet3geom_points gdal_qh_printfacet3geom_points +static void qh_printfacet3geom_points(); +#define qh_printfacet3geom_simplicial gdal_qh_printfacet3geom_simplicial +static void qh_printfacet3geom_simplicial(); +#define qh_printfacet3vertex gdal_qh_printfacet3vertex +static void qh_printfacet3vertex(); +#define qh_printfacet4geom_nonsimplicial gdal_qh_printfacet4geom_nonsimplicial +static void qh_printfacet4geom_nonsimplicial(); +#define qh_printfacet4geom_simplicial gdal_qh_printfacet4geom_simplicial +static void qh_printfacet4geom_simplicial(); +#define qh_printfacetNvertex_nonsimplicial gdal_qh_printfacetNvertex_nonsimplicial +static void qh_printfacetNvertex_nonsimplicial(); +#define qh_printfacetNvertex_simplicial gdal_qh_printfacetNvertex_simplicial +static void qh_printfacetNvertex_simplicial(); +#define qh_printfacetheader gdal_qh_printfacetheader +static void qh_printfacetheader(); +#define qh_printfacetridges gdal_qh_printfacetridges +static void qh_printfacetridges(); +#define qh_printfacets gdal_qh_printfacets +static void qh_printfacets(); +#define qh_printhyperplaneintersection gdal_qh_printhyperplaneintersection +static void qh_printhyperplaneintersection(); +#define qh_printneighborhood gdal_qh_printneighborhood +static void qh_printneighborhood(); +#define qh_printline3geom gdal_qh_printline3geom +static void qh_printline3geom(); +#define qh_printpoint gdal_qh_printpoint +static void qh_printpoint(); +#define qh_printpointid gdal_qh_printpointid +static void qh_printpointid(); +#define qh_printpoint3 gdal_qh_printpoint3 +static void qh_printpoint3(); +#define qh_printpoints_out gdal_qh_printpoints_out +static void qh_printpoints_out(); +#define qh_printpointvect gdal_qh_printpointvect +static void qh_printpointvect(); +#define qh_printpointvect2 gdal_qh_printpointvect2 +static void qh_printpointvect2(); +#define qh_printridge gdal_qh_printridge +static void qh_printridge(); +#define qh_printspheres gdal_qh_printspheres +static void qh_printspheres(); +#define qh_printvdiagram gdal_qh_printvdiagram +static void qh_printvdiagram(); +#define qh_printvdiagram2 gdal_qh_printvdiagram2 +static int qh_printvdiagram2(); +#define qh_printvertex gdal_qh_printvertex +static void qh_printvertex(); +#define qh_printvertexlist gdal_qh_printvertexlist +static void qh_printvertexlist(); +#define qh_printvertices gdal_qh_printvertices +static void qh_printvertices(); +#define qh_printvneighbors gdal_qh_printvneighbors +static void qh_printvneighbors(); +#define qh_printvoronoi gdal_qh_printvoronoi +static void qh_printvoronoi(); +#define qh_printvnorm gdal_qh_printvnorm +static void qh_printvnorm(); +#define qh_printvridge gdal_qh_printvridge +static void qh_printvridge(); +#define qh_produce_output gdal_qh_produce_output +static void qh_produce_output(); +#define qh_produce_output2 gdal_qh_produce_output2 +static void qh_produce_output2(); +#define qh_projectdim3 gdal_qh_projectdim3 +static void qh_projectdim3(); +#define qh_readfeasible gdal_qh_readfeasible +static int qh_readfeasible(); +#define qh_readpoints gdal_qh_readpoints +static gdal_coordT * qh_readpoints(); +#define qh_setfeasible gdal_qh_setfeasible +static void qh_setfeasible(); +#define qh_skipfacet gdal_qh_skipfacet +static gdal_boolT qh_skipfacet(); +#define qh_skipfilename gdal_qh_skipfilename +static char * qh_skipfilename(); +#define qh_qhull gdal_qh_qhull +static void qh_qhull(); +#define qh_addpoint gdal_qh_addpoint +static gdal_boolT qh_addpoint(); +#define qh_printsummary gdal_qh_printsummary +static void qh_printsummary(); +#define qh_errexit gdal_qh_errexit +static void qh_errexit(); +#define qh_errprint gdal_qh_errprint +static void qh_errprint(); +#define qh_new_qhull gdal_qh_new_qhull +static int qh_new_qhull(); +#define qh_printfacetlist gdal_qh_printfacetlist +static void qh_printfacetlist(); +#define qh_printhelp_degenerate gdal_qh_printhelp_degenerate +static void qh_printhelp_degenerate(); +#define qh_printhelp_narrowhull gdal_qh_printhelp_narrowhull +static void qh_printhelp_narrowhull(); +#define qh_printhelp_singular gdal_qh_printhelp_singular +static void qh_printhelp_singular(); +#define qh_user_memsizes gdal_qh_user_memsizes +static void qh_user_memsizes(); +#define qh_exit gdal_qh_exit +static void qh_exit(); +#define qh_free gdal_qh_free +static void qh_free(); +#define qh_malloc gdal_qh_malloc +static void * qh_malloc(); +#define qh_fprintf gdal_qh_fprintf +static void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ); +/*#define qh_fprintf_rbox gdal_qh_fprintf_rbox*/ +/*static void qh_fprintf_rbox(FILE *fp, int msgcode, const char *fmt, ... );*/ +#define qh_findbest gdal_qh_findbest +static gdal_facetT * qh_findbest(); +#define qh_findbestnew gdal_qh_findbestnew +static gdal_facetT * qh_findbestnew(); +#define qh_gram_schmidt gdal_qh_gram_schmidt +static gdal_boolT qh_gram_schmidt(); +#define qh_outerinner gdal_qh_outerinner +static void qh_outerinner(); +#define qh_printsummary gdal_qh_printsummary +static void qh_printsummary(); +#define qh_projectinput gdal_qh_projectinput +static void qh_projectinput(); +#define qh_randommatrix gdal_qh_randommatrix +static void qh_randommatrix(); +#define qh_rotateinput gdal_qh_rotateinput +static void qh_rotateinput(); +#define qh_scaleinput gdal_qh_scaleinput +static void qh_scaleinput(); +#define qh_setdelaunay gdal_qh_setdelaunay +static void qh_setdelaunay(); +#define qh_sethalfspace_all gdal_qh_sethalfspace_all +static gdal_coordT * qh_sethalfspace_all(); +#define qh_clock gdal_qh_clock +static unsigned long qh_clock(); +#define qh_checkflags gdal_qh_checkflags +static void qh_checkflags(); +#define qh_clear_outputflags gdal_qh_clear_outputflags +static void qh_clear_outputflags(); +#define qh_freebuffers gdal_qh_freebuffers +static void qh_freebuffers(); +#define qh_freeqhull gdal_qh_freeqhull +static void qh_freeqhull(); +#define qh_freeqhull2 gdal_qh_freeqhull2 +static void qh_freeqhull2(); +#define qh_init_A gdal_qh_init_A +static void qh_init_A(); +#define qh_init_B gdal_qh_init_B +static void qh_init_B(); +#define qh_init_qhull_command gdal_qh_init_qhull_command +static void qh_init_qhull_command(); +/*#define qh_initbuffers gdal_qh_initbuffers*/ +/*static void qh_initbuffers();*/ +#define qh_initflags gdal_qh_initflags +static void qh_initflags(); +#define qh_initqhull_buffers gdal_qh_initqhull_buffers +static void qh_initqhull_buffers(); +#define qh_initqhull_globals gdal_qh_initqhull_globals +static void qh_initqhull_globals(); +#define qh_initqhull_mem gdal_qh_initqhull_mem +static void qh_initqhull_mem(); +#define qh_initqhull_outputflags gdal_qh_initqhull_outputflags +static void qh_initqhull_outputflags(); +#define qh_initqhull_start gdal_qh_initqhull_start +static void qh_initqhull_start(); +#define qh_initqhull_start2 gdal_qh_initqhull_start2 +static void qh_initqhull_start2(); +#define qh_initthresholds gdal_qh_initthresholds +static void qh_initthresholds(); +#define qh_option gdal_qh_option +static void qh_option(); +/*#define qh_restore_qhull gdal_qh_restore_qhull*/ +/*static void qh_restore_qhull();*/ +/*#define qh_save_qhull gdal_qh_save_qhull*/ +/*static gdal_qhT * qh_save_qhull();*/ +#define dfacet gdal_dfacet +static void dfacet(); +#define dvertex gdal_dvertex +static void dvertex(); +#define qh_printneighborhood gdal_qh_printneighborhood +static void qh_printneighborhood(); +#define qh_produce_output gdal_qh_produce_output +static void qh_produce_output(); +#define qh_readpoints gdal_qh_readpoints +static gdal_coordT * qh_readpoints(); +#define qh_meminit gdal_qh_meminit +static void qh_meminit(); +#define qh_memfreeshort gdal_qh_memfreeshort +static void qh_memfreeshort(); +#define qh_check_output gdal_qh_check_output +static void qh_check_output(); +#define qh_check_points gdal_qh_check_points +static void qh_check_points(); +#define qh_facetvertices gdal_qh_facetvertices +static gdal_setT * qh_facetvertices(); +#define qh_findbestfacet gdal_qh_findbestfacet +static gdal_facetT * qh_findbestfacet(); +#define qh_nearvertex gdal_qh_nearvertex +static gdal_vertexT * qh_nearvertex(); +#define qh_point gdal_qh_point +static gdal_pointT * qh_point(); +#define qh_pointfacet gdal_qh_pointfacet +static gdal_setT * qh_pointfacet(); +#define qh_pointid gdal_qh_pointid +static int qh_pointid(); +#define qh_pointvertex gdal_qh_pointvertex +static gdal_setT * qh_pointvertex(); +#define qh_setvoronoi_all gdal_qh_setvoronoi_all +static void qh_setvoronoi_all(); +#define qh_triangulate gdal_qh_triangulate +static void qh_triangulate(); +/*#define qh_rboxpoints gdal_qh_rboxpoints*/ +/*static int qh_rboxpoints();*/ +/*#define qh_errexit_rbox gdal_qh_errexit_rbox*/ +/*static void qh_errexit_rbox();*/ +#define qh_collectstatistics gdal_qh_collectstatistics +static void qh_collectstatistics(); +#define qh_printallstatistics gdal_qh_printallstatistics +static void qh_printallstatistics(); +/*#define machines gdal_machines*/ +/*static gdal_of machines();*/ +#define qh_memalloc gdal_qh_memalloc +static void * qh_memalloc(); +#define qh_memfree gdal_qh_memfree +static void qh_memfree(); +#define qh_memfreeshort gdal_qh_memfreeshort +static void qh_memfreeshort(); +#define qh_meminit gdal_qh_meminit +static void qh_meminit(); +#define qh_meminitbuffers gdal_qh_meminitbuffers +static void qh_meminitbuffers(); +#define qh_memsetup gdal_qh_memsetup +static void qh_memsetup(); +#define qh_memsize gdal_qh_memsize +static void qh_memsize(); +#define qh_memstatistics gdal_qh_memstatistics +static void qh_memstatistics(); +#define qh_memtotal gdal_qh_memtotal +static void qh_memtotal(); +/*#define qh_mergefacet gdal_qh_mergefacet*/ +/*static gdal_if qh_mergefacet();*/ +#define qh_premerge gdal_qh_premerge +static void qh_premerge(); +#define qh_postmerge gdal_qh_postmerge +static void qh_postmerge(); +#define qh_all_merges gdal_qh_all_merges +static void qh_all_merges(); +#define qh_appendmergeset gdal_qh_appendmergeset +static void qh_appendmergeset(); +#define qh_basevertices gdal_qh_basevertices +static gdal_setT * qh_basevertices(); +#define qh_checkconnect gdal_qh_checkconnect +static void qh_checkconnect(); +#define qh_checkzero gdal_qh_checkzero +static gdal_boolT qh_checkzero(); +#define qh_compareangle gdal_qh_compareangle +static int qh_compareangle(); +#define qh_comparemerge gdal_qh_comparemerge +static int qh_comparemerge(); +#define qh_comparevisit gdal_qh_comparevisit +static int qh_comparevisit(); +#define qh_copynonconvex gdal_qh_copynonconvex +static void qh_copynonconvex(); +#define qh_degen_redundant_facet gdal_qh_degen_redundant_facet +static void qh_degen_redundant_facet(); +#define qh_degen_redundant_neighbors gdal_qh_degen_redundant_neighbors +static void qh_degen_redundant_neighbors(); +#define qh_find_newvertex gdal_qh_find_newvertex +static gdal_vertexT * qh_find_newvertex(); +#define qh_findbest_test gdal_qh_findbest_test +static void qh_findbest_test(); +#define qh_findbestneighbor gdal_qh_findbestneighbor +static gdal_facetT * qh_findbestneighbor(); +#define qh_flippedmerges gdal_qh_flippedmerges +static void qh_flippedmerges(); +#define qh_forcedmerges gdal_qh_forcedmerges +static void qh_forcedmerges(); +#define qh_getmergeset gdal_qh_getmergeset +static void qh_getmergeset(); +#define qh_getmergeset_initial gdal_qh_getmergeset_initial +static void qh_getmergeset_initial(); +#define qh_hashridge gdal_qh_hashridge +static void qh_hashridge(); +#define qh_hashridge_find gdal_qh_hashridge_find +static gdal_ridgeT * qh_hashridge_find(); +#define qh_makeridges gdal_qh_makeridges +static void qh_makeridges(); +#define qh_mark_dupridges gdal_qh_mark_dupridges +static void qh_mark_dupridges(); +#define qh_maydropneighbor gdal_qh_maydropneighbor +static void qh_maydropneighbor(); +#define qh_merge_degenredundant gdal_qh_merge_degenredundant +static int qh_merge_degenredundant(); +#define qh_merge_nonconvex gdal_qh_merge_nonconvex +static void qh_merge_nonconvex(); +#define qh_mergecycle gdal_qh_mergecycle +static void qh_mergecycle(); +#define qh_mergecycle_all gdal_qh_mergecycle_all +static void qh_mergecycle_all(); +#define qh_mergecycle_facets gdal_qh_mergecycle_facets +static void qh_mergecycle_facets(); +#define qh_mergecycle_neighbors gdal_qh_mergecycle_neighbors +static void qh_mergecycle_neighbors(); +#define qh_mergecycle_ridges gdal_qh_mergecycle_ridges +static void qh_mergecycle_ridges(); +#define qh_mergecycle_vneighbors gdal_qh_mergecycle_vneighbors +static void qh_mergecycle_vneighbors(); +#define qh_mergefacet gdal_qh_mergefacet +static void qh_mergefacet(); +#define qh_mergefacet2d gdal_qh_mergefacet2d +static void qh_mergefacet2d(); +#define qh_mergeneighbors gdal_qh_mergeneighbors +static void qh_mergeneighbors(); +#define qh_mergeridges gdal_qh_mergeridges +static void qh_mergeridges(); +#define qh_mergesimplex gdal_qh_mergesimplex +static void qh_mergesimplex(); +#define qh_mergevertex_del gdal_qh_mergevertex_del +static void qh_mergevertex_del(); +#define qh_mergevertex_neighbors gdal_qh_mergevertex_neighbors +static void qh_mergevertex_neighbors(); +#define qh_mergevertices gdal_qh_mergevertices +static void qh_mergevertices(); +#define qh_neighbor_intersections gdal_qh_neighbor_intersections +static gdal_setT * qh_neighbor_intersections(); +#define qh_newvertices gdal_qh_newvertices +static void qh_newvertices(); +#define qh_reducevertices gdal_qh_reducevertices +static gdal_boolT qh_reducevertices(); +#define qh_redundant_vertex gdal_qh_redundant_vertex +static gdal_vertexT * qh_redundant_vertex(); +#define qh_remove_extravertices gdal_qh_remove_extravertices +static gdal_boolT qh_remove_extravertices(); +#define qh_rename_sharedvertex gdal_qh_rename_sharedvertex +static gdal_vertexT * qh_rename_sharedvertex(); +#define qh_renameridgevertex gdal_qh_renameridgevertex +static void qh_renameridgevertex(); +#define qh_renamevertex gdal_qh_renamevertex +static void qh_renamevertex(); +#define qh_test_appendmerge gdal_qh_test_appendmerge +static gdal_boolT qh_test_appendmerge(); +#define qh_test_vneighbors gdal_qh_test_vneighbors +static gdal_boolT qh_test_vneighbors(); +#define qh_tracemerge gdal_qh_tracemerge +static void qh_tracemerge(); +#define qh_tracemerging gdal_qh_tracemerging +static void qh_tracemerging(); +#define qh_updatetested gdal_qh_updatetested +static void qh_updatetested(); +#define qh_vertexridges gdal_qh_vertexridges +static gdal_setT * qh_vertexridges(); +#define qh_vertexridges_facet gdal_qh_vertexridges_facet +static void qh_vertexridges_facet(); +#define qh_willdelete gdal_qh_willdelete +static void qh_willdelete(); +#define qh_appendfacet gdal_qh_appendfacet +static void qh_appendfacet(); +#define qh_appendvertex gdal_qh_appendvertex +static void qh_appendvertex(); +#define qh_attachnewfacets gdal_qh_attachnewfacets +static void qh_attachnewfacets(); +#define qh_checkflipped gdal_qh_checkflipped +static gdal_boolT qh_checkflipped(); +#define qh_delfacet gdal_qh_delfacet +static void qh_delfacet(); +#define qh_deletevisible gdal_qh_deletevisible +static void qh_deletevisible(); +#define qh_facetintersect gdal_qh_facetintersect +static gdal_setT * qh_facetintersect(); +#define qh_gethash gdal_qh_gethash +static int qh_gethash(); +#define qh_makenewfacet gdal_qh_makenewfacet +static gdal_facetT * qh_makenewfacet(); +#define qh_makenewplanes gdal_qh_makenewplanes +static void qh_makenewplanes(); +#define qh_makenew_nonsimplicial gdal_qh_makenew_nonsimplicial +static gdal_facetT * qh_makenew_nonsimplicial(); +#define qh_makenew_simplicial gdal_qh_makenew_simplicial +static gdal_facetT * qh_makenew_simplicial(); +#define qh_matchneighbor gdal_qh_matchneighbor +static void qh_matchneighbor(); +#define qh_matchnewfacets gdal_qh_matchnewfacets +static void qh_matchnewfacets(); +#define qh_matchvertices gdal_qh_matchvertices +static gdal_boolT qh_matchvertices(); +#define qh_newfacet gdal_qh_newfacet +static gdal_facetT * qh_newfacet(); +#define qh_newridge gdal_qh_newridge +static gdal_ridgeT * qh_newridge(); +#define qh_pointid gdal_qh_pointid +static int qh_pointid(); +#define qh_removefacet gdal_qh_removefacet +static void qh_removefacet(); +#define qh_removevertex gdal_qh_removevertex +static void qh_removevertex(); +#define qh_updatevertices gdal_qh_updatevertices +static void qh_updatevertices(); +#define qh_addhash gdal_qh_addhash +static void qh_addhash(); +#define qh_check_bestdist gdal_qh_check_bestdist +static void qh_check_bestdist(); +#define qh_check_maxout gdal_qh_check_maxout +static void qh_check_maxout(); +#define qh_check_output gdal_qh_check_output +static void qh_check_output(); +#define qh_check_point gdal_qh_check_point +static void qh_check_point(); +#define qh_check_points gdal_qh_check_points +static void qh_check_points(); +#define qh_checkconvex gdal_qh_checkconvex +static void qh_checkconvex(); +#define qh_checkfacet gdal_qh_checkfacet +static void qh_checkfacet(); +#define qh_checkflipped_all gdal_qh_checkflipped_all +static void qh_checkflipped_all(); +#define qh_checkpolygon gdal_qh_checkpolygon +static void qh_checkpolygon(); +#define qh_checkvertex gdal_qh_checkvertex +static void qh_checkvertex(); +#define qh_clearcenters gdal_qh_clearcenters +static void qh_clearcenters(); +#define qh_createsimplex gdal_qh_createsimplex +static void qh_createsimplex(); +#define qh_delridge gdal_qh_delridge +static void qh_delridge(); +#define qh_delvertex gdal_qh_delvertex +static void qh_delvertex(); +#define qh_facet3vertex gdal_qh_facet3vertex +static gdal_setT * qh_facet3vertex(); +#define qh_findbestfacet gdal_qh_findbestfacet +static gdal_facetT * qh_findbestfacet(); +#define qh_findbestlower gdal_qh_findbestlower +static gdal_facetT * qh_findbestlower(); +#define qh_findfacet_all gdal_qh_findfacet_all +static gdal_facetT * qh_findfacet_all(); +#define qh_findgood gdal_qh_findgood +static int qh_findgood(); +#define qh_findgood_all gdal_qh_findgood_all +static void qh_findgood_all(); +#define qh_furthestnext gdal_qh_furthestnext +static void qh_furthestnext(); +#define qh_furthestout gdal_qh_furthestout +static void qh_furthestout(); +#define qh_infiniteloop gdal_qh_infiniteloop +static void qh_infiniteloop(); +#define qh_initbuild gdal_qh_initbuild +static void qh_initbuild(); +#define qh_initialhull gdal_qh_initialhull +static void qh_initialhull(); +#define qh_initialvertices gdal_qh_initialvertices +static gdal_setT * qh_initialvertices(); +#define qh_isvertex gdal_qh_isvertex +static gdal_vertexT * qh_isvertex(); +#define qh_makenewfacets gdal_qh_makenewfacets +static gdal_vertexT * qh_makenewfacets(); +#define qh_matchduplicates gdal_qh_matchduplicates +static void qh_matchduplicates(); +#define qh_nearcoplanar gdal_qh_nearcoplanar +static void qh_nearcoplanar(); +#define qh_nearvertex gdal_qh_nearvertex +static gdal_vertexT * qh_nearvertex(); +#define qh_newhashtable gdal_qh_newhashtable +static int qh_newhashtable(); +#define qh_newvertex gdal_qh_newvertex +static gdal_vertexT * qh_newvertex(); +#define qh_nextridge3d gdal_qh_nextridge3d +static gdal_ridgeT * qh_nextridge3d(); +#define qh_outcoplanar gdal_qh_outcoplanar +static void qh_outcoplanar(); +#define qh_point gdal_qh_point +static gdal_pointT * qh_point(); +#define qh_point_add gdal_qh_point_add +static void qh_point_add(); +#define qh_pointfacet gdal_qh_pointfacet +static gdal_setT * qh_pointfacet(); +#define qh_pointvertex gdal_qh_pointvertex +static gdal_setT * qh_pointvertex(); +#define qh_prependfacet gdal_qh_prependfacet +static void qh_prependfacet(); +#define qh_printhashtable gdal_qh_printhashtable +static void qh_printhashtable(); +#define qh_printlists gdal_qh_printlists +static void qh_printlists(); +#define qh_resetlists gdal_qh_resetlists +static void qh_resetlists(); +#define qh_setvoronoi_all gdal_qh_setvoronoi_all +static void qh_setvoronoi_all(); +#define qh_triangulate gdal_qh_triangulate +static void qh_triangulate(); +#define qh_triangulate_facet gdal_qh_triangulate_facet +static void qh_triangulate_facet(); +#define qh_triangulate_link gdal_qh_triangulate_link +static void qh_triangulate_link(); +#define qh_triangulate_mirror gdal_qh_triangulate_mirror +static void qh_triangulate_mirror(); +#define qh_triangulate_null gdal_qh_triangulate_null +static void qh_triangulate_null(); +#define qh_vertexintersect gdal_qh_vertexintersect +static void qh_vertexintersect(); +#define qh_vertexintersect_new gdal_qh_vertexintersect_new +static gdal_setT * qh_vertexintersect_new(); +#define qh_vertexneighbors gdal_qh_vertexneighbors +static void qh_vertexneighbors(); +#define qh_vertexsubset gdal_qh_vertexsubset +static gdal_boolT qh_vertexsubset(); +#define qh_qhull gdal_qh_qhull +static void qh_qhull(); +#define qh_addpoint gdal_qh_addpoint +static gdal_boolT qh_addpoint(); +#define qh_buildhull gdal_qh_buildhull +static void qh_buildhull(); +#define qh_buildtracing gdal_qh_buildtracing +static void qh_buildtracing(); +#define qh_build_withrestart gdal_qh_build_withrestart +static void qh_build_withrestart(); +#define qh_errexit2 gdal_qh_errexit2 +static void qh_errexit2(); +#define qh_findhorizon gdal_qh_findhorizon +static void qh_findhorizon(); +#define qh_nextfurthest gdal_qh_nextfurthest +static gdal_pointT * qh_nextfurthest(); +#define qh_partitionall gdal_qh_partitionall +static void qh_partitionall(); +#define qh_partitioncoplanar gdal_qh_partitioncoplanar +static void qh_partitioncoplanar(); +#define qh_partitionpoint gdal_qh_partitionpoint +static void qh_partitionpoint(); +#define qh_partitionvisible gdal_qh_partitionvisible +static void qh_partitionvisible(); +#define qh_precision gdal_qh_precision +static void qh_precision(); +#define qh_printsummary gdal_qh_printsummary +static void qh_printsummary(); +#define qh_appendprint gdal_qh_appendprint +static void qh_appendprint(); +#define qh_freebuild gdal_qh_freebuild +static void qh_freebuild(); +#define qh_freebuffers gdal_qh_freebuffers +static void qh_freebuffers(); +/*#define qh_initbuffers gdal_qh_initbuffers*/ +/*static void qh_initbuffers();*/ +#define qh_allstatA gdal_qh_allstatA +static void qh_allstatA(); +#define qh_allstatB gdal_qh_allstatB +static void qh_allstatB(); +#define qh_allstatC gdal_qh_allstatC +static void qh_allstatC(); +#define qh_allstatD gdal_qh_allstatD +static void qh_allstatD(); +#define qh_allstatE gdal_qh_allstatE +static void qh_allstatE(); +#define qh_allstatE2 gdal_qh_allstatE2 +static void qh_allstatE2(); +#define qh_allstatF gdal_qh_allstatF +static void qh_allstatF(); +#define qh_allstatG gdal_qh_allstatG +static void qh_allstatG(); +#define qh_allstatH gdal_qh_allstatH +static void qh_allstatH(); +#define qh_freebuffers gdal_qh_freebuffers +static void qh_freebuffers(); +/*#define qh_initbuffers gdal_qh_initbuffers*/ +/*static void qh_initbuffers();*/ +#define qh_setaddsorted gdal_qh_setaddsorted +static void qh_setaddsorted(); +#define qh_setaddnth gdal_qh_setaddnth +static void qh_setaddnth(); +#define qh_setappend gdal_qh_setappend +static void qh_setappend(); +#define qh_setappend_set gdal_qh_setappend_set +static void qh_setappend_set(); +#define qh_setappend2ndlast gdal_qh_setappend2ndlast +static void qh_setappend2ndlast(); +#define qh_setcheck gdal_qh_setcheck +static void qh_setcheck(); +#define qh_setcompact gdal_qh_setcompact +static void qh_setcompact(); +#define qh_setcopy gdal_qh_setcopy +static gdal_setT * qh_setcopy(); +#define qh_setdel gdal_qh_setdel +static void * qh_setdel(); +#define qh_setdellast gdal_qh_setdellast +static void * qh_setdellast(); +#define qh_setdelnth gdal_qh_setdelnth +static void * qh_setdelnth(); +#define qh_setdelnthsorted gdal_qh_setdelnthsorted +static void * qh_setdelnthsorted(); +#define qh_setdelsorted gdal_qh_setdelsorted +static void * qh_setdelsorted(); +#define qh_setduplicate gdal_qh_setduplicate +static gdal_setT * qh_setduplicate(); +#define qh_setequal gdal_qh_setequal +static int qh_setequal(); +#define qh_setequal_except gdal_qh_setequal_except +static int qh_setequal_except(); +#define qh_setequal_skip gdal_qh_setequal_skip +static int qh_setequal_skip(); +#define qh_setendpointer gdal_qh_setendpointer +static void ** qh_setendpointer(); +#define qh_setfree gdal_qh_setfree +static void qh_setfree(); +#define qh_setfree2 gdal_qh_setfree2 +static void qh_setfree2(); +#define qh_setfreelong gdal_qh_setfreelong +static void qh_setfreelong(); +#define qh_setin gdal_qh_setin +static int qh_setin(); +#define qh_setindex gdal_qh_setindex +static int qh_setindex(); +#define qh_setlarger gdal_qh_setlarger +static void qh_setlarger(); +#define qh_setlast gdal_qh_setlast +static void * qh_setlast(); +#define qh_setnew gdal_qh_setnew +static gdal_setT * qh_setnew(); +#define qh_setnew_delnthsorted gdal_qh_setnew_delnthsorted +static gdal_setT * qh_setnew_delnthsorted(); +#define qh_setprint gdal_qh_setprint +static void qh_setprint(); +#define qh_setreplace gdal_qh_setreplace +static void qh_setreplace(); +#define qh_setsize gdal_qh_setsize +static int qh_setsize(); +#define qh_settemp gdal_qh_settemp +static gdal_setT * qh_settemp(); +#define qh_settempfree gdal_qh_settempfree +static void qh_settempfree(); +#define qh_settempfree_all gdal_qh_settempfree_all +static void qh_settempfree_all(); +#define qh_settemppop gdal_qh_settemppop +static gdal_setT * qh_settemppop(); +#define qh_settemppush gdal_qh_settemppush +static void qh_settemppush(); +#define qh_settruncate gdal_qh_settruncate +static void qh_settruncate(); +#define qh_setunique gdal_qh_setunique +static int qh_setunique(); +#define qh_setzero gdal_qh_setzero +static void qh_setzero(); +#define qh_argv_to_command gdal_qh_argv_to_command +static int qh_argv_to_command(); +#define qh_argv_to_command_size gdal_qh_argv_to_command_size +static int qh_argv_to_command_size(); +#define qh_rand gdal_qh_rand +static int qh_rand(); +#define qh_srand gdal_qh_srand +static void qh_srand(); +#define qh_randomfactor gdal_qh_randomfactor +static gdal_realT qh_randomfactor(); +#define qh_randommatrix gdal_qh_randommatrix +static void qh_randommatrix(); +#define qh_strtol gdal_qh_strtol +static int qh_strtol(); +#define qh_strtod gdal_qh_strtod +static double qh_strtod(); +#define qh_allstatA gdal_qh_allstatA +static void qh_allstatA(); +#define qh_allstatB gdal_qh_allstatB +static void qh_allstatB(); +#define qh_allstatC gdal_qh_allstatC +static void qh_allstatC(); +#define qh_allstatD gdal_qh_allstatD +static void qh_allstatD(); +#define qh_allstatE gdal_qh_allstatE +static void qh_allstatE(); +#define qh_allstatE2 gdal_qh_allstatE2 +static void qh_allstatE2(); +#define qh_allstatF gdal_qh_allstatF +static void qh_allstatF(); +#define qh_allstatG gdal_qh_allstatG +static void qh_allstatG(); +#define qh_allstatH gdal_qh_allstatH +static void qh_allstatH(); +#define qh_allstatI gdal_qh_allstatI +static void qh_allstatI(); +#define qh_allstatistics gdal_qh_allstatistics +static void qh_allstatistics(); +#define qh_collectstatistics gdal_qh_collectstatistics +static void qh_collectstatistics(); +#define qh_freestatistics gdal_qh_freestatistics +static void qh_freestatistics(); +#define qh_initstatistics gdal_qh_initstatistics +static void qh_initstatistics(); +#define qh_newstats gdal_qh_newstats +static gdal_boolT qh_newstats(); +#define qh_nostatistic gdal_qh_nostatistic +static gdal_boolT qh_nostatistic(); +#define qh_printallstatistics gdal_qh_printallstatistics +static void qh_printallstatistics(); +#define qh_printstatistics gdal_qh_printstatistics +static void qh_printstatistics(); +#define qh_printstatlevel gdal_qh_printstatlevel +static void qh_printstatlevel(); +#define qh_printstats gdal_qh_printstats +static void qh_printstats(); +#define qh_stddev gdal_qh_stddev +static gdal_realT qh_stddev(); + +#ifdef _MSC_VER +#pragma warning( push ) +#pragma warning( disable : 4324 ) +#pragma warning( disable : 4032 ) +#pragma warning( disable : 4306 ) /* e.g 'type cast' : conversion from 'long' to 'facetT *' of greater size */ +#endif + +#include "libqhull.h" +#include "libqhull.c" +#include "poly.c" +#include "poly2.c" +#include "mem.c" +#include "user.c" +#include "global.c" +/*#include "userprintf.c"*/ +#include "random.c" +#include "qset.c" +#include "io.c" +#include "usermem.c" +#include "geom.c" +#include "geom2.c" +#include "stat.c" +#include "merge.c" + +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + +/* Replaces userprintf.c implementation */ +static void qh_fprintf(CPL_UNUSED FILE *fp, CPL_UNUSED int msgcode, const char *fmt, ... ) +{ + va_list args; + va_start(args, fmt); + CPLErrorV(CE_Warning, CPLE_AppDefined, fmt, args); + va_end(args); +} + +#endif diff --git a/modules/globebrowsing/ext/gdal/include/memdataset.h b/modules/globebrowsing/ext/gdal/include/memdataset.h new file mode 100644 index 0000000000..6a069f01bc --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/memdataset.h @@ -0,0 +1,184 @@ +/****************************************************************************** + * $Id$ + * + * 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 */ diff --git a/modules/globebrowsing/ext/gdal/include/ogr_api.h b/modules/globebrowsing/ext/gdal/include/ogr_api.h new file mode 100644 index 0000000000..29538cf067 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogr_api.h @@ -0,0 +1,655 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenGIS Simple Features Reference Implementation + * Purpose: C API for OGR Geometry, Feature, Layers, DataSource and drivers. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 2002, Frank Warmerdam + * Copyright (c) 2008-2013, Even Rouault + * + * 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_API_H_INCLUDED +#define OGR_API_H_INCLUDED + +/** + * \file ogr_api.h + * + * C API and defines for OGRFeature, OGRGeometry, and OGRDataSource + * related classes. + * + * See also: ogr_geometry.h, ogr_feature.h, ogrsf_frmts.h, ogr_featurestyle.h + */ + +#include "cpl_progress.h" +#include "cpl_minixml.h" +#include "ogr_core.h" + +CPL_C_START + +/* -------------------------------------------------------------------- */ +/* Geometry related functions (ogr_geometry.h) */ +/* -------------------------------------------------------------------- */ +#ifdef DEBUG +typedef struct OGRGeometryHS *OGRGeometryH; +#else +typedef void *OGRGeometryH; +#endif + +#ifndef DEFINED_OGRSpatialReferenceH +#define DEFINED_OGRSpatialReferenceH + +#ifdef DEBUG +typedef struct OGRSpatialReferenceHS *OGRSpatialReferenceH; +typedef struct OGRCoordinateTransformationHS *OGRCoordinateTransformationH; +#else +typedef void *OGRSpatialReferenceH; +typedef void *OGRCoordinateTransformationH; +#endif + +#endif + +struct _CPLXMLNode; + +/* From base OGRGeometry class */ + +OGRErr CPL_DLL OGR_G_CreateFromWkb( unsigned char *, OGRSpatialReferenceH, + OGRGeometryH *, int ); +OGRErr CPL_DLL OGR_G_CreateFromWkt( char **, OGRSpatialReferenceH, + OGRGeometryH * ); +OGRErr CPL_DLL OGR_G_CreateFromFgf( unsigned char *, OGRSpatialReferenceH, + OGRGeometryH *, int, int * ); +void CPL_DLL OGR_G_DestroyGeometry( OGRGeometryH ); +OGRGeometryH CPL_DLL OGR_G_CreateGeometry( OGRwkbGeometryType ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL +OGR_G_ApproximateArcAngles( + double dfCenterX, double dfCenterY, double dfZ, + double dfPrimaryRadius, double dfSecondaryAxis, double dfRotation, + double dfStartAngle, double dfEndAngle, + double dfMaxAngleStepSizeDegrees ) CPL_WARN_UNUSED_RESULT; + +OGRGeometryH CPL_DLL OGR_G_ForceToPolygon( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL OGR_G_ForceToLineString( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL OGR_G_ForceToMultiPolygon( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL OGR_G_ForceToMultiPoint( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL OGR_G_ForceToMultiLineString( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL OGR_G_ForceTo( OGRGeometryH hGeom, + OGRwkbGeometryType eTargetType, + char** papszOptions ) CPL_WARN_UNUSED_RESULT; + +int CPL_DLL OGR_G_GetDimension( OGRGeometryH ); +int CPL_DLL OGR_G_GetCoordinateDimension( OGRGeometryH ); +int CPL_DLL OGR_G_CoordinateDimension( OGRGeometryH ); +void CPL_DLL OGR_G_SetCoordinateDimension( OGRGeometryH, int ); +int CPL_DLL OGR_G_Is3D( OGRGeometryH ); +int CPL_DLL OGR_G_IsMeasured( OGRGeometryH ); +void CPL_DLL OGR_G_Set3D( OGRGeometryH, int ); +void CPL_DLL OGR_G_SetMeasured( OGRGeometryH, int ); +OGRGeometryH CPL_DLL OGR_G_Clone( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +void CPL_DLL OGR_G_GetEnvelope( OGRGeometryH, OGREnvelope * ); +void CPL_DLL OGR_G_GetEnvelope3D( OGRGeometryH, OGREnvelope3D * ); +OGRErr CPL_DLL OGR_G_ImportFromWkb( OGRGeometryH, unsigned char *, int ); +OGRErr CPL_DLL OGR_G_ExportToWkb( OGRGeometryH, OGRwkbByteOrder, unsigned char*); +OGRErr CPL_DLL OGR_G_ExportToIsoWkb( OGRGeometryH, OGRwkbByteOrder, unsigned char*); +int CPL_DLL OGR_G_WkbSize( OGRGeometryH hGeom ); +OGRErr CPL_DLL OGR_G_ImportFromWkt( OGRGeometryH, char ** ); +OGRErr CPL_DLL OGR_G_ExportToWkt( OGRGeometryH, char ** ); +OGRErr CPL_DLL OGR_G_ExportToIsoWkt( OGRGeometryH, char ** ); +OGRwkbGeometryType CPL_DLL OGR_G_GetGeometryType( OGRGeometryH ); +const char CPL_DLL *OGR_G_GetGeometryName( OGRGeometryH ); +void CPL_DLL OGR_G_DumpReadable( OGRGeometryH, FILE *, const char * ); +void CPL_DLL OGR_G_FlattenTo2D( OGRGeometryH ); +void CPL_DLL OGR_G_CloseRings( OGRGeometryH ); + +OGRGeometryH CPL_DLL OGR_G_CreateFromGML( const char * ) CPL_WARN_UNUSED_RESULT; +char CPL_DLL *OGR_G_ExportToGML( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +char CPL_DLL *OGR_G_ExportToGMLEx( OGRGeometryH, char** papszOptions ) CPL_WARN_UNUSED_RESULT; + +OGRGeometryH CPL_DLL OGR_G_CreateFromGMLTree( const CPLXMLNode * ) CPL_WARN_UNUSED_RESULT; +CPLXMLNode CPL_DLL *OGR_G_ExportToGMLTree( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +CPLXMLNode CPL_DLL *OGR_G_ExportEnvelopeToGMLTree( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; + +char CPL_DLL *OGR_G_ExportToKML( OGRGeometryH, const char* pszAltitudeMode ) CPL_WARN_UNUSED_RESULT; + +char CPL_DLL *OGR_G_ExportToJson( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +char CPL_DLL *OGR_G_ExportToJsonEx( OGRGeometryH, char** papszOptions ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL OGR_G_CreateGeometryFromJson( const char* ) CPL_WARN_UNUSED_RESULT; + +void CPL_DLL OGR_G_AssignSpatialReference( OGRGeometryH, + OGRSpatialReferenceH ); +OGRSpatialReferenceH CPL_DLL OGR_G_GetSpatialReference( OGRGeometryH ); +OGRErr CPL_DLL OGR_G_Transform( OGRGeometryH, OGRCoordinateTransformationH ); +OGRErr CPL_DLL OGR_G_TransformTo( OGRGeometryH, OGRSpatialReferenceH ); + +OGRGeometryH CPL_DLL OGR_G_Simplify( OGRGeometryH hThis, double tolerance ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL OGR_G_SimplifyPreserveTopology( OGRGeometryH hThis, double tolerance ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL OGR_G_DelaunayTriangulation( OGRGeometryH hThis, double dfTolerance, int bOnlyEdges ) CPL_WARN_UNUSED_RESULT; + +void CPL_DLL OGR_G_Segmentize(OGRGeometryH hGeom, double dfMaxLength ); +int CPL_DLL OGR_G_Intersects( OGRGeometryH, OGRGeometryH ); +int CPL_DLL OGR_G_Equals( OGRGeometryH, OGRGeometryH ); +/*int CPL_DLL OGR_G_EqualsExact( OGRGeometryH, OGRGeometryH, double );*/ +int CPL_DLL OGR_G_Disjoint( OGRGeometryH, OGRGeometryH ); +int CPL_DLL OGR_G_Touches( OGRGeometryH, OGRGeometryH ); +int CPL_DLL OGR_G_Crosses( OGRGeometryH, OGRGeometryH ); +int CPL_DLL OGR_G_Within( OGRGeometryH, OGRGeometryH ); +int CPL_DLL OGR_G_Contains( OGRGeometryH, OGRGeometryH ); +int CPL_DLL OGR_G_Overlaps( OGRGeometryH, OGRGeometryH ); + +OGRGeometryH CPL_DLL OGR_G_Boundary( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL OGR_G_ConvexHull( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL OGR_G_Buffer( OGRGeometryH, double, int ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL OGR_G_Intersection( OGRGeometryH, OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL OGR_G_Union( OGRGeometryH, OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL OGR_G_UnionCascaded( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +OGRGeometryH CPL_DLL OGR_G_PointOnSurface( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; +/*OGRGeometryH CPL_DLL OGR_G_Polygonize( OGRGeometryH *, int);*/ +/*OGRGeometryH CPL_DLL OGR_G_Polygonizer_getCutEdges( OGRGeometryH *, int);*/ +/*OGRGeometryH CPL_DLL OGR_G_LineMerge( OGRGeometryH );*/ + +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_Length( OGRGeometryH ); +double CPL_DLL OGR_G_Area( OGRGeometryH ); +int CPL_DLL OGR_G_Centroid( OGRGeometryH, OGRGeometryH ); +OGRGeometryH CPL_DLL OGR_G_Value( OGRGeometryH, double dfDistance ) CPL_WARN_UNUSED_RESULT; + +void CPL_DLL OGR_G_Empty( OGRGeometryH ); +int CPL_DLL OGR_G_IsEmpty( OGRGeometryH ); +int CPL_DLL OGR_G_IsValid( OGRGeometryH ); +/*char CPL_DLL *OGR_G_IsValidReason( OGRGeometryH );*/ +int CPL_DLL OGR_G_IsSimple( OGRGeometryH ); +int CPL_DLL OGR_G_IsRing( OGRGeometryH ); + +OGRGeometryH CPL_DLL OGR_G_Polygonize( OGRGeometryH ) CPL_WARN_UNUSED_RESULT; + +/* 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"); + +/* Methods for getting/setting vertices in points, line strings and rings */ +int CPL_DLL OGR_G_GetPointCount( OGRGeometryH ); +int CPL_DLL OGR_G_GetPoints( OGRGeometryH hGeom, + void* pabyX, int nXStride, + void* pabyY, int nYStride, + void* pabyZ, int nZStride); +int CPL_DLL OGR_G_GetPointsZM( OGRGeometryH hGeom, + void* pabyX, int nXStride, + void* pabyY, int nYStride, + void* pabyZ, int nZStride, + void* pabyM, int nMStride); +double CPL_DLL OGR_G_GetX( OGRGeometryH, int ); +double CPL_DLL OGR_G_GetY( OGRGeometryH, int ); +double CPL_DLL OGR_G_GetZ( OGRGeometryH, int ); +double CPL_DLL OGR_G_GetM( OGRGeometryH, int ); +void CPL_DLL OGR_G_GetPoint( OGRGeometryH, int iPoint, + double *, double *, double * ); +void CPL_DLL OGR_G_GetPointZM( OGRGeometryH, int iPoint, + double *, double *, double *, double * ); +void CPL_DLL OGR_G_SetPointCount( OGRGeometryH hGeom, int nNewPointCount ); +void CPL_DLL OGR_G_SetPoint( OGRGeometryH, int iPoint, + double, double, double ); +void CPL_DLL OGR_G_SetPoint_2D( OGRGeometryH, int iPoint, + double, double ); +void CPL_DLL OGR_G_SetPointM( OGRGeometryH, int iPoint, + double, double, double ); +void CPL_DLL OGR_G_SetPointZM( OGRGeometryH, int iPoint, + double, double, double, double ); +void CPL_DLL OGR_G_AddPoint( OGRGeometryH, double, double, double ); +void CPL_DLL OGR_G_AddPoint_2D( OGRGeometryH, double, double ); +void CPL_DLL OGR_G_AddPointM( OGRGeometryH, double, double, double ); +void CPL_DLL OGR_G_AddPointZM( OGRGeometryH, double, double, double, double ); +void CPL_DLL OGR_G_SetPoints( OGRGeometryH hGeom, int nPointsIn, + void* pabyX, int nXStride, + void* pabyY, int nYStride, + void* pabyZ, int nZStride ); +void CPL_DLL OGR_G_SetPointsZM( OGRGeometryH hGeom, int nPointsIn, + void* pabyX, int nXStride, + void* pabyY, int nYStride, + void* pabyZ, int nZStride, + void* pabyM, int nMStride ); + +/* Methods for getting/setting rings and members collections */ + +int CPL_DLL OGR_G_GetGeometryCount( OGRGeometryH ); +OGRGeometryH CPL_DLL OGR_G_GetGeometryRef( OGRGeometryH, int ); +OGRErr CPL_DLL OGR_G_AddGeometry( OGRGeometryH, OGRGeometryH ); +OGRErr CPL_DLL OGR_G_AddGeometryDirectly( OGRGeometryH, OGRGeometryH ); +OGRErr CPL_DLL OGR_G_RemoveGeometry( OGRGeometryH, int, int ); + +int CPL_DLL OGR_G_HasCurveGeometry( OGRGeometryH, int bLookForNonLinear ); +OGRGeometryH CPL_DLL OGR_G_GetLinearGeometry( OGRGeometryH hGeom, + double dfMaxAngleStepSizeDegrees, + char** papszOptions) CPL_WARN_UNUSED_RESULT; +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; + +OGRErr CPL_DLL OGRSetGenerate_DB2_V72_BYTE_ORDER( + int bGenerate_DB2_V72_BYTE_ORDER ); + +int CPL_DLL OGRGetGenerate_DB2_V72_BYTE_ORDER(void); + +void CPL_DLL OGRSetNonLinearGeometriesEnabledFlag(int bFlag); +int CPL_DLL OGRGetNonLinearGeometriesEnabledFlag(void); + +/* -------------------------------------------------------------------- */ +/* Feature related (ogr_feature.h) */ +/* -------------------------------------------------------------------- */ + +#ifdef DEBUG +typedef struct OGRFieldDefnHS *OGRFieldDefnH; +typedef struct OGRFeatureDefnHS *OGRFeatureDefnH; +typedef struct OGRFeatureHS *OGRFeatureH; +typedef struct OGRStyleTableHS *OGRStyleTableH; +#else +typedef void *OGRFieldDefnH; +typedef void *OGRFeatureDefnH; +typedef void *OGRFeatureH; +typedef void *OGRStyleTableH; +#endif +typedef struct OGRGeomFieldDefnHS *OGRGeomFieldDefnH; + +/* OGRFieldDefn */ + +OGRFieldDefnH CPL_DLL OGR_Fld_Create( const char *, OGRFieldType ) CPL_WARN_UNUSED_RESULT; +void CPL_DLL OGR_Fld_Destroy( OGRFieldDefnH ); + +void CPL_DLL OGR_Fld_SetName( OGRFieldDefnH, const char * ); +const char CPL_DLL *OGR_Fld_GetNameRef( OGRFieldDefnH ); +OGRFieldType CPL_DLL OGR_Fld_GetType( OGRFieldDefnH ); +void CPL_DLL OGR_Fld_SetType( OGRFieldDefnH, OGRFieldType ); +OGRFieldSubType CPL_DLL OGR_Fld_GetSubType( OGRFieldDefnH ); +void CPL_DLL OGR_Fld_SetSubType( OGRFieldDefnH, OGRFieldSubType ); +OGRJustification CPL_DLL OGR_Fld_GetJustify( OGRFieldDefnH ); +void CPL_DLL OGR_Fld_SetJustify( OGRFieldDefnH, OGRJustification ); +int CPL_DLL OGR_Fld_GetWidth( OGRFieldDefnH ); +void CPL_DLL OGR_Fld_SetWidth( OGRFieldDefnH, int ); +int CPL_DLL OGR_Fld_GetPrecision( OGRFieldDefnH ); +void CPL_DLL OGR_Fld_SetPrecision( OGRFieldDefnH, int ); +void CPL_DLL OGR_Fld_Set( OGRFieldDefnH, const char *, OGRFieldType, + int, int, OGRJustification ); +int CPL_DLL OGR_Fld_IsIgnored( OGRFieldDefnH hDefn ); +void CPL_DLL OGR_Fld_SetIgnored( OGRFieldDefnH hDefn, int ); +int CPL_DLL OGR_Fld_IsNullable( OGRFieldDefnH hDefn ); +void CPL_DLL OGR_Fld_SetNullable( OGRFieldDefnH hDefn, int ); +const char CPL_DLL *OGR_Fld_GetDefault( OGRFieldDefnH hDefn ); +void CPL_DLL OGR_Fld_SetDefault( OGRFieldDefnH hDefn, const char* ); +int CPL_DLL OGR_Fld_IsDefaultDriverSpecific( OGRFieldDefnH hDefn ); + +const char CPL_DLL *OGR_GetFieldTypeName( OGRFieldType ); +const char CPL_DLL *OGR_GetFieldSubTypeName( OGRFieldSubType ); +int CPL_DLL OGR_AreTypeSubTypeCompatible( OGRFieldType eType, + OGRFieldSubType eSubType ); + +/* OGRGeomFieldDefnH */ + +OGRGeomFieldDefnH CPL_DLL OGR_GFld_Create( const char *, OGRwkbGeometryType ) CPL_WARN_UNUSED_RESULT; +void CPL_DLL OGR_GFld_Destroy( OGRGeomFieldDefnH ); + +void CPL_DLL OGR_GFld_SetName( OGRGeomFieldDefnH, const char * ); +const char CPL_DLL *OGR_GFld_GetNameRef( OGRGeomFieldDefnH ); + +OGRwkbGeometryType CPL_DLL OGR_GFld_GetType( OGRGeomFieldDefnH ); +void CPL_DLL OGR_GFld_SetType( OGRGeomFieldDefnH, OGRwkbGeometryType ); + +OGRSpatialReferenceH CPL_DLL OGR_GFld_GetSpatialRef( OGRGeomFieldDefnH ); +void CPL_DLL OGR_GFld_SetSpatialRef( OGRGeomFieldDefnH, + OGRSpatialReferenceH hSRS ); + +int CPL_DLL OGR_GFld_IsNullable( OGRGeomFieldDefnH hDefn ); +void CPL_DLL OGR_GFld_SetNullable( OGRGeomFieldDefnH hDefn, int ); + +int CPL_DLL OGR_GFld_IsIgnored( OGRGeomFieldDefnH hDefn ); +void CPL_DLL OGR_GFld_SetIgnored( OGRGeomFieldDefnH hDefn, int ); + +/* OGRFeatureDefn */ + +OGRFeatureDefnH CPL_DLL OGR_FD_Create( const char * ) CPL_WARN_UNUSED_RESULT; +void CPL_DLL OGR_FD_Destroy( OGRFeatureDefnH ); +void CPL_DLL OGR_FD_Release( OGRFeatureDefnH ); +const char CPL_DLL *OGR_FD_GetName( OGRFeatureDefnH ); +int CPL_DLL OGR_FD_GetFieldCount( OGRFeatureDefnH ); +OGRFieldDefnH CPL_DLL OGR_FD_GetFieldDefn( OGRFeatureDefnH, int ); +int CPL_DLL OGR_FD_GetFieldIndex( OGRFeatureDefnH, const char * ); +void CPL_DLL OGR_FD_AddFieldDefn( OGRFeatureDefnH, OGRFieldDefnH ); +OGRErr CPL_DLL OGR_FD_DeleteFieldDefn( OGRFeatureDefnH hDefn, int iField ); +OGRErr CPL_DLL OGR_FD_ReorderFieldDefns( OGRFeatureDefnH hDefn, int* panMap ); +OGRwkbGeometryType CPL_DLL OGR_FD_GetGeomType( OGRFeatureDefnH ); +void CPL_DLL OGR_FD_SetGeomType( OGRFeatureDefnH, OGRwkbGeometryType ); +int CPL_DLL OGR_FD_IsGeometryIgnored( OGRFeatureDefnH ); +void CPL_DLL OGR_FD_SetGeometryIgnored( OGRFeatureDefnH, int ); +int CPL_DLL OGR_FD_IsStyleIgnored( OGRFeatureDefnH ); +void CPL_DLL OGR_FD_SetStyleIgnored( OGRFeatureDefnH, int ); +int CPL_DLL OGR_FD_Reference( OGRFeatureDefnH ); +int CPL_DLL OGR_FD_Dereference( OGRFeatureDefnH ); +int CPL_DLL OGR_FD_GetReferenceCount( OGRFeatureDefnH ); + +int CPL_DLL OGR_FD_GetGeomFieldCount( OGRFeatureDefnH hFDefn ); +OGRGeomFieldDefnH CPL_DLL OGR_FD_GetGeomFieldDefn( OGRFeatureDefnH hFDefn, + int i ); +int CPL_DLL OGR_FD_GetGeomFieldIndex( OGRFeatureDefnH hFDefn, + const char *pszName); + +void CPL_DLL OGR_FD_AddGeomFieldDefn( OGRFeatureDefnH hFDefn, + OGRGeomFieldDefnH hGFldDefn); +OGRErr CPL_DLL OGR_FD_DeleteGeomFieldDefn( OGRFeatureDefnH hFDefn, + int iGeomField ); +int CPL_DLL OGR_FD_IsSame( OGRFeatureDefnH hFDefn, + OGRFeatureDefnH hOtherFDefn ); +/* OGRFeature */ + +OGRFeatureH CPL_DLL OGR_F_Create( OGRFeatureDefnH ) CPL_WARN_UNUSED_RESULT; +void CPL_DLL OGR_F_Destroy( OGRFeatureH ); +OGRFeatureDefnH CPL_DLL OGR_F_GetDefnRef( OGRFeatureH ); + +OGRErr CPL_DLL OGR_F_SetGeometryDirectly( OGRFeatureH, OGRGeometryH ); +OGRErr CPL_DLL OGR_F_SetGeometry( OGRFeatureH, OGRGeometryH ); +OGRGeometryH CPL_DLL OGR_F_GetGeometryRef( OGRFeatureH ); +OGRGeometryH CPL_DLL OGR_F_StealGeometry( OGRFeatureH ) CPL_WARN_UNUSED_RESULT; +OGRFeatureH CPL_DLL OGR_F_Clone( OGRFeatureH ) CPL_WARN_UNUSED_RESULT; +int CPL_DLL OGR_F_Equal( OGRFeatureH, OGRFeatureH ); + +int CPL_DLL OGR_F_GetFieldCount( OGRFeatureH ); +OGRFieldDefnH CPL_DLL OGR_F_GetFieldDefnRef( OGRFeatureH, int ); +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 ); +OGRField CPL_DLL *OGR_F_GetRawFieldRef( OGRFeatureH, int ); + +int CPL_DLL OGR_F_GetFieldAsInteger( OGRFeatureH, int ); +GIntBig CPL_DLL OGR_F_GetFieldAsInteger64( OGRFeatureH, int ); +double CPL_DLL OGR_F_GetFieldAsDouble( OGRFeatureH, int ); +const char CPL_DLL *OGR_F_GetFieldAsString( OGRFeatureH, int ); +const int CPL_DLL *OGR_F_GetFieldAsIntegerList( OGRFeatureH, int, int * ); +const GIntBig CPL_DLL *OGR_F_GetFieldAsInteger64List( OGRFeatureH, int, int * ); +const double CPL_DLL *OGR_F_GetFieldAsDoubleList( OGRFeatureH, int, int * ); +char CPL_DLL **OGR_F_GetFieldAsStringList( OGRFeatureH, int ); +GByte CPL_DLL *OGR_F_GetFieldAsBinary( OGRFeatureH, int, int * ); +int CPL_DLL OGR_F_GetFieldAsDateTime( OGRFeatureH, int, int *, int *, int *, + int *, int *, int *, int * ); +int CPL_DLL OGR_F_GetFieldAsDateTimeEx( OGRFeatureH hFeat, int iField, + int *pnYear, int *pnMonth, int *pnDay, + int *pnHour, int *pnMinute, float *pfSecond, + int *pnTZFlag ); + +void CPL_DLL OGR_F_SetFieldInteger( OGRFeatureH, int, int ); +void CPL_DLL OGR_F_SetFieldInteger64( OGRFeatureH, int, GIntBig ); +void CPL_DLL OGR_F_SetFieldDouble( OGRFeatureH, int, double ); +void CPL_DLL OGR_F_SetFieldString( OGRFeatureH, int, const char * ); +void CPL_DLL OGR_F_SetFieldIntegerList( OGRFeatureH, int, int, int * ); +void CPL_DLL OGR_F_SetFieldInteger64List( OGRFeatureH, int, int, const GIntBig * ); +void CPL_DLL OGR_F_SetFieldDoubleList( OGRFeatureH, int, int, double * ); +void CPL_DLL OGR_F_SetFieldStringList( OGRFeatureH, int, char ** ); +void CPL_DLL OGR_F_SetFieldRaw( OGRFeatureH, int, OGRField * ); +void CPL_DLL OGR_F_SetFieldBinary( OGRFeatureH, int, int, GByte * ); +void CPL_DLL OGR_F_SetFieldDateTime( OGRFeatureH, int, + int, int, int, int, int, int, int ); +void CPL_DLL OGR_F_SetFieldDateTimeEx( OGRFeatureH, int, + int, int, int, int, int, float, int ); + +int CPL_DLL OGR_F_GetGeomFieldCount( OGRFeatureH hFeat ); +OGRGeomFieldDefnH CPL_DLL OGR_F_GetGeomFieldDefnRef( OGRFeatureH hFeat, + int iField ); +int CPL_DLL OGR_F_GetGeomFieldIndex( OGRFeatureH hFeat, + const char *pszName); + +OGRGeometryH CPL_DLL OGR_F_GetGeomFieldRef( OGRFeatureH hFeat, + int iField ); +OGRErr CPL_DLL OGR_F_SetGeomFieldDirectly( OGRFeatureH hFeat, + int iField, + OGRGeometryH hGeom ); +OGRErr CPL_DLL OGR_F_SetGeomField( OGRFeatureH hFeat, + int iField, OGRGeometryH hGeom ); + +GIntBig CPL_DLL OGR_F_GetFID( OGRFeatureH ); +OGRErr CPL_DLL OGR_F_SetFID( OGRFeatureH, GIntBig ); +void CPL_DLL OGR_F_DumpReadable( OGRFeatureH, FILE * ); +OGRErr CPL_DLL OGR_F_SetFrom( OGRFeatureH, OGRFeatureH, int ); +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 * ); +OGRStyleTableH CPL_DLL OGR_F_GetStyleTable( OGRFeatureH ); +void CPL_DLL OGR_F_SetStyleTableDirectly( OGRFeatureH, OGRStyleTableH ); +void CPL_DLL OGR_F_SetStyleTable( OGRFeatureH, OGRStyleTableH ); + +const char CPL_DLL *OGR_F_GetNativeData( OGRFeatureH ); +void CPL_DLL OGR_F_SetNativeData( OGRFeatureH, const char* ); +const char CPL_DLL *OGR_F_GetNativeMediaType( OGRFeatureH ); +void CPL_DLL OGR_F_SetNativeMediaType( OGRFeatureH, const char* ); + +void CPL_DLL OGR_F_FillUnsetWithDefault( OGRFeatureH hFeat, + int bNotNullableOnly, + char** papszOptions ); +int CPL_DLL OGR_F_Validate( OGRFeatureH, int nValidateFlags, int bEmitError ); + +/* -------------------------------------------------------------------- */ +/* ogrsf_frmts.h */ +/* -------------------------------------------------------------------- */ + +#ifdef DEBUG +typedef struct OGRLayerHS *OGRLayerH; +typedef struct OGRDataSourceHS *OGRDataSourceH; +typedef struct OGRDriverHS *OGRSFDriverH; +#else +typedef void *OGRLayerH; +typedef void *OGRDataSourceH; +typedef void *OGRSFDriverH; +#endif + +/* OGRLayer */ + +const char CPL_DLL* OGR_L_GetName( OGRLayerH ); +OGRwkbGeometryType CPL_DLL OGR_L_GetGeomType( OGRLayerH ); +OGRGeometryH CPL_DLL OGR_L_GetSpatialFilter( OGRLayerH ); +void CPL_DLL OGR_L_SetSpatialFilter( OGRLayerH, OGRGeometryH ); +void CPL_DLL OGR_L_SetSpatialFilterRect( OGRLayerH, + double, double, double, double ); +void CPL_DLL OGR_L_SetSpatialFilterEx( OGRLayerH, int iGeomField, + OGRGeometryH hGeom ); +void CPL_DLL OGR_L_SetSpatialFilterRectEx( OGRLayerH, int iGeomField, + double dfMinX, double dfMinY, + double dfMaxX, double dfMaxY ); +OGRErr CPL_DLL OGR_L_SetAttributeFilter( OGRLayerH, const char * ); +void CPL_DLL OGR_L_ResetReading( OGRLayerH ); +OGRFeatureH CPL_DLL OGR_L_GetNextFeature( OGRLayerH ) CPL_WARN_UNUSED_RESULT; +OGRErr CPL_DLL OGR_L_SetNextByIndex( OGRLayerH, GIntBig ); +OGRFeatureH CPL_DLL OGR_L_GetFeature( OGRLayerH, GIntBig ) CPL_WARN_UNUSED_RESULT; +OGRErr CPL_DLL OGR_L_SetFeature( OGRLayerH, OGRFeatureH ) CPL_WARN_UNUSED_RESULT; +OGRErr CPL_DLL OGR_L_CreateFeature( OGRLayerH, OGRFeatureH ) CPL_WARN_UNUSED_RESULT; +OGRErr CPL_DLL OGR_L_DeleteFeature( OGRLayerH, GIntBig ) CPL_WARN_UNUSED_RESULT; +OGRFeatureDefnH CPL_DLL OGR_L_GetLayerDefn( OGRLayerH ); +OGRSpatialReferenceH CPL_DLL OGR_L_GetSpatialRef( OGRLayerH ); +int CPL_DLL OGR_L_FindFieldIndex( OGRLayerH, const char *, int bExactMatch ); +GIntBig CPL_DLL OGR_L_GetFeatureCount( OGRLayerH, int ); +OGRErr CPL_DLL OGR_L_GetExtent( OGRLayerH, OGREnvelope *, int ); +OGRErr CPL_DLL OGR_L_GetExtentEx( OGRLayerH, int iGeomField, + OGREnvelope *psExtent, int bForce ); +int CPL_DLL OGR_L_TestCapability( OGRLayerH, const char * ); +OGRErr CPL_DLL OGR_L_CreateField( OGRLayerH, OGRFieldDefnH, int ); +OGRErr CPL_DLL OGR_L_CreateGeomField( OGRLayerH hLayer, + OGRGeomFieldDefnH hFieldDefn, int bForce ); +OGRErr CPL_DLL OGR_L_DeleteField( OGRLayerH, int iField ); +OGRErr CPL_DLL OGR_L_ReorderFields( OGRLayerH, int* panMap ); +OGRErr CPL_DLL OGR_L_ReorderField( OGRLayerH, int iOldFieldPos, int iNewFieldPos ); +OGRErr CPL_DLL OGR_L_AlterFieldDefn( OGRLayerH, int iField, OGRFieldDefnH hNewFieldDefn, int nFlags ); +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 ); +int CPL_DLL OGR_L_Reference( OGRLayerH ); +int CPL_DLL OGR_L_Dereference( OGRLayerH ); +int CPL_DLL OGR_L_GetRefCount( OGRLayerH ); +OGRErr CPL_DLL OGR_L_SyncToDisk( OGRLayerH ); +GIntBig CPL_DLL OGR_L_GetFeaturesRead( OGRLayerH ); +const char CPL_DLL *OGR_L_GetFIDColumn( OGRLayerH ); +const char CPL_DLL *OGR_L_GetGeometryColumn( OGRLayerH ); +OGRStyleTableH CPL_DLL OGR_L_GetStyleTable( OGRLayerH ); +void CPL_DLL OGR_L_SetStyleTableDirectly( OGRLayerH, OGRStyleTableH ); +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 * ); +OGRErr CPL_DLL OGR_L_Union( OGRLayerH, OGRLayerH, OGRLayerH, char**, GDALProgressFunc, void * ); +OGRErr CPL_DLL OGR_L_SymDifference( OGRLayerH, OGRLayerH, OGRLayerH, char**, GDALProgressFunc, void * ); +OGRErr CPL_DLL OGR_L_Identity( OGRLayerH, OGRLayerH, OGRLayerH, char**, GDALProgressFunc, void * ); +OGRErr CPL_DLL OGR_L_Update( OGRLayerH, OGRLayerH, OGRLayerH, char**, GDALProgressFunc, void * ); +OGRErr CPL_DLL OGR_L_Clip( OGRLayerH, OGRLayerH, OGRLayerH, char**, GDALProgressFunc, void * ); +OGRErr CPL_DLL OGR_L_Erase( OGRLayerH, OGRLayerH, OGRLayerH, char**, GDALProgressFunc, void * ); + +/* OGRDataSource */ + +void CPL_DLL OGR_DS_Destroy( OGRDataSourceH ); +const char CPL_DLL *OGR_DS_GetName( OGRDataSourceH ); +int CPL_DLL OGR_DS_GetLayerCount( OGRDataSourceH ); +OGRLayerH CPL_DLL OGR_DS_GetLayer( OGRDataSourceH, int ); +OGRLayerH CPL_DLL OGR_DS_GetLayerByName( OGRDataSourceH, const char * ); +OGRErr CPL_DLL OGR_DS_DeleteLayer( OGRDataSourceH, int ); +OGRSFDriverH CPL_DLL OGR_DS_GetDriver( OGRDataSourceH ); +OGRLayerH CPL_DLL OGR_DS_CreateLayer( OGRDataSourceH, const char *, + OGRSpatialReferenceH, OGRwkbGeometryType, + char ** ); +OGRLayerH CPL_DLL OGR_DS_CopyLayer( OGRDataSourceH, OGRLayerH, const char *, + char ** ); +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 ); +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 ); +OGRErr CPL_DLL OGR_DS_SyncToDisk( OGRDataSourceH ); +OGRStyleTableH CPL_DLL OGR_DS_GetStyleTable( OGRDataSourceH ); +void CPL_DLL OGR_DS_SetStyleTableDirectly( OGRDataSourceH, OGRStyleTableH ); +void CPL_DLL OGR_DS_SetStyleTable( OGRDataSourceH, OGRStyleTableH ); + +/* OGRSFDriver */ + +const char CPL_DLL *OGR_Dr_GetName( OGRSFDriverH ); +OGRDataSourceH CPL_DLL OGR_Dr_Open( OGRSFDriverH, const char *, int ) CPL_WARN_UNUSED_RESULT; +int CPL_DLL OGR_Dr_TestCapability( OGRSFDriverH, const char * ); +OGRDataSourceH CPL_DLL OGR_Dr_CreateDataSource( OGRSFDriverH, const char *, + char ** ) CPL_WARN_UNUSED_RESULT; +OGRDataSourceH CPL_DLL OGR_Dr_CopyDataSource( OGRSFDriverH, OGRDataSourceH, + const char *, char ** ) CPL_WARN_UNUSED_RESULT; +OGRErr CPL_DLL OGR_Dr_DeleteDataSource( OGRSFDriverH, const char * ); + +/* OGRSFDriverRegistrar */ + +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 ); +void CPL_DLL OGRRegisterDriver( OGRSFDriverH ); +void CPL_DLL OGRDeregisterDriver( OGRSFDriverH ); +int CPL_DLL OGRGetDriverCount(void); +OGRSFDriverH CPL_DLL OGRGetDriver( int ); +OGRSFDriverH CPL_DLL OGRGetDriverByName( const char * ); +int CPL_DLL OGRGetOpenDSCount(void); +OGRDataSourceH CPL_DLL OGRGetOpenDS( int iDS ); + + +/* note: this is also declared in ogrsf_frmts.h */ +void CPL_DLL OGRRegisterAll(void); +void CPL_DLL OGRCleanupAll(void); + +/* -------------------------------------------------------------------- */ +/* ogrsf_featurestyle.h */ +/* -------------------------------------------------------------------- */ + +#ifdef DEBUG +typedef struct OGRStyleMgrHS *OGRStyleMgrH; +typedef struct OGRStyleToolHS *OGRStyleToolH; +#else +typedef void *OGRStyleMgrH; +typedef void *OGRStyleToolH; +#endif + +/* OGRStyleMgr */ + +OGRStyleMgrH CPL_DLL OGR_SM_Create(OGRStyleTableH hStyleTable) CPL_WARN_UNUSED_RESULT; +void CPL_DLL OGR_SM_Destroy(OGRStyleMgrH hSM); + +const char CPL_DLL *OGR_SM_InitFromFeature(OGRStyleMgrH hSM, + OGRFeatureH hFeat); +int CPL_DLL OGR_SM_InitStyleString(OGRStyleMgrH hSM, + const char *pszStyleString); +int CPL_DLL OGR_SM_GetPartCount(OGRStyleMgrH hSM, + const char *pszStyleString); +OGRStyleToolH CPL_DLL OGR_SM_GetPart(OGRStyleMgrH hSM, int nPartId, + const char *pszStyleString); +int CPL_DLL OGR_SM_AddPart(OGRStyleMgrH hSM, OGRStyleToolH hST); +int CPL_DLL OGR_SM_AddStyle(OGRStyleMgrH hSM, const char *pszStyleName, + const char *pszStyleString); + +/* OGRStyleTool */ + +OGRStyleToolH CPL_DLL OGR_ST_Create(OGRSTClassId eClassId) CPL_WARN_UNUSED_RESULT; +void CPL_DLL OGR_ST_Destroy(OGRStyleToolH hST); + +OGRSTClassId CPL_DLL OGR_ST_GetType(OGRStyleToolH hST); + +OGRSTUnitId CPL_DLL OGR_ST_GetUnit(OGRStyleToolH hST); +void CPL_DLL OGR_ST_SetUnit(OGRStyleToolH hST, OGRSTUnitId eUnit, + double dfGroundPaperScale); + +const char CPL_DLL *OGR_ST_GetParamStr(OGRStyleToolH hST, int eParam, int *bValueIsNull); +int CPL_DLL OGR_ST_GetParamNum(OGRStyleToolH hST, int eParam, int *bValueIsNull); +double CPL_DLL OGR_ST_GetParamDbl(OGRStyleToolH hST, int eParam, int *bValueIsNull); +void CPL_DLL OGR_ST_SetParamStr(OGRStyleToolH hST, int eParam, const char *pszValue); +void CPL_DLL OGR_ST_SetParamNum(OGRStyleToolH hST, int eParam, int nValue); +void CPL_DLL OGR_ST_SetParamDbl(OGRStyleToolH hST, int eParam, double dfValue); +const char CPL_DLL *OGR_ST_GetStyleString(OGRStyleToolH hST); + +int CPL_DLL OGR_ST_GetRGBFromString(OGRStyleToolH hST, const char *pszColor, + int *pnRed, int *pnGreen, int *pnBlue, + int *pnAlpha); + +/* OGRStyleTable */ + +OGRStyleTableH CPL_DLL OGR_STBL_Create( void ) CPL_WARN_UNUSED_RESULT; +void CPL_DLL OGR_STBL_Destroy( OGRStyleTableH hSTBL ); +int CPL_DLL OGR_STBL_AddStyle( OGRStyleTableH hStyleTable, + const char *pszName, + const char *pszStyleString); +int CPL_DLL OGR_STBL_SaveStyleTable( OGRStyleTableH hStyleTable, + const char *pszFilename ); +int CPL_DLL OGR_STBL_LoadStyleTable( OGRStyleTableH hStyleTable, + const char *pszFilename ); +const char CPL_DLL *OGR_STBL_Find( OGRStyleTableH hStyleTable, const char *pszName ); +void CPL_DLL OGR_STBL_ResetStyleStringReading( OGRStyleTableH hStyleTable ); +const char CPL_DLL *OGR_STBL_GetNextStyle( OGRStyleTableH hStyleTable); +const char CPL_DLL *OGR_STBL_GetLastStyleName( OGRStyleTableH hStyleTable); + +CPL_C_END + +#endif /* ndef OGR_API_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/ogr_attrind.h b/modules/globebrowsing/ext/gdal/include/ogr_attrind.h new file mode 100644 index 0000000000..29a7c7a2f1 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogr_attrind.h @@ -0,0 +1,93 @@ +/****************************************************************************** + * $Id$ + * + * 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 + * + * 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 */ + diff --git a/modules/globebrowsing/ext/gdal/include/ogr_core.h b/modules/globebrowsing/ext/gdal/include/ogr_core.h new file mode 100644 index 0000000000..ba206658f8 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogr_core.h @@ -0,0 +1,910 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenGIS Simple Features Reference Implementation + * Purpose: Define some core portability services for cross-platform OGR code. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 1999, Frank Warmerdam + * Copyright (c) 2007-2014, Even Rouault + * + * 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_CORE_H_INCLUDED +#define OGR_CORE_H_INCLUDED + +#include "cpl_port.h" +#include "gdal_version.h" + +/** + * \file + * + * Core portability services for cross-platform OGR code. + */ + +/** + * Simple container for a bounding region. + */ + +#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) +class CPL_DLL OGREnvelope +{ + public: + OGREnvelope() : MinX(0.0), MaxX(0.0), MinY(0.0), MaxY(0.0) + { + } + + OGREnvelope(const OGREnvelope& oOther) : + MinX(oOther.MinX),MaxX(oOther.MaxX), MinY(oOther.MinY), MaxY(oOther.MaxY) + { + } + + double MinX; + double MaxX; + double MinY; + double MaxY; + +#ifdef HAVE_GCC_DIAGNOSTIC_PUSH +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + int IsInit() const { return MinX != 0 || MinY != 0 || MaxX != 0 || MaxY != 0; } + +#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; + } + } + 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; + } + } + + void Intersect( OGREnvelope const& sOther ) { + if(Intersects(sOther)) + { + if( IsInit() ) + { + MinX = MAX(MinX,sOther.MinX); + MaxX = MIN(MaxX,sOther.MaxX); + MinY = MAX(MinY,sOther.MinY); + MaxY = MIN(MaxY,sOther.MaxY); + } + else + { + MinX = sOther.MinX; + MaxX = sOther.MaxX; + MinY = sOther.MinY; + MaxY = sOther.MaxY; + } + } + else + { + MinX = 0; + MaxX = 0; + MinY = 0; + MaxY = 0; + } + } + + int Intersects(OGREnvelope const& other) const + { + return MinX <= other.MaxX && MaxX >= other.MinX && + MinY <= other.MaxY && MaxY >= other.MinY; + } + + int Contains(OGREnvelope const& other) const + { + return MinX <= other.MinX && MinY <= other.MinY && + MaxX >= other.MaxX && MaxY >= other.MaxY; + } +}; +#else +typedef struct +{ + double MinX; + double MaxX; + double MinY; + double MaxY; +} OGREnvelope; +#endif + + +/** + * Simple container for a bounding region in 3D. + */ + +#if defined(__cplusplus) && !defined(CPL_SURESS_CPLUSPLUS) +class CPL_DLL OGREnvelope3D : public OGREnvelope +{ + public: + OGREnvelope3D() : OGREnvelope(), MinZ(0.0), MaxZ(0.0) + { + } + + OGREnvelope3D(const OGREnvelope3D& oOther) : + OGREnvelope(oOther), + MinZ(oOther.MinZ), MaxZ(oOther.MaxZ) + { + } + + double MinZ; + double MaxZ; + +#ifdef HAVE_GCC_DIAGNOSTIC_PUSH +#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; } +#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; + } + } + 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; + } + } + + void Intersect( OGREnvelope3D const& sOther ) { + if(Intersects(sOther)) + { + if( IsInit() ) + { + MinX = MAX(MinX,sOther.MinX); + MaxX = MIN(MaxX,sOther.MaxX); + MinY = MAX(MinY,sOther.MinY); + MaxY = MIN(MaxY,sOther.MaxY); + MinZ = MAX(MinZ,sOther.MinZ); + MaxZ = MIN(MaxZ,sOther.MaxZ); + } + else + { + MinX = sOther.MinX; + MaxX = sOther.MaxX; + MinY = sOther.MinY; + MaxY = sOther.MaxY; + MinZ = sOther.MinZ; + MaxZ = sOther.MaxZ; + } + } + else + { + MinX = 0; + MaxX = 0; + MinY = 0; + MaxY = 0; + MinZ = 0; + MaxZ = 0; + } + } + + int Intersects(OGREnvelope3D const& other) const + { + return MinX <= other.MaxX && MaxX >= other.MinX && + MinY <= other.MaxY && MaxY >= other.MinY && + MinZ <= other.MaxZ && MaxZ >= other.MinZ; + } + + int Contains(OGREnvelope3D const& other) const + { + return MinX <= other.MinX && MinY <= other.MinY && + MaxX >= other.MaxX && MaxY >= other.MaxY && + MinZ <= other.MinZ && MaxZ >= other.MaxZ; + } +}; +#else +typedef struct +{ + double MinX; + double MaxX; + double MinY; + double MaxY; + double MinZ; + double MaxZ; +} OGREnvelope3D; +#endif + + +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 * ); + +#ifdef STRICT_OGRERR_TYPE +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; +#else +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 */ + +#endif + +typedef int OGRBoolean; + +/* -------------------------------------------------------------------- */ +/* ogr_geometry.h related definitions. */ +/* -------------------------------------------------------------------- */ + +/** + * List of well known binary geometry types. These are used within the BLOBs + * but are also returned from OGRGeometry::getGeometryType() to identify the + * type of a geometry object. + */ +typedef enum +{ + wkbUnknown = 0, /**< unknown type, non-standard */ + + wkbPoint = 1, /**< 0-dimensional geometric object, standard WKB */ + wkbLineString = 2, /**< 1-dimensional geometric object with linear + * interpolation between Points, standard WKB */ + wkbPolygon = 3, /**< planar 2-dimensional geometric object defined + * by 1 exterior boundary and 0 or more interior + * boundaries, standard WKB */ + wkbMultiPoint = 4, /**< GeometryCollection of Points, standard WKB */ + wkbMultiLineString = 5, /**< GeometryCollection of LineStrings, standard WKB */ + wkbMultiPolygon = 6, /**< GeometryCollection of Polygons, standard WKB */ + wkbGeometryCollection = 7, /**< geometric object that is a collection of 1 + or more geometric objects, standard WKB */ + + wkbCircularString = 8, /**< one or more circular arc segments connected end to end, + * ISO SQL/MM Part 3. GDAL >= 2.0 */ + wkbCompoundCurve = 9, /**< sequence of contiguous curves, ISO SQL/MM Part 3. GDAL >= 2.0 */ + wkbCurvePolygon = 10, /**< planar surface, defined by 1 exterior boundary + * and zero or more interior boundaries, that are curves. + * ISO SQL/MM Part 3. GDAL >= 2.0 */ + wkbMultiCurve = 11, /**< GeometryCollection of Curves, ISO SQL/MM Part 3. GDAL >= 2.0 */ + wkbMultiSurface = 12, /**< GeometryCollection of Surfaces, ISO SQL/MM Part 3. GDAL >= 2.0 */ + wkbCurve = 13, /**< Curve (abstract type). ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbSurface = 14, /**< Surface (abstract type). ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbPolyhedralSurface = 15,/**< a contiguous collection of polygons, which share common boundary segments, + * 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 */ + + wkbNone = 100, /**< non-standard, for pure attribute records */ + wkbLinearRing = 101, /**< non-standard, just for createGeometry() */ + + wkbCircularStringZ = 1008, /**< wkbCircularString with Z component. ISO SQL/MM Part 3. GDAL >= 2.0 */ + wkbCompoundCurveZ = 1009, /**< wkbCompoundCurve with Z component. ISO SQL/MM Part 3. GDAL >= 2.0 */ + wkbCurvePolygonZ = 1010, /**< wkbCurvePolygon with Z component. ISO SQL/MM Part 3. GDAL >= 2.0 */ + wkbMultiCurveZ = 1011, /**< wkbMultiCurve with Z component. ISO SQL/MM Part 3. GDAL >= 2.0 */ + wkbMultiSurfaceZ = 1012, /**< wkbMultiSurface with Z component. ISO SQL/MM Part 3. GDAL >= 2.0 */ + wkbCurveZ = 1013, /**< wkbCurve with Z component. ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbSurfaceZ = 1014, /**< wkbSurface with Z component. ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbPolyhedralSurfaceZ = 1015, /**< ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented */ + wkbTINZ = 1016, /**< ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented */ + wkbTriangleZ = 1017, /**< ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented */ + + wkbPointM = 2001, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbLineStringM = 2002, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbPolygonM = 2003, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbMultiPointM = 2004, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbMultiLineStringM = 2005, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbMultiPolygonM = 2006, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbGeometryCollectionM = 2007, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbCircularStringM = 2008, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbCompoundCurveM = 2009, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbCurvePolygonM = 2010, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbMultiCurveM = 2011, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbMultiSurfaceM = 2012, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbCurveM = 2013, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbSurfaceM = 2014, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbPolyhedralSurfaceM = 2015, /**< ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented */ + wkbTINM = 2016, /**< ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented */ + wkbTriangleM = 2017, /**< ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented */ + + wkbPointZM = 3001, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbLineStringZM = 3002, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbPolygonZM = 3003, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbMultiPointZM = 3004, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbMultiLineStringZM = 3005, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbMultiPolygonZM = 3006, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbGeometryCollectionZM = 3007, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbCircularStringZM = 3008, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbCompoundCurveZM = 3009, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbCurvePolygonZM = 3010, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbMultiCurveZM = 3011, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbMultiSurfaceZM = 3012, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbCurveZM = 3013, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbSurfaceZM = 3014, /**< ISO SQL/MM Part 3. GDAL >= 2.1 */ + wkbPolyhedralSurfaceZM = 3015, /**< ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented */ + wkbTINZM = 3016, /**< ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented */ + wkbTriangleZM = 3017, /**< ISO SQL/MM Part 3. Reserved in GDAL >= 2.1 but not yet implemented */ + + wkbPoint25D = 0x80000001, /**< 2.5D extension as per 99-402 */ + wkbLineString25D = 0x80000002, /**< 2.5D extension as per 99-402 */ + wkbPolygon25D = 0x80000003, /**< 2.5D extension as per 99-402 */ + wkbMultiPoint25D = 0x80000004, /**< 2.5D extension as per 99-402 */ + wkbMultiLineString25D = 0x80000005, /**< 2.5D extension as per 99-402 */ + wkbMultiPolygon25D = 0x80000006, /**< 2.5D extension as per 99-402 */ + wkbGeometryCollection25D = 0x80000007 /**< 2.5D extension as per 99-402 */ + +} OGRwkbGeometryType; + +/** + * Output variants of WKB we support. + * + * 99-402 was a short-lived extension to SFSQL 1.1 that used a high-bit flag + * to indicate the presence of Z coordinates in a WKB geometry. + * + * SQL/MM Part 3 and SFSQL 1.2 use offsets of 1000 (Z), 2000 (M) and 3000 (ZM) + * to indicate the present of higher dimensional coordinates in a WKB geometry. + * Reference: + * 09-009_Committee_Draft_ISOIEC_CD_13249-3_SQLMM_Spatial.pdf, + * ISO/IEC JTC 1/SC 32 N 1820, ISO/IEC CD 13249-3:201x(E), Date: 2009-01-16. + * The codes are also found in §8.2.3 of + * OGC 06-103r4 "OpenGIS® Implementation Standard for Geographic information - Simple feature access - Part 1: Common architecture", v1.2.1 + */ +typedef enum +{ + wkbVariantOldOgc, /**< Old-style 99-402 extended dimension (Z) WKB types */ + wkbVariantIso, /**< SFSQL 1.2 and ISO SQL/MM Part 3 extended dimension (Z&M) WKB types */ + 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 +#define wkb25DBit 0x80000000 +#endif + +/** Return the 2D geometry type corresponding to the specified geometry type */ +#define wkbFlatten(x) OGR_GT_Flatten((OGRwkbGeometryType)(x)) + +/** Return if the geometry type is a 3D geometry type + * @since GDAL 2.0 + */ +#define wkbHasZ(x) (OGR_GT_HasZ(x) != 0) + +/** Return the 3D geometry type corresponding to the specified geometry type. + * @since GDAL 2.0 + */ +#define wkbSetZ(x) OGR_GT_SetZ(x) + +/** Return if the geometry type is a measured geometry type + * @since GDAL 2.1 + */ +#define wkbHasM(x) (OGR_GT_HasM(x) != 0) + +/** Return the measured geometry type corresponding to the specified geometry type. + * @since GDAL 2.1 + */ +#define wkbSetM(x) OGR_GT_SetM(x) + +#define ogrZMarker 0x21125711 + +const char CPL_DLL * OGRGeometryTypeToName( OGRwkbGeometryType eType ); +OGRwkbGeometryType CPL_DLL OGRMergeGeometryTypes( OGRwkbGeometryType eMain, + OGRwkbGeometryType eExtra ); +OGRwkbGeometryType CPL_DLL OGRMergeGeometryTypesEx( OGRwkbGeometryType eMain, + OGRwkbGeometryType eExtra, + int bAllowPromotingToCurves ); +OGRwkbGeometryType CPL_DLL OGR_GT_Flatten( OGRwkbGeometryType eType ); +OGRwkbGeometryType CPL_DLL OGR_GT_SetZ( OGRwkbGeometryType eType ); +OGRwkbGeometryType CPL_DLL OGR_GT_SetM( OGRwkbGeometryType eType ); +OGRwkbGeometryType CPL_DLL OGR_GT_SetModifier( OGRwkbGeometryType eType, int bSetZ, int bSetM ); +int CPL_DLL OGR_GT_HasZ( OGRwkbGeometryType eType ); +int CPL_DLL OGR_GT_HasM( OGRwkbGeometryType eType ); +int CPL_DLL OGR_GT_IsSubClassOf( OGRwkbGeometryType eType, + OGRwkbGeometryType eSuperType ); +int CPL_DLL OGR_GT_IsCurve( OGRwkbGeometryType ); +int CPL_DLL OGR_GT_IsSurface( OGRwkbGeometryType ); +int CPL_DLL OGR_GT_IsNonLinear( OGRwkbGeometryType ); +OGRwkbGeometryType CPL_DLL OGR_GT_GetCollection( OGRwkbGeometryType eType ); +OGRwkbGeometryType CPL_DLL OGR_GT_GetCurve( OGRwkbGeometryType eType ); +OGRwkbGeometryType CPL_DLL OGR_GT_GetLinear( OGRwkbGeometryType eType ); + +typedef enum +{ + wkbXDR = 0, /* MSB/Sun/Motoroloa: Most Significant Byte First */ + wkbNDR = 1 /* LSB/Intel/Vax: Least Significant Byte First */ +} OGRwkbByteOrder; + +#ifndef NO_HACK_FOR_IBM_DB2_V72 +# define HACK_FOR_IBM_DB2_V72 +#endif + +#ifdef HACK_FOR_IBM_DB2_V72 +# define DB2_V72_FIX_BYTE_ORDER(x) ((((x) & 0x31) == (x)) ? ((x) & 0x1) : (x)) +# define DB2_V72_UNFIX_BYTE_ORDER(x) ((unsigned char) (OGRGeometry::bGenerate_DB2_V72_BYTE_ORDER ? ((x) | 0x30) : (x))) +#else +# define DB2_V72_FIX_BYTE_ORDER(x) (x) +# define DB2_V72_UNFIX_BYTE_ORDER(x) (x) +#endif + +/** Alter field name. + * Used by OGR_L_AlterFieldDefn(). + */ +#define ALTER_NAME_FLAG 0x1 + +/** Alter field type. + * Used by OGR_L_AlterFieldDefn(). + */ +#define ALTER_TYPE_FLAG 0x2 + +/** Alter field width and precision. + * Used by OGR_L_AlterFieldDefn(). + */ +#define ALTER_WIDTH_PRECISION_FLAG 0x4 + +/** Alter field NOT NULL constraint. + * Used by OGR_L_AlterFieldDefn(). + * @since GDAL 2.0 + */ +#define ALTER_NULLABLE_FLAG 0x8 + +/** Alter field DEFAULT value. + * Used by OGR_L_AlterFieldDefn(). + * @since GDAL 2.0 + */ +#define ALTER_DEFAULT_FLAG 0x10 + +/** Alter all parameters of field definition. + * Used by OGR_L_AlterFieldDefn(). + */ +#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 + */ +#define OGR_F_VAL_NULL 0x00000001 + +/** Validate that geometries respect geometry column type. + * Used by OGR_F_Validate(). + * @since GDAL 2.0 + */ +#define OGR_F_VAL_GEOM_TYPE 0x00000002 + +/** Validate that (string) fields respect field width. + * Used by OGR_F_Validate(). + * @since GDAL 2.0 + */ +#define OGR_F_VAL_WIDTH 0x00000004 + +/** Allow fields that are null when there's an associated default value. + * This can be used for drivers where the low-level layers will automatically set the + * field value to the associated default value. + * This flag only makes sense if OGR_F_VAL_NULL is set too. + * Used by OGR_F_Validate(). + * @since GDAL 2.0 + */ +#define OGR_F_VAL_ALLOW_NULL_WHEN_DEFAULT 0x00000008 + +/** Allow geometry fields to have a different coordinate dimension that their + * geometry column type. + * This flag only makes sense if OGR_F_VAL_GEOM_TYPE is set too. + * Used by OGR_F_Validate(). + * @since GDAL 2.1 + */ +#define OGR_F_VAL_ALLOW_DIFFERENT_GEOM_DIM 0x00000010 + +/** Enable all validation tests (except OGR_F_VAL_ALLOW_DIFFERENT_GEOM_DIM) + * Used by OGR_F_Validate(). + * @since GDAL 2.0 + */ +#define OGR_F_VAL_ALL (0x7FFFFFFF & ~OGR_F_VAL_ALLOW_DIFFERENT_GEOM_DIM) + +/************************************************************************/ +/* ogr_feature.h related definitions. */ +/************************************************************************/ + +/** + * List of feature field types. This list is likely to be extended in the + * future ... avoid coding applications based on the assumption that all + * field types can be known. + */ + +typedef enum +{ + /** Simple 32bit integer */ OFTInteger = 0, + /** List of 32bit integers */ OFTIntegerList = 1, + /** Double Precision floating point */ OFTReal = 2, + /** List of doubles */ OFTRealList = 3, + /** String of ASCII chars */ OFTString = 4, + /** Array of strings */ OFTStringList = 5, + /** deprecated */ OFTWideString = 6, + /** deprecated */ OFTWideStringList = 7, + /** Raw Binary data */ OFTBinary = 8, + /** Date */ OFTDate = 9, + /** Time */ OFTTime = 10, + /** Date and Time */ OFTDateTime = 11, + /** Single 64bit integer */ OFTInteger64 = 12, + /** List of 64bit integers */ OFTInteger64List = 13, + OFTMaxType = 13 +} OGRFieldType; + +/** + * List of field subtypes. A subtype represents a hint, a restriction of the + * main type, that is not strictly necessary to consult. + * This list is likely to be extended in the + * future ... avoid coding applications based on the assumption that all + * field types can be known. + * Most subtypes only make sense for a restricted set of main types. + * @since GDAL 2.0 + */ +typedef enum +{ + /** No subtype. This is the default value */ OFSTNone = 0, + /** Boolean integer. Only valid for OFTInteger and OFTIntegerList.*/ + OFSTBoolean = 1, + /** Signed 16-bit integer. Only valid for OFTInteger and OFTIntegerList. */ + OFSTInt16 = 2, + /** Single precision (32 bit) floating point. Only valid for OFTReal and OFTRealList. */ + OFSTFloat32 = 3, + OFSTMaxSubType = 3 +} OGRFieldSubType; + +/** + * Display justification for field values. + */ + +typedef enum +{ + OJUndefined = 0, + OJLeft = 1, + OJRight = 2 +} OGRJustification; + +#define OGRNullFID -1 +#define OGRUnsetMarker -21121 + +/************************************************************************/ +/* OGRField */ +/************************************************************************/ + +/** + * OGRFeature field attribute value union. + */ + +typedef union { + int Integer; + GIntBig Integer64; + double Real; + char *String; + + struct { + int nCount; + int *paList; + } IntegerList; + + struct { + int nCount; + GIntBig *paList; + } Integer64List; + + struct { + int nCount; + double *paList; + } RealList; + + struct { + int nCount; + char **paList; + } StringList; + + struct { + int nCount; + GByte *paData; + } Binary; + + struct { + int nMarker1; + int nMarker2; + } Set; + + struct { + GInt16 Year; + GByte Month; + GByte Day; + GByte Hour; + GByte Minute; + GByte TZFlag; /* 0=unknown, 1=localtime(ambiguous), + 100=GMT, 104=GMT+1, 80=GMT-5, etc */ + 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; +} OGRField; + +#define OGR_GET_MS(floatingpoint_sec) (int)(((floatingpoint_sec) - (int)(floatingpoint_sec)) * 1000 + 0.5) + +int CPL_DLL OGRParseDate( const char *pszInput, OGRField *psOutput, + int nOptions ); + +/* -------------------------------------------------------------------- */ +/* 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 ODsCCreateLayer "CreateLayer" +#define ODsCDeleteLayer "DeleteLayer" +#define ODsCCreateGeomFieldAfterCreateLayer "CreateGeomFieldAfterCreateLayer" +#define ODsCCurveGeometries "CurveGeometries" +#define ODsCTransactions "Transactions" +#define ODsCEmulatedTransactions "EmulatedTransactions" +#define ODsCMeasuredGeometries "MeasuredGeometries" + +#define ODrCCreateDataSource "CreateDataSource" +#define ODrCDeleteDataSource "DeleteDataSource" + +/* -------------------------------------------------------------------- */ +/* Layer metadata items. */ +/* -------------------------------------------------------------------- */ +/** Capability set to YES as metadata on a layer that has features with + * 64 bit identifiers. + @since GDAL 2.0 + */ +#define OLMD_FID64 "OLMD_FID64" + +/************************************************************************/ +/* ogr_featurestyle.h related definitions. */ +/************************************************************************/ + +/** + * OGRStyleTool derived class types (returned by GetType()). + */ + +typedef enum ogr_style_tool_class_id +{ + OGRSTCNone = 0, + OGRSTCPen = 1, + OGRSTCBrush = 2, + OGRSTCSymbol = 3, + OGRSTCLabel = 4, + OGRSTCVector = 5 +} OGRSTClassId; + +/** + * List of units supported by OGRStyleTools. + */ +typedef enum ogr_style_tool_units_id +{ + OGRSTUGround = 0, + OGRSTUPixel = 1, + OGRSTUPoints = 2, + OGRSTUMM = 3, + OGRSTUCM = 4, + OGRSTUInches = 5 +} OGRSTUnitId; + +/** + * List of parameters for use with OGRStylePen. + */ +typedef enum ogr_style_tool_param_pen_id +{ + OGRSTPenColor = 0, + OGRSTPenWidth = 1, + OGRSTPenPattern = 2, + OGRSTPenId = 3, + OGRSTPenPerOffset = 4, + OGRSTPenCap = 5, + OGRSTPenJoin = 6, + OGRSTPenPriority = 7, + OGRSTPenLast = 8 + +} OGRSTPenParam; + +/** + * List of parameters for use with OGRStyleBrush. + */ +typedef enum ogr_style_tool_param_brush_id +{ + OGRSTBrushFColor = 0, + OGRSTBrushBColor = 1, + OGRSTBrushId = 2, + OGRSTBrushAngle = 3, + OGRSTBrushSize = 4, + OGRSTBrushDx = 5, + OGRSTBrushDy = 6, + OGRSTBrushPriority = 7, + OGRSTBrushLast = 8 + +} 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, + OGRSTSymbolLast = 12 + +} OGRSTSymbolParam; + +/** + * List of parameters for use with OGRStyleLabel. + */ +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, + OGRSTLabelLast = 21 + +} OGRSTLabelParam; + +/* ------------------------------------------------------------------- */ +/* Version checking */ +/* -------------------------------------------------------------------- */ + +/* Note to developers : please keep this section in sync with gdal.h */ + +#ifndef GDAL_VERSION_INFO_DEFINED +#define GDAL_VERSION_INFO_DEFINED +const char CPL_DLL * CPL_STDCALL GDALVersionInfo( const char * ); +#endif + +#ifndef GDAL_CHECK_VERSION + +/** Return TRUE if GDAL library version at runtime matches nVersionMajor.nVersionMinor. + + The purpose of this method is to ensure that calling code will run with the GDAL + version it is compiled for. It is primarily indented for external plugins. + + @param nVersionMajor Major version to be tested against + @param nVersionMinor Minor version to be tested against + @param pszCallingComponentName If not NULL, in case of version mismatch, the method + will issue a failure mentioning the name of + the calling component. + */ +int CPL_DLL CPL_STDCALL GDALCheckVersion( int nVersionMajor, int nVersionMinor, + const char* pszCallingComponentName); + +/** Helper macro for GDALCheckVersion */ +#define GDAL_CHECK_VERSION(pszCallingComponentName) \ + GDALCheckVersion(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, pszCallingComponentName) + +#endif + +CPL_C_END + +#endif /* ndef OGR_CORE_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/ogr_expat.h b/modules/globebrowsing/ext/gdal/include/ogr_expat.h new file mode 100644 index 0000000000..bc19366191 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogr_expat.h @@ -0,0 +1,58 @@ +/****************************************************************************** + * $Id$ + * + * Project: OGR + * Purpose: Convenience function for parsing with Expat library + * Author: Even Rouault, even dot rouault at mines dash paris dot org + * + ****************************************************************************** + * Copyright (c) 2009, Even Rouault + * + * 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_EXPATH_INCLUDED +#define OGR_EXPATH_INCLUDED + +#ifdef HAVE_EXPAT + +#include "cpl_port.h" +#include + +/* Compatibility stuff for expat >= 1.95.0 and < 1.95.7 */ +#ifndef XMLCALL +#define XMLCALL +#endif +#ifndef XML_STATUS_OK +#define XML_STATUS_OK 1 +#define XML_STATUS_ERROR 0 +#endif + +/* XML_StopParser only available for expat >= 1.95.8 */ +#if !defined(XML_MAJOR_VERSION) || (XML_MAJOR_VERSION * 10000 + XML_MINOR_VERSION * 100 + XML_MICRO_VERSION) < 19508 +#define XML_StopParser(parser, resumable) +#warning "Expat version is too old and does not have XML_StopParser. Corrupted files could hang OGR" +#endif + +/* Only for internal use ! */ +XML_Parser CPL_DLL OGRCreateExpatXMLParser(void); + +#endif /* HAVE_EXPAT */ + +#endif /* OGR_EXPATH_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/ogr_feature.h b/modules/globebrowsing/ext/gdal/include/ogr_feature.h new file mode 100644 index 0000000000..cd01ffb482 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogr_feature.h @@ -0,0 +1,490 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenGIS Simple Features Reference Implementation + * Purpose: Class for representing a whole feature, and layer schemas. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 1999, Les Technologies SoftMap Inc. + * Copyright (c) 2008-2013, Even Rouault + * + * 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_FEATURE_H_INCLUDED +#define OGR_FEATURE_H_INCLUDED + +#include "ogr_geometry.h" +#include "ogr_featurestyle.h" +#include "cpl_atomic_ops.h" + +/** + * \file ogr_feature.h + * + * Simple feature classes. + */ + +/************************************************************************/ +/* OGRFieldDefn */ +/************************************************************************/ + +/** + * Definition of an attribute of an OGRFeatureDefn. A field is described by : + *
    + *
  • a name. See SetName() / GetNameRef()
  • + *
  • a type: OFTString, OFTInteger, OFTReal, ... See SetType() / GetType()
  • + *
  • a subtype (optional): OFSTBoolean, ... See SetSubType() / GetSubType()
  • + *
  • a width (optional): maximal number of characters. See SetWidth() / GetWidth()
  • + *
  • a precision (optional): number of digits after decimal point. See SetPrecision() / GetPrecision()
  • + *
  • a NOT NULL constraint (optional). See SetNullable() / IsNullable()
  • + *
  • a default value (optional). See SetDefault() / GetDefault()
  • + *
  • a boolean to indicate whether it should be ignored when retrieving features. See SetIgnored() / IsIgnored()
  • + *
+ */ + +class CPL_DLL OGRFieldDefn +{ + private: + char *pszName; + OGRFieldType eType; + OGRJustification eJustify; + int nWidth; /* zero is variable */ + int nPrecision; + char *pszDefault; + + int bIgnore; + OGRFieldSubType eSubType; + + int bNullable; + + void Initialize( const char *, OGRFieldType ); + + public: + OGRFieldDefn( const char *, OGRFieldType ); + OGRFieldDefn( OGRFieldDefn * ); + ~OGRFieldDefn(); + + void SetName( const char * ); + const char *GetNameRef() { return pszName; } + + OGRFieldType GetType() { return eType; } + void SetType( OGRFieldType eTypeIn ); + static const char *GetFieldTypeName( OGRFieldType ); + + OGRFieldSubType GetSubType() { return eSubType; } + void SetSubType( OGRFieldSubType eSubTypeIn ); + static const char *GetFieldSubTypeName( OGRFieldSubType ); + + OGRJustification GetJustify() { return eJustify; } + void SetJustify( OGRJustification eJustifyIn ) + { eJustify = eJustifyIn; } + + int GetWidth() { return nWidth; } + void SetWidth( int nWidthIn ) { nWidth = MAX(0,nWidthIn); } + + int GetPrecision() { return nPrecision; } + void SetPrecision( int nPrecisionIn ) + { nPrecision = nPrecisionIn; } + + void Set( const char *, OGRFieldType, int = 0, int = 0, + OGRJustification = OJUndefined ); + + void SetDefault( const char* ); + const char *GetDefault() const; + int IsDefaultDriverSpecific() const; + + int IsIgnored() { return bIgnore; } + void SetIgnored( int bIgnoreIn ) { bIgnore = bIgnoreIn; } + + int IsNullable() const { return bNullable; } + void SetNullable( int bNullableIn ) { bNullable = bNullableIn; } + + int IsSame( const OGRFieldDefn * ) const; + + private: + CPL_DISALLOW_COPY_ASSIGN(OGRFieldDefn); +}; + +/************************************************************************/ +/* OGRGeomFieldDefn */ +/************************************************************************/ + +/** + * Definition of a geometry field of an OGRFeatureDefn. A geometry field is + * described by : + *
    + *
  • a name. See SetName() / GetNameRef()
  • + *
  • a type: wkbPoint, wkbLineString, ... See SetType() / GetType()
  • + *
  • a spatial reference system (optional). See SetSpatialRef() / GetSpatialRef()
  • + *
  • a NOT NULL constraint (optional). See SetNullable() / IsNullable()
  • + *
  • a boolean to indicate whether it should be ignored when retrieving features. See SetIgnored() / IsIgnored()
  • + *
+ * + * @since OGR 1.11 + */ + +class CPL_DLL OGRGeomFieldDefn +{ +protected: + char *pszName; + OGRwkbGeometryType eGeomType; /* all values possible except wkbNone */ + OGRSpatialReference* poSRS; + + int bIgnore; + int bNullable; + + void Initialize( const char *, OGRwkbGeometryType ); + +public: + OGRGeomFieldDefn(const char *pszNameIn, + OGRwkbGeometryType eGeomTypeIn); + OGRGeomFieldDefn( OGRGeomFieldDefn * ); + virtual ~OGRGeomFieldDefn(); + + void SetName( const char * ); + const char *GetNameRef() { return pszName; } + + OGRwkbGeometryType GetType() { return eGeomType; } + void SetType( OGRwkbGeometryType eTypeIn ); + + virtual OGRSpatialReference* GetSpatialRef(); + void SetSpatialRef(OGRSpatialReference* poSRSIn); + + int IsIgnored() { return bIgnore; } + void SetIgnored( int bIgnoreIn ) { bIgnore = bIgnoreIn; } + + int IsNullable() const { return bNullable; } + void SetNullable( int bNullableIn ) { bNullable = bNullableIn; } + + int IsSame( OGRGeomFieldDefn * ); + + private: + CPL_DISALLOW_COPY_ASSIGN(OGRGeomFieldDefn); +}; + +/************************************************************************/ +/* OGRFeatureDefn */ +/************************************************************************/ + +/** + * Definition of a feature class or feature layer. + * + * This object contains schema information for a set of OGRFeatures. In + * table based systems, an OGRFeatureDefn is essentially a layer. In more + * object oriented approaches (such as SF CORBA) this can represent a class + * of features but doesn't necessarily relate to all of a layer, or just one + * layer. + * + * This object also can contain some other information such as a name and + * potentially other metadata. + * + * It is essentially a collection of field descriptions (OGRFieldDefn class). + * Starting with GDAL 1.11, in addition to attribute fields, it can also + * contain multiple geometry fields (OGRGeomFieldDefn class). + * + * It is reasonable for different translators to derive classes from + * OGRFeatureDefn with additional translator specific information. + */ + +class CPL_DLL OGRFeatureDefn +{ + protected: + volatile int nRefCount; + + int nFieldCount; + OGRFieldDefn **papoFieldDefn; + + int nGeomFieldCount; + OGRGeomFieldDefn **papoGeomFieldDefn; + + char *pszFeatureClassName; + + int bIgnoreStyle; + + public: + OGRFeatureDefn( const char * pszName = NULL ); + virtual ~OGRFeatureDefn(); + + virtual const char *GetName(); + + virtual int GetFieldCount(); + virtual OGRFieldDefn *GetFieldDefn( int i ); + virtual int GetFieldIndex( const char * ); + + virtual void AddFieldDefn( OGRFieldDefn * ); + virtual OGRErr DeleteFieldDefn( int iField ); + virtual OGRErr ReorderFieldDefns( int* panMap ); + + virtual int GetGeomFieldCount(); + virtual OGRGeomFieldDefn *GetGeomFieldDefn( int i ); + virtual int GetGeomFieldIndex( const char * ); + + virtual void AddGeomFieldDefn( OGRGeomFieldDefn *, int bCopy = TRUE ); + virtual OGRErr DeleteGeomFieldDefn( int iGeomField ); + + virtual OGRwkbGeometryType GetGeomType(); + virtual void SetGeomType( OGRwkbGeometryType ); + + virtual OGRFeatureDefn *Clone(); + + int Reference() { return CPLAtomicInc(&nRefCount); } + int Dereference() { return CPLAtomicDec(&nRefCount); } + int GetReferenceCount() { return nRefCount; } + void Release(); + + virtual int IsGeometryIgnored(); + virtual void SetGeometryIgnored( int bIgnore ); + virtual int IsStyleIgnored() { return bIgnoreStyle; } + virtual void SetStyleIgnored( int bIgnore ) { bIgnoreStyle = bIgnore; } + + virtual int IsSame( OGRFeatureDefn * poOtherFeatureDefn ); + + static OGRFeatureDefn *CreateFeatureDefn( const char *pszName = NULL ); + static void DestroyFeatureDefn( OGRFeatureDefn * ); + + private: + CPL_DISALLOW_COPY_ASSIGN(OGRFeatureDefn); +}; + +/************************************************************************/ +/* OGRFeature */ +/************************************************************************/ + +/** + * A simple feature, including geometry and attributes. + */ + +class CPL_DLL OGRFeature +{ + private: + + GIntBig nFID; + OGRFeatureDefn *poDefn; + OGRGeometry **papoGeometries; + OGRField *pauFields; + char *m_pszNativeData; + char *m_pszNativeMediaType; + + bool SetFieldInternal( int i, OGRField * puValue ); + + protected: + char * m_pszStyleString; + OGRStyleTable *m_poStyleTable; + char * m_pszTmpFieldValue; + + public: + OGRFeature( OGRFeatureDefn * ); + virtual ~OGRFeature(); + + OGRFeatureDefn *GetDefnRef() { return poDefn; } + + OGRErr SetGeometryDirectly( OGRGeometry * ); + OGRErr SetGeometry( OGRGeometry * ); + OGRGeometry *GetGeometryRef(); + OGRGeometry *StealGeometry() CPL_WARN_UNUSED_RESULT; + + int GetGeomFieldCount() + { return poDefn->GetGeomFieldCount(); } + OGRGeomFieldDefn *GetGeomFieldDefnRef( int iField ) + { return poDefn->GetGeomFieldDefn(iField); } + int GetGeomFieldIndex( const char * pszName) + { return poDefn->GetGeomFieldIndex(pszName); } + + OGRGeometry* GetGeomFieldRef(int iField); + OGRGeometry* StealGeometry(int iField); + OGRGeometry* GetGeomFieldRef(const char* pszFName); + OGRErr SetGeomFieldDirectly( int iField, OGRGeometry * ); + OGRErr SetGeomField( int iField, OGRGeometry * ); + + OGRFeature *Clone() CPL_WARN_UNUSED_RESULT; + virtual OGRBoolean Equal( OGRFeature * poFeature ); + + int GetFieldCount() { return poDefn->GetFieldCount(); } + OGRFieldDefn *GetFieldDefnRef( int iField ) + { return poDefn->GetFieldDefn(iField); } + int GetFieldIndex( const char * pszName) + { return poDefn->GetFieldIndex(pszName);} + + int IsFieldSet( int iField ); + + void UnsetField( int iField ); + + OGRField *GetRawFieldRef( int i ) { return pauFields + i; } + + int GetFieldAsInteger( int i ); + GIntBig GetFieldAsInteger64( int i ); + double GetFieldAsDouble( int i ); + const char *GetFieldAsString( int i ); + const int *GetFieldAsIntegerList( int i, int *pnCount ); + const GIntBig *GetFieldAsInteger64List( int i, int *pnCount ); + const double *GetFieldAsDoubleList( int i, int *pnCount ); + 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 GetFieldAsDateTime( int i, + int *pnYear, int *pnMonth, int *pnDay, + int *pnHour, int *pnMinute, float *pfSecond, + int *pnTZFlag ); + + int GetFieldAsInteger( const char *pszFName ) + { return GetFieldAsInteger( GetFieldIndex(pszFName) ); } + GIntBig GetFieldAsInteger64( const char *pszFName ) + { return GetFieldAsInteger64( GetFieldIndex(pszFName) ); } + double GetFieldAsDouble( const char *pszFName ) + { return GetFieldAsDouble( GetFieldIndex(pszFName) ); } + const char *GetFieldAsString( const char *pszFName ) + { return GetFieldAsString( GetFieldIndex(pszFName) ); } + const int *GetFieldAsIntegerList( const char *pszFName, + int *pnCount ) + { return GetFieldAsIntegerList( GetFieldIndex(pszFName), + pnCount ); } + const GIntBig *GetFieldAsInteger64List( const char *pszFName, + int *pnCount ) + { return GetFieldAsInteger64List( GetFieldIndex(pszFName), + pnCount ); } + const double *GetFieldAsDoubleList( const char *pszFName, + int *pnCount ) + { return GetFieldAsDoubleList( GetFieldIndex(pszFName), + pnCount ); } + char **GetFieldAsStringList( const char *pszFName ) + { return GetFieldAsStringList(GetFieldIndex(pszFName)); } + + void SetField( int i, int nValue ); + void SetField( int i, GIntBig nValue ); + 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, double * padfValues ); + void SetField( int i, char ** papszValues ); + void SetField( int i, OGRField * puValue ); + void SetField( int i, int nCount, GByte * pabyBinary ); + void SetField( int i, int nYear, int nMonth, int nDay, + int nHour=0, int nMinute=0, float fSecond=0.f, + int nTZFlag = 0 ); + + void SetField( const char *pszFName, int nValue ) + { SetField( GetFieldIndex(pszFName), nValue ); } + void SetField( const char *pszFName, GIntBig nValue ) + { SetField( GetFieldIndex(pszFName), nValue ); } + void SetField( const char *pszFName, double dfValue ) + { SetField( GetFieldIndex(pszFName), dfValue ); } + 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);} + void SetField( const char *pszFName, int nCount, + const GIntBig * panValues ) + { SetField(GetFieldIndex(pszFName),nCount,panValues);} + void SetField( const char *pszFName, int nCount, + double * padfValues ) + {SetField(GetFieldIndex(pszFName),nCount,padfValues);} + void SetField( const char *pszFName, char ** papszValues ) + { SetField( GetFieldIndex(pszFName), papszValues); } + void SetField( const char *pszFName, OGRField * puValue ) + { SetField( GetFieldIndex(pszFName), puValue ); } + void SetField( const char *pszFName, + int nYear, int nMonth, int nDay, + int nHour=0, int nMinute=0, float fSecond=0.f, + int nTZFlag = 0 ) + { SetField( GetFieldIndex(pszFName), + nYear, nMonth, nDay, + nHour, nMinute, fSecond, nTZFlag ); } + + GIntBig GetFID() { return nFID; } + virtual OGRErr SetFID( GIntBig nFIDIn ); + + void DumpReadable( FILE *, char** papszOptions = NULL ); + + OGRErr SetFrom( OGRFeature *, int = TRUE); + OGRErr SetFrom( OGRFeature *, int *, int = TRUE ); + OGRErr SetFieldsFrom( OGRFeature *, int *, int = TRUE ); + + OGRErr RemapFields( OGRFeatureDefn *poNewDefn, + int *panRemapSource ); + OGRErr RemapGeomFields( OGRFeatureDefn *poNewDefn, + int *panRemapSource ); + + int Validate( int nValidateFlags, + int bEmitError ); + void FillUnsetWithDefault(int bNotNullableOnly, + char** papszOptions ); + + virtual const char *GetStyleString(); + virtual void SetStyleString( const char * ); + virtual void SetStyleStringDirectly( char * ); + virtual OGRStyleTable *GetStyleTable() { return m_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; } + void SetNativeData( const char* pszNativeData ); + void SetNativeMediaType( const char* pszNativeMediaType ); + + static OGRFeature *CreateFeature( OGRFeatureDefn * ); + static void DestroyFeature( OGRFeature * ); + + private: + CPL_DISALLOW_COPY_ASSIGN(OGRFeature); +}; + +/************************************************************************/ +/* OGRFeatureQuery */ +/************************************************************************/ + +class OGRLayer; +class swq_expr_node; +class swq_custom_func_registrar; + +class CPL_DLL OGRFeatureQuery +{ + private: + OGRFeatureDefn *poTargetDefn; + void *pSWQExpr; + + char **FieldCollector( void *, char ** ); + + GIntBig *EvaluateAgainstIndices( swq_expr_node*, OGRLayer *, GIntBig& nFIDCount); + + int CanUseIndex( swq_expr_node*, OGRLayer * ); + + public: + OGRFeatureQuery(); + ~OGRFeatureQuery(); + + OGRErr Compile( OGRFeatureDefn *, const char *, + int bCheck = TRUE, swq_custom_func_registrar* poCustomFuncRegistrar = NULL ); + int Evaluate( OGRFeature * ); + + GIntBig *EvaluateAgainstIndices( OGRLayer *, OGRErr * ); + + int CanUseIndex( OGRLayer * ); + + char **GetUsedFields(); + + void *GetSWQExpr() { return pSWQExpr; } +}; + +#endif /* ndef OGR_FEATURE_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/ogr_featurestyle.h b/modules/globebrowsing/ext/gdal/include/ogr_featurestyle.h new file mode 100644 index 0000000000..6230ef1cce --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogr_featurestyle.h @@ -0,0 +1,466 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenGIS Simple Features Reference Implementation + * Purpose: Define of Feature Representation + * Author: Stephane Villeneuve, stephane.v@videtron.ca + * + ****************************************************************************** + * Copyright (c) 1999, 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 OGR_FEATURESTYLE_INCLUDE +#define OGR_FEATURESTYLE_INCLUDE + +#include "cpl_conv.h" +#include "cpl_string.h" +#include "ogr_core.h" + +class OGRFeature; + +/** + * \file ogr_featurestyle.h + * + * Simple feature style classes. + */ + +/* + * All OGRStyleTool param lists are defined in ogr_core.h. + */ + +typedef enum ogr_style_type +{ + OGRSTypeString, + OGRSTypeDouble, + OGRSTypeInteger, + OGRSTypeBoolean +} OGRSType; + +typedef struct ogr_style_param +{ + int eParam; + const char *pszToken; + GBool bGeoref; + OGRSType eType; +} OGRStyleParamId; + + +typedef struct ogr_style_value +{ + char *pszValue; + double dfValue; + int nValue; // Used for both integer and boolean types + GBool bValid; + OGRSTUnitId eUnit; +} OGRStyleValue; + + +// Every time a pszStyleString given in parameter is NULL, +// the StyleString defined in the Mgr will be use. + +/** + * This class represents a style table + */ +class CPL_DLL OGRStyleTable +{ + private: + char **m_papszStyleTable; + + CPLString osLastRequestedStyleName; + int iNextStyle; + + public: + OGRStyleTable(); + ~OGRStyleTable(); + GBool AddStyle(const char *pszName,const char *pszStyleString); + GBool RemoveStyle(const char *pszName); + GBool ModifyStyle(const char *pszName, const char *pszStyleString); + + GBool SaveStyleTable(const char *pszFilename); + GBool LoadStyleTable(const char *pszFilename); + const char *Find(const char *pszStyleString); + GBool IsExist(const char *pszName); + const char *GetStyleName(const char *pszName); + void Print(FILE *fpOut); + void Clear(); + OGRStyleTable *Clone(); + void ResetStyleStringReading(); + const char *GetNextStyle(); + const char *GetLastStyleName(); +}; + + +class OGRStyleTool; + +/** + * This class represents a style manager + */ +class CPL_DLL OGRStyleMgr +{ + private: + OGRStyleTable *m_poDataSetStyleTable; + char *m_pszStyleString; + + public: + OGRStyleMgr(OGRStyleTable *poDataSetStyleTable = NULL); + ~OGRStyleMgr(); + + GBool SetFeatureStyleString(OGRFeature *,const char *pszStyleString=NULL, + GBool bNoMatching = FALSE); + /* It will set in the given feature the pszStyleString with + the style or will set the style name found in + dataset StyleTable (if bNoMatching == FALSE). */ + + const char *InitFromFeature(OGRFeature *); + GBool InitStyleString(const char *pszStyleString = NULL); + + const char *GetStyleName(const char *pszStyleString= NULL); + const char *GetStyleByName(const char *pszStyleName); + + GBool AddStyle(const char *pszStyleName, const char *pszStyleString=NULL); + + const char *GetStyleString(OGRFeature * = NULL); + + GBool AddPart(OGRStyleTool *); + GBool AddPart(const char *); + + int GetPartCount(const char *pszStyleString = NULL); + OGRStyleTool *GetPart(int hPartId, const char *pszStyleString = NULL); + + /* It could have a reference counting process us for the OGRStyleTable, if + needed. */ + + OGRStyleTable *GetDataSetStyleTable(){return m_poDataSetStyleTable;} + + OGRStyleTool *CreateStyleToolFromStyleString(const char *pszStyleString); + +}; + +/** + * This class represents a style tool + */ +class CPL_DLL OGRStyleTool +{ + private: + GBool m_bModified; + GBool m_bParsed; + double m_dfScale; + OGRSTUnitId m_eUnit; + OGRSTClassId m_eClassId; + char *m_pszStyleString; + + virtual GBool Parse() = 0; + + protected: + GBool Parse(const OGRStyleParamId* pasStyle, + OGRStyleValue* pasValue, + int nCount); + + public: + + OGRStyleTool(){} + OGRStyleTool(OGRSTClassId eClassId); + virtual ~OGRStyleTool(); + + GBool GetRGBFromString(const char *pszColor, int &nRed, int &nGreen, + int &nBlue, int &nTransparence); + int GetSpecificId(const char *pszId, const char *pszWanted); + + GBool IsStyleModified() {return m_bModified;} + void StyleModified() {m_bModified = TRUE;} + + GBool IsStyleParsed() {return m_bParsed;} + void StyleParsed() {m_bParsed = TRUE;} + + OGRSTClassId GetType(); + + void SetInternalInputUnitFromParam(char *pszString); + + void SetUnit(OGRSTUnitId,double dfScale = 1.0); //the dfScale will be + //used if we are working with Ground Unit ( ground = paper * scale); + + OGRSTUnitId GetUnit(){return m_eUnit;} + + // There are two way to set the parameters in the Style, with generic + // methods (using a defined enumeration) or with the reel method specific + // for Each style tools. + + virtual const char *GetStyleString() = 0; + void SetStyleString(const char *pszStyleString); + const char *GetStyleString(const OGRStyleParamId *pasStyleParam , + OGRStyleValue *pasStyleValue, int nSize); + + const char *GetParamStr(const OGRStyleParamId &sStyleParam , + OGRStyleValue &sStyleValue, + GBool &bValueIsNull); + + int GetParamNum(const OGRStyleParamId &sStyleParam , + OGRStyleValue &sStyleValue, + GBool &bValueIsNull); + + double GetParamDbl(const OGRStyleParamId &sStyleParam , + OGRStyleValue &sStyleValue, + GBool &bValueIsNull); + + void SetParamStr(const OGRStyleParamId &sStyleParam , + OGRStyleValue &sStyleValue, + const char *pszParamString); + + void SetParamNum(const OGRStyleParamId &sStyleParam , + OGRStyleValue &sStyleValue, + int nParam); + + void SetParamDbl(const OGRStyleParamId &sStyleParam , + OGRStyleValue &sStyleValue, + double dfParam); + + double ComputeWithUnit(double, OGRSTUnitId); + int ComputeWithUnit(int , OGRSTUnitId); + +}; + +/** + * This class represents a style pen + */ +class CPL_DLL OGRStylePen : public OGRStyleTool +{ + private: + + OGRStyleValue *m_pasStyleValue; + + GBool Parse(); + + public: + + OGRStylePen(); + virtual ~OGRStylePen(); + + /**********************************************************************/ + /* Explicit fct for all parameters defined in the Drawing tools Pen */ + /**********************************************************************/ + + const char *Color(GBool &bDefault){return GetParamStr(OGRSTPenColor,bDefault);} + void SetColor(const char *pszColor){SetParamStr(OGRSTPenColor,pszColor);} + double Width(GBool &bDefault){return GetParamDbl(OGRSTPenWidth,bDefault);} + void SetWidth(double dfWidth){SetParamDbl(OGRSTPenWidth,dfWidth);} + const char *Pattern(GBool &bDefault){return (const char *)GetParamStr(OGRSTPenPattern,bDefault);} + void SetPattern(const char *pszPattern){SetParamStr(OGRSTPenPattern,pszPattern);} + const char *Id(GBool &bDefault){return GetParamStr(OGRSTPenId,bDefault);} + void SetId(const char *pszId){SetParamStr(OGRSTPenId,pszId);} + double PerpendicularOffset(GBool &bDefault){return GetParamDbl(OGRSTPenPerOffset,bDefault);} + void SetPerpendicularOffset(double dfPerp){SetParamDbl(OGRSTPenPerOffset,dfPerp);} + const char *Cap(GBool &bDefault){return GetParamStr(OGRSTPenCap,bDefault);} + void SetCap(const char *pszCap){SetParamStr(OGRSTPenCap,pszCap);} + const char *Join(GBool &bDefault){return GetParamStr(OGRSTPenJoin,bDefault);} + void SetJoin(const char *pszJoin){SetParamStr(OGRSTPenJoin,pszJoin);} + int Priority(GBool &bDefault){return GetParamNum(OGRSTPenPriority,bDefault);} + void SetPriority(int nPriority){SetParamNum(OGRSTPenPriority,nPriority);} + + /*****************************************************************/ + + const char *GetParamStr(OGRSTPenParam eParam, GBool &bValueIsNull); + int GetParamNum(OGRSTPenParam eParam,GBool &bValueIsNull); + double GetParamDbl(OGRSTPenParam eParam,GBool &bValueIsNull); + void SetParamStr(OGRSTPenParam eParam, const char *pszParamString); + void SetParamNum(OGRSTPenParam eParam, int nParam); + void SetParamDbl(OGRSTPenParam eParam, double dfParam); + const char *GetStyleString(); +}; + +/** + * This class represents a style brush + */ +class CPL_DLL OGRStyleBrush : public OGRStyleTool +{ + private: + + OGRStyleValue *m_pasStyleValue; + + GBool Parse(); + + public: + + OGRStyleBrush(); + virtual ~OGRStyleBrush(); + + /* Explicit fct for all parameters defined in the Drawing tools Brush */ + + const char *ForeColor(GBool &bDefault){return GetParamStr(OGRSTBrushFColor,bDefault);} + void SetForeColor(const char *pszColor){SetParamStr(OGRSTBrushFColor,pszColor);} + const char *BackColor(GBool &bDefault){return GetParamStr(OGRSTBrushBColor,bDefault);} + void SetBackColor(const char *pszColor){SetParamStr(OGRSTBrushBColor,pszColor);} + const char *Id(GBool &bDefault){ return GetParamStr(OGRSTBrushId,bDefault);} + void SetId(const char *pszId){SetParamStr(OGRSTBrushId,pszId);} + double Angle(GBool &bDefault){return GetParamDbl(OGRSTBrushAngle,bDefault);} + void SetAngle(double dfAngle){SetParamDbl(OGRSTBrushAngle,dfAngle );} + double Size(GBool &bDefault){return GetParamDbl(OGRSTBrushSize,bDefault);} + void SetSize(double dfSize){SetParamDbl(OGRSTBrushSize,dfSize );} + double SpacingX(GBool &bDefault){return GetParamDbl(OGRSTBrushDx,bDefault);} + void SetSpacingX(double dfX){SetParamDbl(OGRSTBrushDx,dfX );} + double SpacingY(GBool &bDefault){return GetParamDbl(OGRSTBrushDy,bDefault);} + void SetSpacingY(double dfY){SetParamDbl(OGRSTBrushDy,dfY );} + int Priority(GBool &bDefault){ return GetParamNum(OGRSTBrushPriority,bDefault);} + void SetPriority(int nPriority){ SetParamNum(OGRSTBrushPriority,nPriority);} + + /*****************************************************************/ + + const char *GetParamStr(OGRSTBrushParam eParam, GBool &bValueIsNull); + int GetParamNum(OGRSTBrushParam eParam,GBool &bValueIsNull); + double GetParamDbl(OGRSTBrushParam eParam,GBool &bValueIsNull); + void SetParamStr(OGRSTBrushParam eParam, const char *pszParamString); + void SetParamNum(OGRSTBrushParam eParam, int nParam); + void SetParamDbl(OGRSTBrushParam eParam, double dfParam); + const char *GetStyleString(); +}; + +/** + * This class represents a style symbol + */ +class CPL_DLL OGRStyleSymbol : public OGRStyleTool +{ + private: + + OGRStyleValue *m_pasStyleValue; + + GBool Parse(); + + public: + + OGRStyleSymbol(); + virtual ~OGRStyleSymbol(); + + /*****************************************************************/ + /* Explicit fct for all parameters defined in the Drawing tools */ + /*****************************************************************/ + + const char *Id(GBool &bDefault){return GetParamStr(OGRSTSymbolId,bDefault);} + void SetId(const char *pszId){ SetParamStr(OGRSTSymbolId,pszId);} + double Angle(GBool &bDefault){ return GetParamDbl(OGRSTSymbolAngle,bDefault);} + void SetAngle(double dfAngle){SetParamDbl(OGRSTSymbolAngle,dfAngle );} + const char *Color(GBool &bDefault){return GetParamStr(OGRSTSymbolColor,bDefault);} + void SetColor(const char *pszColor){SetParamStr(OGRSTSymbolColor,pszColor);} + double Size(GBool &bDefault){ return GetParamDbl(OGRSTSymbolSize,bDefault);} + void SetSize(double dfSize){ SetParamDbl(OGRSTSymbolSize,dfSize );} + double SpacingX(GBool &bDefault){return GetParamDbl(OGRSTSymbolDx,bDefault);} + void SetSpacingX(double dfX){SetParamDbl(OGRSTSymbolDx,dfX );} + double SpacingY(GBool &bDefault){return GetParamDbl(OGRSTSymbolDy,bDefault);} + void SetSpacingY(double dfY){SetParamDbl(OGRSTSymbolDy,dfY );} + double Step(GBool &bDefault){return GetParamDbl(OGRSTSymbolStep,bDefault);} + void SetStep(double dfStep){SetParamDbl(OGRSTSymbolStep,dfStep );} + double Offset(GBool &bDefault){return GetParamDbl(OGRSTSymbolOffset,bDefault);} + void SetOffset(double dfOffset){SetParamDbl(OGRSTSymbolOffset,dfOffset );} + double Perp(GBool &bDefault){return GetParamDbl(OGRSTSymbolPerp,bDefault);} + void SetPerp(double dfPerp){SetParamDbl(OGRSTSymbolPerp,dfPerp );} + int Priority(GBool &bDefault){return GetParamNum(OGRSTSymbolPriority,bDefault);} + void SetPriority(int nPriority){SetParamNum(OGRSTSymbolPriority,nPriority);} + const char *FontName(GBool &bDefault) + {return GetParamStr(OGRSTSymbolFontName,bDefault);} + void SetFontName(const char *pszFontName) + {SetParamStr(OGRSTSymbolFontName,pszFontName);} + const char *OColor(GBool &bDefault){return GetParamStr(OGRSTSymbolOColor,bDefault);} + void SetOColor(const char *pszColor){SetParamStr(OGRSTSymbolOColor,pszColor);} + + /*****************************************************************/ + + const char *GetParamStr(OGRSTSymbolParam eParam, GBool &bValueIsNull); + int GetParamNum(OGRSTSymbolParam eParam,GBool &bValueIsNull); + double GetParamDbl(OGRSTSymbolParam eParam,GBool &bValueIsNull); + void SetParamStr(OGRSTSymbolParam eParam, const char *pszParamString); + void SetParamNum(OGRSTSymbolParam eParam, int nParam); + void SetParamDbl(OGRSTSymbolParam eParam, double dfParam); + const char *GetStyleString(); +}; + +/** + * This class represents a style label + */ +class CPL_DLL OGRStyleLabel : public OGRStyleTool +{ + private: + + OGRStyleValue *m_pasStyleValue; + + GBool Parse(); + + public: + + OGRStyleLabel(); + virtual ~OGRStyleLabel(); + + /*****************************************************************/ + /* Explicit fct for all parameters defined in the Drawing tools */ + /*****************************************************************/ + + const char *FontName(GBool &bDefault){return GetParamStr(OGRSTLabelFontName,bDefault);} + void SetFontName(const char *pszFontName){SetParamStr(OGRSTLabelFontName,pszFontName);} + double Size(GBool &bDefault){return GetParamDbl(OGRSTLabelSize,bDefault);} + void SetSize(double dfSize){SetParamDbl(OGRSTLabelSize,dfSize);} + const char *TextString(GBool &bDefault){return GetParamStr(OGRSTLabelTextString,bDefault);} + void SetTextString(const char *pszTextString){SetParamStr(OGRSTLabelTextString,pszTextString);} + double Angle(GBool &bDefault){return GetParamDbl(OGRSTLabelAngle,bDefault);} + void SetAngle(double dfAngle){SetParamDbl(OGRSTLabelAngle,dfAngle);} + const char *ForeColor(GBool &bDefault){return GetParamStr(OGRSTLabelFColor,bDefault);} + void SetForColor(const char *pszForColor){SetParamStr(OGRSTLabelFColor,pszForColor);} + const char *BackColor(GBool &bDefault){return GetParamStr(OGRSTLabelBColor,bDefault);} + void SetBackColor(const char *pszBackColor){SetParamStr(OGRSTLabelBColor,pszBackColor);} + const char *Placement(GBool &bDefault){return GetParamStr(OGRSTLabelPlacement,bDefault);} + void SetPlacement(const char *pszPlacement){SetParamStr(OGRSTLabelPlacement,pszPlacement);} + int Anchor(GBool &bDefault){return GetParamNum(OGRSTLabelAnchor,bDefault);} + void SetAnchor(int nAnchor){SetParamNum(OGRSTLabelAnchor,nAnchor);} + double SpacingX(GBool &bDefault){return GetParamDbl(OGRSTLabelDx,bDefault);} + void SetSpacingX(double dfX){SetParamDbl(OGRSTLabelDx,dfX);} + double SpacingY(GBool &bDefault){return GetParamDbl(OGRSTLabelDy,bDefault);} + void SetSpacingY(double dfY){SetParamDbl(OGRSTLabelDy,dfY);} + double Perp(GBool &bDefault){return GetParamDbl(OGRSTLabelPerp,bDefault);} + void SetPerp(double dfPerp){SetParamDbl(OGRSTLabelPerp,dfPerp);} + GBool Bold(GBool &bDefault){return GetParamNum(OGRSTLabelBold,bDefault);} + void SetBold(GBool bBold){SetParamNum(OGRSTLabelBold,bBold);} + GBool Italic(GBool &bDefault){return GetParamNum(OGRSTLabelItalic,bDefault);} + void SetItalic(GBool bItalic){SetParamNum(OGRSTLabelItalic,bItalic);} + GBool Underline(GBool &bDefault){return GetParamNum(OGRSTLabelUnderline,bDefault);} + void SetUnderline(GBool bUnderline){SetParamNum(OGRSTLabelUnderline,bUnderline);} + int Priority(GBool &bDefault){return GetParamNum(OGRSTLabelPriority,bDefault);} + void SetPriority(int nPriority){SetParamNum(OGRSTLabelPriority,nPriority);} + GBool Strikeout(GBool &bDefault){return GetParamNum(OGRSTLabelStrikeout,bDefault);} + void SetStrikeout(GBool bStrikeout){SetParamNum(OGRSTLabelStrikeout,bStrikeout);} + double Stretch(GBool &bDefault){return GetParamDbl(OGRSTLabelStretch,bDefault);} + void SetStretch(double dfStretch){SetParamDbl(OGRSTLabelStretch,dfStretch);} + const char *AdjustmentHor(GBool &bDefault){return GetParamStr(OGRSTLabelAdjHor,bDefault);} + void SetAdjustmentHor(const char *pszAdjustmentHor){SetParamStr(OGRSTLabelAdjHor,pszAdjustmentHor);} + const char *AdjustmentVert(GBool &bDefault){return GetParamStr(OGRSTLabelAdjVert,bDefault);} + void SetAdjustmentVert(const char *pszAdjustmentVert){SetParamStr(OGRSTLabelAdjHor,pszAdjustmentVert);} + const char *ShadowColor(GBool &bDefault){return GetParamStr(OGRSTLabelHColor,bDefault);} + void SetShadowColor(const char *pszShadowColor){SetParamStr(OGRSTLabelHColor,pszShadowColor);} + const char *OutlineColor(GBool &bDefault){return GetParamStr(OGRSTLabelOColor,bDefault);} + void SetOutlineColor(const char *pszOutlineColor){SetParamStr(OGRSTLabelOColor,pszOutlineColor);} + + /*****************************************************************/ + + const char *GetParamStr(OGRSTLabelParam eParam, GBool &bValueIsNull); + int GetParamNum(OGRSTLabelParam eParam,GBool &bValueIsNull); + double GetParamDbl(OGRSTLabelParam eParam,GBool &bValueIsNull); + void SetParamStr(OGRSTLabelParam eParam, const char *pszParamString); + void SetParamNum(OGRSTLabelParam eParam, int nParam); + void SetParamDbl(OGRSTLabelParam eParam, double dfParam); + const char *GetStyleString(); +}; + +#endif /* OGR_FEATURESTYLE_INCLUDE */ diff --git a/modules/globebrowsing/ext/gdal/include/ogr_geocoding.h b/modules/globebrowsing/ext/gdal/include/ogr_geocoding.h new file mode 100644 index 0000000000..0817776768 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogr_geocoding.h @@ -0,0 +1,63 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenGIS Simple Features Reference Implementation + * Purpose: Client of geocoding service. + * Author: Even Rouault, + * + ****************************************************************************** + * Copyright (c) 2012, Even Rouault + * + * 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_GEOCODING_H_INCLUDED +#define OGR_GEOCODING_H_INCLUDED + +#include "cpl_port.h" +#include "ogr_api.h" + +/** + * \file ogr_geocoding.h + * + * C API for geocoding client. + */ + +CPL_C_START + +typedef struct _OGRGeocodingSessionHS *OGRGeocodingSessionH; + +OGRGeocodingSessionH CPL_DLL OGRGeocodeCreateSession(char** papszOptions); + +void CPL_DLL OGRGeocodeDestroySession(OGRGeocodingSessionH hSession); + +OGRLayerH CPL_DLL OGRGeocode(OGRGeocodingSessionH hSession, + const char* pszQuery, + char** papszStructuredQuery, + char** papszOptions); + +OGRLayerH CPL_DLL OGRGeocodeReverse(OGRGeocodingSessionH hSession, + double dfLon, double dfLat, + char** papszOptions); + +void CPL_DLL OGRGeocodeFreeResult(OGRLayerH hLayer); + +CPL_C_END + +#endif // OGR_GEOCODING_H_INCLUDED diff --git a/modules/globebrowsing/ext/gdal/include/ogr_geometry.h b/modules/globebrowsing/ext/gdal/include/ogr_geometry.h new file mode 100644 index 0000000000..4406051e80 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogr_geometry.h @@ -0,0 +1,1400 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenGIS Simple Features Reference Implementation + * Purpose: Classes for manipulating simple features that is not specific + * to a particular interface technology. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 1999, Frank Warmerdam + * Copyright (c) 2008-2014, Even Rouault + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + ****************************************************************************/ + +#ifndef OGR_GEOMETRY_H_INCLUDED +#define OGR_GEOMETRY_H_INCLUDED + +#include "ogr_core.h" +#include "ogr_spatialref.h" + +/** + * \file ogr_geometry.h + * + * Simple feature geometry classes. + */ + +/** + * Simple container for a position. + */ +class OGRRawPoint +{ + public: + OGRRawPoint() + { + x = y = 0.0; + } + + OGRRawPoint(double xIn, double yIn) : x(xIn), y(yIn) {} + double x; + double y; +}; + +typedef struct GEOSGeom_t *GEOSGeom; +typedef struct GEOSContextHandle_HS *GEOSContextHandle_t; + +class OGRPoint; +class OGRCurve; +class OGRCompoundCurve; +class OGRLinearRing; +class OGRLineString; +class OGRSurface; +class OGRCurvePolygon; +class OGRPolygon; +class OGRMultiSurface; +class OGRMultiPolygon; +class OGRMultiCurve; +class OGRMultiLineString; + +typedef OGRLineString* (*OGRCurveCasterToLineString)(OGRCurve*); +typedef OGRLinearRing* (*OGRCurveCasterToLinearRing)(OGRCurve*); + +typedef OGRPolygon* (*OGRSurfaceCasterToPolygon)(OGRSurface*); +typedef OGRCurvePolygon* (*OGRSurfaceCasterToCurvePolygon)(OGRSurface*); + +/************************************************************************/ +/* OGRGeometry */ +/************************************************************************/ + +/** + * Abstract base class for all geometry classes. + * + * Some spatial analysis methods require that OGR is built on the GEOS library + * to work properly. The precise meaning of methods that describe spatial relationships + * between geometries is described in the SFCOM, or other simple features interface + * specifications, like "OpenGIS® Implementation Specification for + * Geographic information - Simple feature access - Part 1: Common architecture" + * (OGC 06-103r4) + * + * In GDAL 2.0, the hierarchy of classes has been extended with + * + * (working draft) ISO SQL/MM Part 3 (ISO/IEC 13249-3) curve geometries : + * CIRCULARSTRING (OGRCircularString), COMPOUNDCURVE (OGRCompoundCurve), + * CURVEPOLYGON (OGRCurvePolygon), MULTICURVE (OGRMultiCurve) and MULTISURFACE (OGRMultiSurface). + * + */ + +class CPL_DLL OGRGeometry +{ + private: + OGRSpatialReference * poSRS; // may be NULL + + protected: + friend class OGRCurveCollection; + + unsigned int flags; + + OGRErr importPreambuleFromWkt( char ** ppszInput, + int* pbHasZ, int* pbHasM, + bool* pbIsEmpty ); + OGRErr importCurveCollectionFromWkt( char ** ppszInput, + int bAllowEmptyComponent, + int bAllowLineString, + int bAllowCurve, + int bAllowCompoundCurve, + OGRErr (*pfnAddCurveDirectly)(OGRGeometry* poSelf, OGRCurve* poCurve) ); + OGRErr importPreambuleFromWkb( unsigned char * pabyData, + int nSize, + OGRwkbByteOrder& eByteOrder, + OGRwkbVariant eWkbVariant ); + OGRErr importPreambuleOfCollectionFromWkb( + unsigned char * pabyData, + int& nSize, + int& nDataOffset, + OGRwkbByteOrder& eByteOrder, + int nMinSubGeomSize, + int& nGeomCount, + OGRwkbVariant eWkbVariant ); + OGRErr PointOnSurfaceInternal( OGRPoint * poPoint ) const; + + public: + +/************************************************************************/ +/* Bit flags for OGRGeometry */ +/* The OGR_G_NOT_EMPTY_POINT is used *only* for points. */ +/* Do not use these outside of the core. */ +/* Use Is3D, IsMeasured, set3D, and setMeasured instead */ +/************************************************************************/ + + static const unsigned int OGR_G_NOT_EMPTY_POINT = 0x1; + static const unsigned int OGR_G_3D = 0x2; + static const unsigned int OGR_G_MEASURED = 0x4; + + OGRGeometry(); + OGRGeometry( const OGRGeometry& other ); + virtual ~OGRGeometry(); + + OGRGeometry& operator=( const OGRGeometry& other ); + + // standard IGeometry + virtual int getDimension() const = 0; + virtual int getCoordinateDimension() const; + int CoordinateDimension() const; + virtual OGRBoolean IsEmpty() const; + virtual OGRBoolean IsValid() const; + virtual OGRBoolean IsSimple() const; + OGRBoolean Is3D() const { return flags & OGR_G_3D; } + OGRBoolean IsMeasured() const { return flags & OGR_G_MEASURED; } + virtual OGRBoolean IsRing() const; + virtual void empty() = 0; + virtual OGRGeometry *clone() const CPL_WARN_UNUSED_RESULT = 0; + virtual void getEnvelope( OGREnvelope * psEnvelope ) const = 0; + virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const = 0; + + // IWks Interface + virtual int WkbSize() const = 0; + virtual OGRErr importFromWkb( unsigned char *, int=-1, OGRwkbVariant=wkbVariantOldOgc )=0; + virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc ) const = 0; + virtual OGRErr importFromWkt( char ** ppszInput ) = 0; + virtual OGRErr exportToWkt( char ** ppszDstText, OGRwkbVariant=wkbVariantOldOgc ) const = 0; + + // non-standard + virtual OGRwkbGeometryType getGeometryType() const = 0; + OGRwkbGeometryType getIsoGeometryType() const; + virtual const char *getGeometryName() const = 0; + virtual void dumpReadable( FILE *, const char * = NULL, char** papszOptions = NULL ) const; + virtual void flattenTo2D() = 0; + virtual char * exportToGML( const char* const * papszOptions = NULL ) const; + virtual char * exportToKML() const; + virtual char * exportToJson() const; + + static GEOSContextHandle_t createGEOSContext(); + static void freeGEOSContext(GEOSContextHandle_t hGEOSCtxt); + virtual GEOSGeom exportToGEOS(GEOSContextHandle_t hGEOSCtxt) const CPL_WARN_UNUSED_RESULT; + virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const; + virtual OGRGeometry* getCurveGeometry(const char* const* papszOptions = NULL) const CPL_WARN_UNUSED_RESULT; + virtual OGRGeometry* getLinearGeometry(double dfMaxAngleStepSizeDegrees = 0, + const char* const* papszOptions = NULL) const CPL_WARN_UNUSED_RESULT; + + virtual void closeRings(); + + virtual void setCoordinateDimension( int nDimension ); + virtual void set3D( OGRBoolean bIs3D ); + virtual void setMeasured( OGRBoolean bIsMeasured ); + + void assignSpatialReference( OGRSpatialReference * poSR ); + OGRSpatialReference *getSpatialReference( void ) const { return poSRS; } + + virtual OGRErr transform( OGRCoordinateTransformation *poCT ) = 0; + OGRErr transformTo( OGRSpatialReference *poSR ); + + virtual void segmentize(double dfMaxLength); + + // ISpatialRelation + virtual OGRBoolean Intersects( const OGRGeometry * ) const; + virtual OGRBoolean Equals( OGRGeometry * ) const = 0; + virtual OGRBoolean Disjoint( const OGRGeometry * ) const; + virtual OGRBoolean Touches( const OGRGeometry * ) const; + virtual OGRBoolean Crosses( const OGRGeometry * ) const; + virtual OGRBoolean Within( const OGRGeometry * ) const; + virtual OGRBoolean Contains( const OGRGeometry * ) const; + virtual OGRBoolean Overlaps( const OGRGeometry * ) const; +// virtual OGRBoolean Relate( const OGRGeometry *, const char * ) const; +// virtual OGRGeometry *LocateAlong( double mValue ) const; +// virtual OGRGeometry *LocateBetween( double mStart, double mEnd ) const; + + virtual OGRGeometry *Boundary() const CPL_WARN_UNUSED_RESULT; + virtual double Distance( const OGRGeometry * ) const ; + virtual OGRGeometry *ConvexHull() const CPL_WARN_UNUSED_RESULT; + virtual OGRGeometry *Buffer( double dfDist, int nQuadSegs = 30 ) const CPL_WARN_UNUSED_RESULT; + virtual OGRGeometry *Intersection( const OGRGeometry *) const CPL_WARN_UNUSED_RESULT; + virtual OGRGeometry *Union( const OGRGeometry * ) const CPL_WARN_UNUSED_RESULT; + virtual OGRGeometry *UnionCascaded() const CPL_WARN_UNUSED_RESULT; + virtual OGRGeometry *Difference( const OGRGeometry * ) const CPL_WARN_UNUSED_RESULT; + virtual OGRGeometry *SymDifference( const OGRGeometry * ) const CPL_WARN_UNUSED_RESULT; + virtual OGRErr Centroid( OGRPoint * poPoint ) const; + virtual OGRGeometry *Simplify(double dTolerance) const CPL_WARN_UNUSED_RESULT; + OGRGeometry *SimplifyPreserveTopology(double dTolerance) const CPL_WARN_UNUSED_RESULT; + virtual OGRGeometry *DelaunayTriangulation(double dfTolerance, int bOnlyEdges) const CPL_WARN_UNUSED_RESULT; + + virtual OGRGeometry *Polygonize() const CPL_WARN_UNUSED_RESULT; + + // backward compatibility to non-standard method names. + OGRBoolean Intersect( OGRGeometry * ) const CPL_WARN_DEPRECATED("Non standard method. Use Intersects() instead"); + OGRBoolean Equal( OGRGeometry * ) const CPL_WARN_DEPRECATED("Non standard method. Use Equals() instead"); + OGRGeometry *SymmetricDifference( const OGRGeometry * ) const CPL_WARN_DEPRECATED("Non standard method. Use SymDifference() instead"); + OGRGeometry *getBoundary() const CPL_WARN_DEPRECATED("Non standard method. Use Boundary() instead"); + + // Special HACK for DB2 7.2 support + static int bGenerate_DB2_V72_BYTE_ORDER; + + virtual void swapXY(); + + static OGRGeometry* CastToIdentity(OGRGeometry* poGeom) { return poGeom; } + static OGRGeometry* CastToError(OGRGeometry* poGeom); +}; + +/************************************************************************/ +/* OGRPoint */ +/************************************************************************/ + +/** + * Point class. + * + * Implements SFCOM IPoint methods. + */ + +class CPL_DLL OGRPoint : public OGRGeometry +{ + double x; + double y; + double z; + double m; + + public: + OGRPoint(); + OGRPoint( double x, double y ); + OGRPoint( double x, double y, double z ); + OGRPoint( double x, double y, double z, double m ); + OGRPoint( const OGRPoint& other ); + virtual ~OGRPoint(); + + OGRPoint& operator=( const OGRPoint& other ); + + // IWks Interface + virtual int WkbSize() const; + virtual OGRErr importFromWkb( unsigned char *, int=-1, OGRwkbVariant=wkbVariantOldOgc ); + virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc ) const; + virtual OGRErr importFromWkt( char ** ); + virtual OGRErr exportToWkt( char ** ppszDstText, OGRwkbVariant=wkbVariantOldOgc ) const; + + // IGeometry + virtual int getDimension() const; + virtual OGRGeometry *clone() const; + virtual void empty(); + virtual void getEnvelope( OGREnvelope * psEnvelope ) const; + virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const; + virtual OGRBoolean IsEmpty() const { return !(flags & OGR_G_NOT_EMPTY_POINT); } + + // IPoint + double getX() const { return x; } + double getY() const { return y; } + double getZ() const { return z; } + double getM() const { return m; } + + // Non standard + virtual void setCoordinateDimension( int nDimension ); + void setX( double xIn ) { x = xIn; flags |= OGR_G_NOT_EMPTY_POINT; } + void setY( double yIn ) { y = yIn; flags |= OGR_G_NOT_EMPTY_POINT; } + void setZ( double zIn ) { z = zIn; flags |= (OGR_G_NOT_EMPTY_POINT | OGR_G_3D); } + void setM( double mIn ) { m = mIn; flags |= (OGR_G_NOT_EMPTY_POINT | OGR_G_MEASURED); } + + // ISpatialRelation + virtual OGRBoolean Equals( OGRGeometry * ) const; + virtual OGRBoolean Intersects( const OGRGeometry * ) const; + virtual OGRBoolean Within( const OGRGeometry * ) const; + + // Non standard from OGRGeometry + virtual const char *getGeometryName() const; + virtual OGRwkbGeometryType getGeometryType() const; + virtual OGRErr transform( OGRCoordinateTransformation *poCT ); + virtual void flattenTo2D(); + + virtual void swapXY(); +}; + +/************************************************************************/ +/* OGRPointIterator */ +/************************************************************************/ + +/** + * Interface for a point iterator. + * + * @since GDAL 2.0 + */ + +class CPL_DLL OGRPointIterator +{ + public: + virtual ~OGRPointIterator(); + virtual OGRBoolean getNextPoint(OGRPoint* p) = 0; + + static void destroy(OGRPointIterator*); +}; + +/************************************************************************/ +/* OGRCurve */ +/************************************************************************/ + +/** + * Abstract curve base class for OGRLineString, OGRCircularString and + * OGRCompoundCurve + */ + +class CPL_DLL OGRCurve : public OGRGeometry +{ + protected: + OGRCurve(); + OGRCurve( const OGRCurve& other ); + + virtual OGRCurveCasterToLineString GetCasterToLineString() const = 0; + virtual OGRCurveCasterToLinearRing GetCasterToLinearRing() const = 0; + + friend class OGRCurvePolygon; + friend class OGRCompoundCurve; + virtual int ContainsPoint( const OGRPoint* p ) const; + virtual double get_AreaOfCurveSegments() const = 0; + + public: + virtual ~OGRCurve(); + + OGRCurve& operator=( const OGRCurve& other ); + + // ICurve methods + virtual double get_Length() const = 0; + virtual void StartPoint(OGRPoint *) const = 0; + virtual void EndPoint(OGRPoint *) const = 0; + virtual int get_IsClosed() const; + virtual void Value( double, OGRPoint * ) const = 0; + virtual OGRLineString* CurveToLine(double dfMaxAngleStepSizeDegrees = 0, + const char* const* papszOptions = NULL) const = 0; + virtual int getDimension() const; + + // non standard + virtual int getNumPoints() const = 0; + virtual OGRPointIterator* getPointIterator() const = 0; + virtual OGRBoolean IsConvex() const; + virtual double get_Area() const = 0; + + static OGRCompoundCurve* CastToCompoundCurve(OGRCurve* puCurve); + static OGRLineString* CastToLineString(OGRCurve* poCurve); + static OGRLinearRing* CastToLinearRing(OGRCurve* poCurve); +}; + +/************************************************************************/ +/* OGRSimpleCurve */ +/************************************************************************/ + +/** + * Abstract curve base class for OGRLineString and OGRCircularString + * + * Note: this class does not exist in SQL/MM standard and exists for + * implementation convenience. + * + * @since GDAL 2.0 + */ + +class CPL_DLL OGRSimpleCurve: public OGRCurve +{ + protected: + friend class OGRGeometry; + + int nPointCount; + OGRRawPoint *paoPoints; + double *padfZ; + double *padfM; + + void Make3D(); + void Make2D(); + void RemoveM(); + void AddM(); + + OGRErr importFromWKTListOnly( char ** ppszInput, int bHasZ, int bHasM, + OGRRawPoint*& paoPointsIn, int& nMaxPoints, + double*& padfZIn ); + + virtual double get_LinearArea() const; + + OGRSimpleCurve(); + OGRSimpleCurve( const OGRSimpleCurve& other ); + + public: + virtual ~OGRSimpleCurve(); + + OGRSimpleCurve& operator=( const OGRSimpleCurve& other ); + + // IWks Interface + virtual int WkbSize() const; + virtual OGRErr importFromWkb( unsigned char *, int = -1, OGRwkbVariant=wkbVariantOldOgc ); + virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc ) const; + virtual OGRErr importFromWkt( char ** ); + virtual OGRErr exportToWkt( char ** ppszDstText, OGRwkbVariant=wkbVariantOldOgc ) const; + + // IGeometry interface + virtual OGRGeometry *clone() const; + virtual void empty(); + virtual void getEnvelope( OGREnvelope * psEnvelope ) const; + virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const; + virtual OGRBoolean IsEmpty() const; + + // ICurve methods + virtual double get_Length() const; + virtual void StartPoint(OGRPoint *) const; + virtual void EndPoint(OGRPoint *) const; + virtual void Value( double, OGRPoint * ) const; + virtual double Project(const OGRPoint *) const; + virtual OGRLineString* getSubLine(double, double, int) const; + + // ILineString methods + virtual int getNumPoints() const { return nPointCount; } + void getPoint( int, OGRPoint * ) const; + double getX( int i ) const { return paoPoints[i].x; } + double getY( int i ) const { return paoPoints[i].y; } + double getZ( int i ) const; + double getM( int i ) const; + + // ISpatialRelation + virtual OGRBoolean Equals( OGRGeometry * ) const; + + // non standard. + virtual void setCoordinateDimension( int nDimension ); + virtual void set3D( OGRBoolean bIs3D ); + virtual void setMeasured( OGRBoolean bIsMeasured ); + void setNumPoints( int nNewPointCount, int bZeroizeNewContent = TRUE ); + void setPoint( int, OGRPoint * ); + void setPoint( int, double, double ); + void setZ( int, double ); + void setM( int, double ); + void setPoint( int, double, double, double ); + void setPointM( int, double, double, double ); + void setPoint( int, double, double, double, double ); + void setPoints( int, OGRRawPoint *, double * = NULL ); + void setPointsM( int, OGRRawPoint *, double * ); + void setPoints( int, OGRRawPoint *, double *, double * ); + void setPoints( int, double * padfX, double * padfY, + double *padfZIn = NULL ); + void setPointsM( int, double * padfX, double * padfY, + double *padfMIn = NULL ); + void setPoints( int, double * padfX, double * padfY, + double *padfZIn, double *padfMIn ); + void addPoint( OGRPoint * ); + void addPoint( double, double ); + void addPoint( double, double, double ); + void addPointM( double, double, double ); + void addPoint( double, double, double, double ); + + void getPoints( OGRRawPoint *, double * = NULL ) const; + void getPoints( OGRRawPoint *, double *, double * ) const; + void getPoints( void* pabyX, int nXStride, + void* pabyY, int nYStride, + void* pabyZ = NULL, int nZStride = 0 ) const; + void getPoints( void* pabyX, int nXStride, + void* pabyY, int nYStride, + void* pabyZ, int nZStride, + void* pabyM, int nMStride ) const; + + void addSubLineString( const OGRLineString *, + int nStartVertex = 0, int nEndVertex = -1 ); + void reversePoints( void ); + virtual OGRPointIterator* getPointIterator() const; + + // non-standard from OGRGeometry + virtual OGRErr transform( OGRCoordinateTransformation *poCT ); + virtual void flattenTo2D(); + virtual void segmentize(double dfMaxLength); + + virtual void swapXY(); +}; + +/************************************************************************/ +/* OGRLineString */ +/************************************************************************/ + +/** + * Concrete representation of a multi-vertex line. + * + * Note: for implementation convenience, we make it inherit from OGRSimpleCurve whereas + * SFSQL and SQL/MM only make it inherits from OGRCurve. + */ + +class CPL_DLL OGRLineString : public OGRSimpleCurve +{ + protected: + static OGRLineString* TransferMembersAndDestroy( + OGRLineString* poSrc, + OGRLineString* poDst); + + static OGRLinearRing* CastToLinearRing(OGRLineString* poLS); + + virtual OGRCurveCasterToLineString GetCasterToLineString() const; + virtual OGRCurveCasterToLinearRing GetCasterToLinearRing() const; + + virtual double get_AreaOfCurveSegments() const; + + public: + OGRLineString(); + OGRLineString(const OGRLineString& other); + virtual ~OGRLineString(); + + OGRLineString& operator=(const OGRLineString& other); + + virtual OGRLineString* CurveToLine(double dfMaxAngleStepSizeDegrees = 0, + const char* const* papszOptions = NULL) const; + virtual OGRGeometry* getCurveGeometry(const char* const* papszOptions = NULL) const; + virtual double get_Area() const; + + // non-standard from OGRGeometry + virtual OGRwkbGeometryType getGeometryType() const; + virtual const char *getGeometryName() const; +}; + +/************************************************************************/ +/* OGRLinearRing */ +/************************************************************************/ + +/** + * Concrete representation of a closed ring. + * + * This class is functionally equivalent to an OGRLineString, but has a + * separate identity to maintain alignment with the OpenGIS simple feature + * data model. It exists to serve as a component of an OGRPolygon. + * + * The OGRLinearRing has no corresponding free standing well known binary + * representation, so importFromWkb() and exportToWkb() will not actually + * work. There is a non-standard GDAL WKT representation though. + * + * Because OGRLinearRing is not a "proper" free standing simple features + * object, it cannot be directly used on a feature via SetGeometry(), and + * cannot generally be used with GEOS for operations like Intersects(). + * Instead the polygon should be used, or the OGRLinearRing should be + * converted to an OGRLineString for such operations. + * + * Note: this class exists in SFSQL 1.2, but not in ISO SQL/MM Part 3. + */ + +class CPL_DLL OGRLinearRing : public OGRLineString +{ + protected: + friend class OGRPolygon; + + // These are not IWks compatible ... just a convenience for OGRPolygon. + virtual int _WkbSize( int _flags ) const; + virtual OGRErr _importFromWkb( OGRwkbByteOrder, int _flags, + unsigned char *, int=-1 ); + virtual OGRErr _exportToWkb( OGRwkbByteOrder, int _flags, + unsigned char * ) const; + + static OGRLineString* CastToLineString(OGRLinearRing* poLR); + + virtual OGRCurveCasterToLineString GetCasterToLineString() const; + virtual OGRCurveCasterToLinearRing GetCasterToLinearRing() const; + + public: + OGRLinearRing(); + OGRLinearRing(const OGRLinearRing& other); + OGRLinearRing( OGRLinearRing * ); + virtual ~OGRLinearRing(); + + OGRLinearRing& operator=(const OGRLinearRing& other); + + // Non standard. + virtual const char *getGeometryName() const; + virtual OGRGeometry *clone() const; + virtual int isClockwise() const; + virtual void reverseWindingOrder(); + virtual void closeRings(); + OGRBoolean isPointInRing(const OGRPoint* pt, int bTestEnvelope = TRUE) const; + OGRBoolean isPointOnRingBoundary(const OGRPoint* pt, int bTestEnvelope = TRUE) const; + + // IWks Interface - Note this isn't really a first class object + // for the purposes of WKB form. These methods always fail since this + // object can't be serialized on its own. + virtual int WkbSize() const; + virtual OGRErr importFromWkb( unsigned char *, int=-1, OGRwkbVariant=wkbVariantOldOgc ); + virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc ) const; +}; + +/************************************************************************/ +/* OGRCircularString */ +/************************************************************************/ + +/** + * Concrete representation of a circular string, that is to say a curve made + * of one or several arc circles. + * + * Note: for implementation convenience, we make it inherit from OGRSimpleCurve whereas + * SQL/MM only makes it inherits from OGRCurve. + * + * Compatibility: ISO SQL/MM Part 3. + * + * @since GDAL 2.0 + */ + +class CPL_DLL OGRCircularString : public OGRSimpleCurve +{ + private: + void ExtendEnvelopeWithCircular( OGREnvelope * psEnvelope ) const; + OGRBoolean IsValidFast() const; + int IsFullCircle( double& cx, double& cy, double& square_R ) const; + + protected: + virtual OGRCurveCasterToLineString GetCasterToLineString() const; + virtual OGRCurveCasterToLinearRing GetCasterToLinearRing() const; + virtual int ContainsPoint( const OGRPoint* p ) const; + virtual double get_AreaOfCurveSegments() const; + + public: + OGRCircularString(); + OGRCircularString(const OGRCircularString& other); + virtual ~OGRCircularString(); + + OGRCircularString& operator=(const OGRCircularString& other); + + // IWks Interface + virtual OGRErr importFromWkb( unsigned char *, int = -1, OGRwkbVariant=wkbVariantOldOgc ); + virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc ) const; + virtual OGRErr importFromWkt( char ** ); + virtual OGRErr exportToWkt( char ** ppszDstText, OGRwkbVariant=wkbVariantOldOgc ) const; + + // IGeometry interface + virtual OGRBoolean IsValid() const; + virtual void getEnvelope( OGREnvelope * psEnvelope ) const; + virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const; + + // ICurve methods + virtual double get_Length() const; + virtual OGRLineString* CurveToLine(double dfMaxAngleStepSizeDegrees = 0, + const char* const* papszOptions = NULL) const; + virtual void Value( double, OGRPoint * ) const; + virtual double get_Area() const; + + // non-standard from OGRGeometry + virtual OGRwkbGeometryType getGeometryType() const; + virtual const char *getGeometryName() const; + virtual void segmentize(double dfMaxLength); + virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const; + virtual OGRGeometry* getLinearGeometry(double dfMaxAngleStepSizeDegrees = 0, + const char* const* papszOptions = NULL) const; +}; + +/************************************************************************/ +/* OGRCurveCollection */ +/************************************************************************/ + +/** + * Utility class to store a collection of curves. Used as a member of + * OGRCompoundCurve and OGRCurvePolygon. + * + * This class is only exported because of linking issues. It should never + * be directly used. + * + * @since GDAL 2.0 + */ + +class CPL_DLL OGRCurveCollection +{ + protected: + friend class OGRCompoundCurve; + friend class OGRCurvePolygon; + friend class OGRPolygon; + + int nCurveCount; + OGRCurve **papoCurves; + + public: + OGRCurveCollection(); + OGRCurveCollection(const OGRCurveCollection& other); + ~OGRCurveCollection(); + + OGRCurveCollection& operator=(const OGRCurveCollection& other); + + void empty(OGRGeometry* poGeom); + OGRBoolean IsEmpty() const; + void getEnvelope( OGREnvelope * psEnvelope ) const; + void getEnvelope( OGREnvelope3D * psEnvelope ) const; + + OGRErr addCurveDirectly( OGRGeometry* poGeom, OGRCurve* poCurve, + int bNeedRealloc ); + int WkbSize() const; + OGRErr importPreambuleFromWkb( OGRGeometry* poGeom, + unsigned char * pabyData, + int& nSize, + int& nDataOffset, + OGRwkbByteOrder& eByteOrder, + int nMinSubGeomSize, + OGRwkbVariant eWkVariant ); + OGRErr importBodyFromWkb( OGRGeometry* poGeom, + unsigned char * pabyData, + int nSize, + int nDataOffset, + int bAcceptCompoundCurve, + OGRErr (*pfnAddCurveDirectlyFromWkb)(OGRGeometry* poGeom, OGRCurve* poCurve), + OGRwkbVariant eWkVariant ); + OGRErr exportToWkt( const OGRGeometry* poGeom, char ** ppszDstText ) const; + OGRErr exportToWkb( const OGRGeometry* poGeom, OGRwkbByteOrder, + unsigned char *, OGRwkbVariant eWkbVariant ) const; + OGRBoolean Equals(OGRCurveCollection *poOCC) const; + void setCoordinateDimension( OGRGeometry* poGeom, int nNewDimension ); + void set3D( OGRGeometry* poGeom, OGRBoolean bIs3D ); + void setMeasured( OGRGeometry* poGeom, OGRBoolean bIsMeasured ); + int getNumCurves() const; + OGRCurve *getCurve( int ); + const OGRCurve *getCurve( int ) const; + OGRCurve *stealCurve( int ); + OGRErr transform( OGRGeometry* poGeom, + OGRCoordinateTransformation *poCT ); + void flattenTo2D(OGRGeometry* poGeom); + void segmentize(double dfMaxLength); + void swapXY(); + OGRBoolean hasCurveGeometry(int bLookForNonLinear) const; +}; + +/************************************************************************/ +/* OGRCompoundCurve */ +/************************************************************************/ + +/** + * Concrete representation of a compound curve, made of curves: OGRLineString + * and OGRCircularString. Each curve is connected by its first point to + * the last point of the previous curve. + * + * Compatibility: ISO SQL/MM Part 3. + * + * @since GDAL 2.0 + */ + +class CPL_DLL OGRCompoundCurve : public OGRCurve +{ + private: + OGRCurveCollection oCC; + + OGRErr addCurveDirectlyInternal( OGRCurve* poCurve, + double dfToleranceEps, + int bNeedRealloc ); + static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf, OGRCurve* poCurve ); + static OGRErr addCurveDirectlyFromWkb( OGRGeometry* poSelf, OGRCurve* poCurve ); + OGRLineString* CurveToLineInternal(double dfMaxAngleStepSizeDegrees, + const char* const* papszOptions, + int bIsLinearRing) const; + + protected: + static OGRLineString* CastToLineString(OGRCompoundCurve* poCC); + static OGRLinearRing* CastToLinearRing(OGRCompoundCurve* poCC); + + virtual OGRCurveCasterToLineString GetCasterToLineString() const; + virtual OGRCurveCasterToLinearRing GetCasterToLinearRing() const; + + public: + OGRCompoundCurve(); + OGRCompoundCurve(const OGRCompoundCurve& other); + virtual ~OGRCompoundCurve(); + + OGRCompoundCurve& operator=(const OGRCompoundCurve& other); + + // IWks Interface + virtual int WkbSize() const; + virtual OGRErr importFromWkb( unsigned char *, int = -1, OGRwkbVariant=wkbVariantOldOgc ); + virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc ) const; + virtual OGRErr importFromWkt( char ** ); + virtual OGRErr exportToWkt( char ** ppszDstText, OGRwkbVariant=wkbVariantOldOgc ) const; + + // IGeometry interface + virtual OGRGeometry *clone() const; + virtual void empty(); + virtual void getEnvelope( OGREnvelope * psEnvelope ) const; + virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const; + virtual OGRBoolean IsEmpty() const; + + // ICurve methods + virtual double get_Length() const; + virtual void StartPoint(OGRPoint *) const; + virtual void EndPoint(OGRPoint *) const; + virtual void Value( double, OGRPoint * ) const; + virtual OGRLineString* CurveToLine(double dfMaxAngleStepSizeDegrees = 0, + const char* const* papszOptions = NULL) const; + + virtual int getNumPoints() const; + virtual double get_AreaOfCurveSegments() const; + virtual double get_Area() const; + + // ISpatialRelation + virtual OGRBoolean Equals( OGRGeometry * ) const; + + // ICompoundCurve method + int getNumCurves() const; + OGRCurve *getCurve( int ); + const OGRCurve *getCurve( int ) const; + + // non standard. + virtual void setCoordinateDimension( int nDimension ); + virtual void set3D( OGRBoolean bIs3D ); + virtual void setMeasured( OGRBoolean bIsMeasured ); + + OGRErr addCurve( OGRCurve*, double dfToleranceEps = 1e-14 ); + OGRErr addCurveDirectly( OGRCurve*, double dfToleranceEps = 1e-14 ); + OGRCurve *stealCurve( int ); + virtual OGRPointIterator* getPointIterator() const; + + // non-standard from OGRGeometry + virtual OGRwkbGeometryType getGeometryType() const; + virtual const char *getGeometryName() const; + virtual OGRErr transform( OGRCoordinateTransformation *poCT ); + virtual void flattenTo2D(); + virtual void segmentize(double dfMaxLength); + virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const; + virtual OGRGeometry* getLinearGeometry(double dfMaxAngleStepSizeDegrees = 0, + const char* const* papszOptions = NULL) const; + + virtual void swapXY(); +}; + +/************************************************************************/ +/* OGRSurface */ +/************************************************************************/ + +/** + * Abstract base class for 2 dimensional objects like polygons or curve polygons. + */ + +class CPL_DLL OGRSurface : public OGRGeometry +{ + protected: + + virtual OGRSurfaceCasterToPolygon GetCasterToPolygon() const = 0; + virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon() const = 0; + + public: + virtual double get_Area() const = 0; + virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const = 0; + + static OGRPolygon* CastToPolygon(OGRSurface* poSurface); + static OGRCurvePolygon* CastToCurvePolygon(OGRSurface* poSurface); +}; + + +/************************************************************************/ +/* OGRCurvePolygon */ +/************************************************************************/ + +/** + * Concrete class representing curve polygons. + * + * Note that curve polygons consist of one outer (curve) ring, and zero or + * more inner rings. A curve polygon cannot represent disconnected + * regions (such as multiple islands in a political body). The + * OGRMultiSurface must be used for this. + * + * Compatibility: ISO SQL/MM Part 3. + * + * @since GDAL 2.0 + */ + +class CPL_DLL OGRCurvePolygon : public OGRSurface +{ + private: + OGRBoolean ContainsPoint( const OGRPoint* p ) const; + virtual int checkRing( OGRCurve * poNewRing ) const; + OGRErr addRingDirectlyInternal( OGRCurve* poCurve, int bNeedRealloc ); + static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf, OGRCurve* poCurve ); + static OGRErr addCurveDirectlyFromWkb( OGRGeometry* poSelf, OGRCurve* poCurve ); + + protected: + friend class OGRPolygon; + OGRCurveCollection oCC; + + static OGRPolygon* CastToPolygon(OGRCurvePolygon* poCP); + + virtual OGRSurfaceCasterToPolygon GetCasterToPolygon() const; + virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon() const; + + public: + OGRCurvePolygon(); + OGRCurvePolygon(const OGRCurvePolygon&); + virtual ~OGRCurvePolygon(); + + OGRCurvePolygon& operator=(const OGRCurvePolygon& other); + + // Non standard (OGRGeometry). + virtual const char *getGeometryName() const; + virtual OGRwkbGeometryType getGeometryType() const; + virtual OGRGeometry *clone() const; + virtual void empty(); + virtual OGRErr transform( OGRCoordinateTransformation *poCT ); + virtual void flattenTo2D(); + virtual OGRBoolean IsEmpty() const; + virtual void segmentize(double dfMaxLength); + virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const; + virtual OGRGeometry* getLinearGeometry(double dfMaxAngleStepSizeDegrees = 0, + const char* const* papszOptions = NULL) const; + + // ISurface Interface + virtual double get_Area() const; + virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const; + + // IWks Interface + virtual int WkbSize() const; + virtual OGRErr importFromWkb( unsigned char *, int = -1, OGRwkbVariant=wkbVariantOldOgc ); + virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc ) const; + virtual OGRErr importFromWkt( char ** ); + virtual OGRErr exportToWkt( char ** ppszDstText, OGRwkbVariant eWkbVariant = wkbVariantOldOgc ) const; + + // IGeometry + virtual int getDimension() const; + virtual void getEnvelope( OGREnvelope * psEnvelope ) const; + virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const; + + // ICurvePolygon + virtual OGRPolygon* CurvePolyToPoly(double dfMaxAngleStepSizeDegrees = 0, + const char* const* papszOptions = NULL) const; + + // ISpatialRelation + virtual OGRBoolean Equals( OGRGeometry * ) const; + virtual OGRBoolean Intersects( const OGRGeometry * ) const; + virtual OGRBoolean Contains( const OGRGeometry * ) const; + + // Non standard + virtual void setCoordinateDimension( int nDimension ); + virtual void set3D( OGRBoolean bIs3D ); + virtual void setMeasured( OGRBoolean bIsMeasured ); + + OGRErr addRing( OGRCurve * ); + OGRErr addRingDirectly( OGRCurve * ); + + OGRCurve *getExteriorRingCurve(); + const OGRCurve *getExteriorRingCurve() const; + int getNumInteriorRings() const; + OGRCurve *getInteriorRingCurve( int ); + const OGRCurve *getInteriorRingCurve( int ) const; + + OGRCurve *stealExteriorRingCurve(); + + virtual void swapXY(); +}; + +/************************************************************************/ +/* OGRPolygon */ +/************************************************************************/ + +/** + * Concrete class representing polygons. + * + * Note that the OpenGIS simple features polygons consist of one outer + * ring (linearring), and zero or more inner rings. A polygon cannot represent disconnected + * regions (such as multiple islands in a political body). The + * OGRMultiPolygon must be used for this. + */ + +class CPL_DLL OGRPolygon : public OGRCurvePolygon +{ + protected: + friend class OGRMultiSurface; + + virtual int checkRing( OGRCurve * poNewRing ) const; + OGRErr importFromWKTListOnly( char ** ppszInput, int bHasZ, int bHasM, + OGRRawPoint*& paoPoints, int& nMaxPoints, + double*& padfZ ); + + static OGRCurvePolygon* CastToCurvePolygon(OGRPolygon* poPoly); + + virtual OGRSurfaceCasterToPolygon GetCasterToPolygon() const; + virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon() const; + + public: + OGRPolygon(); + OGRPolygon(const OGRPolygon& other); + virtual ~OGRPolygon(); + + OGRPolygon& operator=(const OGRPolygon& other); + + // Non standard (OGRGeometry). + virtual const char *getGeometryName() const; + virtual OGRwkbGeometryType getGeometryType() const; + virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const; + virtual OGRGeometry* getCurveGeometry(const char* const* papszOptions = NULL) const; + virtual OGRGeometry* getLinearGeometry(double dfMaxAngleStepSizeDegrees = 0, + const char* const* papszOptions = NULL) const; + + // ISurface Interface + virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const; + + // IWks Interface + virtual int WkbSize() const; + virtual OGRErr importFromWkb( unsigned char *, int = -1, OGRwkbVariant=wkbVariantOldOgc ); + virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc ) const; + virtual OGRErr importFromWkt( char ** ); + virtual OGRErr exportToWkt( char ** ppszDstText, OGRwkbVariant=wkbVariantOldOgc ) const; + + // ICurvePolygon + virtual OGRPolygon* CurvePolyToPoly(double dfMaxAngleStepSizeDegrees = 0, + const char* const* papszOptions = NULL) const; + + OGRLinearRing *getExteriorRing(); + const OGRLinearRing *getExteriorRing() const; + OGRLinearRing *getInteriorRing( int ); + const OGRLinearRing *getInteriorRing( int ) const; + + OGRLinearRing *stealExteriorRing(); + OGRLinearRing *stealInteriorRing(int); + + OGRBoolean IsPointOnSurface( const OGRPoint * ) const; + + virtual void closeRings(); +}; + +/************************************************************************/ +/* OGRGeometryCollection */ +/************************************************************************/ + +/** + * A collection of 1 or more geometry objects. + * + * All geometries must share a common spatial reference system, and + * Subclasses may impose additional restrictions on the contents. + */ + +class CPL_DLL OGRGeometryCollection : public OGRGeometry +{ + OGRErr importFromWkbInternal( unsigned char * pabyData, int nSize, int nRecLevel, + OGRwkbVariant ); + OGRErr importFromWktInternal( char **ppszInput, int nRecLevel ); + + protected: + int nGeomCount; + OGRGeometry **papoGeoms; + + OGRErr exportToWktInternal( char ** ppszDstText, + OGRwkbVariant eWkbVariant, + const char* pszSkipPrefix ) const; + virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType ) const; + + static OGRGeometryCollection* TransferMembersAndDestroy(OGRGeometryCollection* poSrc, + OGRGeometryCollection* poDst); + + public: + OGRGeometryCollection(); + OGRGeometryCollection(const OGRGeometryCollection& other); + virtual ~OGRGeometryCollection(); + + OGRGeometryCollection& operator=(const OGRGeometryCollection& other); + + // Non standard (OGRGeometry). + virtual const char *getGeometryName() const; + virtual OGRwkbGeometryType getGeometryType() const; + virtual OGRGeometry *clone() const; + virtual void empty(); + virtual OGRErr transform( OGRCoordinateTransformation *poCT ); + virtual void flattenTo2D(); + virtual OGRBoolean IsEmpty() const; + virtual void segmentize(double dfMaxLength); + virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const; + virtual OGRGeometry* getCurveGeometry(const char* const* papszOptions = NULL) const; + virtual OGRGeometry* getLinearGeometry(double dfMaxAngleStepSizeDegrees = 0, const char* const* papszOptions = NULL) const; + + // IWks Interface + virtual int WkbSize() const; + virtual OGRErr importFromWkb( unsigned char *, int = -1, OGRwkbVariant=wkbVariantOldOgc ); + virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc ) const; + virtual OGRErr importFromWkt( char ** ); + virtual OGRErr exportToWkt( char ** ppszDstText, OGRwkbVariant=wkbVariantOldOgc ) const; + + virtual double get_Length() const; + virtual double get_Area() const; + + // IGeometry methods + virtual int getDimension() const; + virtual void getEnvelope( OGREnvelope * psEnvelope ) const; + virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const; + + // IGeometryCollection + int getNumGeometries() const; + OGRGeometry *getGeometryRef( int ); + const OGRGeometry *getGeometryRef( int ) const; + + // ISpatialRelation + virtual OGRBoolean Equals( OGRGeometry * ) const; + + // Non standard + virtual void setCoordinateDimension( int nDimension ); + virtual void set3D( OGRBoolean bIs3D ); + virtual void setMeasured( OGRBoolean bIsMeasured ); + virtual OGRErr addGeometry( const OGRGeometry * ); + virtual OGRErr addGeometryDirectly( OGRGeometry * ); + virtual OGRErr removeGeometry( int iIndex, int bDelete = TRUE ); + + void closeRings(); + + virtual void swapXY(); +}; + +/************************************************************************/ +/* OGRMultiSurface */ +/************************************************************************/ + +/** + * A collection of non-overlapping OGRSurface. + * + * @since GDAL 2.0 + */ + +class CPL_DLL OGRMultiSurface : public OGRGeometryCollection +{ + protected: + virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType ) const; + + public: + OGRMultiSurface(); + OGRMultiSurface(const OGRMultiSurface& other); + virtual ~OGRMultiSurface(); + + OGRMultiSurface& operator=(const OGRMultiSurface& other); + + // Non standard (OGRGeometry). + virtual const char *getGeometryName() const; + virtual OGRwkbGeometryType getGeometryType() const; + virtual OGRErr importFromWkt( char ** ); + virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc ) const; + + // IMultiSurface methods + virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const; + + // IGeometry methods + virtual int getDimension() const; + + // Non standard + virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const; + + static OGRMultiPolygon* CastToMultiPolygon(OGRMultiSurface* poMS); +}; + +/************************************************************************/ +/* OGRMultiPolygon */ +/************************************************************************/ + +/** + * A collection of non-overlapping OGRPolygon. + */ + +class CPL_DLL OGRMultiPolygon : public OGRMultiSurface +{ + protected: + virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType ) const; + + public: + OGRMultiPolygon(); + OGRMultiPolygon(const OGRMultiPolygon& other); + virtual ~OGRMultiPolygon(); + + OGRMultiPolygon& operator=(const OGRMultiPolygon& other); + + // Non standard (OGRGeometry). + virtual const char *getGeometryName() const; + virtual OGRwkbGeometryType getGeometryType() const; + virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc ) const; + + // IMultiSurface methods + virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const; + + // Non standard + virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const; + + static OGRMultiSurface* CastToMultiSurface(OGRMultiPolygon* poMP); +}; + +/************************************************************************/ +/* OGRMultiPoint */ +/************************************************************************/ + +/** + * A collection of OGRPoint. + */ + +class CPL_DLL OGRMultiPoint : public OGRGeometryCollection +{ + private: + OGRErr importFromWkt_Bracketed( char **, int bHasM, int bHasZ ); + + protected: + virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType ) const; + + public: + OGRMultiPoint(); + OGRMultiPoint(const OGRMultiPoint& other); + virtual ~OGRMultiPoint(); + + OGRMultiPoint& operator=(const OGRMultiPoint& other); + + // Non standard (OGRGeometry). + virtual const char *getGeometryName() const; + virtual OGRwkbGeometryType getGeometryType() const; + virtual OGRErr importFromWkt( char ** ); + virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc ) const; + + // IGeometry methods + virtual int getDimension() const; + + // Non standard + virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const; +}; + +/************************************************************************/ +/* OGRMultiCurve */ +/************************************************************************/ + +/** + * A collection of OGRCurve. + * + * @since GDAL 2.0 + */ + +class CPL_DLL OGRMultiCurve : public OGRGeometryCollection +{ + protected: + static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf, OGRCurve* poCurve ); + virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType ) const; + + public: + OGRMultiCurve(); + OGRMultiCurve(const OGRMultiCurve& other); + virtual ~OGRMultiCurve(); + + OGRMultiCurve& operator=(const OGRMultiCurve& other); + + // Non standard (OGRGeometry). + virtual const char *getGeometryName() const; + virtual OGRwkbGeometryType getGeometryType() const; + virtual OGRErr importFromWkt( char ** ); + virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc ) const; + + // IGeometry methods + virtual int getDimension() const; + + // Non standard + virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const; + + static OGRMultiLineString* CastToMultiLineString(OGRMultiCurve* poMC); +}; + +/************************************************************************/ +/* OGRMultiLineString */ +/************************************************************************/ + +/** + * A collection of OGRLineString. + */ + +class CPL_DLL OGRMultiLineString : public OGRMultiCurve +{ + protected: + virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType ) const; + + public: + OGRMultiLineString(); + OGRMultiLineString(const OGRMultiLineString& other); + virtual ~OGRMultiLineString(); + + OGRMultiLineString& operator=(const OGRMultiLineString& other); + + // Non standard (OGRGeometry). + virtual const char *getGeometryName() const; + virtual OGRwkbGeometryType getGeometryType() const; + virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc ) const; + + // Non standard + virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const; + + static OGRMultiCurve* CastToMultiCurve(OGRMultiLineString* poMLS); +}; + + +/************************************************************************/ +/* OGRGeometryFactory */ +/************************************************************************/ + +/** + * Create geometry objects from well known text/binary. + */ + +class CPL_DLL OGRGeometryFactory +{ + static OGRErr createFromFgfInternal( unsigned char *pabyData, + OGRSpatialReference * poSR, + OGRGeometry **ppoReturn, + int nBytes, + int *pnBytesConsumed, + int nRecLevel ); + public: + static OGRErr createFromWkb( unsigned char *, OGRSpatialReference *, + OGRGeometry **, int = -1, OGRwkbVariant=wkbVariantOldOgc ); + static OGRErr createFromWkt( char **, OGRSpatialReference *, + OGRGeometry ** ); + static OGRErr createFromFgf( unsigned char *, OGRSpatialReference *, + OGRGeometry **, int = -1, int * = NULL ); + static OGRGeometry *createFromGML( const char * ); + static OGRGeometry *createFromGEOS( GEOSContextHandle_t hGEOSCtxt, GEOSGeom ); + + static void destroyGeometry( OGRGeometry * ); + static OGRGeometry *createGeometry( OGRwkbGeometryType ); + + static OGRGeometry * forceToPolygon( OGRGeometry * ); + static OGRGeometry * forceToLineString( OGRGeometry *, bool bOnlyInOrder = true ); + static OGRGeometry * forceToMultiPolygon( OGRGeometry * ); + static OGRGeometry * forceToMultiPoint( OGRGeometry * ); + static OGRGeometry * forceToMultiLineString( OGRGeometry * ); + + static OGRGeometry * forceTo( OGRGeometry* poGeom, + OGRwkbGeometryType eTargetType, + const char*const* papszOptions = NULL ); + + static OGRGeometry * organizePolygons( OGRGeometry **papoPolygons, + int nPolygonCount, + int *pbResultValidGeometry, + const char **papszOptions = NULL); + static int haveGEOS(); + + static OGRGeometry* transformWithOptions( const OGRGeometry* poSrcGeom, + OGRCoordinateTransformation *poCT, + char** papszOptions ); + + static OGRGeometry* + approximateArcAngles( double dfX, double dfY, double dfZ, + double dfPrimaryRadius, double dfSecondaryAxis, + double dfRotation, + double dfStartAngle, double dfEndAngle, + double dfMaxAngleStepSizeDegrees ); + + static int GetCurveParmeters(double x0, double y0, + double x1, double y1, + double x2, double y2, + double& R, double& cx, double& cy, + double& alpha0, double& alpha1, double& alpha2 ); + static OGRLineString* curveToLineString( double x0, double y0, double z0, + double x1, double y1, double z1, + double x2, double y2, double z2, + int bHasZ, + double dfMaxAngleStepSizeDegrees, + const char*const* papszOptions = NULL ); + static OGRCurve* curveFromLineString(const OGRLineString* poLS, + const char*const* papszOptions = NULL); +}; + +OGRwkbGeometryType CPL_DLL OGRFromOGCGeomType( const char *pszGeomType ); +const char CPL_DLL * OGRToOGCGeomType( OGRwkbGeometryType eGeomType ); + +/* Prepared geometry API (needs GEOS >= 3.1.0) */ +typedef struct _OGRPreparedGeometry OGRPreparedGeometry; +int OGRHasPreparedGeometrySupport(); +OGRPreparedGeometry* OGRCreatePreparedGeometry( const OGRGeometry* poGeom ); +void OGRDestroyPreparedGeometry( OGRPreparedGeometry* poPreparedGeom ); +int OGRPreparedGeometryIntersects( const OGRPreparedGeometry* poPreparedGeom, + const OGRGeometry* poOtherGeom ); +int OGRPreparedGeometryContains( const OGRPreparedGeometry* poPreparedGeom, + const OGRGeometry* poOtherGeom ); + +#endif /* ndef OGR_GEOMETRY_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/ogr_geos.h b/modules/globebrowsing/ext/gdal/include/ogr_geos.h new file mode 100644 index 0000000000..079a9355a6 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogr_geos.h @@ -0,0 +1,49 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenGIS Simple Features Reference Implementation + * Purpose: Definitions related to support for use of GEOS in OGR. + * This file is only intended to be pulled in by OGR implementation + * code directly accessing GEOS. + * Author: Frank Warmerdam + * + ****************************************************************************** + * Copyright (c) 2004, 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 OGR_GEOS_H_INCLUDED +#define OGR_GEOS_H_INCLUDED + +#ifdef HAVE_GEOS +// To avoid accidental use of non reentrant GEOS API. +// (check only effective in GEOS >= 3.5) +# define GEOS_USE_ONLY_R_API + +# include +#else + +namespace geos { + class Geometry; +}; + +#endif + +#endif /* ndef OGR_GEOS_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/ogr_p.h b/modules/globebrowsing/ext/gdal/include/ogr_p.h new file mode 100644 index 0000000000..7d11d26dbe --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogr_p.h @@ -0,0 +1,182 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenGIS Simple Features Reference Implementation + * Purpose: Some private helper functions and stuff for OGR implementation. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 1999, Frank Warmerdam + * Copyright (c) 2008-2014, Even Rouault + * + * 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_P_H_INCLUDED +#define OGR_P_H_INCLUDED + +/* -------------------------------------------------------------------- */ +/* Include the common portability library ... lets us do lots */ +/* of stuff easily. */ +/* -------------------------------------------------------------------- */ + +#include "cpl_string.h" +#include "cpl_conv.h" +#include "cpl_minixml.h" + +#include "ogr_core.h" +#include "ogr_geometry.h" +#include "ogr_feature.h" + +/* A default name for the default geometry column, instead of '' */ +#define OGR_GEOMETRY_DEFAULT_NON_EMPTY_NAME "_ogr_geometry_" + +#ifdef CPL_MSB +# define OGR_SWAP(x) (x == wkbNDR) +#else +# define OGR_SWAP(x) (x == wkbXDR) +#endif + +/* PostGIS 1.X has non standard codes for the following geometry types */ +#define POSTGIS15_CURVEPOLYGON 13 /* instead of 10 */ +#define POSTGIS15_MULTICURVE 14 /* instead of 11 */ +#define POSTGIS15_MULTISURFACE 15 /* instead of 12 */ + +/* Has been deprecated. Can only be used in very specific circumstances */ +#ifdef GDAL_COMPILATION +#define wkb25DBitInternalUse 0x80000000 +#endif + +/* -------------------------------------------------------------------- */ +/* helper function for parsing well known text format vector objects.*/ +/* -------------------------------------------------------------------- */ + +#ifdef OGR_GEOMETRY_H_INCLUDED +#define OGR_WKT_TOKEN_MAX 64 + +const char CPL_DLL * OGRWktReadToken( const char * pszInput, char * pszToken ); + +const char CPL_DLL * OGRWktReadPoints( const char * pszInput, + OGRRawPoint **ppaoPoints, + double **ppadfZ, + int * pnMaxPoints, + int * pnReadPoints ); + +const char CPL_DLL * OGRWktReadPointsM( const char * pszInput, + OGRRawPoint **ppaoPoints, + double **ppadfZ, + double **ppadfM, + int * flags, /* geometry flags, are we expecting Z, M, or both; may change due to input */ + int * pnMaxPoints, + int * pnReadPoints ); + +void CPL_DLL OGRMakeWktCoordinate( char *, double, double, double, int ); +void CPL_DLL OGRMakeWktCoordinateM( char *, double, double, double, double, OGRBoolean, OGRBoolean ); + +#endif + +void OGRFormatDouble( char *pszBuffer, int nBufferLen, double dfVal, + char chDecimalSep, int nPrecision = 15, char chConversionSpecifier = 'f' ); + +/* -------------------------------------------------------------------- */ +/* Date-time parsing and processing functions */ +/* -------------------------------------------------------------------- */ + +/* Internal use by OGR drivers only, CPL_DLL is just there in case */ +/* they are compiled as plugins */ +int CPL_DLL OGRGetDayOfWeek(int day, int month, int year); +int CPL_DLL OGRParseXMLDateTime( const char* pszXMLDateTime, + OGRField* psField ); +int CPL_DLL OGRParseRFC822DateTime( const char* pszRFC822DateTime, + OGRField* psField ); +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 */ + +/* General utility option processing. */ +int CPL_DLL OGRGeneralCmdLineProcessor( int nArgc, char ***ppapszArgv, int nOptions ); + +/************************************************************************/ +/* Support for special attributes (feature query and selection) */ +/************************************************************************/ +#define SPF_FID 0 +#define SPF_OGR_GEOMETRY 1 +#define SPF_OGR_STYLE 2 +#define SPF_OGR_GEOM_WKT 3 +#define SPF_OGR_GEOM_AREA 4 +#define SPECIAL_FIELD_COUNT 5 + +extern const char* const SpecialFieldNames[SPECIAL_FIELD_COUNT]; + +#ifdef SWQ_H_INCLUDED_ +extern const swq_field_type SpecialFieldTypes[SPECIAL_FIELD_COUNT]; +#endif + +/************************************************************************/ +/* Some SRS related stuff, search in SRS data files. */ +/************************************************************************/ + +OGRErr CPL_DLL OSRGetEllipsoidInfo( int, char **, double *, double *); + +/* Fast atof function */ +double OGRFastAtof(const char* pszStr); + +OGRErr CPL_DLL OGRCheckPermutation(int* panPermutation, int nSize); + +/* GML related */ + +OGRGeometry *GML2OGRGeometry_XMLNode( const CPLXMLNode *psNode, + int nPseudoBoolGetSecondaryGeometryOption, + int nRecLevel = 0, + int nSRSDimension = 0, + bool bIgnoreGSG = false, + bool bOrientation = true, + bool bFaceHoleNegative = false); + +/************************************************************************/ +/* PostGIS EWKB encoding */ +/************************************************************************/ + +OGRGeometry CPL_DLL *OGRGeometryFromEWKB( GByte *pabyWKB, int nLength, int* pnSRID, + int bIsPostGIS1_EWKB ); +OGRGeometry CPL_DLL *OGRGeometryFromHexEWKB( const char *pszBytea, int* pnSRID, + int bIsPostGIS1_EWKB ); +char CPL_DLL * OGRGeometryToHexEWKB( OGRGeometry * poGeometry, int nSRSId, + int nPostGISMajor, int nPostGISMinor ); + +/************************************************************************/ +/* WKB Type Handling encoding */ +/************************************************************************/ + +OGRErr OGRReadWKBGeometryType( unsigned char * pabyData, + OGRwkbVariant wkbVariant, + OGRwkbGeometryType *eGeometryType ); + +/************************************************************************/ +/* Other */ +/************************************************************************/ + +void CPL_DLL OGRUpdateFieldType( OGRFieldDefn* poFDefn, + OGRFieldType eNewType, + OGRFieldSubType eNewSubType ); + +#endif /* ndef OGR_P_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/ogr_spatialref.h b/modules/globebrowsing/ext/gdal/include/ogr_spatialref.h new file mode 100644 index 0000000000..12c1a39dfd --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogr_spatialref.h @@ -0,0 +1,636 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenGIS Simple Features Reference Implementation + * Purpose: Classes for manipulating spatial reference systems in a + * platform non-specific manner. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 1999, Les Technologies SoftMap Inc. + * Copyright (c) 2008-2013, Even Rouault + * + * 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_SPATIALREF_H_INCLUDED +#define OGR_SPATIALREF_H_INCLUDED + +#include "ogr_srs_api.h" + +/** + * \file ogr_spatialref.h + * + * Coordinate systems services. + */ + +/************************************************************************/ +/* OGR_SRSNode */ +/************************************************************************/ + +/** + * Objects of this class are used to represent value nodes in the parsed + * representation of the WKT SRS format. For instance UNIT["METER",1] + * would be rendered into three OGR_SRSNodes. The root node would have a + * value of UNIT, and two children, the first with a value of METER, and the + * second with a value of 1. + * + * Normally application code just interacts with the OGRSpatialReference + * object, which uses the OGR_SRSNode to implement it's data structure; + * however, this class is user accessible for detailed access to components + * of an SRS definition. + */ + +class CPL_DLL OGR_SRSNode +{ + char *pszValue; + + OGR_SRSNode **papoChildNodes; + OGR_SRSNode *poParent; + + int nChildren; + + int NeedsQuoting() const; + OGRErr importFromWkt( char **, int nRecLevel, int* pnNodes ); + + public: + OGR_SRSNode(const char * = NULL); + ~OGR_SRSNode(); + + int IsLeafNode() const { return nChildren == 0; } + + int GetChildCount() const { return nChildren; } + OGR_SRSNode *GetChild( int ); + const OGR_SRSNode *GetChild( int ) const; + + OGR_SRSNode *GetNode( const char * ); + const OGR_SRSNode *GetNode( const char * ) const; + + void InsertChild( OGR_SRSNode *, int ); + void AddChild( OGR_SRSNode * ); + int FindChild( const char * ) const; + void DestroyChild( int ); + void ClearChildren(); + void StripNodes( const char * ); + + const char *GetValue() const { return pszValue; } + void SetValue( const char * ); + + void MakeValueSafe(); + OGRErr FixupOrdering(); + + OGR_SRSNode *Clone() const; + + OGRErr importFromWkt( char ** ); + OGRErr exportToWkt( char ** ) const; + OGRErr exportToPrettyWkt( char **, int = 1) const; + + OGRErr applyRemapper( const char *pszNode, + char **papszSrcValues, + char **papszDstValues, + int nStepSize = 1, + int bChildOfHit = FALSE ); +}; + +/************************************************************************/ +/* OGRSpatialReference */ +/************************************************************************/ + +/** + * This class represents an OpenGIS Spatial Reference System, and contains + * methods for converting between this object organization and well known + * text (WKT) format. This object is reference counted as one instance of + * the object is normally shared between many OGRGeometry objects. + * + * Normally application code can fetch needed parameter values for this + * SRS using GetAttrValue(), but in special cases the underlying parse tree + * (or OGR_SRSNode objects) can be accessed more directly. + * + * See the tutorial for more information on + * how to use this class. + */ + +class CPL_DLL OGRSpatialReference +{ + double dfFromGreenwich; + double dfToMeter; + double dfToDegrees; + + OGR_SRSNode *poRoot; + + int nRefCount; + int bNormInfoSet; + + static OGRErr Validate(OGR_SRSNode *poRoot); + static OGRErr ValidateAuthority(OGR_SRSNode *poRoot); + static OGRErr ValidateAxis(OGR_SRSNode *poRoot); + static OGRErr ValidateUnit(OGR_SRSNode *poRoot); + static OGRErr ValidateVertDatum(OGR_SRSNode *poRoot); + static OGRErr ValidateProjection( OGR_SRSNode* poRoot ); + static int IsAliasFor( const char *, const char * ); + void GetNormInfo() const; + + OGRErr importFromURNPart(const char* pszAuthority, + const char* pszCode, + const char* pszURN); + public: + OGRSpatialReference(const OGRSpatialReference&); + OGRSpatialReference(const char * = NULL); + + virtual ~OGRSpatialReference(); + + static void DestroySpatialReference(OGRSpatialReference* poSRS); + + OGRSpatialReference &operator=(const OGRSpatialReference&); + + int Reference(); + int Dereference(); + int GetReferenceCount() const { return nRefCount; } + void Release(); + + OGRSpatialReference *Clone() const; + OGRSpatialReference *CloneGeogCS() const; + + void dumpReadable(); + OGRErr exportToWkt( char ** ) const; + OGRErr exportToPrettyWkt( char **, int = FALSE) const; + OGRErr exportToProj4( char ** ) const; + OGRErr exportToPCI( char **, char **, double ** ) const; + OGRErr exportToUSGS( long *, long *, double **, long * ) const; + OGRErr exportToXML( char **, const char * = NULL ) const; + OGRErr exportToPanorama( long *, long *, long *, long *, + double * ) const; + OGRErr exportToERM( char *pszProj, char *pszDatum, char *pszUnits ); + OGRErr exportToMICoordSys( char ** ) const; + + OGRErr importFromWkt( char ** ); + OGRErr importFromProj4( const char * ); + OGRErr importFromEPSG( int ); + OGRErr importFromEPSGA( int ); + 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 + OGRErr importFromUSGS( long iProjSys, long iZone, + double *padfPrjParams, long iDatum, + int nUSGSAngleFormat = USGS_ANGLE_PACKEDDMS ); + OGRErr importFromPanorama( long, long, long, double* ); + OGRErr importFromOzi( const char * const* papszLines ); + OGRErr importFromWMSAUTO( const char *pszAutoDef ); + OGRErr importFromXML( const char * ); + OGRErr importFromDict( const char *pszDict, const char *pszCode ); + OGRErr importFromURN( const char * ); + OGRErr importFromCRSURL( const char * ); + OGRErr importFromERM( const char *pszProj, const char *pszDatum, + const char *pszUnits ); + OGRErr importFromUrl( const char * ); + OGRErr importFromMICoordSys( const char * ); + + OGRErr morphToESRI(); + OGRErr morphFromESRI(); + + OGRErr Validate(); + OGRErr StripCTParms( OGR_SRSNode * = NULL ); + OGRErr StripVertical(); + OGRErr FixupOrdering(); + OGRErr Fixup(); + + int EPSGTreatsAsLatLong(); + int EPSGTreatsAsNorthingEasting(); + const char *GetAxis( const char *pszTargetKey, int iAxis, + OGRAxisOrientation *peOrientation ) const; + OGRErr SetAxes( const char *pszTargetKey, + const char *pszXAxisName, + OGRAxisOrientation eXAxisOrientation, + const char *pszYAxisName, + OGRAxisOrientation eYAxisOrientation ); + + // Machinery for accessing parse nodes + OGR_SRSNode *GetRoot() { return poRoot; } + const OGR_SRSNode *GetRoot() const { return poRoot; } + void SetRoot( OGR_SRSNode * ); + + OGR_SRSNode *GetAttrNode(const char *); + const OGR_SRSNode *GetAttrNode(const char *) const; + const char *GetAttrValue(const char *, int = 0) const; + + OGRErr SetNode( const char *, const char * ); + OGRErr SetNode( const char *, double ); + + OGRErr SetLinearUnitsAndUpdateParameters( const char *pszName, + double dfInMeters ); + OGRErr SetLinearUnits( const char *pszName, double dfInMeters ); + OGRErr SetTargetLinearUnits( const char *pszTargetKey, + const char *pszName, double dfInMeters ); + double GetLinearUnits( char ** = NULL ) const; + double GetTargetLinearUnits( const char *pszTargetKey, + char ** ppszRetName = NULL ) const; + + OGRErr SetAngularUnits( const char *pszName, double dfInRadians ); + double GetAngularUnits( char ** = NULL ) const; + + double GetPrimeMeridian( char ** = NULL ) const; + + int IsGeographic() const; + int IsProjected() const; + int IsGeocentric() const; + int IsLocal() const; + int IsVertical() const; + int IsCompound() const; + int IsSameGeogCS( const OGRSpatialReference * ) const; + int IsSameVertCS( const OGRSpatialReference * ) const; + int IsSame( const OGRSpatialReference * ) const; + + void Clear(); + OGRErr SetLocalCS( const char * ); + OGRErr SetProjCS( const char * ); + OGRErr SetProjection( const char * ); + OGRErr SetGeocCS( const char * pszGeocName ); + OGRErr SetGeogCS( const char * pszGeogName, + const char * pszDatumName, + const char * pszEllipsoidName, + double dfSemiMajor, double dfInvFlattening, + const char * pszPMName = NULL, + double dfPMOffset = 0.0, + const char * pszUnits = NULL, + double dfConvertToRadians = 0.0 ); + OGRErr SetWellKnownGeogCS( const char * ); + OGRErr CopyGeogCSFrom( const OGRSpatialReference * poSrcSRS ); + OGRErr SetVertCS( const char *pszVertCSName, + const char *pszVertDatumName, + int nVertDatumClass = 2005 ); + OGRErr SetCompoundCS( const char *pszName, + const OGRSpatialReference *poHorizSRS, + const OGRSpatialReference *poVertSRS ); + + OGRErr SetFromUserInput( const char * ); + + OGRErr SetTOWGS84( double, double, double, + double = 0.0, double = 0.0, double = 0.0, + double = 0.0 ); + OGRErr GetTOWGS84( double *padfCoef, int nCoeff = 7 ) const; + + double GetSemiMajor( OGRErr * = NULL ) const; + double GetSemiMinor( OGRErr * = NULL ) const; + double GetInvFlattening( OGRErr * = NULL ) const; + + OGRErr SetAuthority( const char * pszTargetKey, + const char * pszAuthority, + int nCode ); + + OGRErr AutoIdentifyEPSG(); + int GetEPSGGeogCS(); + + const char *GetAuthorityCode( const char * pszTargetKey ) const; + const char *GetAuthorityName( const char * pszTargetKey ) const; + + const char *GetExtension( const char *pszTargetKey, + const char *pszName, + const char *pszDefault = NULL ) const; + OGRErr SetExtension( const char *pszTargetKey, + const char *pszName, + const char *pszValue ); + + int FindProjParm( const char *pszParameter, + const OGR_SRSNode *poPROJCS=NULL ) const; + OGRErr SetProjParm( const char *, double ); + double GetProjParm( const char *, double =0.0, OGRErr* = NULL ) const; + + OGRErr SetNormProjParm( const char *, double ); + double GetNormProjParm( const char *, double=0.0, OGRErr* =NULL)const; + + static int IsAngularParameter( const char * ); + static int IsLongitudeParameter( const char * ); + static int IsLinearParameter( const char * ); + + /** Albers Conic Equal Area */ + OGRErr SetACEA( double dfStdP1, double dfStdP2, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Azimuthal Equidistant */ + OGRErr SetAE( double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Bonne */ + OGRErr SetBonne( double dfStdP1, double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + + /** Cylindrical Equal Area */ + OGRErr SetCEA( double dfStdP1, double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + + /** Cassini-Soldner */ + OGRErr SetCS( double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Equidistant Conic */ + OGRErr SetEC( double dfStdP1, double dfStdP2, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Eckert I-VI */ + OGRErr SetEckert( int nVariation, double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + + OGRErr SetEckertIV( double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + + OGRErr SetEckertVI( double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + + /** Equirectangular */ + OGRErr SetEquirectangular(double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + /** Equirectangular generalized form : */ + OGRErr SetEquirectangular2( double dfCenterLat, double dfCenterLong, + double dfPseudoStdParallel1, + double dfFalseEasting, double dfFalseNorthing ); + + /** Geostationary Satellite */ + OGRErr SetGEOS( double dfCentralMeridian, double dfSatelliteHeight, + double dfFalseEasting, double dfFalseNorthing ); + + /** Goode Homolosine */ + OGRErr SetGH( double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + + /** Interrupted Goode Homolosine */ + OGRErr SetIGH(); + + /** Gall Stereograpic */ + OGRErr SetGS( double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + + /** Gauss Schreiber Transverse Mercator */ + OGRErr SetGaussSchreiberTMercator(double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + + /** Gnomonic */ + OGRErr SetGnomonic(double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Hotine Oblique Mercator */ + OGRErr SetHOM( double dfCenterLat, double dfCenterLong, + double dfAzimuth, double dfRectToSkew, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + + OGRErr SetHOM2PNO( double dfCenterLat, + double dfLat1, double dfLong1, + double dfLat2, double dfLong2, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + + OGRErr SetOM( double dfCenterLat, double dfCenterLong, + double dfAzimuth, double dfRectToSkew, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + + /** Hotine Oblique Mercator Azimuth Center / Variant B */ + OGRErr SetHOMAC( double dfCenterLat, double dfCenterLong, + double dfAzimuth, double dfRectToSkew, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + + /** International Map of the World Polyconic */ + OGRErr SetIWMPolyconic( double dfLat1, double dfLat2, + double dfCenterLong, + double dfFalseEasting, + double dfFalseNorthing ); + + /** Krovak Oblique Conic Conformal */ + OGRErr SetKrovak( double dfCenterLat, double dfCenterLong, + double dfAzimuth, double dfPseudoStdParallelLat, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + + /** Lambert Azimuthal Equal-Area */ + OGRErr SetLAEA( double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Lambert Conformal Conic */ + OGRErr SetLCC( double dfStdP1, double dfStdP2, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Lambert Conformal Conic 1SP */ + OGRErr SetLCC1SP( double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + + /** Lambert Conformal Conic (Belgium) */ + OGRErr SetLCCB( double dfStdP1, double dfStdP2, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Miller Cylindrical */ + OGRErr SetMC( double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Mercator */ + OGRErr SetMercator( double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + + OGRErr SetMercator2SP( double dfStdP1, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Mollweide */ + OGRErr SetMollweide( double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + + /** New Zealand Map Grid */ + OGRErr SetNZMG( double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Oblique Stereographic */ + OGRErr SetOS( double dfOriginLat, double dfCMeridian, + double dfScale, + double dfFalseEasting,double dfFalseNorthing); + + /** Orthographic */ + OGRErr SetOrthographic( double dfCenterLat, double dfCenterLong, + double dfFalseEasting,double dfFalseNorthing); + + /** Polyconic */ + OGRErr SetPolyconic( double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Polar Stereographic */ + OGRErr SetPS( double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, double dfFalseNorthing); + + /** Robinson */ + OGRErr SetRobinson( double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Sinusoidal */ + OGRErr SetSinusoidal( double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Stereographic */ + OGRErr SetStereographic( double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting,double dfFalseNorthing); + + /** Swiss Oblique Cylindrical */ + OGRErr SetSOC( double dfLatitudeOfOrigin, double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + + /** Transverse Mercator */ + OGRErr SetTM( double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + + /** Transverse Mercator variants. */ + OGRErr SetTMVariant( const char *pszVariantName, + double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + + /** Tunesia Mining Grid */ + OGRErr SetTMG( double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Transverse Mercator (South Oriented) */ + OGRErr SetTMSO( double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + + /** Two Point Equidistant */ + OGRErr SetTPED( double dfLat1, double dfLong1, + double dfLat2, double dfLong2, + double dfFalseEasting, double dfFalseNorthing ); + + /** VanDerGrinten */ + OGRErr SetVDG( double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + + /** Universal Transverse Mercator */ + OGRErr SetUTM( int nZone, int bNorth = TRUE ); + int GetUTMZone( int *pbNorth = NULL ) const; + + /** Wagner I -- VII */ + OGRErr SetWagner( int nVariation, double dfCenterLat, + double dfFalseEasting, double dfFalseNorthing ); + + /** Quadrilateralized Spherical Cube */ + OGRErr SetQSC(double dfCenterLat, double dfCenterLong); + + /** Spherical, Cross-track, Height */ + OGRErr SetSCH( double dfPegLat, double dfPegLong, + double dfPegHeading, double dfPegHgt); + /** State Plane */ + OGRErr SetStatePlane( int nZone, int bNAD83 = TRUE, + const char *pszOverrideUnitName = NULL, + double dfOverrideUnit = 0.0 ); + + OGRErr ImportFromESRIStatePlaneWKT( + int nCode, const char* pszDatumName, const char* pszUnitsName, + int nPCSCode, const char* pszCSName = NULL ); + OGRErr ImportFromESRIWisconsinWKT( + const char* pszPrjName, double dfCentralMeridian, double dfLatOfOrigin, + const char* pszUnitsName, const char* pszCSName = NULL ); + + static OGRSpatialReference* GetWGS84SRS(); +}; + +/************************************************************************/ +/* OGRCoordinateTransformation */ +/* */ +/* This is really just used as a base class for a private */ +/* implementation. */ +/************************************************************************/ + +/** + * Interface for transforming between coordinate systems. + * + * Currently, the only implementation within OGR is OGRProj4CT, which + * requires the PROJ.4 library to be available at run-time. + * + * Also, see OGRCreateCoordinateTransformation() for creating transformations. + */ + +class CPL_DLL OGRCoordinateTransformation +{ +public: + virtual ~OGRCoordinateTransformation() {} + + static void DestroyCT(OGRCoordinateTransformation* poCT); + + // From CT_CoordinateTransformation + + /** Fetch internal source coordinate system. */ + virtual OGRSpatialReference *GetSourceCS() = 0; + + /** Fetch internal target coordinate system. */ + virtual OGRSpatialReference *GetTargetCS() = 0; + + // From CT_MathTransform + + /** + * Transform points from source to destination space. + * + * This method is the same as the C function OCTTransform(). + * + * The method TransformEx() allows extended success information to + * be captured indicating which points failed to transform. + * + * @param nCount number of points to transform. + * @param x array of nCount X vertices, modified in place. + * @param y array of nCount Y vertices, modified in place. + * @param z array of nCount Z vertices, modified in place. + * @return TRUE on success, or FALSE if some or all points fail to + * transform. + */ + virtual int Transform( int nCount, + double *x, double *y, double *z = NULL ) = 0; + + /** + * Transform points from source to destination space. + * + * This method is the same as the C function OCTTransformEx(). + * + * @param nCount number of points to transform. + * @param x array of nCount X vertices, modified in place. + * @param y array of nCount Y vertices, modified in place. + * @param z array of nCount Z vertices, modified in place. + * @param pabSuccess array of per-point flags set to TRUE if that point + * transforms, or FALSE if it does not. + * + * @return TRUE if some or all points transform successfully, or FALSE if + * if none transform. + */ + virtual int TransformEx( int nCount, + double *x, double *y, double *z = NULL, + int *pabSuccess = NULL ) = 0; + +}; + +OGRCoordinateTransformation CPL_DLL * +OGRCreateCoordinateTransformation( OGRSpatialReference *poSource, + OGRSpatialReference *poTarget ); + +#endif /* ndef OGR_SPATIALREF_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/ogr_srs_api.h b/modules/globebrowsing/ext/gdal/include/ogr_srs_api.h new file mode 100644 index 0000000000..abaa72184c --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogr_srs_api.h @@ -0,0 +1,791 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenGIS Simple Features Reference Implementation + * Purpose: C API and constant declarations for OGR Spatial References. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 2000, Frank Warmerdam + * Copyright (c) 2008-2013, Even Rouault + * + * 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_SRS_API_H_INCLUDED +#define OGR_SRS_API_H_INCLUDED + +#ifndef SWIG +#include "ogr_core.h" + +CPL_C_START + +/** + * \file ogr_srs_api.h + * + * C spatial reference system services and defines. + * + * See also: ogr_spatialref.h + */ + +/* -------------------------------------------------------------------- */ +/* 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 +} OGRAxisOrientation; + +const char CPL_DLL *OSRAxisEnumToName( OGRAxisOrientation eOrientation ); + +/* -------------------------------------------------------------------- */ +/* Datum types (corresponds to CS_DatumType). */ +/* -------------------------------------------------------------------- */ + +typedef enum { + ODT_HD_Min=1000, + ODT_HD_Other=1000, + ODT_HD_Classic=1001, + ODT_HD_Geocentric=1002, + ODT_HD_Max=1999, + ODT_VD_Min=2000, + ODT_VD_Other=2000, + ODT_VD_Orthometric=2001, + ODT_VD_Ellipsoidal=2002, + ODT_VD_AltitudeBarometric=2003, + ODT_VD_Normal=2004, + ODT_VD_GeoidModelDerived=2005, + ODT_VD_Depth=2006, + ODT_VD_Max=2999, + ODT_LD_Min=10000, + ODT_LD_Max=32767 +} OGRDatumType; + +#endif // ndef SWIG + +/* ==================================================================== */ +/* Some standard WKT geographic coordinate systems. */ +/* ==================================================================== */ + +#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. */ +/* ==================================================================== */ + +#define SRS_PT_ALBERS_CONIC_EQUAL_AREA \ + "Albers_Conic_Equal_Area" +#define SRS_PT_AZIMUTHAL_EQUIDISTANT "Azimuthal_Equidistant" +#define SRS_PT_CASSINI_SOLDNER "Cassini_Soldner" +#define SRS_PT_CYLINDRICAL_EQUAL_AREA "Cylindrical_Equal_Area" +#define SRS_PT_BONNE "Bonne" +#define SRS_PT_ECKERT_I "Eckert_I" +#define SRS_PT_ECKERT_II "Eckert_II" +#define SRS_PT_ECKERT_III "Eckert_III" +#define SRS_PT_ECKERT_IV "Eckert_IV" +#define SRS_PT_ECKERT_V "Eckert_V" +#define SRS_PT_ECKERT_VI "Eckert_VI" +#define SRS_PT_EQUIDISTANT_CONIC \ + "Equidistant_Conic" +#define SRS_PT_EQUIRECTANGULAR "Equirectangular" +#define SRS_PT_GALL_STEREOGRAPHIC \ + "Gall_Stereographic" +#define SRS_PT_GAUSSSCHREIBERTMERCATOR \ + "Gauss_Schreiber_Transverse_Mercator" +#define SRS_PT_GEOSTATIONARY_SATELLITE \ + "Geostationary_Satellite" +#define SRS_PT_GOODE_HOMOLOSINE "Goode_Homolosine" +#define SRS_PT_IGH "Interrupted_Goode_Homolosine" +#define SRS_PT_GNOMONIC "Gnomonic" +#define SRS_PT_HOTINE_OBLIQUE_MERCATOR_AZIMUTH_CENTER \ + "Hotine_Oblique_Mercator_Azimuth_Center" +#define SRS_PT_HOTINE_OBLIQUE_MERCATOR \ + "Hotine_Oblique_Mercator" +#define SRS_PT_HOTINE_OBLIQUE_MERCATOR_TWO_POINT_NATURAL_ORIGIN \ + "Hotine_Oblique_Mercator_Two_Point_Natural_Origin" +#define SRS_PT_LABORDE_OBLIQUE_MERCATOR \ + "Laborde_Oblique_Mercator" +#define SRS_PT_LAMBERT_CONFORMAL_CONIC_1SP \ + "Lambert_Conformal_Conic_1SP" +#define SRS_PT_LAMBERT_CONFORMAL_CONIC_2SP \ + "Lambert_Conformal_Conic_2SP" +#define SRS_PT_LAMBERT_CONFORMAL_CONIC_2SP_BELGIUM \ + "Lambert_Conformal_Conic_2SP_Belgium" +#define SRS_PT_LAMBERT_AZIMUTHAL_EQUAL_AREA \ + "Lambert_Azimuthal_Equal_Area" +#define SRS_PT_MERCATOR_1SP "Mercator_1SP" +#define SRS_PT_MERCATOR_2SP "Mercator_2SP" +// Mercator_Auxiliary_Sphere is used used by ESRI to mean EPSG:3875 +#define SRS_PT_MERCATOR_AUXILIARY_SPHERE \ + "Mercator_Auxiliary_Sphere" +#define SRS_PT_MILLER_CYLINDRICAL "Miller_Cylindrical" +#define SRS_PT_MOLLWEIDE "Mollweide" +#define SRS_PT_NEW_ZEALAND_MAP_GRID \ + "New_Zealand_Map_Grid" +#define SRS_PT_OBLIQUE_STEREOGRAPHIC \ + "Oblique_Stereographic" +#define SRS_PT_ORTHOGRAPHIC "Orthographic" +#define SRS_PT_POLAR_STEREOGRAPHIC \ + "Polar_Stereographic" +#define SRS_PT_POLYCONIC "Polyconic" +#define SRS_PT_ROBINSON "Robinson" +#define SRS_PT_SINUSOIDAL "Sinusoidal" +#define SRS_PT_STEREOGRAPHIC "Stereographic" +#define SRS_PT_SWISS_OBLIQUE_CYLINDRICAL \ + "Swiss_Oblique_Cylindrical" +#define SRS_PT_TRANSVERSE_MERCATOR \ + "Transverse_Mercator" +#define SRS_PT_TRANSVERSE_MERCATOR_SOUTH_ORIENTED \ + "Transverse_Mercator_South_Orientated" + +/* special mapinfo variants on Transverse Mercator */ +#define SRS_PT_TRANSVERSE_MERCATOR_MI_21 \ + "Transverse_Mercator_MapInfo_21" +#define SRS_PT_TRANSVERSE_MERCATOR_MI_22 \ + "Transverse_Mercator_MapInfo_22" +#define SRS_PT_TRANSVERSE_MERCATOR_MI_23 \ + "Transverse_Mercator_MapInfo_23" +#define SRS_PT_TRANSVERSE_MERCATOR_MI_24 \ + "Transverse_Mercator_MapInfo_24" +#define SRS_PT_TRANSVERSE_MERCATOR_MI_25 \ + "Transverse_Mercator_MapInfo_25" + +#define SRS_PT_TUNISIA_MINING_GRID \ + "Tunisia_Mining_Grid" +#define SRS_PT_TWO_POINT_EQUIDISTANT \ + "Two_Point_Equidistant" +#define SRS_PT_VANDERGRINTEN "VanDerGrinten" +#define SRS_PT_KROVAK "Krovak" +#define SRS_PT_IMW_POLYCONIC "International_Map_of_the_World_Polyconic" +#define SRS_PT_WAGNER_I "Wagner_I" +#define SRS_PT_WAGNER_II "Wagner_II" +#define SRS_PT_WAGNER_III "Wagner_III" +#define SRS_PT_WAGNER_IV "Wagner_IV" +#define SRS_PT_WAGNER_V "Wagner_V" +#define SRS_PT_WAGNER_VI "Wagner_VI" +#define SRS_PT_WAGNER_VII "Wagner_VII" +#define SRS_PT_QSC "Quadrilateralized_Spherical_Cube" +#define SRS_PT_AITOFF "Aitoff" +#define SRS_PT_WINKEL_I "Winkel_I" +#define SRS_PT_WINKEL_II "Winkel_II" +#define SRS_PT_WINKEL_TRIPEL "Winkel_Tripel" +#define SRS_PT_CRASTER_PARABOLIC "Craster_Parabolic" +#define SRS_PT_LOXIMUTHAL "Loximuthal" +#define SRS_PT_QUARTIC_AUTHALIC "Quartic_Authalic" +#define SRS_PT_SCH "Spherical_Cross_Track_Height" + +#define SRS_PP_CENTRAL_MERIDIAN "central_meridian" +#define SRS_PP_SCALE_FACTOR "scale_factor" +#define SRS_PP_STANDARD_PARALLEL_1 "standard_parallel_1" +#define SRS_PP_STANDARD_PARALLEL_2 "standard_parallel_2" +#define SRS_PP_PSEUDO_STD_PARALLEL_1 "pseudo_standard_parallel_1" +#define SRS_PP_LONGITUDE_OF_CENTER "longitude_of_center" +#define SRS_PP_LATITUDE_OF_CENTER "latitude_of_center" +#define SRS_PP_LONGITUDE_OF_ORIGIN "longitude_of_origin" +#define SRS_PP_LATITUDE_OF_ORIGIN "latitude_of_origin" +#define SRS_PP_FALSE_EASTING "false_easting" +#define SRS_PP_FALSE_NORTHING "false_northing" +#define SRS_PP_AZIMUTH "azimuth" +#define SRS_PP_LONGITUDE_OF_POINT_1 "longitude_of_point_1" +#define SRS_PP_LATITUDE_OF_POINT_1 "latitude_of_point_1" +#define SRS_PP_LONGITUDE_OF_POINT_2 "longitude_of_point_2" +#define SRS_PP_LATITUDE_OF_POINT_2 "latitude_of_point_2" +#define SRS_PP_LONGITUDE_OF_POINT_3 "longitude_of_point_3" +#define SRS_PP_LATITUDE_OF_POINT_3 "latitude_of_point_3" +#define SRS_PP_RECTIFIED_GRID_ANGLE "rectified_grid_angle" +#define SRS_PP_LANDSAT_NUMBER "landsat_number" +#define SRS_PP_PATH_NUMBER "path_number" +#define SRS_PP_PERSPECTIVE_POINT_HEIGHT "perspective_point_height" +#define SRS_PP_SATELLITE_HEIGHT "satellite_height" +#define SRS_PP_FIPSZONE "fipszone" +#define SRS_PP_ZONE "zone" +#define SRS_PP_LATITUDE_OF_1ST_POINT "Latitude_Of_1st_Point" +#define SRS_PP_LONGITUDE_OF_1ST_POINT "Longitude_Of_1st_Point" +#define SRS_PP_LATITUDE_OF_2ND_POINT "Latitude_Of_2nd_Point" +#define SRS_PP_LONGITUDE_OF_2ND_POINT "Longitude_Of_2nd_Point" +#define SRS_PP_PEG_POINT_LATITUDE "peg_point_latitude" +#define SRS_PP_PEG_POINT_LONGITUDE "peg_point_longitude" +#define SRS_PP_PEG_POINT_HEADING "peg_point_heading" +#define SRS_PP_PEG_POINT_HEIGHT "peg_point_height" + +#define SRS_UL_METER "Meter" +#define SRS_UL_FOOT "Foot (International)" /* or just "FOOT"? */ +#define SRS_UL_FOOT_CONV "0.3048" +#define SRS_UL_US_FOOT "Foot_US" /* or "US survey foot" from EPSG */ +#define SRS_UL_US_FOOT_CONV "0.3048006096012192" +#define SRS_UL_NAUTICAL_MILE "Nautical Mile" +#define SRS_UL_NAUTICAL_MILE_CONV "1852.0" +#define SRS_UL_LINK "Link" /* Based on US Foot */ +#define SRS_UL_LINK_CONV "0.20116684023368047" +#define SRS_UL_CHAIN "Chain" /* based on US Foot */ +#define SRS_UL_CHAIN_CONV "20.116684023368047" +#define SRS_UL_ROD "Rod" /* based on US Foot */ +#define SRS_UL_ROD_CONV "5.02921005842012" +#define SRS_UL_LINK_Clarke "Link_Clarke" +#define SRS_UL_LINK_Clarke_CONV "0.2011661949" + +#define SRS_UL_KILOMETER "Kilometer" +#define SRS_UL_KILOMETER_CONV "1000." +#define SRS_UL_DECIMETER "Decimeter" +#define SRS_UL_DECIMETER_CONV "0.1" +#define SRS_UL_CENTIMETER "Centimeter" +#define SRS_UL_CENTIMETER_CONV "0.01" +#define SRS_UL_MILLIMETER "Millimeter" +#define SRS_UL_MILLIMETER_CONV "0.001" +#define SRS_UL_INTL_NAUT_MILE "Nautical_Mile_International" +#define SRS_UL_INTL_NAUT_MILE_CONV "1852.0" +#define SRS_UL_INTL_INCH "Inch_International" +#define SRS_UL_INTL_INCH_CONV "0.0254" +#define SRS_UL_INTL_FOOT "Foot_International" +#define SRS_UL_INTL_FOOT_CONV "0.3048" +#define SRS_UL_INTL_YARD "Yard_International" +#define SRS_UL_INTL_YARD_CONV "0.9144" +#define SRS_UL_INTL_STAT_MILE "Statute_Mile_International" +#define SRS_UL_INTL_STAT_MILE_CONV "1609.344" +#define SRS_UL_INTL_FATHOM "Fathom_International" +#define SRS_UL_INTL_FATHOM_CONV "1.8288" +#define SRS_UL_INTL_CHAIN "Chain_International" +#define SRS_UL_INTL_CHAIN_CONV "20.1168" +#define SRS_UL_INTL_LINK "Link_International" +#define SRS_UL_INTL_LINK_CONV "0.201168" +#define SRS_UL_US_INCH "Inch_US_Surveyor" +#define SRS_UL_US_INCH_CONV "0.025400050800101603" +#define SRS_UL_US_YARD "Yard_US_Surveyor" +#define SRS_UL_US_YARD_CONV "0.914401828803658" +#define SRS_UL_US_CHAIN "Chain_US_Surveyor" +#define SRS_UL_US_CHAIN_CONV "20.11684023368047" +#define SRS_UL_US_STAT_MILE "Statute_Mile_US_Surveyor" +#define SRS_UL_US_STAT_MILE_CONV "1609.347218694437" +#define SRS_UL_INDIAN_YARD "Yard_Indian" +#define SRS_UL_INDIAN_YARD_CONV "0.91439523" +#define SRS_UL_INDIAN_FOOT "Foot_Indian" +#define SRS_UL_INDIAN_FOOT_CONV "0.30479841" +#define SRS_UL_INDIAN_CHAIN "Chain_Indian" +#define SRS_UL_INDIAN_CHAIN_CONV "20.11669506" + +#define SRS_UA_DEGREE "degree" +#define SRS_UA_DEGREE_CONV "0.0174532925199433" +#define SRS_UA_RADIAN "radian" + +#define SRS_PM_GREENWICH "Greenwich" + +#define SRS_DN_NAD27 "North_American_Datum_1927" +#define SRS_DN_NAD83 "North_American_Datum_1983" +#define SRS_DN_WGS72 "WGS_1972" +#define SRS_DN_WGS84 "WGS_1984" + +#define SRS_WGS84_SEMIMAJOR 6378137.0 +#define SRS_WGS84_INVFLATTENING 298.257223563 + +#ifndef SWIG +/* -------------------------------------------------------------------- */ +/* C Wrappers for C++ objects and methods. */ +/* -------------------------------------------------------------------- */ +#ifndef DEFINED_OGRSpatialReferenceH +#define DEFINED_OGRSpatialReferenceH + +#ifdef DEBUG +typedef struct OGRSpatialReferenceHS *OGRSpatialReferenceH; +typedef struct OGRCoordinateTransformationHS *OGRCoordinateTransformationH; +#else +typedef void *OGRSpatialReferenceH; +typedef void *OGRCoordinateTransformationH; +#endif + +#endif + + +OGRSpatialReferenceH CPL_DLL CPL_STDCALL + OSRNewSpatialReference( const char * /* = NULL */); +OGRSpatialReferenceH CPL_DLL CPL_STDCALL OSRCloneGeogCS( OGRSpatialReferenceH ); +OGRSpatialReferenceH CPL_DLL CPL_STDCALL OSRClone( OGRSpatialReferenceH ); +void CPL_DLL CPL_STDCALL OSRDestroySpatialReference( OGRSpatialReferenceH ); + +int CPL_DLL OSRReference( OGRSpatialReferenceH ); +int CPL_DLL OSRDereference( OGRSpatialReferenceH ); +void CPL_DLL OSRRelease( OGRSpatialReferenceH ); + +OGRErr CPL_DLL OSRValidate( OGRSpatialReferenceH ); +OGRErr CPL_DLL OSRFixupOrdering( OGRSpatialReferenceH ); +OGRErr CPL_DLL OSRFixup( OGRSpatialReferenceH ); +OGRErr CPL_DLL OSRStripCTParms( OGRSpatialReferenceH ); + +OGRErr CPL_DLL CPL_STDCALL OSRImportFromEPSG( OGRSpatialReferenceH, int ); +OGRErr CPL_DLL CPL_STDCALL OSRImportFromEPSGA( OGRSpatialReferenceH, int ); +OGRErr CPL_DLL OSRImportFromWkt( OGRSpatialReferenceH, char ** ); +OGRErr CPL_DLL OSRImportFromProj4( OGRSpatialReferenceH, const char *); +OGRErr CPL_DLL OSRImportFromESRI( OGRSpatialReferenceH, char **); +OGRErr CPL_DLL OSRImportFromPCI( OGRSpatialReferenceH hSRS, const char *, + const char *, double * ); +OGRErr CPL_DLL OSRImportFromUSGS( OGRSpatialReferenceH, + long, long, double *, long); +OGRErr CPL_DLL OSRImportFromXML( OGRSpatialReferenceH, const char * ); +OGRErr CPL_DLL OSRImportFromDict( OGRSpatialReferenceH, const char *, + const char * ); +OGRErr CPL_DLL OSRImportFromPanorama( OGRSpatialReferenceH, long, long, long, + double * ); +OGRErr CPL_DLL OSRImportFromOzi( OGRSpatialReferenceH , const char * const *); +OGRErr CPL_DLL OSRImportFromMICoordSys( OGRSpatialReferenceH, const char *); +OGRErr CPL_DLL OSRImportFromERM( OGRSpatialReferenceH, + const char *, const char *, const char * ); +OGRErr CPL_DLL OSRImportFromUrl( OGRSpatialReferenceH, const char * ); + +OGRErr CPL_DLL CPL_STDCALL OSRExportToWkt( OGRSpatialReferenceH, char ** ); +OGRErr CPL_DLL CPL_STDCALL OSRExportToPrettyWkt( OGRSpatialReferenceH, char **, int); +OGRErr CPL_DLL CPL_STDCALL OSRExportToProj4( OGRSpatialReferenceH, char **); +OGRErr CPL_DLL OSRExportToPCI( OGRSpatialReferenceH, char **, char **, + double ** ); +OGRErr CPL_DLL OSRExportToUSGS( OGRSpatialReferenceH, long *, long *, + double **, long * ); +OGRErr CPL_DLL OSRExportToXML( OGRSpatialReferenceH, char **, const char * ); +OGRErr CPL_DLL OSRExportToPanorama( OGRSpatialReferenceH, long *, long *, + long *, long *, double * ); +OGRErr CPL_DLL OSRExportToMICoordSys( OGRSpatialReferenceH, char ** ); +OGRErr CPL_DLL OSRExportToERM( OGRSpatialReferenceH, char *, char *, char * ); + +OGRErr CPL_DLL OSRMorphToESRI( OGRSpatialReferenceH ); +OGRErr CPL_DLL OSRMorphFromESRI( OGRSpatialReferenceH ); + +OGRErr CPL_DLL CPL_STDCALL OSRSetAttrValue( OGRSpatialReferenceH hSRS, + const char * pszNodePath, + const char * pszNewNodeValue ); +const char CPL_DLL * CPL_STDCALL OSRGetAttrValue( OGRSpatialReferenceH hSRS, + const char * pszName, int iChild /* = 0 */ ); + +OGRErr CPL_DLL OSRSetAngularUnits( OGRSpatialReferenceH, const char *, double ); +double CPL_DLL OSRGetAngularUnits( OGRSpatialReferenceH, char ** ); +OGRErr CPL_DLL OSRSetLinearUnits( OGRSpatialReferenceH, const char *, double ); +OGRErr CPL_DLL OSRSetTargetLinearUnits( OGRSpatialReferenceH, const char *, const char *, double ); +OGRErr CPL_DLL OSRSetLinearUnitsAndUpdateParameters( + OGRSpatialReferenceH, const char *, double ); +double CPL_DLL OSRGetLinearUnits( OGRSpatialReferenceH, char ** ); +double CPL_DLL OSRGetTargetLinearUnits( OGRSpatialReferenceH, const char *, char ** ); + +double CPL_DLL OSRGetPrimeMeridian( OGRSpatialReferenceH, char ** ); + +int CPL_DLL OSRIsGeographic( OGRSpatialReferenceH ); +int CPL_DLL OSRIsLocal( OGRSpatialReferenceH ); +int CPL_DLL OSRIsProjected( OGRSpatialReferenceH ); +int CPL_DLL OSRIsCompound( OGRSpatialReferenceH ); +int CPL_DLL OSRIsGeocentric( OGRSpatialReferenceH ); +int CPL_DLL OSRIsVertical( OGRSpatialReferenceH ); +int CPL_DLL OSRIsSameGeogCS( OGRSpatialReferenceH, OGRSpatialReferenceH ); +int CPL_DLL OSRIsSameVertCS( OGRSpatialReferenceH, OGRSpatialReferenceH ); +int CPL_DLL OSRIsSame( OGRSpatialReferenceH, OGRSpatialReferenceH ); + +OGRErr CPL_DLL OSRSetLocalCS( OGRSpatialReferenceH hSRS, const char *pszName ); +OGRErr CPL_DLL OSRSetProjCS( OGRSpatialReferenceH hSRS, const char * pszName ); +OGRErr CPL_DLL OSRSetGeocCS( OGRSpatialReferenceH hSRS, const char * pszName ); +OGRErr CPL_DLL OSRSetWellKnownGeogCS( OGRSpatialReferenceH hSRS, + const char * pszName ); +OGRErr CPL_DLL CPL_STDCALL OSRSetFromUserInput( OGRSpatialReferenceH hSRS, + const char * ); +OGRErr CPL_DLL OSRCopyGeogCSFrom( OGRSpatialReferenceH hSRS, + const OGRSpatialReferenceH hSrcSRS ); +OGRErr CPL_DLL OSRSetTOWGS84( OGRSpatialReferenceH hSRS, + double, double, double, + double, double, double, double ); +OGRErr CPL_DLL OSRGetTOWGS84( OGRSpatialReferenceH hSRS, double *, int ); + +OGRErr CPL_DLL OSRSetCompoundCS( OGRSpatialReferenceH hSRS, + const char *pszName, + OGRSpatialReferenceH hHorizSRS, + OGRSpatialReferenceH hVertSRS ); +OGRErr CPL_DLL OSRSetGeogCS( OGRSpatialReferenceH hSRS, + const char * pszGeogName, + const char * pszDatumName, + const char * pszEllipsoidName, + double dfSemiMajor, double dfInvFlattening, + const char * pszPMName /* = NULL */, + double dfPMOffset /* = 0.0 */, + const char * pszUnits /* = NULL */, + double dfConvertToRadians /* = 0.0 */ ); + +OGRErr CPL_DLL OSRSetVertCS( OGRSpatialReferenceH hSRS, + const char * pszVertCSName, + const char * pszVertDatumName, + int nVertDatumType ); + +double CPL_DLL OSRGetSemiMajor( OGRSpatialReferenceH, OGRErr * /* = NULL */ ); +double CPL_DLL OSRGetSemiMinor( OGRSpatialReferenceH, OGRErr * /* = NULL */ ); +double CPL_DLL OSRGetInvFlattening( OGRSpatialReferenceH, OGRErr * /*=NULL*/); + +OGRErr CPL_DLL OSRSetAuthority( OGRSpatialReferenceH hSRS, + const char * pszTargetKey, + const char * pszAuthority, + int nCode ); +const char CPL_DLL *OSRGetAuthorityCode( OGRSpatialReferenceH hSRS, + const char * pszTargetKey ); +const char CPL_DLL *OSRGetAuthorityName( OGRSpatialReferenceH hSRS, + const char * pszTargetKey ); +OGRErr CPL_DLL OSRSetProjection( OGRSpatialReferenceH, const char * ); +OGRErr CPL_DLL OSRSetProjParm( OGRSpatialReferenceH, const char *, double ); +double CPL_DLL OSRGetProjParm( OGRSpatialReferenceH hSRS, + const char * pszParmName, + double dfDefault /* = 0.0 */, + OGRErr * /* = NULL */ ); +OGRErr CPL_DLL OSRSetNormProjParm( OGRSpatialReferenceH, const char *, double); +double CPL_DLL OSRGetNormProjParm( OGRSpatialReferenceH hSRS, + const char * pszParmName, + double dfDefault /* = 0.0 */, + OGRErr * /* = NULL */ ); + +OGRErr CPL_DLL OSRSetUTM( OGRSpatialReferenceH hSRS, int nZone, int bNorth ); +int CPL_DLL OSRGetUTMZone( OGRSpatialReferenceH hSRS, int *pbNorth ); +OGRErr CPL_DLL OSRSetStatePlane( OGRSpatialReferenceH hSRS, + int nZone, int bNAD83 ); +OGRErr CPL_DLL OSRSetStatePlaneWithUnits( OGRSpatialReferenceH hSRS, + int nZone, int bNAD83, + const char *pszOverrideUnitName, + double dfOverrideUnit ); +OGRErr CPL_DLL OSRAutoIdentifyEPSG( OGRSpatialReferenceH hSRS ); + +int CPL_DLL OSREPSGTreatsAsLatLong( OGRSpatialReferenceH hSRS ); +int CPL_DLL OSREPSGTreatsAsNorthingEasting( OGRSpatialReferenceH hSRS ); +const char CPL_DLL *OSRGetAxis( OGRSpatialReferenceH hSRS, + const char *pszTargetKey, int iAxis, + OGRAxisOrientation *peOrientation ); +OGRErr CPL_DLL OSRSetAxes( OGRSpatialReferenceH hSRS, + const char *pszTargetKey, + const char *pszXAxisName, + OGRAxisOrientation eXAxisOrientation, + const char *pszYAxisName, + OGRAxisOrientation eYAxisOrientation ); +/** Albers Conic Equal Area */ +OGRErr CPL_DLL OSRSetACEA( OGRSpatialReferenceH hSRS, double dfStdP1, double dfStdP2, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Azimuthal Equidistant */ +OGRErr CPL_DLL OSRSetAE( OGRSpatialReferenceH hSRS, double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Bonne */ +OGRErr CPL_DLL OSRSetBonne(OGRSpatialReferenceH hSRS, + double dfStandardParallel, double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + +/** Cylindrical Equal Area */ +OGRErr CPL_DLL OSRSetCEA( OGRSpatialReferenceH hSRS, double dfStdP1, double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + +/** Cassini-Soldner */ +OGRErr CPL_DLL OSRSetCS( OGRSpatialReferenceH hSRS, double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Equidistant Conic */ +OGRErr CPL_DLL OSRSetEC( OGRSpatialReferenceH hSRS, double dfStdP1, double dfStdP2, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Eckert I-VI */ +OGRErr CPL_DLL OSRSetEckert( OGRSpatialReferenceH hSRS, int nVariation, + double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + +/** Eckert IV */ +OGRErr CPL_DLL OSRSetEckertIV( OGRSpatialReferenceH hSRS, double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + +/** Eckert VI */ +OGRErr CPL_DLL OSRSetEckertVI( OGRSpatialReferenceH hSRS, double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + +/** Equirectangular */ +OGRErr CPL_DLL OSRSetEquirectangular(OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Equirectangular generalized form */ +OGRErr CPL_DLL OSRSetEquirectangular2( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfPseudoStdParallel1, + double dfFalseEasting, + double dfFalseNorthing ); + +/** Gall Stereograpic */ +OGRErr CPL_DLL OSRSetGS( OGRSpatialReferenceH hSRS, double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + +/** Goode Homolosine */ +OGRErr CPL_DLL OSRSetGH( OGRSpatialReferenceH hSRS, double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + +/** Interrupted Goode Homolosine */ +OGRErr CPL_DLL OSRSetIGH( OGRSpatialReferenceH hSRS ); + +/** GEOS - Geostationary Satellite View */ +OGRErr CPL_DLL OSRSetGEOS( OGRSpatialReferenceH hSRS, + double dfCentralMeridian, double dfSatelliteHeight, + double dfFalseEasting, double dfFalseNorthing ); + +/** Gauss Schreiber Transverse Mercator */ +OGRErr CPL_DLL OSRSetGaussSchreiberTMercator( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, + double dfFalseNorthing ); +/** Gnomonic */ +OGRErr CPL_DLL OSRSetGnomonic(OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Oblique Mercator (aka HOM (variant B) */ +OGRErr CPL_DLL OSRSetOM( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfAzimuth, double dfRectToSkew, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + +/** Hotine Oblique Mercator using azimuth angle */ +OGRErr CPL_DLL OSRSetHOM( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfAzimuth, double dfRectToSkew, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + +OGRErr CPL_DLL OSRSetHOMAC( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfAzimuth, double dfRectToSkew, + double dfScale, + double dfFalseEasting, + double dfFalseNorthing ); + +/** Hotine Oblique Mercator using two points on centerline */ +OGRErr CPL_DLL OSRSetHOM2PNO( OGRSpatialReferenceH hSRS, double dfCenterLat, + double dfLat1, double dfLong1, + double dfLat2, double dfLong2, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + +/** International Map of the World Polyconic */ +OGRErr CPL_DLL OSRSetIWMPolyconic( OGRSpatialReferenceH hSRS, + double dfLat1, double dfLat2, + double dfCenterLong, + double dfFalseEasting, + double dfFalseNorthing ); + +/** Krovak Oblique Conic Conformal */ +OGRErr CPL_DLL OSRSetKrovak( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfAzimuth, double dfPseudoStdParallelLat, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + +/** Lambert Azimuthal Equal-Area */ +OGRErr CPL_DLL OSRSetLAEA( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Lambert Conformal Conic */ +OGRErr CPL_DLL OSRSetLCC( OGRSpatialReferenceH hSRS, + double dfStdP1, double dfStdP2, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Lambert Conformal Conic 1SP */ +OGRErr CPL_DLL OSRSetLCC1SP( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + +/** Lambert Conformal Conic (Belgium) */ +OGRErr CPL_DLL OSRSetLCCB( OGRSpatialReferenceH hSRS, + double dfStdP1, double dfStdP2, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Miller Cylindrical */ +OGRErr CPL_DLL OSRSetMC( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Mercator */ +OGRErr CPL_DLL OSRSetMercator( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); +OGRErr CPL_DLL OSRSetMercator2SP( OGRSpatialReferenceH hSRS, + double dfStdP1, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Mollweide */ +OGRErr CPL_DLL OSRSetMollweide( OGRSpatialReferenceH hSRS, + double dfCentralMeridian, + double dfFalseEasting, + double dfFalseNorthing ); + +/** New Zealand Map Grid */ +OGRErr CPL_DLL OSRSetNZMG( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Oblique Stereographic */ +OGRErr CPL_DLL OSRSetOS( OGRSpatialReferenceH hSRS, + double dfOriginLat, double dfCMeridian, + double dfScale, + double dfFalseEasting,double dfFalseNorthing); + +/** Orthographic */ +OGRErr CPL_DLL OSRSetOrthographic( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, + double dfFalseNorthing); + +/** Polyconic */ +OGRErr CPL_DLL OSRSetPolyconic( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Polar Stereographic */ +OGRErr CPL_DLL OSRSetPS( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, double dfFalseNorthing); + +/** Robinson */ +OGRErr CPL_DLL OSRSetRobinson( OGRSpatialReferenceH hSRS, + double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Sinusoidal */ +OGRErr CPL_DLL OSRSetSinusoidal( OGRSpatialReferenceH hSRS, + double dfCenterLong, + double dfFalseEasting, + double dfFalseNorthing ); + +/** Stereographic */ +OGRErr CPL_DLL OSRSetStereographic( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, + double dfFalseNorthing); + +/** Swiss Oblique Cylindrical */ +OGRErr CPL_DLL OSRSetSOC( OGRSpatialReferenceH hSRS, + double dfLatitudeOfOrigin, double dfCentralMeridian, + double dfFalseEasting, double dfFalseNorthing ); + +/** Transverse Mercator + * + * Special processing available for Transverse Mercator with GDAL >= 1.10 and PROJ >= 4.8 : + * see OGRSpatialReference::exportToProj4(). + */ + +OGRErr CPL_DLL OSRSetTM( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + +/** Transverse Mercator variant */ +OGRErr CPL_DLL OSRSetTMVariant( + OGRSpatialReferenceH hSRS, const char *pszVariantName, + double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + +/** Tunesia Mining Grid */ +OGRErr CPL_DLL OSRSetTMG( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Transverse Mercator (South Oriented) */ +OGRErr CPL_DLL OSRSetTMSO( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong, + double dfScale, + double dfFalseEasting, double dfFalseNorthing ); + +OGRErr CPL_DLL OSRSetTPED( OGRSpatialReferenceH hSRS, + double dfLat1, double dfLong1, + double dfLat2, double dfLong2, + double dfFalseEasting, double dfFalseNorthing ); + +/** VanDerGrinten */ +OGRErr CPL_DLL OSRSetVDG( OGRSpatialReferenceH hSRS, + double dfCenterLong, + double dfFalseEasting, double dfFalseNorthing ); + +/** Wagner I -- VII */ +OGRErr CPL_DLL OSRSetWagner( OGRSpatialReferenceH hSRS, int nVariation, + double dfCenterLat, + double dfFalseEasting, + double dfFalseNorthing ); + +/** Quadrilateralized Spherical Cube */ +OGRErr CPL_DLL OSRSetQSC( OGRSpatialReferenceH hSRS, + double dfCenterLat, double dfCenterLong ); + +/** Spherical, Cross-track, Height */ +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 ); + +void CPL_DLL OSRCleanup( void ); + +/* -------------------------------------------------------------------- */ +/* OGRCoordinateTransform C API. */ +/* -------------------------------------------------------------------- */ +OGRCoordinateTransformationH CPL_DLL CPL_STDCALL +OCTNewCoordinateTransformation( OGRSpatialReferenceH hSourceSRS, + OGRSpatialReferenceH hTargetSRS ); +void CPL_DLL CPL_STDCALL + OCTDestroyCoordinateTransformation( OGRCoordinateTransformationH ); + +int CPL_DLL CPL_STDCALL +OCTTransform( OGRCoordinateTransformationH hCT, + int nCount, double *x, double *y, double *z ); + +int CPL_DLL CPL_STDCALL +OCTTransformEx( OGRCoordinateTransformationH hCT, + int nCount, double *x, double *y, double *z, + int *pabSuccess ); + +/* this is really private to OGR. */ +char *OCTProj4Normalize( const char *pszProj4Src ); + +void OCTCleanupProjMutex( void ); + +/* -------------------------------------------------------------------- */ +/* Projection transform dictionary query. */ +/* -------------------------------------------------------------------- */ + +char CPL_DLL ** OPTGetProjectionMethods( void ); +char CPL_DLL ** OPTGetParameterList( const char * pszProjectionMethod, + char ** ppszUserName ); +int CPL_DLL OPTGetParameterInfo( const char * pszProjectionMethod, + const char * pszParameterName, + char ** ppszUserName, + char ** ppszType, + double *pdfDefaultValue ); + +CPL_C_END + +#endif /* ndef SWIG */ + +#endif /* ndef OGR_SRS_API_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/ogr_srs_esri_names.h b/modules/globebrowsing/ext/gdal/include/ogr_srs_esri_names.h new file mode 100644 index 0000000000..2a7181bd0e --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogr_srs_esri_names.h @@ -0,0 +1,717 @@ +static const char * const apszGcsNameMapping[] = { +"North_American_Datum_1983", "GCS_North_American_1983", +"North_American_Datum_1927", "GCS_North_American_1927", +"NAD27_CONUS", "GCS_North_American_1927", +"Reseau_Geodesique_de_Nouvelle_Caledonie_1991-93", "GCS_RGNC_1991-93", +"Reseau_Geodesique_de_la_Polynesie_Francaise", "GCS_RGPF", +"Rauenberg_1983", "GCS_RD/83", +"Phillipine_Reference_System_1992", "GCS_PRS_1992", +"Potsdam_1983", "GCS_PD/83", +"Datum_Geodesi_Nasional_1995", "GCS_DGN_1995", +"Islands_Network_1993", "GCS_ISN_1993", +"Institut_Geographique_du_Congo_Belge_1955", "GCS_IGCB_1955", +"IGC_1962_Arc_of_the_6th_Parallel_South", "GCS_IGC_1962_6th_Parallel_South", +"Jamaica_2001", "GCS_JAD_2001", +"European_Libyan_1979", "GCS_European_Libyan_Datum_1979", +"Madrid_1870", "GCS_Madrid_1870_Madrid", +"Azores_Occidental_Islands_1939", "GCS_Azores_Occidental_1939", +"Azores_Central_Islands_1948", "GCS_Azores_Central_1948", +"Azores_Oriental_Islands_1940", "GCS_Azores_Oriental_1940", +"Lithuania_1994", "GCS_LKS_1994", +"Libyan_Geodetic_Datum_2006", "GCS_LGD2006", +//"Lisbon", "GCS_Lisbon_Lisbon", +"Stockholm_1938", "GCS_RT38", +"Latvia_1992", "GCS_LKS_1992", +"Azores_Oriental_Islands_1995", "GCS_Azores_Oriental_1995", +"Azores_Central_Islands_1948", "GCS_Azores_Central_1948", +"Azores_Central_Islands_1995", "GCS_Azores_Central_1995", +"ATF", "GCS_ATF_Paris", +//"ITRF_2000", "GCS_MONREF_1997", +"Faroe_Datum_1954", "GCS_FD_1954", +"Vietnam_2000", "GCS_VN_2000", +//"Belge_1950", "GCS_Belge_1950_Brussels", +"Qatar_1948", "GCS_Qatar_1948", +"Qatar", "GCS_Qatar_1974", +"Kuwait_Utility", "GCS_KUDAMS", +"ED_1950_16", "GCS_European_1950", +"SAD_1969_Mean", "GCS_South_American_1969", +"Sphere_of_Radius_6370997m", "GCS_Sphere_ARC_INFO", +"Australian_Geodetic_1966", "GCS_Australian_1966", +"Australian_Geodetic_1984", "GCS_Australian_1984", +"AGD84", "GCS_Australian_1984", +"AGD66", "GCS_Australian_1966", +"Rome_1940", "GCS_Monte_Mario", +"Tokyo_Japan", "GCS_Tokyo", +"Graciosa_Base_SW_1948_1", "GCS_Graciosa_Base_SW_1948", +"Datum_Lisboa_Bessel_1", "GCS_Datum_Lisboa_Bessel", +"Datum_Lisboa_Hayford_1", "GCS_Datum_Lisboa_Hayford", +"Observatorio_Metereo_1939_Grupo_Ocidental", "GCS_Observ_Meteorologico_1939", +"Porto_Santo_1936_1", "GCS_Porto_Santo_1936", +"Sao_Braz_1", "GCS_Sao_Braz", +"GDA94", "GCS_GDA_1994", +"HARN", "GCS_North_American_1983_HARN", +"NAD83_HARN", "GCS_North_American_1983_HARN", +"Voirol_1875", "GCS_Voirol_1875", +"Voirol_1960", "GCS_Voirol_Unifie_1960", +"Ain_el_Abd_1970_Bahrain", "GCS_Ain_el_Abd_1970", +"ED_1950_ED77", "GCS_European_1950_ED77", +"Naparima_1955_2", "GCS_Naparima_1955", +"Aratu_Brazil_Campos_Espirito_Santo_and_Santos_basins", "GCS_Aratu", +"Camacupa_Angola_1", "GCS_Camacupa", +"Cape_1", "GCS_Cape", +"Carthage_Tunisia", "GCS_Carthage", +"Deir_ez_Zor_2", "GCS_Deir_ez_Zor", +"Old_Egyptian_1907", "GCS_Egypt_1907", +"PSAD56", "GCS_Provisional_S_American_1956", +"Indian 1975", "GCS_Indian_1975", +"Indian_1960_1", "GCS_Indian_1960", +"Kalianpur_1937_1", "GCS_Kalianpur_1937", +"Kertau_1948", "GCS_Kertau", +"Kertau_1968", "GCS_Kertau", +"Luzon", "GCS_Luzon_1911", +"Malongo_1987_1", "GCS_Malongo_1987", +"Minna_Cameroon", "GCS_Minna", +"Mporaloko_1", "GCS_Mporaloko", +"Nahrwan_Oman", "GCS_Nahrwan_1967", +"Naparima_BWI", "GCS_Naparima_1972", +"Geodetic_Datum_1949", "GCS_New_Zealand_1949", +"Qatar_National", "GCS_Qatar_1974", +"SAD_1969_Mean", "GCS_South_American_1969", +"Tananarive_Observatory_1925", "GCS_Tananarive_1925", +"Tananarive", "GCS_Tananarive_1925", +"Ireland_1965", "GCS_TM65", +"DE_DHDN_whole_country_2001_to_ETRS89", "GCS_Deutsches_Hauptdreiecksnetz", +"Belge_1972_1", "GCS_Belge_1972", +"WGS_72", "GCS_WGS_1972", +"JGD2000", "GCS_JGD_2000", +"NZGD49", "GCS_New_Zealand_1949", +"CH1903_1", "GCS_CH1903", +"DE_42/83_to_ETRS89", "GCS_Pulkovo_1942", +"DE_42_83_to_ETRS89", "GCS_Pulkovo_1942", +"Amersfoort_1", "GCS_Amersfoort", +"CH1903+_L+T1997", "GCS_CH1903+", +"Ord_Survey_G_Britain_1936", "GCS_OSGB_1936", +"European_Datum_1950", "GCS_European_1950", +"Geocentric_Datum_of_Australia_1994", "GCS_GDA_1994", +"NAD83_High_Accuracy_Regional_Network", "GCS_North_American_1983_HARN", +"Bogota_1975", "GCS_Bogota", +"North_American_Datum_1927_CGQ77", "GCS_NAD_1927_CGQ77", +"North_American_Datum_1927_1976", "GCS_NAD_1927_Definition_1976", +"European_Datum_1950_1977", "GCS_European_1950_ED77", +"WGS_1972_Transit_Broadcast_Ephemeris", "GCS_WGS_1972_BE", +"Greek_Geodetic_Reference_System_1987", "GCS_GGRS_1987", +"Militar_Geographische_Institute", "GCS_MGI", +"ED50", "GCS_European_1950", +"ETRS89", "GCS_ETRS_1989", +NULL, NULL}; + +static const char * const apszGcsNameMappingBasedOnProjCS[] = { +"EUREF_FIN_TM35FIN", "GCS_ETRS_1989", "GCS_EUREF_FIN", +"Nord_Maroc_Degree", "GCS_Merchich", "GCS_Merchich_Degree", +"Sahara_Degree", "GCS_Merchich", "GCS_Merchich_Degree", +"Sud_Maroc_Degree", "GCS_Merchich", "GCS_Merchich_Degree", +"Merchich_Degree_UTM_Zone_28N", "GCS_Merchich", "GCS_Merchich_Degree", +"Lambert_Conformal_Conic", "GCS_Merchich", "GCS_Merchich_Degree", +"UTM", "GCS_Merchich", "GCS_Merchich_Degree", +"UTM_Zone_28_Northern_Hemisphere", "GCS_Merchich", "GCS_Merchich_Degree", +"Portuguese_National_Grid", "GCS_Lisbon", "GCS_Lisbon_Lisbon", +"Belge_Lambert_1950", "GCS_Belge_1950", "GCS_Belge_1950_Brussels", +"MONREF_1997_UTM_Zone_46N", "GCS_ITRF_2000", "GCS_MONREF_1997", +"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", +"Voirol 1960", "Degree", "GCS_Voirol_Unifie_1960_Degree", +"Voirol_1875", "Degree", "GCS_Voirol_1875_Degree", +"Voirol 1875", "Degree", "GCS_Voirol_1875_Degree", +"NTF", "Grad", "GCS_NTF_Paris", +NULL, NULL, NULL}; + +static const char * const apszGcsNameMappingBasedPrime[] = { +"Bern_1898", "Bern", "GCS_Bern_1898_Bern", +"Madrid_1870", "Madrid", "GCS_Madrid_1870_Madrid", +"MGI", "Ferro", "GCS_MGI_Ferro", +"MGI", "Stockholm", "GCS_RT38_Stockholm", +"Monte_Mario", "Rome", "GCS_Monte_Mario_Rome", +"NGO_1948", "Oslo", "GCS_NGO_1948_Oslo", +"S_JTSK", "Ferro", "GCS_S_JTSK_Ferro", +"Stockholm_1938", "Stockholm", "GCS_RT38_Stockholm", +NULL, NULL, NULL}; + +static const char * const apszInvFlatteningMapping[] = { +"293.464999999", "293.465", +"293.465000003", "293.465", +"293.465073361", "293.465", +"293.466020000", "293.46602", +"293.466021293", "293.46602", +"293.4663077168286", "293.466307656", +"293.4664236085404", "293.466307656", +"294.2606763690", "294.260676369", +"294.9786981999", "294.9786982", +"294.978698213", "294.9786982", +"295.9999999999", "296.0", +"297.0000000000", "297.0", +"297.0000000284", "297.0", +"297.0000535480", "297.0", +"298.2499972761", "298.25", +"298.2500000654", "298.25", +"298.2500112226", "298.25", +"298.256999999", "298.257", +"298.2600000000", "298.26", +"298.2571643544962", "298.257223563", +"298.25716435449", "298.257222101", +"298.257222096042", "298.257222101", +"298.25722210100", "298.257222101", +"298.25722356299", "298.257223563", +"298.25722356300", "298.257223563", +"298.25999858999", "298.26", +"298.2684109950054", "298.268410995005", +"298.2999", "298.3", +"298.3000", "298.3", +"299.1527033239203", "299.1528128", +"299.15281280000", "299.1528128", +"299.15281283", "299.1528128", +"299.15281310607", "299.1528128", +"299.15281327254", "299.1528128", +"299.32496460000", "299.3249646", +"299.32496405862", "299.3249646", +"299.32497531503", "299.3249646", +"300.80158474106", "300.8017", +"300.80169943849", "300.8017", +"300.80169999999", "300.8017", +"300.80170000000", "300.8017", +"300.80170009712", "300.8017", +NULL, NULL}; + +static const char * const apszParamValueMapping[] = { +"Cassini", "false_easting", "283799.9999", "283800.0", +"Cassini", "false_easting", "132033.9199", "132033.92", +"Cassini", "false_northing", "214499.9999", "214500.0", +"Cassini", "false_northing", "62565.9599", "62565.95", +"Transverse_Mercator", "false_easting", "499999.1331", "500000.0", +"Transverse_Mercator", "false_easting", "299999.4798609", "300000.0", +"Transverse_Mercator", "false_northing", "399999.30648", "400000.0", +"Transverse_Mercator", "false_northing", "499999.1331", "500000.0", +"Transverse_Mercator", "central_meridian","51.21666666666668", "51.21666666666667", +"Transverse_Mercator", "Scale_Factor", "0.999601272", "0.9996012717", +"Lambert_Conformal_Conic", "central_meridian", "-90.33333333333334", "-90.33333333333333", +"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", +NULL, NULL, NULL, NULL}; + +static const char * const apszParamNameMapping[] = { +"Lambert_Azimuthal_Equal_Area", "longitude_of_center", "Central_Meridian", +"Lambert_Azimuthal_Equal_Area", "Latitude_Of_Center", "Latitude_Of_Origin", +"Miller_Cylindrical", "longitude_of_center", "Central_Meridian", +"Gnomonic", "central_meridian", "Longitude_Of_Center", +"Gnomonic", "latitude_of_origin", "Latitude_Of_Center", +"Orthographic", "central_meridian", "Longitude_Of_Center", +"Orthographic", "latitude_of_origin", "Latitude_Of_Center", +"New_Zealand_Map_Grid", "central_meridian", "Longitude_Of_Origin", +"Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "latitude_of_point_1", "Latitude_Of_1st_Point", +"Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "longitude_of_point_1", "Longitude_Of_1st_Point", +"Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "latitude_of_point_2", "Latitude_Of_2nd_Point", +"Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "longitude_of_point_2", "Longitude_Of_2nd_Point", +NULL, NULL, NULL}; + +static const char * const apszDeleteParametersBasedOnProjection[] = { +"Stereographic_South_Pole", "scale_factor", +"Stereographic_North_Pole", "scale_factor", +"Mercator", "scale_factor", +"Miller_Cylindrical", "latitude_of_center", +"Equidistant_Cylindrical", "pseudo_standard_parallel_1", +"Equidistant_Cylindrical", "latitude_of_origin", +"Plate_Carree", "latitude_of_origin", +"Plate_Carree", "pseudo_standard_parallel_1", +"Plate_Carree", "standard_parallel_1", +"Hotine_Oblique_Mercator_Azimuth_Center", "rectified_grid_angle", +"Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "rectified_grid_angle", +NULL, NULL}; + +static const char * const apszAddParametersBasedOnProjection[] = { +"Cassini", "scale_factor", "1.0", +"Mercator", "standard_parallel_1", "0.0", +NULL, NULL, NULL}; + +static const int statePlaneZoneMapping[] = { +/* old zone code, prj code, new zone code */ + 3126, -1, 101, + 3151, -1, 102, + 3176, -1, 202, + 3201, -1, 203, + 3226, -1, 301, + 3251, -1, 302, + 3326, -1, 403, + 3351, -1, 404, + 3376, 26945, 405, + 3426, -1, 407, + 3451, -1, 501, + 3476, -1, 502, + 3526, -1, 600, + 3551, -1, 700, + 3576, -1, 903, + 3626, -1, 902, + 3651, -1, 1001, + 3676, -1, 1002, + 3726, -1, 1102, + 3751, -1, 1103, + 3776, -1, 1201, + 3801, -1, 1202, + 3826, -1, 1301, + 3851, -1, 1302, + 3876, -1, 1401, + 3926, -1, 1501, + 3951, -1, 1502, + 3976, -1, 1601, + 4026, -1, 1701, + 6426, -1, 1703, + 4076, -1, 1801, + 4101, -1, 1802, + 4126, -1, 1900, + 4151, -1, 2001, + 4176, -1, 2002, + 4226, -1, 2102, + 4251, -1, 2103, + 6351, -1, 2111, + 6376, -1, 2112, + 6401, -1, 2113, + 4276, -1, 2201, + 4326, -1, 2203, + 4351, -1, 2301, + 4376, -1, 2302, + 4400, 32045, 3400, + 4401, -1, 2401, + 4426, -1, 2402, + 4451, -1, 2403, + 4476, 32100, 2500, + 4476, -1, 2501, + 4701, 32111, 2900, + 4801, 2260, 3101, + 4801, 32115, 3101, + 4526, -1, 2503, + 4551, -1, 2601, + 4576, -1, 2602, + 4626, -1, 2702, + 4651, -1, 2703, + 4676, -1, 2800, + 4726, -1, 3001, + 4751, -1, 3002, + 4776, -1, 3003, + 4826, -1, 3102, + 4851, -1, 3103, + 4876, -1, 3104, + 4926, -1, 3301, + 4951, -1, 3302, + 4976, -1, 3401, + 5026, -1, 3501, + 5051, -1, 3502, + 5076, -1, 3601, + 5126, -1, 3701, + 5151, -1, 3702, + 5176, -1, 3800, + 5226, -1, 3902, + 5251, -1, 4001, + 5276, -1, 4002, + 5301, -1, 4100, + 5326, -1, 4201, + 5351, -1, 4202, + 5376, -1, 4203, + 5401, -1, 4204, + 5426, -1, 4205, + 5451, -1, 4301, + 5476, -1, 4302, + 5501, -1, 4303, + 5526, -1, 4400, + 5551, -1, 4501, + 5576, -1, 4502, + 5601, -1, 4601, + 5626, -1, 4602, + 5651, -1, 4701, + 5676, -1, 4702, + 5701, -1, 4801, + 5726, -1, 4802, + 5751, -1, 4803, + 5776, -1, 4901, + 5801, -1, 4902, + 5826, -1, 4903, + 5851, -1, 4904, + 6101, -1, 5001, + 6126, -1, 5002, + 6151, -1, 5003, + 6176, -1, 5004, + 6201, -1, 5005, + 6226, -1, 5006, + 6251, -1, 5007, + 6276, -1, 5008, + 6301, -1, 5009, + 6326, -1, 5010, + 5876, -1, 5101, + 5901, -1, 5102, + 5926, -1, 5103, + 5951, -1, 5104, + 5976, -1, 5105, + 6001, -1, 5201, + 6026, -1, 5200, + 6076, -1, 5200, + 6051, -1, 5202, + 0, 0, 0 + }; + +/* This is not a complete mapping. Need to add more. */ +static const int statePlanePcsCodeToZoneCode[] = { +/* pcs code, state plane prj str index*/ +2222, 2016, +2223, 2026, +2224, 2036, +2225, 4012, +2226, 4022, +2227, 4032, +2228, 4042, +2229, 4052, +2230, 4062, +2231, 5012, +2232, 5022, +2233, 5032, +2234, 6002, +2235, 7002, +2236, 9012, +2237, 9022, +2238, 9032, +2239, 10012, +2240, 10022, +2241, 11012, +2242, 11022, +2243, 11032, +2251, 21116, +2252, 21126, +2253, 21136, +2256, 25006, +2265, 33016, +2266, 33026, +2965, 13012, +2966, 13022, +2246, 16012, +2247, 16022, +2248, 19002, +2249, 20012, +2250, 20022, +2254, 23012, +2255, 23022, +2257, 30012, +2258, 30022, +2259, 30032, +2260, 31012, +2261, 31022, +2262, 31032, +2263, 31042, +2264, 32002, +2267, 35012, +2268, 35022, +2269, 36016, +2270, 36026, +2271, 37012, +2272, 37022, +2273, 39006, +2274, 41002, +2275, 42012, +2276, 42022, +2277, 42032, +2278, 42042, +2279, 42052, +2280, 43016, +2281, 43026, +2282, 43036, +2283, 45012, +2284, 45022, +2285, 46012, +2286, 46022, +2287, 48012, +2288, 48022, +2289, 48032, +2867, 2015, +2868, 2025, +2869, 2035, +2896, 21115, +2897, 21125, +2898, 21135, +2901, 25005, +2909, 33015, +2910, 33025, +2913, 36015, +2914, 36025, +2921, 43015, +2922, 43025, +2923, 43035, +2870, 4013, +2871, 4023, +2872, 4033, +2873, 4043, +2874, 4053, +2875, 4063, +2876, 5013, +2877, 5023, +2878, 5033, +2879, 6003, +2880, 7003, +2881, 9013, +2882, 9023, +2883, 9033, +2884, 10013, +2885, 10023, +2886, 11013, +2887, 11023, +2888, 11033, +2967, 13013, +2968, 13023, +2891, 16013, +2892, 16023, +2893, 19003, +2894, 20013, +2895, 20023, +2899, 23013, +2900, 23023, +2902, 30013, +2903, 30023, +2904, 30033, +2905, 31013, +2906, 31023, +2907, 31033, +2908, 31043, +2911, 35013, +2912, 35023, +2915, 41003, +2916, 42013, +2917, 42023, +2918, 42033, +2919, 42043, +2920, 42053, +2924, 45013, +2925, 45023, +2926, 46013, +2927, 46023, +2928, 48013, +2929, 48023, +2930, 48033, +// following are state systems (not complete) +2964, 102965, +2991, 102991, +2992, 102992, +2993, 102993, +2994, 102994, +// following are NAD 1983 SPCS Zone +26929, 1011, +26930, 1021, +26931, 50011, +26932, 50021, +26933, 50031, +26934, 50041, +26935, 50051, +26936, 50061, +26937, 50071, +26938, 50081, +26939, 50091, +26940, 50101, +26948, 2011, +26949, 2021, +26950, 2031, +26951, 3011, +26952, 3021, +26941, 4011, +26942, 4021, +26943, 4031, +26944, 4041, +26945, 4051, +26946, 4061, +26953, 5011, +26954, 5021, +26955, 5031, +26956, 6001, +26957, 7001, +26958, 9011, +26959, 9021, +26960, 9031, +26966, 10011, +26967, 10021, +26961, 51011, +26962, 51021, +26963, 51031, +26964, 51041, +26965, 51051, +26968, 11011, +26969, 11021, +26970, 11031, +26971, 12011, +26972, 12021, +26973, 13011, +26974, 13021, +26975, 14011, +26976, 14021, +26977, 15011, +26978, 15021, +26979, 16011, +26980, 16021, +26981, 17011, +26982, 17021, +26983, 18011, +26984, 18021, +26985, 19001, +26986, 20011, +26987, 20021, +26988, 21111, +26989, 21121, +26990, 21131, +26991, 22011, +26992, 22021, +26993, 22031, +26994, 23011, +26995, 23021, +26996, 24011, +26997, 24021, +26998, 24031, +32100, 25001, +32104, 26001, +32107, 27011, +32108, 27021, +32109, 27031, +32110, 28001, +32111, 29001, +32112, 30011, +32113, 30021, +32114, 30031, +32115, 31011, +32116, 31021, +32117, 31031, +32118, 31041, +32119, 32001, +32120, 33011, +32121, 33021, +32122, 34011, +32123, 34021, +32124, 35011, +32125, 35021, +32126, 36011, +32127, 36021, +32128, 37011, +32129, 37021, +32130, 38001, +32133, 39001, +32134, 40011, +32135, 40021, +32136, 41001, +32137, 42011, +32138, 42021, +32139, 42031, +32140, 42041, +32141, 42051, +32142, 43011, +32143, 43021, +32144, 43031, +32145, 44001, +32146, 45011, +32147, 45021, +32148, 46011, +32149, 46021, +32150, 47011, +32151, 47021, +32152, 48011, +32153, 48021, +32154, 48031, +32155, 49011, +32156, 49021, +32157, 49031, +32158, 49041, +32161, 52000, +65161, 54001, +0, 0 +}; + +/* ==================================================================== */ +/* WISCRS Table */ +/* ==================================================================== */ +static const double apszWISCRS_LCC_meter[] = { +// Central_Meridian, Latitude_Of_Origin, SR code + -91.1527777777, 46.6696483772, 103303.0, + -92.4577777777, 45.8987148658, 103306.0, + -91.2944444444, 44.9778568986, 103308.0, + -89.3944444444, 43.4625466458, 103310.0, + -90.9388888888, 43.2000556050, 103311.0, + -89.4222222222, 43.0695160375, 103312.0, + -91.2888888888, 45.8722811263, 103317.0, + -89.8388888888, 42.6375622769, 103322.0, + -89.2416666666, 43.8070001177, 103323.0, + -89.8388888888, 42.6375622769, 103332.0, + -89.0333333333, 45.1542371052, 103333.0, + -89.7700000000, 44.9009044236, 103336.0, + -89.2416666666, 43.8070001177, 103338.0, + -90.6416666666, 44.0000739286, 103341.0, + -89.5444444444, 45.7042237702, 103343.0, + -92.2277777777, 44.6361488719, 103346.0, + -92.2277777777, 44.6361488719, 103347.0, + -89.5000000000, 44.4168239752, 103349.0, + -90.4305555555, 43.3223129275, 103352.0, + -91.1166666666, 45.9000991313, 103356.0, + -90.4833333333, 45.1778220858, 103360.0, + -90.7833333333, 43.5750329397, 103362.0, + -89.4888888888, 46.0778440905, 103363.0, + -88.5416666667, 42.6694620969, 103364.0, + -91.7833333333, 45.9612198333, 103365.0, + -89.2416666666, 44.1139440458, 103369.0, + -90.0000000000, 44.3625954694, 103371.0, + 0.0, 0,0, 0,0 +}; + +static const double apszWISCRS_TM_meter[] = { +// Central_Meridian, Latitude_Of_Origin, SR code + -90.0000000000, 43.3666666666, 103300.0, + -90.6222222222, 45.7061111111, 103301.0, + -91.8500000000, 45.1333333333, 103302.0, + -88.0000000000, 43.0000000000, 103304.0, + -91.7972222222, 43.4813888888, 103305.0, + -88.5000000000, 42.7194444444, 103307.0, + -90.7083333333, 43.6000000000, 103309.0, + -88.7750000000, 41.4722222222, 103313.0, + -87.2722222222, 44.4000000000, 103314.0, + -91.9166666666, 45.8833333333, 103315.0, + -91.8944444444, 44.4083333333, 103316.0, + -88.1416666666, 45.4388888888, 103318.0, + -88.5000000000, 42.7194444444, 103319.0, + -88.6333333333, 44.0055555556, 103320.0, + -90.8000000000, 41.4111111111, 103321.0, + -90.1611111111, 42.5388888888, 103324.0, + -90.2555555555, 45.4333333333, 103325.0, + -90.8442965194, 44.2533351277, 103326.0, + -88.7750000000, 41.4722222222, 103327.0, + -90.0000000000, 43.3666666666, 103328.0, + -87.8944444444, 42.2166666666, 103329.0, + -87.5500000000, 43.2666666666, 103330.0, + -91.3166666666, 43.4511111111, 103331.0, + -89.7333333333, 44.8444444444, 103334.0, + -87.5500000000, 43.2666666666, 103335.0, + -87.7111111111, 44.6916666666, 103337.0, + -88.4166666666, 44.7166666666, 103339.0, + -87.8944444444, 42.2166666666, 103340.0, + -87.9083333333, 44.3972222222, 103342.0, + -88.5000000000, 42.7194444444, 103344.0, + -87.8944444444, 42.2166666666, 103345.0, + -92.6333333333, 44.6611111111, 103348.0, + -90.4888888889, 44.5555555556, 103350.0, + -87.8944444444, 42.2166666666, 103351.0, + -89.0722222222, 41.9444444444, 103353.0, + -91.0666666666, 43.9194444444, 103354.0, + -89.9000000000, 42.8194444444, 103355.0, + -88.6055555556, 44.0361111111, 103357.0, + -87.5500000000, 43.2666666666, 103358.0, + -92.6333333333, 44.0361111111, 103359.0, + -91.3666666666, 43.1611111111, 103361.0, + -88.0638888888, 42.9180555555, 103366.0, + -88.2250000000, 42.5694444444, 103367.0, + -88.8166666666, 43.4202777777, 103368.0, + -88.5000000000, 42.7194444444, 103370.0, + 0.0, 0,0, 0,0 +}; diff --git a/modules/globebrowsing/ext/gdal/include/ograpispy.h b/modules/globebrowsing/ext/gdal/include/ograpispy.h new file mode 100644 index 0000000000..b37340da72 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ograpispy.h @@ -0,0 +1,173 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenGIS Simple Features Reference Implementation + * Purpose: OGR C API "Spy" + * Author: Even Rouault, even.rouault at spatialys.com + * + ****************************************************************************** + * Copyright (c) 2014, Even Rouault + * + * 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 OGRAPISPY_H_INCLUDED +#define OGRAPISPY_H_INCLUDED + +#include "gdal.h" + +/** + * \file ograpispy.h + * + * OGR C API spy. + * + * If GDAL is compiled with OGRAPISPY_ENABLED defined (which is the case for a + * DEBUG build), a mechanism to trace calls to the OGR *C* API is available + * (calls to the C++ API will not be traced) + * + * Provided there is compile-time support, the mechanism must also be enabled at + * runtime by setting the OGR_API_SPY_FILE configuration option + * to a file where the calls to the OGR C API will be dumped (stdout and stderr + * are recognized as special strings to name the standard output and error files). + * The traced calls are outputted as a OGR Python script. + * + * Only calls that may have side-effects to the behaviour of drivers are traced. + * + * If a file-based datasource is open in update mode, a snapshot of its initial + * state is stored in a 'snapshot' directory, and then a copy of it is made as + * the working datasource. That way, the generated script can be executed in a + * reproducible way. The path for snapshots is the current working directory by + * default, and can be changed by setting the OGR_API_SPY_SNAPSHOT_PATH + * configuration option. If it is set to NO, the snapshot feature will be disabled. + * The reliability of snapshoting relies on if the dataset correctly implements + * GetFileList() (for multi-file datasources) + * + * @since GDAL 2.0 + */ + + +#ifdef DEBUG +#define OGRAPISPY_ENABLED +#endif + +#ifdef OGRAPISPY_ENABLED + +CPL_C_START + +extern int bOGRAPISpyEnabled; + +int OGRAPISpyOpenTakeSnapshot(const char* pszName, int bUpdate); +void OGRAPISpyOpen(const char* pszName, int bUpdate, int iSnapshot, + GDALDatasetH* phDS); +void OGRAPISpyPreClose(OGRDataSourceH hDS); +void OGRAPISpyPostClose(); +void OGRAPISpyCreateDataSource(OGRSFDriverH hDriver, const char* pszName, + char** papszOptions, OGRDataSourceH hDS); +void OGRAPISpyDeleteDataSource(OGRSFDriverH hDriver, const char* pszName); + +void OGRAPISpy_DS_GetLayerCount( OGRDataSourceH hDS ); +void OGRAPISpy_DS_GetLayer( OGRDataSourceH hDS, int iLayer, OGRLayerH hLayer ); +void OGRAPISpy_DS_GetLayerByName( OGRDataSourceH hDS, const char* pszLayerName, + OGRLayerH hLayer ); +void OGRAPISpy_DS_ExecuteSQL( OGRDataSourceH hDS, + const char *pszStatement, + OGRGeometryH hSpatialFilter, + const char *pszDialect, + OGRLayerH hLayer); +void OGRAPISpy_DS_ReleaseResultSet( OGRDataSourceH hDS, OGRLayerH hLayer); + +void OGRAPISpy_DS_CreateLayer( OGRDataSourceH hDS, + const char * pszName, + OGRSpatialReferenceH hSpatialRef, + OGRwkbGeometryType eType, + char ** papszOptions, + OGRLayerH hLayer); +void OGRAPISpy_DS_DeleteLayer( OGRDataSourceH hDS, int iLayer ); + +void OGRAPISpy_Dataset_StartTransaction( GDALDatasetH hDS, int bForce ); +void OGRAPISpy_Dataset_CommitTransaction( GDALDatasetH hDS ); +void OGRAPISpy_Dataset_RollbackTransaction( GDALDatasetH hDS ); + +void OGRAPISpy_L_GetFeatureCount( OGRLayerH hLayer, int bForce ); +void OGRAPISpy_L_GetExtent( OGRLayerH hLayer, int bForce ); +void OGRAPISpy_L_GetExtentEx( OGRLayerH hLayer, int iGeomField, int bForce ); +void OGRAPISpy_L_SetAttributeFilter( OGRLayerH hLayer, const char* pszFilter ); +void OGRAPISpy_L_GetFeature( OGRLayerH hLayer, GIntBig nFeatureId ); +void OGRAPISpy_L_SetNextByIndex( OGRLayerH hLayer, GIntBig nIndex ); +void OGRAPISpy_L_GetNextFeature( OGRLayerH hLayer ); +void OGRAPISpy_L_SetFeature( OGRLayerH hLayer, OGRFeatureH hFeat ); +void OGRAPISpy_L_CreateFeature( OGRLayerH hLayer, OGRFeatureH hFeat ); +void OGRAPISpy_L_CreateField( OGRLayerH hLayer, OGRFieldDefnH hField, + int bApproxOK ); +void OGRAPISpy_L_DeleteField( OGRLayerH hLayer, int iField ); +void OGRAPISpy_L_ReorderFields( OGRLayerH hLayer, int* panMap ); +void OGRAPISpy_L_ReorderField( OGRLayerH hLayer, int iOldFieldPos, + int iNewFieldPos ); +void OGRAPISpy_L_AlterFieldDefn( OGRLayerH hLayer, int iField, + OGRFieldDefnH hNewFieldDefn, + int nFlags ); +void OGRAPISpy_L_CreateGeomField( OGRLayerH hLayer, OGRGeomFieldDefnH hField, + int bApproxOK ); +void OGRAPISpy_L_StartTransaction( OGRLayerH hLayer ); +void OGRAPISpy_L_CommitTransaction( OGRLayerH hLayer ); +void OGRAPISpy_L_RollbackTransaction( OGRLayerH hLayer ); +void OGRAPISpy_L_GetLayerDefn( OGRLayerH hLayer ); +void OGRAPISpy_L_FindFieldIndex( OGRLayerH hLayer, const char *pszFieldName, + int bExactMatch ); +void OGRAPISpy_L_GetSpatialRef( OGRLayerH hLayer ); +void OGRAPISpy_L_TestCapability( OGRLayerH hLayer, const char* pszCap ); +void OGRAPISpy_L_GetSpatialFilter( OGRLayerH hLayer ); +void OGRAPISpy_L_SetSpatialFilter( OGRLayerH hLayer, OGRGeometryH hGeom ); +void OGRAPISpy_L_SetSpatialFilterEx( OGRLayerH hLayer, int iGeomField, + OGRGeometryH hGeom ); +void OGRAPISpy_L_SetSpatialFilterRect( OGRLayerH hLayer, + double dfMinX, double dfMinY, + double dfMaxX, double dfMaxY); +void OGRAPISpy_L_SetSpatialFilterRectEx( OGRLayerH hLayer, int iGeomField, + double dfMinX, double dfMinY, + double dfMaxX, double dfMaxY); +void OGRAPISpy_L_ResetReading( OGRLayerH hLayer ); +void OGRAPISpy_L_SyncToDisk( OGRLayerH hLayer ); +void OGRAPISpy_L_DeleteFeature( OGRLayerH hLayer, GIntBig nFID ); +void OGRAPISpy_L_GetFIDColumn( OGRLayerH hLayer ); +void OGRAPISpy_L_GetGeometryColumn( OGRLayerH hLayer ); +void OGRAPISpy_L_GetName( OGRLayerH hLayer ); +void OGRAPISpy_L_GetGeomType( OGRLayerH hLayer ); +void OGRAPISpy_L_SetIgnoredFields( OGRLayerH hLayer, + const char** papszIgnoredFields ); + +void OGRAPISpy_FD_GetGeomType(OGRFeatureDefnH hDefn); +void OGRAPISpy_FD_GetFieldCount(OGRFeatureDefnH hDefn); +void OGRAPISpy_FD_GetFieldDefn(OGRFeatureDefnH hDefn, int iField, + OGRFieldDefnH hGeomField); +void OGRAPISpy_FD_GetFieldIndex(OGRFeatureDefnH hDefn, const char* pszFieldName); + +void OGRAPISpy_Fld_GetXXXX(OGRFieldDefnH hField, const char* pszOp); + +void OGRAPISpy_FD_GetGeomFieldCount(OGRFeatureDefnH hDefn); +void OGRAPISpy_FD_GetGeomFieldDefn(OGRFeatureDefnH hDefn, int iGeomField, + OGRGeomFieldDefnH hGeomField); +void OGRAPISpy_FD_GetGeomFieldIndex(OGRFeatureDefnH hDefn, const char* pszFieldName); +void OGRAPISpy_GFld_GetXXXX(OGRGeomFieldDefnH hGeomField, const char* pszOp); + +CPL_C_END + +#endif /* OGRAPISPY_ENABLED */ + +#endif /* OGRAPISPY_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/ogrgeomediageometry.h b/modules/globebrowsing/ext/gdal/include/ogrgeomediageometry.h new file mode 100644 index 0000000000..9cfa417497 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogrgeomediageometry.h @@ -0,0 +1,43 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenGIS Simple Features Reference Implementation + * Purpose: Implements decoder of geomedia geometry blobs + * Author: Even Rouault, + * + ****************************************************************************** + * Copyright (c) 2011, Even Rouault + * + * 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_GEOMEDIAGEOMETRY_H_INCLUDED +#define OGR_GEOMEDIAGEOMETRY_H_INCLUDED + +#include "ogr_geometry.h" +#include "ogr_spatialref.h" +#include "ogr_feature.h" + +OGRErr OGRCreateFromGeomedia( GByte *pabyGeom, + OGRGeometry **ppoGeom, + int nBytes ); + +OGRSpatialReference* OGRGetGeomediaSRS(OGRFeature* poFeature); + +#endif diff --git a/modules/globebrowsing/ext/gdal/include/ogrpgeogeometry.h b/modules/globebrowsing/ext/gdal/include/ogrpgeogeometry.h new file mode 100644 index 0000000000..60be647cc7 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogrpgeogeometry.h @@ -0,0 +1,96 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenGIS Simple Features Reference Implementation + * Purpose: Implements decoder of shapebin geometry for PGeo + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 2005, Frank Warmerdam + * Copyright (c) 2011-2014, Even Rouault + * + * 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_PGEOGEOMETRY_H_INCLUDED +#define OGR_PGEOGEOMETRY_H_INCLUDED + +#include "ogr_geometry.h" + +#define SHPT_NULL 0 + +#define SHPT_POINT 1 +#define SHPT_POINTM 21 +#define SHPT_POINTZM 11 +#define SHPT_POINTZ 9 + +#define SHPT_MULTIPOINT 8 +#define SHPT_MULTIPOINTM 28 +#define SHPT_MULTIPOINTZM 18 +#define SHPT_MULTIPOINTZ 20 + +#define SHPT_ARC 3 +#define SHPT_ARCM 23 +#define SHPT_ARCZM 13 +#define SHPT_ARCZ 10 + +#define SHPT_POLYGON 5 +#define SHPT_POLYGONM 25 +#define SHPT_POLYGONZM 15 +#define SHPT_POLYGONZ 19 + +#define SHPT_MULTIPATCHM 31 +#define SHPT_MULTIPATCH 32 + +#define SHPT_GENERALPOLYLINE 50 +#define SHPT_GENERALPOLYGON 51 +#define SHPT_GENERALPOINT 52 +#define SHPT_GENERALMULTIPOINT 53 +#define SHPT_GENERALMULTIPATCH 54 + +/* The following are layers geometry type */ +/* They are different from the above shape types */ +#define ESRI_LAYERGEOMTYPE_NULL 0 +#define ESRI_LAYERGEOMTYPE_POINT 1 +#define ESRI_LAYERGEOMTYPE_MULTIPOINT 2 +#define ESRI_LAYERGEOMTYPE_POLYLINE 3 +#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); + +OGRErr CPL_DLL OGRCreateFromShapeBin( GByte *pabyShape, + OGRGeometry **ppoGeom, + int nBytes ); + +OGRErr CPL_DLL OGRWriteToShapeBin( OGRGeometry *poGeom, + GByte **ppabyShape, + int *pnBytes ); + +OGRErr CPL_DLL OGRWriteMultiPatchToShapeBin( OGRGeometry *poGeom, + GByte **ppabyShape, + int *pnBytes ); + +#endif diff --git a/modules/globebrowsing/ext/gdal/include/ogrsf_frmts.h b/modules/globebrowsing/ext/gdal/include/ogrsf_frmts.h new file mode 100644 index 0000000000..72578701bd --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/ogrsf_frmts.h @@ -0,0 +1,427 @@ +/****************************************************************************** + * $Id$ + * + * 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 + * + * 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 */ diff --git a/modules/globebrowsing/ext/gdal/include/osr_cs_wkt.h b/modules/globebrowsing/ext/gdal/include/osr_cs_wkt.h new file mode 100644 index 0000000000..b08df31fc9 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/osr_cs_wkt.h @@ -0,0 +1,55 @@ +/****************************************************************************** + * $Id$ + * + * Project: OpenGIS Simple Features Reference Implementation + * Purpose: CS WKT parser + * Author: Even Rouault, + * + ****************************************************************************** + * Copyright (c) 2013, Even Rouault + * + * 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 OSR_CS_WKT_H_INCLUDED_ +#define OSR_CS_WKT_H_INCLUDED_ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct +{ + const char *pszInput; + const char *pszLastSuccess; + const char *pszNext; + char szErrorMsg[512]; +} osr_cs_wkt_parse_context; + +#include "osr_cs_wkt_parser.h" + +void osr_cs_wkt_error( osr_cs_wkt_parse_context *context, const char *msg ); +int osr_cs_wkt_lex(YYSTYPE* pNode, osr_cs_wkt_parse_context *context); +int osr_cs_wkt_parse(osr_cs_wkt_parse_context *context); + +#ifdef __cplusplus +} +#endif + +#endif /* OSR_CS_WKT_H_INCLUDED_ */ diff --git a/modules/globebrowsing/ext/gdal/include/osr_cs_wkt_parser.h b/modules/globebrowsing/ext/gdal/include/osr_cs_wkt_parser.h new file mode 100644 index 0000000000..c4678054c1 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/osr_cs_wkt_parser.h @@ -0,0 +1,89 @@ +/* A Bison parser, made by GNU Bison 3.0. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2013 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 . */ + +/* 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_OSR_CS_WKT_OSR_CS_WKT_PARSER_H_INCLUDED +# define YY_OSR_CS_WKT_OSR_CS_WKT_PARSER_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int osr_cs_wkt_debug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + END = 0, + T_PARAM_MT = 258, + T_CONCAT_MT = 259, + T_INVERSE_MT = 260, + T_PASSTHROUGH_MT = 261, + T_PROJCS = 262, + T_PROJECTION = 263, + T_GEOGCS = 264, + T_DATUM = 265, + T_SPHEROID = 266, + T_PRIMEM = 267, + T_UNIT = 268, + T_GEOCCS = 269, + T_AUTHORITY = 270, + T_VERT_CS = 271, + T_VERT_DATUM = 272, + T_COMPD_CS = 273, + T_AXIS = 274, + T_TOWGS84 = 275, + T_FITTED_CS = 276, + T_LOCAL_CS = 277, + T_LOCAL_DATUM = 278, + T_PARAMETER = 279, + T_EXTENSION = 280, + T_STRING = 281, + T_NUMBER = 282, + T_IDENTIFIER = 283 + }; +#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 osr_cs_wkt_parse (osr_cs_wkt_parse_context *context); + +#endif /* !YY_OSR_CS_WKT_OSR_CS_WKT_PARSER_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/include/rawdataset.h b/modules/globebrowsing/ext/gdal/include/rawdataset.h new file mode 100644 index 0000000000..68b923ab1a --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/rawdataset.h @@ -0,0 +1,179 @@ +/****************************************************************************** + * $Id$ + * + * 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 + * + * 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( 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 diff --git a/modules/globebrowsing/ext/gdal/include/swq.h b/modules/globebrowsing/ext/gdal/include/swq.h new file mode 100644 index 0000000000..e95486594a --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/swq.h @@ -0,0 +1,389 @@ +/****************************************************************************** + * + * Component: OGDI Driver Support Library + * Purpose: Generic SQL WHERE Expression Evaluator Declarations. + * Author: Frank Warmerdam + * + ****************************************************************************** + * Copyright (C) 2001 Information Interoperability Institute (3i) + * Copyright (c) 2010-2013, Even Rouault + * Permission to use, copy, modify and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies, that + * both the copyright notice and this permission notice appear in + * supporting documentation, and that the name of 3i not be used + * in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. 3i makes no + * representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + ****************************************************************************/ + +#ifndef SWQ_H_INCLUDED_ +#define SWQ_H_INCLUDED_ + +#include "cpl_conv.h" +#include "cpl_string.h" +#include "ogr_core.h" + +#if defined(_WIN32) && !defined(strcasecmp) +# define strcasecmp stricmp +#endif + +typedef enum { + SWQ_OR, + SWQ_AND, + SWQ_NOT, + SWQ_EQ, + SWQ_NE, + SWQ_GE, + SWQ_LE, + SWQ_LT, + SWQ_GT, + SWQ_LIKE, + SWQ_ISNULL, + SWQ_IN, + SWQ_BETWEEN, + SWQ_ADD, + SWQ_SUBTRACT, + SWQ_MULTIPLY, + SWQ_DIVIDE, + SWQ_MODULUS, + SWQ_CONCAT, + SWQ_SUBSTR, + SWQ_HSTORE_GET_VALUE, + SWQ_AVG, + SWQ_MIN, + SWQ_MAX, + SWQ_COUNT, + SWQ_SUM, + SWQ_CAST, + SWQ_CUSTOM_FUNC, /* only if parsing done in bAcceptCustomFuncs mode */ + SWQ_ARGUMENT_LIST /* temporary value only set during parsing and replaced by something else at the end */ +} swq_op; + +typedef enum { + SWQ_INTEGER, + SWQ_INTEGER64, + SWQ_FLOAT, + SWQ_STRING, + SWQ_BOOLEAN, // integer + SWQ_DATE, // string + SWQ_TIME, // string + SWQ_TIMESTAMP,// string + SWQ_GEOMETRY, + SWQ_NULL, + SWQ_OTHER, + SWQ_ERROR +} swq_field_type; + +#define SWQ_IS_INTEGER(x) ((x) == SWQ_INTEGER || (x) == SWQ_INTEGER64) + +typedef enum { + SNT_CONSTANT, + SNT_COLUMN, + SNT_OPERATION +} swq_node_type; + + +class swq_field_list; +class swq_expr_node; +class swq_select; +class OGRGeometry; + +typedef swq_expr_node *(*swq_field_fetcher)( swq_expr_node *op, + void *record_handle ); +typedef swq_expr_node *(*swq_op_evaluator)(swq_expr_node *op, + swq_expr_node **sub_field_values ); +typedef swq_field_type (*swq_op_checker)( swq_expr_node *op, + int bAllowMismatchTypeOnFieldComparison ); + +class swq_custom_func_registrar; + +class swq_expr_node { +public: + swq_expr_node(); + + explicit swq_expr_node( const char * ); + explicit swq_expr_node( int ); + explicit swq_expr_node( GIntBig ); + explicit swq_expr_node( double ); + explicit swq_expr_node( OGRGeometry* ); + explicit swq_expr_node( swq_op ); + + ~swq_expr_node(); + + void Initialize(); + CPLString UnparseOperationFromUnparsedSubExpr(char** apszSubExpr); + char *Unparse( swq_field_list *, char chColumnQuote ); + void Dump( FILE *fp, int depth ); + swq_field_type Check( swq_field_list *, int bAllowFieldsInSecondaryTables, + int bAllowMismatchTypeOnFieldComparison, + swq_custom_func_registrar* poCustomFuncRegistrar ); + swq_expr_node* Evaluate( swq_field_fetcher pfnFetcher, + void *record ); + swq_expr_node* Clone(); + + void ReplaceBetweenByGEAndLERecurse(); + + swq_node_type eNodeType; + swq_field_type field_type; + + /* only for SNT_OPERATION */ + void PushSubExpression( swq_expr_node * ); + void ReverseSubExpressions(); + int nOperation; + int nSubExprCount; + swq_expr_node **papoSubExpr; + + /* only for SNT_COLUMN */ + int field_index; + int table_index; + char *table_name; + + /* only for SNT_CONSTANT */ + int is_null; + GIntBig int_value; + double float_value; + OGRGeometry *geometry_value; + + /* shared by SNT_COLUMN, SNT_CONSTANT and also possibly SNT_OPERATION when */ + /* nOperation == SWQ_CUSTOM_FUNC */ + char *string_value; /* column name when SNT_COLUMN */ + + static CPLString QuoteIfNecessary( const CPLString &, char chQuote = '\'' ); + static CPLString Quote( const CPLString &, char chQuote = '\'' ); +}; + +typedef struct { + const char* pszName; + swq_op eOperation; + swq_op_evaluator pfnEvaluator; + swq_op_checker pfnChecker; +} swq_operation; + +class swq_op_registrar { +public: + static const swq_operation *GetOperator( const char * ); + static const swq_operation *GetOperator( swq_op eOperation ); +}; + +class swq_custom_func_registrar +{ + public: + virtual ~swq_custom_func_registrar() {} + virtual const swq_operation *GetOperator( const char * ) = 0; +}; + + +typedef struct { + char *data_source; + char *table_name; + char *table_alias; +} swq_table_def; + +class swq_field_list { +public: + int count; + char **names; + swq_field_type *types; + int *table_ids; + int *ids; + + int table_count; + swq_table_def *table_defs; +}; + +class swq_parse_context { +public: + swq_parse_context() : nStartToken(0), pszInput(NULL), pszNext(NULL), + pszLastValid(NULL), bAcceptCustomFuncs(FALSE), + poRoot(NULL), poCurSelect(NULL) {} + + int nStartToken; + const char *pszInput; + const char *pszNext; + const char *pszLastValid; + int bAcceptCustomFuncs; + + swq_expr_node *poRoot; + + swq_select *poCurSelect; +}; + +/* Compile an SQL WHERE clause into an internal form. The field_list is +** the list of fields in the target 'table', used to render where into +** field numbers instead of names. +*/ +int swqparse( swq_parse_context *context ); +int swqlex( swq_expr_node **ppNode, swq_parse_context *context ); +void swqerror( swq_parse_context *context, const char *msg ); + +int swq_identify_field( const char* table_name, + const char *token, swq_field_list *field_list, + swq_field_type *this_type, int *table_id ); + +CPLErr swq_expr_compile( const char *where_clause, + int field_count, + char **field_list, + swq_field_type *field_types, + int bCheck, + swq_custom_func_registrar* poCustomFuncRegistrar, + swq_expr_node **expr_root ); + +CPLErr swq_expr_compile2( const char *where_clause, + swq_field_list *field_list, + int bCheck, + swq_custom_func_registrar* poCustomFuncRegistrar, + swq_expr_node **expr_root ); + +/* +** Evaluation related. +*/ +int swq_test_like( const char *input, const char *pattern ); + +swq_expr_node *SWQGeneralEvaluator( swq_expr_node *, swq_expr_node **); +swq_field_type SWQGeneralChecker( swq_expr_node *node, int bAllowMismatchTypeOnFieldComparison ); +swq_expr_node *SWQCastEvaluator( swq_expr_node *, swq_expr_node **); +swq_field_type SWQCastChecker( swq_expr_node *node, int bAllowMismatchTypeOnFieldComparison ); +const char* SWQFieldTypeToString( swq_field_type field_type ); + +/****************************************************************************/ + +#define SWQP_ALLOW_UNDEFINED_COL_FUNCS 0x01 + +#define SWQM_SUMMARY_RECORD 1 +#define SWQM_RECORDSET 2 +#define SWQM_DISTINCT_LIST 3 + +typedef enum { + SWQCF_NONE = 0, + SWQCF_AVG = SWQ_AVG, + SWQCF_MIN = SWQ_MIN, + SWQCF_MAX = SWQ_MAX, + SWQCF_COUNT = SWQ_COUNT, + SWQCF_SUM = SWQ_SUM, + SWQCF_CUSTOM +} swq_col_func; + +typedef struct { + swq_col_func col_func; + char *table_name; + char *field_name; + char *field_alias; + int table_index; + int field_index; + swq_field_type field_type; + swq_field_type target_type; + OGRFieldSubType target_subtype; + int field_length; + int field_precision; + int distinct_flag; + OGRwkbGeometryType eGeomType; + int nSRID; + swq_expr_node *expr; +} swq_col_def; + +typedef struct { + GIntBig count; + + char **distinct_list; /* items of the list can be NULL */ + double sum; + double min; + double max; + char szMin[32]; + char szMax[32]; +} swq_summary; + +typedef struct { + char *table_name; + char *field_name; + int table_index; + int field_index; + int ascending_flag; +} swq_order_def; + +typedef struct { + int secondary_table; + swq_expr_node *poExpr; +} swq_join_def; + +class swq_select_parse_options +{ +public: + swq_custom_func_registrar* poCustomFuncRegistrar; + int bAllowFieldsInSecondaryTablesInWhere; + int bAddSecondaryTablesGeometryFields; + int bAlwaysPrefixWithTableName; + int bAllowDistinctOnGeometryField; + int bAllowDistinctOnMultipleFields; + + swq_select_parse_options(): poCustomFuncRegistrar(NULL), + bAllowFieldsInSecondaryTablesInWhere(FALSE), + bAddSecondaryTablesGeometryFields(FALSE), + bAlwaysPrefixWithTableName(FALSE), + bAllowDistinctOnGeometryField(FALSE), + bAllowDistinctOnMultipleFields(FALSE) {} +}; + +class swq_select +{ + void postpreparse(); + +public: + swq_select(); + ~swq_select(); + + int query_mode; + + char *raw_select; + + int PushField( swq_expr_node *poExpr, const char *pszAlias=NULL, + int distinct_flag = FALSE ); + int result_columns; + swq_col_def *column_defs; + swq_summary *column_summary; + + int PushTableDef( const char *pszDataSource, + const char *pszTableName, + const char *pszAlias ); + int table_count; + swq_table_def *table_defs; + + void PushJoin( int iSecondaryTable, swq_expr_node* poExpr ); + int join_count; + swq_join_def *join_defs; + + swq_expr_node *where_expr; + + void PushOrderBy( const char* pszTableName, const char *pszFieldName, int bAscending ); + int order_specs; + swq_order_def *order_defs; + + swq_select *poOtherSelect; + void PushUnionAll( swq_select* poOtherSelectIn ); + + CPLErr preparse( const char *select_statement, + int bAcceptCustomFuncs = FALSE ); + CPLErr expand_wildcard( swq_field_list *field_list, + int bAlwaysPrefixWithTableName ); + CPLErr parse( swq_field_list *field_list, + swq_select_parse_options* poParseOptions ); + + char *Unparse(); + void Dump( FILE * ); +}; + +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 ); + +int swq_is_reserved_keyword(const char* pszStr); + +char* OGRHStoreGetValue(const char* pszHStore, const char* pszSearchedKey); + +#endif /* def SWQ_H_INCLUDED_ */ diff --git a/modules/globebrowsing/ext/gdal/include/thinplatespline.h b/modules/globebrowsing/ext/gdal/include/thinplatespline.h new file mode 100644 index 0000000000..a597c4f9c4 --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/thinplatespline.h @@ -0,0 +1,188 @@ +/****************************************************************************** + * $Id$ + * + * 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); +}; diff --git a/modules/globebrowsing/ext/gdal/include/vrtdataset.h b/modules/globebrowsing/ext/gdal/include/vrtdataset.h new file mode 100644 index 0000000000..44417ab94b --- /dev/null +++ b/modules/globebrowsing/ext/gdal/include/vrtdataset.h @@ -0,0 +1,1052 @@ +/****************************************************************************** + * $Id$ + * + * Project: Virtual GDAL Datasets + * Purpose: Declaration of virtual gdal dataset classes. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 2001, Frank Warmerdam + * Copyright (c) 2007-2013, Even Rouault + * + * 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 VIRTUALDATASET_H_INCLUDED +#define VIRTUALDATASET_H_INCLUDED + +#include "cpl_hash_set.h" +#include "gdal_pam.h" +#include "gdal_priv.h" +#include "gdal_vrt.h" + +#include +#include + +int VRTApplyMetadata( CPLXMLNode *, GDALMajorObject * ); +CPLXMLNode *VRTSerializeMetadata( GDALMajorObject * ); + +#if 0 +int VRTWarpedOverviewTransform( void *pTransformArg, int bDstToSrc, + int nPointCount, + double *padfX, double *padfY, double *padfZ, + int *panSuccess ); +void* VRTDeserializeWarpedOverviewTransformer( CPLXMLNode *psTree ); +#endif + +/************************************************************************/ +/* VRTOverviewInfo() */ +/************************************************************************/ +class VRTOverviewInfo +{ +public: + CPLString osFilename; + int nBand; + GDALRasterBand *poBand; + int bTriedToOpen; + + VRTOverviewInfo() : nBand(0), poBand(NULL), bTriedToOpen(FALSE) {} + ~VRTOverviewInfo() { + if( poBand == NULL ) + /* do nothing */; + else if( poBand->GetDataset()->GetShared() ) + GDALClose( /* (GDALDatasetH) */ poBand->GetDataset() ); + else + poBand->GetDataset()->Dereference(); + } +}; + + +/************************************************************************/ +/* VRTSource */ +/************************************************************************/ + +class CPL_DLL VRTSource +{ +public: + virtual ~VRTSource(); + + virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize, + void *pData, int nBufXSize, int nBufYSize, + GDALDataType eBufType, + GSpacing nPixelSpace, GSpacing nLineSpace, + GDALRasterIOExtraArg* psExtraArg ) = 0; + + virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) = 0; + virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) = 0; + virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK, + double* adfMinMax ) = 0; + virtual CPLErr ComputeStatistics( int nXSize, int nYSize, + int bApproxOK, + double *pdfMin, double *pdfMax, + double *pdfMean, double *pdfStdDev, + GDALProgressFunc pfnProgress, + void *pProgressData ) = 0; + virtual CPLErr GetHistogram( int nXSize, int nYSize, + double dfMin, double dfMax, + int nBuckets, GUIntBig * panHistogram, + int bIncludeOutOfRange, int bApproxOK, + GDALProgressFunc pfnProgress, + void *pProgressData ) = 0; + + virtual CPLErr XMLInit( CPLXMLNode *psTree, const char * ) = 0; + virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) = 0; + + virtual void GetFileList(char*** ppapszFileList, int *pnSize, + int *pnMaxSize, CPLHashSet* hSetFiles); + + virtual int IsSimpleSource() { return FALSE; } +}; + +typedef VRTSource *(*VRTSourceParser)(CPLXMLNode *, const char *); + +VRTSource *VRTParseCoreSources( CPLXMLNode *psTree, const char * ); +VRTSource *VRTParseFilterSources( CPLXMLNode *psTree, const char * ); + +/************************************************************************/ +/* VRTDataset */ +/************************************************************************/ + +class VRTRasterBand; + +class CPL_DLL VRTDataset : public GDALDataset +{ + friend class VRTRasterBand; + + char *m_pszProjection; + + int m_bGeoTransformSet; + double m_adfGeoTransform[6]; + + int m_nGCPCount; + GDAL_GCP *m_pasGCPList; + char *m_pszGCPProjection; + + int m_bNeedsFlush; + int m_bWritable; + + char *m_pszVRTPath; + + VRTRasterBand *m_poMaskBand; + + int m_bCompatibleForDatasetIO; + int CheckCompatibleForDatasetIO(); + std::vector m_apoOverviews; + std::vector m_apoOverviewsBak; + + protected: + virtual int CloseDependentDatasets(); + + public: + VRTDataset(int nXSize, int nYSize); + virtual ~VRTDataset(); + + void SetNeedsFlush() { m_bNeedsFlush = TRUE; } + virtual void FlushCache(); + + void SetWritable(int bWritableIn) { m_bWritable = bWritableIn; } + + virtual CPLErr CreateMaskBand( int nFlags ); + void SetMaskBand(VRTRasterBand* poMaskBand); + + virtual const char *GetProjectionRef(void); + virtual CPLErr SetProjection( const char * ); + virtual CPLErr GetGeoTransform( double * ); + virtual CPLErr SetGeoTransform( double * ); + + virtual CPLErr SetMetadata( char **papszMD, const char *pszDomain = "" ); + virtual CPLErr SetMetadataItem( const char *pszName, const char *pszValue, + const char *pszDomain = "" ); + + virtual char** GetMetadata( const char *pszDomain = "" ); + + 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 char **GetFileList(); + + 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 nPixelSpace, GSpacing nLineSpace, + GSpacing nBandSpace, + GDALRasterIOExtraArg* psExtraArg); + + virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath); + virtual CPLErr XMLInit( CPLXMLNode *, const char * ); + + virtual CPLErr IBuildOverviews( const char *, int, int *, + int, int *, GDALProgressFunc, void * ); + + /* Used by PDF driver for example */ + GDALDataset* GetSingleSimpleSource(); + void BuildVirtualOverviews(); + + void UnsetPreservedRelativeFilenames(); + + static int Identify( GDALOpenInfo * ); + static GDALDataset *Open( GDALOpenInfo * ); + static GDALDataset *OpenXML( const char *, const char * = NULL, + GDALAccess eAccess = GA_ReadOnly ); + static GDALDataset *Create( const char * pszName, + int nXSize, int nYSize, int nBands, + GDALDataType eType, char ** papszOptions ); + static CPLErr Delete( const char * pszFilename ); +}; + +/************************************************************************/ +/* VRTWarpedDataset */ +/************************************************************************/ + +class GDALWarpOperation; +class VRTWarpedRasterBand; + +class CPL_DLL VRTWarpedDataset : public VRTDataset +{ + int m_nBlockXSize; + int m_nBlockYSize; + GDALWarpOperation *m_poWarper; + + int m_nOverviewCount; + VRTWarpedDataset **m_papoOverviews; + int m_nSrcOvrLevel; + + void CreateImplicitOverviews(); + + friend class VRTWarpedRasterBand; + + protected: + virtual int CloseDependentDatasets(); + +public: + VRTWarpedDataset( int nXSize, int nYSize ); + virtual ~VRTWarpedDataset(); + + CPLErr Initialize( /* GDALWarpOptions */ void * ); + + virtual CPLErr IBuildOverviews( const char *, int, int *, + int, int *, GDALProgressFunc, void * ); + + virtual CPLErr SetMetadataItem( const char *pszName, const char *pszValue, + const char *pszDomain = "" ); + + virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ); + virtual CPLErr XMLInit( CPLXMLNode *, const char * ); + + virtual CPLErr AddBand( GDALDataType eType, + char **papszOptions=NULL ); + + virtual char **GetFileList(); + + CPLErr ProcessBlock( int iBlockX, int iBlockY ); + + void GetBlockSize( int *, int * ); +}; + +/************************************************************************/ +/* VRTPansharpenedDataset */ +/************************************************************************/ + +class GDALPansharpenOperation; + +typedef enum +{ + GTAdjust_Union, + GTAdjust_Intersection, + GTAdjust_None, + GTAdjust_NoneWithoutWarning +} GTAdjustment; + +class VRTPansharpenedDataset : public VRTDataset +{ + friend class VRTPansharpenedRasterBand; + + int m_nBlockXSize; + int m_nBlockYSize; + GDALPansharpenOperation* m_poPansharpener; + VRTPansharpenedDataset* m_poMainDataset; + std::vector m_apoOverviewDatasets; + // Map from absolute to relative. + std::map m_oMapToRelativeFilenames; + + int m_bLoadingOtherBands; + + GByte *m_pabyLastBufferBandRasterIO; + int m_nLastBandRasterIOXOff; + int m_nLastBandRasterIOYOff; + int m_nLastBandRasterIOXSize; + int m_nLastBandRasterIOYSize; + GDALDataType m_eLastBandRasterIODataType; + + GTAdjustment m_eGTAdjustment; + int m_bNoDataDisabled; + + std::vector m_apoDatasetsToClose; + + protected: + virtual int CloseDependentDatasets(); + +public: + VRTPansharpenedDataset( int nXSize, int nYSize ); + virtual ~VRTPansharpenedDataset(); + + virtual CPLErr XMLInit( CPLXMLNode *, const char * ); + virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ); + + CPLErr XMLInit( CPLXMLNode *psTree, const char *pszVRTPath, + GDALRasterBandH hPanchroBandIn, + int nInputSpectralBandsIn, + GDALRasterBandH* pahInputSpectralBandsIn ); + + virtual CPLErr AddBand( GDALDataType eType, + char **papszOptions=NULL ); + + virtual char **GetFileList(); + + 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 nPixelSpace, GSpacing nLineSpace, + GSpacing nBandSpace, + GDALRasterIOExtraArg* psExtraArg); + + void GetBlockSize( int *, int * ); + + GDALPansharpenOperation* GetPansharpener() { return m_poPansharpener; } +}; + +/************************************************************************/ +/* VRTRasterBand */ +/* */ +/* Provides support for all the various kinds of metadata but */ +/* no raster access. That is handled by derived classes. */ +/************************************************************************/ + +class CPL_DLL VRTRasterBand : public GDALRasterBand +{ + protected: + int m_bIsMaskBand; + + int m_bNoDataValueSet; + // If set to true, will not report the existence of nodata. + int m_bHideNoDataValue; + double m_dfNoDataValue; + + GDALColorTable *m_poColorTable; + + GDALColorInterp m_eColorInterp; + + char *m_pszUnitType; + char **m_papszCategoryNames; + + double m_dfOffset; + double m_dfScale; + + CPLXMLNode *m_psSavedHistograms; + + void Initialize( int nXSize, int nYSize ); + + std::vector m_apoOverviews; + + VRTRasterBand *m_poMaskBand; + + public: + + VRTRasterBand(); + virtual ~VRTRasterBand(); + + virtual CPLErr XMLInit( CPLXMLNode *, const char * ); + virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ); + + virtual CPLErr SetNoDataValue( double ); + virtual double GetNoDataValue( int *pbSuccess = NULL ); + virtual CPLErr DeleteNoDataValue(); + + virtual CPLErr SetColorTable( GDALColorTable * ); + virtual GDALColorTable *GetColorTable(); + + virtual CPLErr SetColorInterpretation( GDALColorInterp ); + virtual GDALColorInterp GetColorInterpretation(); + + virtual const char *GetUnitType(); + CPLErr SetUnitType( const char * ); + + virtual char **GetCategoryNames(); + virtual CPLErr SetCategoryNames( char ** ); + + virtual CPLErr SetMetadata( char **papszMD, const char *pszDomain = "" ); + virtual CPLErr SetMetadataItem( const char *pszName, const char *pszValue, + const char *pszDomain = "" ); + + virtual double GetOffset( int *pbSuccess = NULL ); + CPLErr SetOffset( double ); + virtual double GetScale( int *pbSuccess = NULL ); + CPLErr SetScale( double ); + + virtual int GetOverviewCount(); + virtual GDALRasterBand *GetOverview(int); + + virtual CPLErr GetHistogram( double dfMin, double dfMax, + int nBuckets, GUIntBig * panHistogram, + int bIncludeOutOfRange, int bApproxOK, + GDALProgressFunc, void *pProgressData ); + + virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax, + int *pnBuckets, GUIntBig ** ppanHistogram, + int bForce, + GDALProgressFunc, void *pProgressData); + + virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax, + int nBuckets, GUIntBig *panHistogram ); + + CPLErr CopyCommonInfoFrom( GDALRasterBand * ); + + virtual void GetFileList(char*** ppapszFileList, int *pnSize, + int *pnMaxSize, CPLHashSet* hSetFiles); + + virtual void SetDescription( const char * ); + + virtual GDALRasterBand *GetMaskBand(); + virtual int GetMaskFlags(); + + virtual CPLErr CreateMaskBand( int nFlags ); + + void SetMaskBand(VRTRasterBand* poMaskBand); + + void SetIsMaskBand(); + + CPLErr UnsetNoDataValue(); + + virtual int CloseDependentDatasets(); + + virtual int IsSourcedRasterBand() { return FALSE; } + virtual int IsPansharpenRasterBand() { return FALSE; } +}; + +/************************************************************************/ +/* VRTSourcedRasterBand */ +/************************************************************************/ + +class VRTSimpleSource; + +class CPL_DLL VRTSourcedRasterBand : public VRTRasterBand +{ + private: + int m_nRecursionCounter; + CPLString m_osLastLocationInfo; + char **m_papszSourceList; + + bool CanUseSourcesMinMaxImplementations(); + + public: + int nSources; + VRTSource **papoSources; + int bEqualAreas; + + VRTSourcedRasterBand( GDALDataset *poDS, int nBand ); + VRTSourcedRasterBand( GDALDataType eType, + int nXSize, int nYSize ); + VRTSourcedRasterBand( GDALDataset *poDS, int nBand, + GDALDataType eType, + int nXSize, int nYSize ); + virtual ~VRTSourcedRasterBand(); + + virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + GSpacing nPixelSpace, GSpacing nLineSpace, + GDALRasterIOExtraArg* psExtraArg); + + virtual char **GetMetadataDomainList(); + virtual const char *GetMetadataItem( const char * pszName, + const char * pszDomain = "" ); + virtual char **GetMetadata( const char * pszDomain = "" ); + virtual CPLErr SetMetadata( char ** papszMetadata, + const char * pszDomain = "" ); + virtual CPLErr SetMetadataItem( const char * pszName, + const char * pszValue, + const char * pszDomain = "" ); + + virtual CPLErr XMLInit( CPLXMLNode *, const char * ); + virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ); + + virtual double GetMinimum( int *pbSuccess = NULL ); + virtual double GetMaximum(int *pbSuccess = NULL ); + virtual CPLErr ComputeRasterMinMax( int bApproxOK, double* adfMinMax ); + virtual CPLErr ComputeStatistics( int bApproxOK, + double *pdfMin, double *pdfMax, + double *pdfMean, double *pdfStdDev, + GDALProgressFunc pfnProgress, + void *pProgressData ); + virtual CPLErr GetHistogram( double dfMin, double dfMax, + int nBuckets, GUIntBig * panHistogram, + int bIncludeOutOfRange, int bApproxOK, + GDALProgressFunc pfnProgress, + void *pProgressData ); + + CPLErr AddSource( VRTSource * ); + CPLErr AddSimpleSource( GDALRasterBand *poSrcBand, + double dfSrcXOff=-1, double dfSrcYOff=-1, + double dfSrcXSize=-1, double dfSrcYSize=-1, + double dfDstXOff=-1, double dfDstYOff=-1, + double dfDstXSize=-1, double dfDstYSize=-1, + const char *pszResampling = "near", + double dfNoDataValue = VRT_NODATA_UNSET); + CPLErr AddComplexSource( GDALRasterBand *poSrcBand, + double dfSrcXOff=-1, double dfSrcYOff=-1, + double dfSrcXSize=-1, double dfSrcYSize=-1, + double dfDstXOff=-1, double dfDstYOff=-1, + double dfDstXSize=-1, double dfDstYSize=-1, + double dfScaleOff=0.0, + double dfScaleRatio=1.0, + double dfNoDataValue = VRT_NODATA_UNSET, + int nColorTableComponent = 0); + + CPLErr AddMaskBandSource( GDALRasterBand *poSrcBand, + double dfSrcXOff=-1, double dfSrcYOff=-1, + double dfSrcXSize=-1, + double dfSrcYSize=-1, + double dfDstXOff=-1, double dfDstYOff=-1, + double dfDstXSize=-1, + double dfDstYSize=-1 ); + + CPLErr AddFuncSource( VRTImageReadFunc pfnReadFunc, void *hCBData, + double dfNoDataValue = VRT_NODATA_UNSET ); + + void ConfigureSource(VRTSimpleSource *poSimpleSource, + GDALRasterBand *poSrcBand, + int bAddAsMaskBand, + double dfSrcXOff, double dfSrcYOff, + double dfSrcXSize, double dfSrcYSize, + double dfDstXOff, double dfDstYOff, + double dfDstXSize, double dfDstYSize ); + + virtual CPLErr IReadBlock( int, int, void * ); + + virtual void GetFileList(char*** ppapszFileList, int *pnSize, + int *pnMaxSize, CPLHashSet* hSetFiles); + + virtual int CloseDependentDatasets(); + + virtual int IsSourcedRasterBand() { return TRUE; } +}; + +/************************************************************************/ +/* VRTWarpedRasterBand */ +/************************************************************************/ + +class CPL_DLL VRTWarpedRasterBand : public VRTRasterBand +{ + public: + VRTWarpedRasterBand( GDALDataset *poDS, int nBand, + GDALDataType eType = GDT_Unknown ); + virtual ~VRTWarpedRasterBand(); + + virtual CPLErr XMLInit( CPLXMLNode *, const char * ); + virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ); + + virtual CPLErr IReadBlock( int, int, void * ); + virtual CPLErr IWriteBlock( int, int, void * ); + + virtual int GetOverviewCount(); + virtual GDALRasterBand *GetOverview(int); +}; +/************************************************************************/ +/* VRTPansharpenedRasterBand */ +/************************************************************************/ + +class VRTPansharpenedRasterBand : public VRTRasterBand +{ + int m_nIndexAsPansharpenedBand; + + public: + VRTPansharpenedRasterBand( + GDALDataset *poDS, int nBand, + GDALDataType eDataType = GDT_Unknown ); + virtual ~VRTPansharpenedRasterBand(); + + virtual CPLErr XMLInit( CPLXMLNode *, const char * ); + virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ); + + virtual CPLErr IReadBlock( 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 nPixelSpace, GSpacing nLineSpace, + GDALRasterIOExtraArg* psExtraArg); + + virtual int GetOverviewCount(); + virtual GDALRasterBand *GetOverview(int); + + virtual int IsPansharpenRasterBand() { return TRUE; } + + void SetIndexAsPansharpenedBand( int nIdx ) + { m_nIndexAsPansharpenedBand = nIdx; } + int GetIndexAsPansharpenedBand() const + { return m_nIndexAsPansharpenedBand; } +}; + +/************************************************************************/ +/* VRTDerivedRasterBand */ +/************************************************************************/ + +class CPL_DLL VRTDerivedRasterBand : public VRTSourcedRasterBand +{ + public: + char *pszFuncName; + GDALDataType eSourceTransferType; + + VRTDerivedRasterBand( GDALDataset *poDS, int nBand ); + VRTDerivedRasterBand( GDALDataset *poDS, int nBand, + GDALDataType eType, int nXSize, int nYSize ); + virtual ~VRTDerivedRasterBand(); + + virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + GSpacing nPixelSpace, GSpacing nLineSpace, + GDALRasterIOExtraArg* psExtraArg ); + + static CPLErr AddPixelFunction( const char *pszFuncName, + GDALDerivedPixelFunc pfnPixelFunc ); + static GDALDerivedPixelFunc GetPixelFunction( const char *pszFuncName ); + + void SetPixelFunctionName( const char *pszFuncName ); + void SetSourceTransferType( GDALDataType eDataType ); + + virtual CPLErr XMLInit( CPLXMLNode *, const char * ); + virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ); + +}; + +/************************************************************************/ +/* VRTRawRasterBand */ +/************************************************************************/ + +class RawRasterBand; + +class CPL_DLL VRTRawRasterBand : public VRTRasterBand +{ + RawRasterBand *m_poRawRaster; + + char *m_pszSourceFilename; + int m_bRelativeToVRT; + + public: + VRTRawRasterBand( GDALDataset *poDS, int nBand, + GDALDataType eType = GDT_Unknown ); + virtual ~VRTRawRasterBand(); + + virtual CPLErr XMLInit( CPLXMLNode *, const char * ); + virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ); + + virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int, + void *, int, int, GDALDataType, + GSpacing nPixelSpace, GSpacing nLineSpace, + GDALRasterIOExtraArg* psExtraArg ); + + virtual CPLErr IReadBlock( int, int, void * ); + virtual CPLErr IWriteBlock( int, int, void * ); + + CPLErr SetRawLink( const char *pszFilename, + const char *pszVRTPath, + int bRelativeToVRT, + vsi_l_offset nImageOffset, + int nPixelOffset, int nLineOffset, + const char *pszByteOrder ); + + void ClearRawLink(); + + virtual void GetFileList( char*** ppapszFileList, int *pnSize, + int *pnMaxSize, CPLHashSet* hSetFiles ); +}; + +/************************************************************************/ +/* VRTDriver */ +/************************************************************************/ + +class VRTDriver : public GDALDriver +{ + public: + VRTDriver(); + virtual ~VRTDriver(); + + char **papszSourceParsers; + + virtual char **GetMetadataDomainList(); + virtual char **GetMetadata( const char * pszDomain = "" ); + virtual CPLErr SetMetadata( char ** papszMetadata, + const char * pszDomain = "" ); + + VRTSource *ParseSource( CPLXMLNode *psSrc, const char *pszVRTPath ); + void AddSourceParser( const char *pszElementName, + VRTSourceParser pfnParser ); +}; + +/************************************************************************/ +/* VRTSimpleSource */ +/************************************************************************/ + +class CPL_DLL VRTSimpleSource : public VRTSource +{ +protected: + GDALRasterBand *m_poRasterBand; + + // When poRasterBand is a mask band, poMaskBandMainBand is the band + // from which the mask band is taken. + GDALRasterBand *m_poMaskBandMainBand; + + double m_dfSrcXOff; + double m_dfSrcYOff; + double m_dfSrcXSize; + double m_dfSrcYSize; + + double m_dfDstXOff; + double m_dfDstYOff; + double m_dfDstXSize; + double m_dfDstYSize; + + int m_bNoDataSet; + double m_dfNoDataValue; + CPLString m_osResampling; + + int m_nMaxValue; + + int m_bRelativeToVRTOri; + CPLString m_osSourceFileNameOri; + + int NeedMaxValAdjustment() const; + +public: + VRTSimpleSource(); + VRTSimpleSource( const VRTSimpleSource* poSrcSource, + double dfXDstRatio, double dfYDstRatio ); + virtual ~VRTSimpleSource(); + + virtual CPLErr XMLInit( CPLXMLNode *psTree, const char * ); + virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ); + + void SetSrcBand( GDALRasterBand * ); + void SetSrcMaskBand( GDALRasterBand * ); + void SetSrcWindow( double, double, double, double ); + void SetDstWindow( double, double, double, double ); + void SetNoDataValue( double dfNoDataValue ); + const CPLString& GetResampling() const { return m_osResampling; } + void SetResampling( const char* pszResampling ); + + int GetSrcDstWindow( int, int, int, int, int, int, + double *pdfReqXOff, double *pdfReqYOff, + double *pdfReqXSize, double *pdfReqYSize, + int *, int *, int *, int *, + int *, int *, int *, int * ); + + virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize, + void *pData, int nBufXSize, int nBufYSize, + GDALDataType eBufType, + GSpacing nPixelSpace, GSpacing nLineSpace, + GDALRasterIOExtraArg* psExtraArg ); + + virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ); + virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ); + virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK, + double* adfMinMax ); + virtual CPLErr ComputeStatistics( int nXSize, int nYSize, + int bApproxOK, + double *pdfMin, double *pdfMax, + double *pdfMean, double *pdfStdDev, + GDALProgressFunc pfnProgress, + void *pProgressData ); + virtual CPLErr GetHistogram( int nXSize, int nYSize, + double dfMin, double dfMax, + int nBuckets, GUIntBig * panHistogram, + int bIncludeOutOfRange, int bApproxOK, + GDALProgressFunc pfnProgress, + void *pProgressData ); + + void DstToSrc( double dfX, double dfY, + double &dfXOut, double &dfYOut ); + void SrcToDst( double dfX, double dfY, + double &dfXOut, double &dfYOut ); + + virtual void GetFileList( char*** ppapszFileList, int *pnSize, + int *pnMaxSize, CPLHashSet* hSetFiles ); + + virtual int IsSimpleSource() { return TRUE; } + virtual const char* GetType() { return "SimpleSource"; } + + GDALRasterBand* GetBand(); + int IsSameExceptBandNumber( VRTSimpleSource* poOtherSource ); + CPLErr DatasetRasterIO( + int nXOff, int nYOff, int nXSize, int nYSize, + void * pData, int nBufXSize, int nBufYSize, + GDALDataType eBufType, + int nBandCount, int *panBandMap, + GSpacing nPixelSpace, GSpacing nLineSpace, + GSpacing nBandSpace, + GDALRasterIOExtraArg* psExtraArg ); + + void UnsetPreservedRelativeFilenames(); + + void SetMaxValue( int nVal ) { m_nMaxValue = nVal; } +}; + +/************************************************************************/ +/* VRTAveragedSource */ +/************************************************************************/ + +class VRTAveragedSource : public VRTSimpleSource +{ +public: + VRTAveragedSource(); + virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize, + void *pData, int nBufXSize, int nBufYSize, + GDALDataType eBufType, + GSpacing nPixelSpace, GSpacing nLineSpace, + GDALRasterIOExtraArg* psExtraArg ); + + virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ); + virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ); + virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK, + double* adfMinMax ); + virtual CPLErr ComputeStatistics( int nXSize, int nYSize, + int bApproxOK, + double *pdfMin, double *pdfMax, + double *pdfMean, double *pdfStdDev, + GDALProgressFunc pfnProgress, + void *pProgressData ); + virtual CPLErr GetHistogram( int nXSize, int nYSize, + double dfMin, double dfMax, + int nBuckets, GUIntBig * panHistogram, + int bIncludeOutOfRange, int bApproxOK, + GDALProgressFunc pfnProgress, + void *pProgressData ); + + virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ); + virtual const char* GetType() { return "AveragedSource"; } +}; + +/************************************************************************/ +/* VRTComplexSource */ +/************************************************************************/ + +typedef enum +{ + VRT_SCALING_NONE, + VRT_SCALING_LINEAR, + VRT_SCALING_EXPONENTIAL, +} VRTComplexSourceScaling; + +class CPL_DLL VRTComplexSource : public VRTSimpleSource +{ +protected: + VRTComplexSourceScaling m_eScalingType; + double m_dfScaleOff; // For linear scaling. + double m_dfScaleRatio; // For linear scaling. + + // For non-linear scaling with a power function. + int m_bSrcMinMaxDefined; + double m_dfSrcMin; + double m_dfSrcMax; + double m_dfDstMin; + double m_dfDstMax; + double m_dfExponent; + + int m_nColorTableComponent; + + CPLErr RasterIOInternal( int nReqXOff, int nReqYOff, + int nReqXSize, int nReqYSize, + void *pData, int nOutXSize, int nOutYSize, + GDALDataType eBufType, + GSpacing nPixelSpace, GSpacing nLineSpace, + GDALRasterIOExtraArg* psExtraArg ); + +public: + VRTComplexSource(); + VRTComplexSource(const VRTComplexSource* poSrcSource, + double dfXDstRatio, double dfYDstRatio); + virtual ~VRTComplexSource(); + + virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize, + void *pData, int nBufXSize, int nBufYSize, + GDALDataType eBufType, + GSpacing nPixelSpace, GSpacing nLineSpace, + GDALRasterIOExtraArg* psExtraArg ); + + virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ); + virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ); + virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK, + double* adfMinMax ); + virtual CPLErr ComputeStatistics( int nXSize, int nYSize, + int bApproxOK, + double *pdfMin, double *pdfMax, + double *pdfMean, double *pdfStdDev, + GDALProgressFunc pfnProgress, + void *pProgressData ); + virtual CPLErr GetHistogram( int nXSize, int nYSize, + double dfMin, double dfMax, + int nBuckets, GUIntBig * panHistogram, + int bIncludeOutOfRange, int bApproxOK, + GDALProgressFunc pfnProgress, + void *pProgressData ); + + virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ); + virtual CPLErr XMLInit( CPLXMLNode *, const char * ); + virtual const char* GetType() { return "ComplexSource"; } + + double LookupValue( double dfInput ); + + void SetLinearScaling( double dfOffset, double dfScale ); + void SetPowerScaling( double dfExponent, + double dfSrcMin, + double dfSrcMax, + double dfDstMin, + double dfDstMax ); + void SetColorTableComponent( int nComponent ); + + double *m_padfLUTInputs; + double *m_padfLUTOutputs; + int m_nLUTItemCount; +}; + +/************************************************************************/ +/* VRTFilteredSource */ +/************************************************************************/ + +class VRTFilteredSource : public VRTComplexSource +{ +private: + int IsTypeSupported( GDALDataType eType ); + +protected: + int m_nSupportedTypesCount; + GDALDataType m_aeSupportedTypes[20]; + + int m_nExtraEdgePixels; + +public: + VRTFilteredSource(); + virtual ~VRTFilteredSource(); + + void SetExtraEdgePixels( int ); + void SetFilteringDataTypesSupported( int, GDALDataType * ); + + virtual CPLErr FilterData( int nXSize, int nYSize, GDALDataType eType, + GByte *pabySrcData, GByte *pabyDstData ) = 0; + + virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize, + void *pData, int nBufXSize, int nBufYSize, + GDALDataType eBufType, + GSpacing nPixelSpace, GSpacing nLineSpace, + GDALRasterIOExtraArg* psExtraArg ); +}; + +/************************************************************************/ +/* VRTKernelFilteredSource */ +/************************************************************************/ + +class VRTKernelFilteredSource : public VRTFilteredSource +{ +protected: + int m_nKernelSize; + + double *m_padfKernelCoefs; + + int m_bNormalized; + +public: + VRTKernelFilteredSource(); + virtual ~VRTKernelFilteredSource(); + + virtual CPLErr XMLInit( CPLXMLNode *psTree, const char * ); + virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ); + + virtual CPLErr FilterData( int nXSize, int nYSize, GDALDataType eType, + GByte *pabySrcData, GByte *pabyDstData ); + + CPLErr SetKernel( int nKernelSize, double *padfCoefs ); + void SetNormalized( int ); +}; + +/************************************************************************/ +/* VRTAverageFilteredSource */ +/************************************************************************/ + +class VRTAverageFilteredSource : public VRTKernelFilteredSource +{ +public: + explicit VRTAverageFilteredSource( int nKernelSize ); + virtual ~VRTAverageFilteredSource(); + + virtual CPLErr XMLInit( CPLXMLNode *psTree, const char * ); + virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ); +}; + +/************************************************************************/ +/* VRTFuncSource */ +/************************************************************************/ +class VRTFuncSource : public VRTSource +{ +public: + VRTFuncSource(); + virtual ~VRTFuncSource(); + + virtual CPLErr XMLInit( CPLXMLNode *, const char *) { return CE_Failure; } + virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ); + + virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize, + void *pData, int nBufXSize, int nBufYSize, + GDALDataType eBufType, + GSpacing nPixelSpace, GSpacing nLineSpace, + GDALRasterIOExtraArg* psExtraArg ); + + virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ); + virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ); + virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK, + double* adfMinMax ); + virtual CPLErr ComputeStatistics( int nXSize, int nYSize, + int bApproxOK, + double *pdfMin, double *pdfMax, + double *pdfMean, double *pdfStdDev, + GDALProgressFunc pfnProgress, + void *pProgressData ); + virtual CPLErr GetHistogram( int nXSize, int nYSize, + double dfMin, double dfMax, + int nBuckets, GUIntBig * panHistogram, + int bIncludeOutOfRange, int bApproxOK, + GDALProgressFunc pfnProgress, + void *pProgressData ); + + VRTImageReadFunc pfnReadFunc; + void *pCBData; + GDALDataType eType; + + float fNoDataValue; +}; + +#endif /* ndef VIRTUALDATASET_H_INCLUDED */ diff --git a/modules/globebrowsing/ext/gdal/lib/gdal201.dll b/modules/globebrowsing/ext/gdal/lib/gdal201.dll new file mode 100644 index 0000000000000000000000000000000000000000..bad96c9e379a6f5f8511ab2f14e655e67ee38c36 GIT binary patch literal 12026880 zcmc${3wTu3)i*xLBoH9s1Z6bdO4KO9C`95VI6-G1qi1xYSV8d$6`@!`DVY&eF2N)= z>2dl}74NO~ZB<%pv9^s!TTB8bK?DLS1h9bC))NOcVhaf<=l}byea_6}0^fDNaw zObKl`ed5eJ%X8<e=s|D+7Ir&`<`&_?bCDTM()nN^X}ZzYp%z*f0!~M+QH;-%hUG``16DP~P^|)JpJ0DNM@7CD4PYjUX z(N7GN-;19}#qXe@-#l@phwpbio{jtI!Oq9OkNfGk|KbGxe*HM>PY=4~z3IWja{v81 zr_Ce`&WI-jT&_DF8sI9cKH&!ES%>S4+(D^>U9PY1ak*NrkjKj}neB3A%Vh=7p{`S1 zu72_;@#`uCW{G6{rMjk~s(Q)!>3y%B>?wW8<@=M{mD~9{*G%c4&Q;6_t9aG*=gZTj zJ^3%Y&Q&-x)it5&Dc7lqr}3+d>Ze@!xSNC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