diff --git a/dbms/src/Functions/FunctionsGeo.cpp b/dbms/src/Functions/FunctionsGeo.cpp index 8240cf6e68a2e1dea2053efdc9e45b55326cdd67..90f573242958429db747b6466372c2cd9ee295b9 100644 --- a/dbms/src/Functions/FunctionsGeo.cpp +++ b/dbms/src/Functions/FunctionsGeo.cpp @@ -31,7 +31,6 @@ namespace ErrorCodes extern const int ILLEGAL_TYPE_OF_ARGUMENT; } -#if USE_POINT_IN_POLYGON namespace FunctionPointInPolygonDetail { @@ -272,18 +271,15 @@ template <> const char * FunctionPointInPolygon::name = "pointInPolygonFranklin"; template <> const char * FunctionPointInPolygon::name = "pointInPolygon"; -#endif void registerFunctionsGeo(FunctionFactory & factory) { factory.registerFunction(); factory.registerFunction(); -#if USE_POINT_IN_POLYGON factory.registerFunction>(); factory.registerFunction>(); factory.registerFunction>(); factory.registerFunction>(); -#endif } } diff --git a/dbms/src/Functions/GeoUtils.h b/dbms/src/Functions/GeoUtils.h index 64cf97c3c712a7c3e707d7be4d169b63b5e86f96..4d392a2a1d356a527da7399b47e7daf7c20fbc5b 100644 --- a/dbms/src/Functions/GeoUtils.h +++ b/dbms/src/Functions/GeoUtils.h @@ -19,11 +19,6 @@ #pragma GCC diagnostic pop #endif -#if __clang__ && __clang_major__ <= 4 -#else -#define USE_POINT_IN_POLYGON 1 -#endif - #include #include #include @@ -83,7 +78,6 @@ UInt64 getMultiPolygonAllocatedBytes(const MultiPolygon & multi_polygon) return size; } -#if USE_POINT_IN_POLYGON template class PointInPolygonWithGrid { @@ -553,7 +547,7 @@ struct CallPointInPolygon template static ColumnPtr call(const IColumn & x, const IColumn & y, PointInPolygonImpl && impl) { - using Impl = typename ApplyTypeListForClass::Type; + using Impl = typename ApplyTypeListForClass<::DB::GeoUtils::CallPointInPolygon, TypeListNumbers>::Type; if (auto column = typeid_cast *>(&x)) return Impl::template call(*column, y, impl); return CallPointInPolygon::call(x, y, impl); @@ -579,12 +573,10 @@ struct CallPointInPolygon<> template ColumnPtr pointInPolygon(const IColumn & x, const IColumn & y, PointInPolygonImpl && impl) { - using Impl = typename ApplyTypeListForClass::Type; + using Impl = typename ApplyTypeListForClass<::DB::GeoUtils::CallPointInPolygon, TypeListNumbers>::Type; return Impl::call(x, y, impl); } -#endif - /// Total angle (signed) between neighbor vectors in linestring. Zero if linestring.size() < 2. template float calcLinestringRotation(const Linestring & points)