| 109 | |
| 110 | |
| 111 | void CropFilter::initialize() |
| 112 | { |
| 113 | // Set geometry from polygons. |
| 114 | if (m_args->m_polys.size()) |
| 115 | { |
| 116 | m_geoms.clear(); |
| 117 | for (Polygon& poly : m_args->m_polys) |
| 118 | { |
| 119 | // Throws if invalid. |
| 120 | poly.valid(); |
| 121 | m_geoms.emplace_back(poly); |
| 122 | } |
| 123 | } |
| 124 | // Add geometry from OGR specification |
| 125 | |
| 126 | for (const Polygon& poly : m_args->m_ogr.getPolygons()) |
| 127 | { |
| 128 | m_geoms.push_back(poly); |
| 129 | } |
| 130 | |
| 131 | m_boxes.clear(); |
| 132 | for (auto& bound : m_args->m_bounds) |
| 133 | m_boxes.push_back(bound); |
| 134 | |
| 135 | m_distance2 = m_args->m_distance * m_args->m_distance; |
| 136 | } |
| 137 | |
| 138 | |
| 139 | void CropFilter::ready(PointTableRef table) |
nothing calls this directly
no test coverage detected