diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-02-06 18:32:58 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-02-07 10:37:51 +0100 |
| commit | 02efe72181814097284196de9b9b984db0fb3d26 (patch) | |
| tree | 3aa91671fad83ae5225489f80731803ffd682d71 /include | |
| parent | 457b173cbe8fdb790b011d1828a0fd9f8f6221a4 (diff) | |
| download | PROJ-02efe72181814097284196de9b9b984db0fb3d26.tar.gz PROJ-02efe72181814097284196de9b9b984db0fb3d26.zip | |
Add proj_get_crs_info_list_from_database()
This method is intended to be used typically by GUI that lists all possible CRS.
What is does could be done by previously existing functions, but it is much faster.
It typically runs in less than 0.1s (hot run) versus ~0.5s with the method that
consists in enumerating all codes and instanciating a PJ object for each of them.
Diffstat (limited to 'include')
| -rw-r--r-- | include/proj/io.hpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/proj/io.hpp b/include/proj/io.hpp index 4120d707..aedf0457 100644 --- a/include/proj/io.hpp +++ b/include/proj/io.hpp @@ -888,6 +888,38 @@ class PROJ_GCC_DLL AuthorityFactory { PROJ_DLL std::string getDescriptionText(const std::string &code) const; + /** CRS information */ + struct CRSInfo { + /** Authority name */ + std::string authName{}; + /** Code */ + std::string code{}; + /** Name */ + std::string name{}; + /** Type */ + ObjectType type{ObjectType::CRS}; + /** Whether the object is deprecated */ + bool deprecated{}; + /** Whereas the west_lon_degree, south_lat_degree, east_lon_degree and + * north_lat_degree fields are valid. */ + bool bbox_valid{}; + /** Western-most longitude of the area of use, in degrees. */ + double west_lon_degree{}; + /** Southern-most latitude of the area of use, in degrees. */ + double south_lat_degree{}; + /** Eastern-most longitude of the area of use, in degrees. */ + double east_lon_degree{}; + /** Northern-most latitude of the area of use, in degrees. */ + double north_lat_degree{}; + /** Name of the area of use. */ + std::string areaName{}; + /** Name of the projection method for a projected CRS. Might be empty + * even for projected CRS in some cases. */ + std::string projectionMethodName{}; + }; + + PROJ_DLL std::list<CRSInfo> getCRSInfoList() const; + // non-standard PROJ_DLL static AuthorityFactoryNNPtr create(const DatabaseContextNNPtr &context, |
