26 #ifndef __TERRALIB_SRS_INTERNAL_SPATIALREFERENCESYSTEMMANAGER_H 27 #define __TERRALIB_SRS_INTERNAL_SPATIALREFERENCESYSTEMMANAGER_H 30 #include "../common/Singleton.h" 31 #include "../common/UnitOfMeasure.h" 42 #include <boost/lexical_cast.hpp> 43 #include <boost/multi_index_container.hpp> 44 #include <boost/multi_index/member.hpp> 45 #include <boost/multi_index/mem_fun.hpp> 46 #include <boost/multi_index/ordered_index.hpp> 78 srs_desc(
const std::string& name,
unsigned int auth_id,
const std::string& auth_name,
const std::string& p4txt,
const std::string& wkt);
80 std::string srid()
const;
96 typedef boost::multi_index_container<
98 boost::multi_index::indexed_by<
99 boost::multi_index::ordered_unique<BOOST_MULTI_INDEX_CONST_MEM_FUN(srs_desc,std::string,srid)>,
100 boost::multi_index::ordered_non_unique<BOOST_MULTI_INDEX_MEMBER(srs_desc,std::string,m_name)>,
101 boost::multi_index::ordered_non_unique<BOOST_MULTI_INDEX_MEMBER(srs_desc,std::string,m_p4txt)>,
102 boost::multi_index::ordered_non_unique<BOOST_MULTI_INDEX_MEMBER(srs_desc,std::string,m_wkt)>,
103 boost::multi_index::ordered_non_unique<BOOST_MULTI_INDEX_MEMBER(srs_desc,std::string,m_auth_name)>
115 typedef boost::multi_index::nth_index<srs_set,0>::type::iterator
iterator;
134 void init(
const std::string& fileName);
145 void add(
const std::string& name,
const std::string& p4Txt,
const std::string& wkt,
unsigned int id,
const std::string& authName=
"EPSG");
153 bool recognizes(
unsigned int id,
const std::string& authName=
"EPSG")
const;
161 std::string getName (
unsigned int id,
const std::string& authName=
"EPSG")
const;
169 std::string getP4Txt(
unsigned int id,
const std::string& authName=
"EPSG")
const;
177 std::string getWkt (
unsigned int id,
const std::string& authName=
"EPSG")
const;
185 std::pair<std::string,unsigned int> getIdFromName (
const std::string& name)
const;
193 std::pair<std::string,unsigned int> getIdFromP4Txt(
const std::string& p4Txt)
const;
201 std::pair<std::string,unsigned int> getIdFromWkt (
const std::string& wkt)
const;
216 void remove (
unsigned int id,
const std::string& authName=
"EPSG");
231 std::pair<te::srs::SpatialReferenceSystemManager::iterator,te::srs::SpatialReferenceSystemManager::iterator> getIterators()
const;
243 bool isGeographic(
unsigned int id,
const std::string& authName=
"EPSG");
248 bool isInitialized();
250 bool isValidNameID(
const std::string& name);
252 bool isValidP4TxtID(
const std::string& p4Txt);
254 bool isValidWktID(
const std::string& wkt);
260 int getNewUserDefinedSRID();
263 static std::string getProjLibDir();
294 std::pair<std::string, unsigned int> getIdFromP4TxtImpl(
const std::string& p4Txt)
const;
302 std::pair<std::string, unsigned int> getIdFromWktImpl(
const std::string& wkt)
const;
307 #endif // __TERRALIB_SRS_INTERNAL_SPATIALREFERENCESYSTEMMANAGER_H
boost::multi_index_container< srs_desc, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< BOOST_MULTI_INDEX_CONST_MEM_FUN(srs_desc, std::string, srid)>, boost::multi_index::ordered_non_unique< BOOST_MULTI_INDEX_MEMBER(srs_desc, std::string, m_name)>, boost::multi_index::ordered_non_unique< BOOST_MULTI_INDEX_MEMBER(srs_desc, std::string, m_p4txt)>, boost::multi_index::ordered_non_unique< BOOST_MULTI_INDEX_MEMBER(srs_desc, std::string, m_wkt)>, boost::multi_index::ordered_non_unique< BOOST_MULTI_INDEX_MEMBER(srs_desc, std::string, m_auth_name)> > > srs_set
boost::multi_index::nth_index< srs_set, 0 >::type::iterator iterator
An iterator by SRS <id,authority>
std::map< int, te::common::UnitOfMeasurePtr > m_cacheUnitOfMeasure
std::unique_ptr< SpatialReferenceSystem > SpatialReferenceSystemPtr
This file contains the structs necessary to represent a Spatial Reference System. ...
A class to manage Coordinate Systems representations within TerraLib environment. ...
boost::shared_ptr< UnitOfMeasure > UnitOfMeasurePtr
#define TESRSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Template support for singleton pattern.