2 #include "../../../../common/StringUtils.h" 3 #include "../../../../common/Enums.h" 4 #include "../../../core/Exception.h" 5 #include "../../../../core/translator/Translator.h" 6 #include "../../../../dataaccess/datasource/DataSource.h" 7 #include "../../../../dataaccess/datasource/DataSourceFactory.h" 8 #include "../../../../dataaccess/datasource/DataSourceTransactor.h" 9 #include "../../../../dataaccess/dataset/DataSet.h" 10 #include "../../../../raster/BandProperty.h" 11 #include "../../../../raster/Grid.h" 12 #include "../../../../raster/Raster.h" 13 #include "../../../../raster/RasterFactory.h" 14 #include "../../../../geometry/Envelope.h" 15 #include "../../../../gdal/Utils.h" 18 #include <gdal_priv.h> 19 #include <gdalwarper.h> 21 #include <ogr_spatialref.h> 22 #include <ogrsf_frmts.h> 27 const int &width,
const int &height)
60 std::string epsgCode =
"EPSG:" + std::to_string(srid);
63 boundingBox.
m_crs = epsgCode;
71 request.
m_srs = epsgCode;
75 std::string format = request.
m_format;
79 if(formatSplit.size() != 2)
84 format = formatSplit[1];
87 std::string filename = wmsLayer->
getId() +
"." + format;
89 std::string filePath = wmsLayer->
saveGetMap(filename);
91 std::map<std::string, std::string> memRInfo;
92 memRInfo[
"URI"] = filePath;
126 std::string format = request.
m_format;
130 if (formatSplit.size() != 2)
135 format = formatSplit[1];
138 std::string filename = wmsLayer->
getId() +
"." + format;
140 std::string filePath = wmsLayer->
saveGetMap(filename);
142 std::map<std::string, std::string> memRInfo;
143 memRInfo[
"URI"] = filePath;
virtual const std::string & getId() const
It returns the layer id.
TECOMMONEXPORT std::vector< std::string > SplitString(const std::string &str, const char &delimiter)
This XML Schema Document named xlinks xsd has been stored here based on the change request
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
TEOGCWMSDATAACCESSEXPORT te::rst::Raster * GetLayerMapRaster(const WMSLayer *wmsLayer)
const double & getUpperRightX() const
It returns a constant refernce to the x coordinate of the upper right corner.
const double & getLowerLeftY() const
It returns a constant refernce to the y coordinate of the lower left corner.
void setGeoreference(const te::gm::Coord2D &ulLocation, int srid, double resX, double resY)
Sets the information needed to georeference the grid.
const double & getUpperRightY() const
It returns a constant refernce to the x coordinate of the upper right corner.
#define TE_TR(message)
It marks a string in order to get translated.
boost::error_info< struct tag_error_description, std::string > ErrorDescription
The base type for error report messages.
TEOGCWMSDATAACCESSEXPORT WMSGetMapResponse GetMap(WMSLayer *wmsLayer, const te::gm::Envelope &box, const int &width, const int &height)
BoundingBox m_boundingBox
An Envelope defines a 2D rectangular region.
An abstract class for raster data strucutures.
TEOGCWMSDATAACCESSEXPORT te::rst::Raster * GetMapRaster(WMSLayer *wmsLayer, const int &srid, const te::gm::Envelope &box, const int &width, const int &height)
unsigned int getNumberOfRows() const
Returns the raster number of rows.
const double * getGeoreference() const
Returns a list of 6 coefficients describing an affine transformation to georeference a grid...
The WMSGetMapResponse WMS 1.3.0 struct.
void setGetMapRequest(const te::ws::ogc::wms::WMSGetMapRequest &getMapRequest)
A layer with reference to a WMS Layer.
Grid * getGrid()
It returns the raster grid.
te::ws::ogc::wms::WMSGetMapRequest getRequest() const
Base exception class for WS Core Runtime Library.
const std::string saveGetMap(const std::string &filename) const
It execute a WMS GetMap and save the result image on disk. The request will be based on WMSGetMapRequ...
const double & getLowerLeftX() const
It returns a constant reference to the x coordinate of the lower left corner.
virtual int getSRID() const
It returns the Spatial Reference System ID associated to the Layer.
A rectified grid is the spatial support for raster data.
Utilitary functions to access GDAL and match some of its concepts to TerraLib concepts.
The WMSGetMapRequest WMS 1.3.0 struct.
static Raster * open(const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)
It opens a raster with the given parameters and default raster driver.
const te::ws::ogc::wms::WMSGetMapResponse getMap() const
It gets a WMS GetMap response with the image on a buffer. The request will be based on WMSGetMapReque...
The BoundingBox WMS 1.3.0 struct.