From 02efe72181814097284196de9b9b984db0fb3d26 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 6 Feb 2019 18:32:58 +0100 Subject: 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. --- include/proj/io.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'include') 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 getCRSInfoList() const; + // non-standard PROJ_DLL static AuthorityFactoryNNPtr create(const DatabaseContextNNPtr &context, -- cgit v1.2.3