32 #include "../../../maptools/Canvas.h"
33 #include "terralib4/terralib/kernel/TeDefines.h"
34 #include "../../../srs/SpatialReferenceSystemManager.h"
35 #include "../../../common/StringUtils.h"
58 notifyAll(contextNotify);
72 if(m_layer->getId() == layer->getId())
93 if(m_layer.get() == 0)
98 int srid = m_layer->getSRID();
106 std::string nameUnit = unitPtr->getName();
115 wMM = m_box.getWidth();
116 fx = m_box.getWidth()/worldBox.
getWidth();
117 fy = m_box.getHeight()/worldBox.
getHeight();
122 area = (int)(factor * worldBox.
getWidth() + .5);
127 area = (int)(factor * worldBox.
getHeight() + .5);
130 if (nameUnit.compare(
"METRE") == 0)
132 else if (nameUnit.compare(
"KILOMETRE") == 0)
134 else if (nameUnit.compare(
"FOOT") == 0)
136 else if (nameUnit.compare(
"DEGREE") == 0)
139 return (1. / factor ) /(wMM / area);
149 if(m_layer.get() == 0)
153 worldBox = m_layer->getExtent();
154 int srid = m_layer->getSRID();
162 std::string unitPtrStr = unitPtr->getName();
165 if(unitPtrStr.compare(
"DEGREE") == 0)
168 int meridiano = (int)(longitude / 6);
169 meridiano = meridiano * 6;
170 meridiano = abs(meridiano) + 3;
172 double long0 = -meridiano * TeCDR;
175 int zone = ((int)((long0*TeCRD+183.0)/6.0));
177 std::string proj4 = proj4DescToPlanar(zone);
183 worldBox.
transform(srid, projMeters.second);
199 int srid = m_layer->getSRID();
202 std::string authName =
"EPSG";
216 if(m_layer.get() == 0)
220 worldBox = m_layer->getExtent();
221 int srid = m_layer->getSRID();
229 std::string unitPtrStr = unitPtr->getName();
232 if(unitPtrStr.compare(
"DEGREE") != 0)
234 std::string proj4 = proj4DescToGeodesic();
240 worldBox.
transform(srid, projMeters.second);
264 std::stringstream szone;
267 std::string proj4 =
"+proj=utm";
268 proj4+=
" +zone="+ szone.str();
270 proj4+=
" +ellps=intl";
271 proj4+=
" +towgs84=-206,172,-6,0,0,0,0";
273 proj4+=
" +no_defs ";
281 proj4 +=
"+proj=longlat";
282 proj4 +=
" +ellps=aust_SA";
283 proj4 +=
" +towgs84=-57,1,-41,0,0,0,0";
284 proj4 +=
" +no_defs ";
virtual te::gm::Envelope getWorldInMeters()
virtual double getScale()
void setPixmap(te::color::RGBAColor **pixmap)
virtual te::gm::Envelope getWorldInDegrees()
std::string Convert2UCase(const std::string &value)
It converts a string to upper case.
double getWidth() const
It returns the envelope width.
virtual void updateProperties(te::layout::Properties *properties)
virtual void updateProperties(te::layout::Properties *properties)
Coord2D getCenter() const
It returns the rectangle's center coordinate.
static SpatialReferenceSystemManager & getInstance()
It returns a reference to the singleton instance.
An Envelope defines a 2D rectangular region.
virtual te::map::AbstractLayerPtr getLayer()
boost::shared_ptr< UnitOfMeasure > UnitOfMeasurePtr
virtual void draw(ContextItem context)
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
virtual bool refreshLayer(te::map::AbstractLayerPtr layer)
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
void transform(int oldsrid, int newsrid)
It will transform the coordinates of the Envelope from the old SRS to the new one.
virtual te::common::UnitOfMeasurePtr unitMeasureLayer()
double getHeight() const
It returns the envelope height.
std::string proj4DescToPlanar(int zone)
std::string proj4DescToGeodesic()