29 #include "../geometry.h" 30 #include "../common/STLUtils.h" 31 #include "../core/translator/Translator.h" 38 unsigned int& firstTile,
unsigned int& lastTile)
const 88 const std::size_t tileIndexSize = rhs.
m_tileIndex.size();
90 for( std::size_t tileIndexIdx = 0 ; tileIndexIdx < tileIndexSize ; ++tileIndexIdx )
108 unsigned int total_tiles_number = 1 +
111 for(
unsigned int i = 0; i < total_tiles_number; i++)
150 unsigned int numSegments = num_points - 1;
152 for(
unsigned int j = 0; j < numSegments; j++)
155 std::pair<unsigned int, unsigned int> segPointer(ri, j);
158 unsigned int firstTileIndex = 0;
159 unsigned int lastTileIndex = 0;
161 std::unique_ptr<te::gm::Point> cj(
163 std::unique_ptr<te::gm::Point> cjp1(
166 if(
getTileIndex(*cj, *cjp1, firstTileIndex, lastTileIndex) )
169 for(
unsigned int k = firstTileIndex; k <= lastTileIndex; k++)
278 if (m_within_coef1 - m_within_coef2 == 0)
std::size_t getNumRings() const
It returns the number of rings in this CurvePolygon.
bool getTile(const double &y, TileSegIndex **index) const
Gets tile index.
An exception class for the Raster module.
te::gm::Coord2D m_withinVtx1
te::gm::Coord2D m_withinVtx0
~TileIndexer()
Destructor.
const te::gm::Polygon & m_referencePolygon
Reference polygon.
Polygon tile indexing class for optmized geometrical relational tests.
te::gm::LinearRing const * m_withinRingPtr
bool within(const te::gm::Point &geometry) const
It returns true if the given geometry is within the indexed reference polygon.
bool addRing(const unsigned int &ri)
Update the tile index with the information of the supplied ring.
Base exception class for plugin module.
const double & getLowerLeftY() const
It returns a constant refernce to the y coordinate of the lower left corner.
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.
bool getTileIndex(const te::gm::Point &p1, const te::gm::Point &p2, unsigned int &firstTile, unsigned int &lastTile) const
Gets tile index intervals in y direction for a given segment.
const double & getY(std::size_t i) const
It returns the n-th y coordinate value.
bool withinOrTouches(const te::gm::Point &geometry) const
It returns true if the given geometry is within or touches the indexed reference polygon.
A LinearRing is a LineString that is both closed and simple.
std::size_t getNPoints() const
it returns the number of points (vertexes) in the geometry.
const double & getY() const
It returns the Point y-coordinate value.
A point with x and y coordinate values.
const Envelope * getMBR() const _NOEXCEPT_OP(true)
It returns the minimum bounding rectangle for the geometry in an internal representation.
const double & getX(std::size_t i) const
It returns the n-th x coordinate value.
Polygon tile indexing class for optmized geometrical relational tests.
double m_dy
Tile resolution along "y" axis.
TileIndexer * clone() const
Returns a clone of this instance (the caller of this method must thake the ownership of the returned ...
TileSegIndex * m_withinTileIndexPtr
void clear()
Clear all internal resources.
TileIndexer(const TileIndexer &)
Constructor.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
std::vector< TileSegIndex * > m_tileIndex
Each tile segments index vector.
std::vector< std::pair< unsigned int, unsigned int > > TileSegIndex
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
double getHeight() const
It returns the envelope height.
const double & getX() const
It returns the Point x-coordinate value.
void init()
Init internal variables.