diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-09-10 20:21:36 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-09-12 15:59:23 +0200 |
| commit | 63857c92b271bbcd10df0a032304982011acb2a9 (patch) | |
| tree | a04e4c96dba6a95613fc2d49da0f4e5c7c5a58d7 /src/iso19111/factory.cpp | |
| parent | 890c94a730474f057f5237ca07699d6af600ed3f (diff) | |
| download | PROJ-63857c92b271bbcd10df0a032304982011acb2a9.tar.gz PROJ-63857c92b271bbcd10df0a032304982011acb2a9.zip | |
Coordinate transformation: improve transformations from/to WGS84 (Gxxxx)
Currently very few transformations from/to WGS84 (Gxxxx) are registered
in the EPSG database, and there isn't even transformations between WGS84 EPSG:4326
and those ones. Consequently transformations to those realizations often
ended up as no-operation, whereas going through WGS84 EPSG:4326 will bring
more meaningful results. So register those EPSG:4326<-->WGS 84 (Gxxx)
null transformations, and when having WGS 84 (Gxxx) as source/target,
consider EPSG:4326 as an intermediate.
This change has no effect on the existing direct transformations
from/to WGS 84 (Gxxx).
Diffstat (limited to 'src/iso19111/factory.cpp')
| -rw-r--r-- | src/iso19111/factory.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/iso19111/factory.cpp b/src/iso19111/factory.cpp index 1f40f1f0..4bf5427d 100644 --- a/src/iso19111/factory.cpp +++ b/src/iso19111/factory.cpp @@ -4982,6 +4982,29 @@ AuthorityFactory::createCompoundCRSFromExisting( // --------------------------------------------------------------------------- //! @cond Doxygen_Suppress +std::list<datum::GeodeticReferenceFrameNNPtr> +AuthorityFactory::getPreferredHubGeodeticReferenceFrames( + const std::string &geodeticReferenceFrameCode) const { + std::list<datum::GeodeticReferenceFrameNNPtr> res; + + const std::string sql("SELECT hub_auth_name, hub_code FROM " + "geodetic_datum_preferred_hub WHERE " + "src_auth_name = ? AND src_code = ?"); + auto sqlRes = d->run(sql, {d->authority(), geodeticReferenceFrameCode}); + for (const auto &row : sqlRes) { + const auto &auth_name = row[0]; + const auto &code = row[1]; + res.emplace_back( + d->createFactory(auth_name)->createGeodeticDatum(code)); + } + + return res; +} +//! @endcond + +// --------------------------------------------------------------------------- + +//! @cond Doxygen_Suppress FactoryException::FactoryException(const char *message) : Exception(message) {} // --------------------------------------------------------------------------- |
