29 #ifndef OGR_PROJ_P_H_INCLUDED
30 #define OGR_PROJ_P_H_INCLUDED
34 #include "cpl_mem_cache.h"
36 #include <unordered_map>
42 PJ_CONTEXT* OSRGetProjTLSContext();
43 void OSRCleanupTLSContext();
50 bool bUseNonDeprecated_;
53 EPSGCacheKey(
int nCode,
bool bUseNonDeprecated,
bool bAddTOWGS84):
54 nCode_(nCode), bUseNonDeprecated_(bUseNonDeprecated), bAddTOWGS84_(bAddTOWGS84) {}
56 bool operator==(
const EPSGCacheKey& other)
const
58 return nCode_ == other.nCode_ &&
59 bUseNonDeprecated_ == other.bUseNonDeprecated_ &&
60 bAddTOWGS84_ == other.bAddTOWGS84_;
63 struct EPSGCacheKeyHasher
65 std::size_t operator()(
const EPSGCacheKey& k)
const
68 ((k.bUseNonDeprecated_ ? 1 : 0) << 16) |
69 ((k.bAddTOWGS84_ ? 1 : 0) << 17);
73 lru11::Cache<EPSGCacheKey, std::shared_ptr<PJ>,
77 typename std::list<lru11::KeyValuePair<EPSGCacheKey,
78 std::shared_ptr<PJ>>>::iterator,
79 EPSGCacheKeyHasher>> m_oCacheEPSG{};
80 lru11::Cache<std::string, std::shared_ptr<PJ>> m_oCacheWKT{};
83 OSRProjTLSCache() =
default;
87 PJ* GetPJForEPSGCode(
int nCode,
bool bUseNonDeprecated,
bool bAddTOWGS84);
88 void CachePJForEPSGCode(
int nCode,
bool bUseNonDeprecated,
bool bAddTOWGS84, PJ* pj);
90 PJ* GetPJForWKT(
const std::string& wkt);
91 void CachePJForWKT(
const std::string& wkt, PJ* pj);
94 OSRProjTLSCache* OSRGetProjTLSCache();
char ** CSLTokenizeString2(const char *pszString, const char *pszDelimiter, int nCSLTFlags)
Definition: cpl_string.cpp:836
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:438
void OSRSetPROJSearchPaths(const char *const *papszPaths)
Set the search path(s) for PROJ resource files.
Definition: ogr_proj_p.cpp:247
void CPLDebug(const char *, const char *,...)
Definition: cpl_error.cpp:602
char ** List()
Definition: cpl_string.h:516
CPLStringList & Assign(char **papszListIn, int bTakeOwnership=TRUE)
Definition: cplstringlist.cpp:191
void CPLError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt,...)
Definition: cpl_error.cpp:308
char ** OSRGetPROJSearchPaths(void)
Get the search path(s) for PROJ resource files.
Definition: ogr_proj_p.cpp:263
char ** CSLDuplicate(CSLConstList papszStrList)
Definition: cpl_string.cpp:228
void OSRGetPROJVersion(int *pnMajor, int *pnMinor, int *pnPatch)
Get the PROJ version.
Definition: ogr_proj_p.cpp:287
int Count() const
Definition: cplstringlist.cpp:218
#define CPLE_AppDefined
Definition: cpl_error.h:99
Generated for GDAL by
1.8.17.