Fire Core  8.0.0.alpha
GIS framework per tutti gli usi
 Tutto Classi Namespace Funzioni Variabili Ridefinizioni di tipo (typedef) Tipi enumerati (enum) Valori del tipo enumerato Friend
ProjectionsManager.hpp
1 // Copyright 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_GEAR_PROJECTION_PROJECTIONSMANAGER_HPP_INCLUDED
5 #define FIRE_GEAR_PROJECTION_PROJECTIONSMANAGER_HPP_INCLUDED
6 
7 #include <boost/filesystem.hpp>
8 
9 #include <json/json.h>
10 
11 #include <ogr_spatialref.h>
12 
13 #include <exception>
14 #include <string>
15 
16 #include "fire/export.hpp"
17 
18 #include "fire/Object.hpp"
19 #include "fire/gear/projection/ProjectionTextType.hpp"
20 
21 namespace fire {
22 namespace gear {
23 namespace projection {
24 class Projection;
25 class Projector;
26 } // namespace projection
27 } // namespace gear
28 } // namespace fire
29 
34 namespace fire {
39 namespace gear {
44 namespace projection {
49 class FIRE_ENGINE_DLL ProjectionsManager : public fire::Object {
50  private:
55  static fire::gear::projection::ProjectionsManager* projectionsManager;
60  static std::size_t sridsCount;
65  boost::filesystem::path projectionsPath;
70  Json::Value projections;
75  OGRSpatialReference spatialReference;
88  explicit ProjectionsManager(const std::string& projectionsPath);
93  virtual ~ProjectionsManager();
94 
95  public:
100  static const int UnknownSrid;
108  static int getUnknownSrid();
113  static ProjectionsManager* instance();
121  static ProjectionsManager* instance(const std::string& projectionsPath);
135  void putProjection(int srid, fire::gear::projection::ProjectionTextType::ProjectionTextType projectionTextType, const std::string& projectionText);
149  int putProjection(fire::gear::projection::ProjectionTextType::ProjectionTextType projectionTextType, const std::string& projectionText);
160  void removeProjection(int srid, fire::gear::projection::ProjectionTextType::ProjectionTextType projectionTextType);
174  bool hasProjection(int srid, fire::gear::projection::ProjectionTextType::ProjectionTextType projectionTextType) const;
188  std::string getProjection(int srid, fire::gear::projection::ProjectionTextType::ProjectionTextType projectionTextType) const;
202  int getSrid(fire::gear::projection::ProjectionTextType::ProjectionTextType projectionTextType, const std::string& projectionText) const;
207  void updateProjections() const;
218  fire::gear::projection::Projection* createProjection(int srid, fire::gear::projection::ProjectionTextType::ProjectionTextType projectionTextType = fire::gear::projection::ProjectionTextType::Proj4) const;
232  fire::gear::projection::Projector* createProjector(int sourceSrid, int destinationSrid, fire::gear::projection::ProjectionTextType::ProjectionTextType projectionTextType = fire::gear::projection::ProjectionTextType::Proj4) const;
233 };
234 } // namespace projection
235 } // namespace gear
236 } // namespace fire
237 
238 #endif
Classe per la gestione di un oggetto.
Definition: Object.hpp:29
Classe per la gestione del gestore delle proiezioni.
Definition: ProjectionsManager.hpp:49
Classe per la gestione di un proiettore.
Definition: Projector.hpp:148
static const int UnknownSrid
Identificativo del sistema di riferimento sconosciuto.
Definition: ProjectionsManager.hpp:100
Classe per la gestione di una proiezione.
Definition: Projection.hpp:34