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
LayerRasterImpl.hpp
1 // Copyright 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef LAYERRASTERGDAL_HPP_INCLUDED
5 #define LAYERRASTERGDAL_HPP_INCLUDED
6 
7 #include <gdal_priv.h>
8 #include <gdal.h>
9 
10 #include <string>
11 #include <vector>
12 
13 #include <boost/thread/mutex.hpp>
14 
15 #include "fire/plugin-impl/connection/rasterImpl/Driver.hpp"
16 #include <fire/source/raster/DriverType.hpp>
17 #include <fire/source/raster/LayerRaster.hpp>
18 #include <fire/gear/geom/MultiPolygon.hpp>
19 #include <fire/gis/data/Size.hpp>
20 #include <boost/thread/condition_variable.hpp>
21 
22 #include "fire/plugin-impl/export.hpp"
23 
24 namespace fire {
25 namespace connection {
26 namespace rasterImpl {
30 class FIRE_PLUGIN_DLL LayerRasterImpl : public source::raster::LayerRaster {
31  public:
32  // LayerRasterImpl();
37  explicit LayerRasterImpl(std::string& filename);
41  ~LayerRasterImpl();
46  const Driver &getDriver() const;
51  const gear::geom::Envelope::EnvelopeShp getExtent() const;
56  const std::string getName() const;
61  const std::string getMime() const;
66  const int getSrid() const;
71  const fire::gis::data::Size getPixelSize() const;
76  const int getBandCount() const;
85  void getBandValuesAt(gear::geom::Envelope::EnvelopeShp envelope, const gis::data::Size& step, const source::raster::InterpolationType::InterpolationType& interptype, const std::vector< int >& bandindexes, std::vector< double >& band_values);
94  void getBandValuesAt(double geoX, double geoY, const source::raster::InterpolationType::InterpolationType& interptype, const std::vector<int> &bandindexes, std::vector< double >& band_values);
99  void setMask(gear::geom::MultiPolygon multipolygon);
104  const source::raster::DriverType::DriverType getDriverType() const;
109  void getNodatavalue(std::vector<double>& nodatavalues) const;
114  void setNodatavalue(double newValue);
115 
116  private:
121  bool _openIf() const;
126  bool _closeIf() const;
130  void _computeNodatavalue() const;
134  void _computeExtent() const;
138  void _computeSrid() const;
144  bool _fileExists(std::string& name) const;
149  const int _getBandCountNoWait() const;
158  void _getBandValuesAtNoWait(double geoX, double geoY, const source::raster::InterpolationType::InterpolationType& interptype, const std::vector<int> &bandindexes, std::vector< double >& band_values);
159  // std::string _SanitizeSRS( std::string pszUserInput );
160 
161  std::string _filepath;
162  mutable int _srid;
163  mutable bool _opened;
164  mutable GDALDatasetH _datasetH;
165  mutable GDALDataset* _dataset;
166  mutable std::auto_ptr< Driver > _driver;
167  mutable fire::gear::geom::Envelope::EnvelopeShp _envelope;
169  mutable gear::geom::Geometry* _intersectionMask;
170  mutable std::vector< double > _nodataValues;
171  mutable boost::mutex _mtx;
172 };
173 
174 } // namespace rasterImpl
175 } // namespace connection
176 } // namespace fire
177 
178 #endif
Definition: EnvelopeSh.hpp:18
Definition: Driver.hpp:19
Definition: LayerRaster.hpp:26
Definition: Geometry.hpp:69
Classe LayerRasterImpl -.
Definition: LayerRasterImpl.hpp:30
Definition: MultiPolygon.hpp:48
Classe contenente le informazioni di dimensione.
Definition: Size.hpp:20