提交 5e21a065 编写于 作者: A Alexey Milovidov

Added bounding box

上级 4deb6959
...@@ -107,7 +107,7 @@ private: ...@@ -107,7 +107,7 @@ private:
/// Simple algorithm with bounding box. /// Simple algorithm with bounding box.
template <typename Strategy, typename CoordinateType> template <typename CoordinateType>
class PointInPolygon class PointInPolygon
{ {
public: public:
...@@ -136,7 +136,7 @@ public: ...@@ -136,7 +136,7 @@ public:
if (!boost::geometry::within(point, box)) if (!boost::geometry::within(point, box))
return false; return false;
return boost::geometry::covered_by(point, polygon, strategy); return boost::geometry::covered_by(point, polygon);
} }
UInt64 getAllocatedBytes() const { return sizeof(*this); } UInt64 getAllocatedBytes() const { return sizeof(*this); }
...@@ -145,7 +145,6 @@ private: ...@@ -145,7 +145,6 @@ private:
const Polygon & polygon; const Polygon & polygon;
Box box; Box box;
bool has_empty_bound = false; bool has_empty_bound = false;
Strategy strategy;
}; };
......
...@@ -260,11 +260,20 @@ private: ...@@ -260,11 +260,20 @@ private:
} }
template <typename T> template <typename T>
void parsePolygonPart(const IColumn & x_column, const IColumn & y_column, size_t begin, size_t end, T & out_container) const void parsePolygonPart(
const IColumn & x_column,
const IColumn & y_column,
size_t begin,
size_t end,
T & out_container) const
{ {
out_container.reserve(end - begin); out_container.reserve(end - begin);
for (size_t i = begin; i < end; ++i) for (size_t i = begin; i < end; ++i)
out_container.emplace_back(x_column.getFloat64(i), y_column.getFloat64(i)); {
Float64 x = x_column.getFloat64(i);
Float64 y = y_column.getFloat64(i);
out_container.emplace_back(x, y);
}
} }
void parsePolygonFromSingleColumn1D(const IColumn & column, size_t i, Polygon & out_polygon) const void parsePolygonFromSingleColumn1D(const IColumn & column, size_t i, Polygon & out_polygon) const
...@@ -372,7 +381,7 @@ private: ...@@ -372,7 +381,7 @@ private:
void registerFunctionPointInPolygon(FunctionFactory & factory) void registerFunctionPointInPolygon(FunctionFactory & factory)
{ {
factory.registerFunction<FunctionPointInPolygon<PointInPolygonWithGrid<Float64>, PointInPolygonTrivial<Float64>>>(); factory.registerFunction<FunctionPointInPolygon<PointInPolygonWithGrid<Float64>, PointInPolygon<Float64>>>();
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册