I get geo coords in lon and lat, like NorthWest and SouthEast lon/lat. So, when I got them I translating into metric system. So here I get my first rectangle with north_west and south_east coords, then I have bounding-rectangle in same metric system with north, south, west and east coords. And I needed check this two rect on intersection within edges touch, what I wrote:
bool filter(TilePosition const& tile_position) const noexcept override
{
MetricBoundingBox tile_bounds{tile_position};
bool cond1 = (tile_bounds.north <= south_east_.lon);
bool cond2 = (tile_bounds.south >= north_west_.lon);
bool cond3 = (tile_bounds.west <= south_east_.lat);
bool cond4 = (tile_bounds.east >= north_west_.lat);
return cond1 && cond2 && cond3 && cond4;
}
And I'm not sure if I did it right? My requirement is if the borders of the second rect intersect with the borders of the first rect, then the second must be left. Else, filter.