Layer.h
Aller à la documentation de ce fichier.
1 /*
2  * Copyright © (2011-2013) Institut national de l'information
3  * géographique et forestière
4  *
5  * Géoportail SAV <contact.geoservices@ign.fr>
6  *
7  * This software is a computer program whose purpose is to publish geographic
8  * data using OGC WMS and WMTS protocol.
9  *
10  * This software is governed by the CeCILL-C license under French law and
11  * abiding by the rules of distribution of free software. You can use,
12  * modify and/ or redistribute the software under the terms of the CeCILL-C
13  * license as circulated by CEA, CNRS and INRIA at the following URL
14  * "http://www.cecill.info".
15  *
16  * As a counterpart to the access to the source code and rights to copy,
17  * modify and redistribute granted by the license, users are provided only
18  * with a limited warranty and the software's author, the holder of the
19  * economic rights, and the successive licensors have only limited
20  * liability.
21  *
22  * In this respect, the user's attention is drawn to the risks associated
23  * with loading, using, modifying and/or developing or reproducing the
24  * software by the user in light of its specific status of free software,
25  * that may mean that it is complicated to manipulate, and that also
26  * therefore means that it is reserved for developers and experienced
27  * professionals having in-depth computer knowledge. Users are therefore
28  * encouraged to load and test the software's suitability as regards their
29  * requirements in conditions enabling the security of their systems and/or
30  * data to be ensured and, more generally, to use and operate it in the
31  * same conditions as regards security.
32  *
33  * The fact that you are presently reading this means that you have had
34  *
35  * knowledge of the CeCILL-C license and that you accept its terms.
36  */
37 
46 class Layer;
47 
48 #ifndef LAYER_H_
49 #define LAYER_H_
50 
51 #include <vector>
52 #include <string>
53 
54 #include <rok4/utils/Pyramid.h>
55 #include <rok4/utils/CRS.h>
56 #include <rok4/style/Style.h>
57 #include "ServerConf.h"
58 #include "ServicesConf.h"
59 #include "MetadataURL.h"
60 #include "AttributionURL.h"
61 #include <rok4/enums/Interpolation.h>
62 #include <rok4/utils/Keyword.h>
63 #include <rok4/utils/BoundingBox.h>
64 #include <rok4/utils/Configuration.h>
65 
66 struct WmtsTmsInfos {
67  TileMatrixSet* tms;
68  std::string wmts_id;
69  std::string top_level;
70  std::string bottom_level;
71  std::vector<TileMatrixLimits> limits;
72 };
73 
95 class Layer : public Configuration {
96 private:
101  std::string id;
106  std::string title;
111  std::string abstract;
116  bool WMSAuthorized;
121  bool WMTSAuthorized;
126  bool TMSAuthorized;
131  std::vector<Keyword> keyWords;
136  Pyramid* dataPyramid;
137 
142  std::string authority;
147  BoundingBox<double> geographicBoundingBox;
152  BoundingBox<double> boundingBox;
157  std::vector<MetadataURL> metadataURLs;
162  AttributionURL* attribution;
163 
164  /******************* PYRAMIDE RASTER *********************/
165 
170  std::vector<Style*> styles;
171 
176  std::vector<CRS*> WMSCRSList;
181  std::vector<WmtsTmsInfos> WMTSTMSList;
182 
187  Interpolation::KernelType resampling;
192  bool getFeatureInfoAvailability;
197  std::string getFeatureInfoType;
202  std::string getFeatureInfoBaseURL;
207  std::string GFIService;
212  std::string GFIVersion;
217  std::string GFIQueryLayers;
222  std::string GFILayers;
227  std::string GFIExtraParams;
232  bool GFIForceEPSG;
233 
234  void calculateBoundingBoxes();
235  void calculateNativeTileMatrixLimits();
236  void calculateTileMatrixLimits();
237 
238  bool parse(json11::Json& doc, ServicesConf* servicesConf);
239 
240 public:
253  Layer(std::string path, ServicesConf* servicesConf );
268  Layer(std::string layerName, std::string content, ServicesConf* servicesConf );
269 
278  std::string getId();
305  Image* getbbox (ServicesConf* servicesConf, BoundingBox<double> bbox, int width, int height, CRS* dst_crs, int dpi, int& error );
314  std::string getAbstract() ;
323  bool getWMSAuthorized() ;
332  bool getTMSAuthorized() ;
341  bool getWMTSAuthorized() ;
350  std::vector<Keyword>* getKeyWords() ;
368  double getMaxRes() ;
377  double getMinRes() ;
386  Pyramid* getDataPyramid() ;
397  std::string getNativeWmtsTmsId() ;
398 
407  Style* getDefaultStyle() ;
416  std::vector<Style*> getStyles() ;
425  std::vector<WmtsTmsInfos> getWMTSTMSList() ;
426 
435  Style* getStyle(std::string id) ;
436 
445  Style* getStyleByIdentifier(std::string identifier) ;
446 
455  std::string getTitle() ;
456 
465  std::vector<CRS*> getWMSCRSList() ;
466 
475  bool isInWMSCRSList(CRS* c) ;
476 
485  bool isInWMSCRSList(std::string c) ;
486 
496  TileMatrixSet* getTms(std::string id) ;
497 
506  TileMatrixLimits* getTmLimits(TileMatrixSet* tms, TileMatrix* tm) ;
507 
516  BoundingBox<double> getGeographicBoundingBox() ;
525  BoundingBox<double> getBoundingBox() ;
534  std::vector<MetadataURL> getMetadataURLs() ;
552  std::string getGFIType() ;
561  std::string getGFIBaseUrl() ;
570  std::string getGFILayers() ;
579  std::string getGFIQueryLayers() ;
588  std::string getGFIService() ;
597  std::string getGFIVersion() ;
606  std::string getGFIExtraParams() ;
615  bool getGFIForceEPSG() ;
622  ~Layer();
623 
624 };
625 
626 #endif /* LAYER_H_ */
AttributionURL
Gestion des éléments d'attribution des documents de capacités.
Definition: AttributionURL.h:63
Layer::getWMSCRSList
std::vector< CRS * > getWMSCRSList()
Retourne la liste des systèmes de coordonnées authorisés.
Definition: Layer.cpp:785
Layer::getGeographicBoundingBox
BoundingBox< double > getGeographicBoundingBox()
Retourne l'emprise des données en coordonnées géographique (WGS84)
Definition: Layer.cpp:804
WmtsTmsInfos
Definition: Layer.h:66
Layer::getGFIBaseUrl
std::string getGFIBaseUrl()
Retourne l'URL du service de GFI.
Definition: Layer.cpp:809
AttributionURL.h
Définition de la classe AttributionURL gérant les liens vers les métadonnées dans les documents de ca...
Layer::getAbstract
std::string getAbstract()
Retourne le résumé
Definition: Layer.cpp:729
Layer::getGFIForceEPSG
bool getGFIForceEPSG()
Definition: Layer.cpp:815
Layer::getDataPyramid
Pyramid * getDataPyramid()
Retourne la pyramide de données associée.
Definition: Layer.cpp:736
Layer::getMinRes
double getMinRes()
Retourne l'échelle minimum.
Definition: Layer.cpp:735
Layer::getGFIType
std::string getGFIType()
Retourne la source du GFI.
Definition: Layer.cpp:808
Layer::getTms
TileMatrixSet * getTms(std::string id)
Récupère le TMS disponible sur la couche par l'identifiant.
Definition: Layer.cpp:747
Layer::Layer
Layer(std::string path, ServicesConf *servicesConf)
Constructeur.
Definition: Layer.cpp:608
Layer::getId
std::string getId()
Retourne l'indentifiant de la couche.
Definition: Layer.cpp:715
Layer::getGFILayers
std::string getGFILayers()
Retourne le paramètre layers de la requête de GFI.
Definition: Layer.cpp:811
Layer::getKeyWords
std::vector< Keyword > * getKeyWords()
Retourne la liste des mots-clés.
Definition: Layer.cpp:733
MetadataURL.h
Définition de la classe MetadataURL gérant les liens vers les métadonnées dans les documents de capac...
Layer::getTitle
std::string getTitle()
Retourne le titre.
Definition: Layer.cpp:784
Layer
Gestion des couches.
Definition: Layer.h:95
Layer::getWMSAuthorized
bool getWMSAuthorized()
Retourne le droit d'utiliser un service WMS.
Definition: Layer.cpp:730
Layer::getWMTSTMSList
std::vector< WmtsTmsInfos > getWMTSTMSList()
Retourne la liste des TMS disponibles.
Definition: Layer.cpp:746
Layer::getAttribution
AttributionURL * getAttribution()
Retourne l'attribution.
Definition: Layer.cpp:803
Layer::getMaxRes
double getMaxRes()
Retourne l'échelle maximum.
Definition: Layer.cpp:734
Layer::getNativeWmtsTmsId
std::string getNativeWmtsTmsId()
Retourne l'ID WMTS du TMS natif de la pyramide de données associée.
Definition: Layer.cpp:816
Layer::getStyleByIdentifier
Style * getStyleByIdentifier(std::string identifier)
Retourne le style associé à la couche (identifiant public)
Definition: Layer.cpp:776
Layer::getGFIVersion
std::string getGFIVersion()
Retourne la version du service de GFI.
Definition: Layer.cpp:814
Layer::getWMTSAuthorized
bool getWMTSAuthorized()
Retourne le droit d'utiliser un service WMTS.
Definition: Layer.cpp:732
Layer::getTmLimits
TileMatrixLimits * getTmLimits(TileMatrixSet *tms, TileMatrix *tm)
Retourne les limites pour le niveau du TMS fourni.
Definition: Layer.cpp:755
Layer::getGFIExtraParams
std::string getGFIExtraParams()
Retourne les paramètres de requête additionnels de la requête de GFI.
Definition: Layer.cpp:810
Layer::getStyles
std::vector< Style * > getStyles()
Retourne la liste des styles associés à la couche.
Definition: Layer.cpp:744
ServicesConf
Definition: ServicesConf.h:54
Layer::getBoundingBox
BoundingBox< double > getBoundingBox()
Retourne l'emprise des données dans le système de coordonnées natif.
Definition: Layer.cpp:805
Layer::~Layer
~Layer()
Destructeur par défaut.
Definition: Layer.cpp:719
Layer::getTMSAuthorized
bool getTMSAuthorized()
Retourne le droit d'utiliser un service TMS.
Definition: Layer.cpp:731
Layer::getMetadataURLs
std::vector< MetadataURL > getMetadataURLs()
Retourne la liste des métadonnées associées.
Definition: Layer.cpp:806
Layer::isInWMSCRSList
bool isInWMSCRSList(CRS *c)
Teste la présence du CRS dans la liste.
Definition: Layer.cpp:786
Layer::getGFIQueryLayers
std::string getGFIQueryLayers()
Retourne le paramètre query_layers de la requête de GFI.
Definition: Layer.cpp:812
Layer::getDefaultStyle
Style * getDefaultStyle()
Retourne le style par défaut associé à la couche.
Definition: Layer.cpp:737
Layer::getbbox
Image * getbbox(ServicesConf *servicesConf, BoundingBox< double > bbox, int width, int height, CRS *dst_crs, int dpi, int &error)
Retourne une l'image correspondant à l'emprise demandée.
Definition: Layer.cpp:707
Layer::getGFIService
std::string getGFIService()
Retourne le type du service de GFI.
Definition: Layer.cpp:813
Layer::isGetFeatureInfoAvailable
bool isGetFeatureInfoAvailable()
GFI est-il autorisé
Definition: Layer.cpp:807
Layer::getStyle
Style * getStyle(std::string id)
Retourne le style associé à la couche (identifiant interne)
Definition: Layer.cpp:768