diff --git a/src/Functions/geometryConverters.h b/src/Functions/geometryConverters.h index f2706c70e3e..c90e6861b85 100644 --- a/src/Functions/geometryConverters.h +++ b/src/Functions/geometryConverters.h @@ -1,12 +1,7 @@ #pragma once -#include #include -#include -#include -#include - #include #include #include @@ -14,12 +9,10 @@ #include #include #include +#include #include #include -#include -#include - namespace DB { @@ -29,26 +22,6 @@ namespace ErrorCodes extern const int ILLEGAL_TYPE_OF_ARGUMENT; } -template -using Ring = boost::geometry::model::ring; - -template -using Polygon = boost::geometry::model::polygon; - -template -using MultiPolygon = boost::geometry::model::multi_polygon>; - -using CartesianPoint = boost::geometry::model::d2::point_xy; -using CartesianRing = Ring; -using CartesianPolygon = Polygon; -using CartesianMultiPolygon = MultiPolygon; - -/// Latitude, longitude -using SphericalPoint = boost::geometry::model::point>; -using SphericalRing = Ring; -using SphericalPolygon = Polygon; -using SphericalMultiPolygon = MultiPolygon; - /** * Class which takes converts Column with type Tuple(Float64, Float64) to a vector of boost point type. * They are (x,y) in case of cartesian coordinated and (lon,lat) in case of Spherical. diff --git a/src/Functions/geometryTypes.h b/src/Functions/geometryTypes.h new file mode 100644 index 00000000000..20344423db5 --- /dev/null +++ b/src/Functions/geometryTypes.h @@ -0,0 +1,33 @@ +#pragma once + +#include + +#include +#include +#include +#include "common/types.h" + +namespace DB +{ + +template +using Ring = boost::geometry::model::ring; + +template +using Polygon = boost::geometry::model::polygon; + +template +using MultiPolygon = boost::geometry::model::multi_polygon>; + +using CartesianPoint = boost::geometry::model::d2::point_xy; +using CartesianRing = Ring; +using CartesianPolygon = Polygon; +using CartesianMultiPolygon = MultiPolygon; + +/// Latitude, longitude +using SphericalPoint = boost::geometry::model::point>; +using SphericalRing = Ring; +using SphericalPolygon = Polygon; +using SphericalMultiPolygon = MultiPolygon; + +} diff --git a/src/Functions/mercatorConverters.cpp b/src/Functions/mercatorConverters.cpp new file mode 100644 index 00000000000..321ad83c16c --- /dev/null +++ b/src/Functions/mercatorConverters.cpp @@ -0,0 +1,111 @@ +#include + +#include + +namespace DB +{ + + +namespace +{ + +constexpr double PI = 3.14159265358979323846; + +constexpr double epsilon = 1e-4; + +/// Convert angle from degrees to radians. +double deg_to_rad(double degree) { + return (degree - epsilon) * (PI / 180.0); +} + +/// Convert angle from radians to degrees. +double rad_to_deg(double radians) { + return radians * (180.0 / PI); +} + +double earth_radius_for_epsg3857 = 6378137.0; +// constexpr double max_coordinate_epsg3857 = 20037508.34; + + +double lon_to_x(double lon) { + return earth_radius_for_epsg3857 * deg_to_rad(lon); +} + +// canonical log(tan()) version +double lat_to_y_with_tan(double lat) { // not constexpr because math functions aren't + return earth_radius_for_epsg3857 * std::log(std::tan(PI/4 + deg_to_rad(lat)/2)); +} + +double x_to_lon(double x) { + return rad_to_deg(x) / earth_radius_for_epsg3857; +} + +double y_to_lat(double y) { // not constexpr because math functions aren't + return rad_to_deg(2 * std::atan(std::exp(y / earth_radius_for_epsg3857)) - PI/2); +} + +} + + +void PointMercatorConverter::forward(CartesianPoint & point) +{ + point.x(lon_to_x(point.template get<0>())); + point.y(lat_to_y_with_tan(point.template get<1>())); +} + + +void RingMercatorConverter::forward(CartesianRing & ring) +{ + for (auto & point : ring) + PointMercatorConverter::forward(point); +} + +void PolygonMercatorConverter::forward(CartesianPolygon & polygon) +{ + RingMercatorConverter::forward(polygon.outer()); + for (auto & hole : polygon.inners()) + RingMercatorConverter::forward(hole); +} + +void MultiPolygonMercatorConverter::forward(CartesianMultiPolygon & multipolygon) +{ + for (auto & polygon : multipolygon) + { + RingMercatorConverter::forward(polygon.outer()); + for (auto & hole : polygon.inners()) + RingMercatorConverter::forward(hole); + } +} + +void PointMercatorConverter::backward(CartesianPoint & point) +{ + point.x(x_to_lon(point.template get<0>())); + point.y(y_to_lat(point.template get<1>())); +} + + +void RingMercatorConverter::backward(CartesianRing & ring) +{ + for (auto & point : ring) + PointMercatorConverter::backward(point); +} + +void PolygonMercatorConverter::backward(CartesianPolygon & polygon) +{ + RingMercatorConverter::backward(polygon.outer()); + for (auto & hole : polygon.inners()) + RingMercatorConverter::backward(hole); +} + +void MultiPolygonMercatorConverter::backward(CartesianMultiPolygon & multipolygon) +{ + for (auto & polygon : multipolygon) + { + RingMercatorConverter::backward(polygon.outer()); + for (auto & hole : polygon.inners()) + RingMercatorConverter::backward(hole); + } +} + +} + diff --git a/src/Functions/mercatorConverters.h b/src/Functions/mercatorConverters.h new file mode 100644 index 00000000000..802370f4c16 --- /dev/null +++ b/src/Functions/mercatorConverters.h @@ -0,0 +1,85 @@ +#pragma once + +#include +#include + +namespace ErrorCodes +{ + extern const int LOGICAL_ERROR; +} + +namespace DB +{ + +/// It must work only with CartesianPoint +class PointMercatorConverter +{ +public: + static void forward(CartesianPoint & point); + static void backward(CartesianPoint & point); +}; + + +class RingMercatorConverter +{ +public: + static void forward(CartesianRing & ring); + static void backward(CartesianRing & ring); +}; + + +class PolygonMercatorConverter +{ +public: + static void forward(CartesianPolygon & polygon); + static void backward(CartesianPolygon & polygon); +}; + + + +class MultiPolygonMercatorConverter +{ +public: + static void forward(CartesianMultiPolygon & polygon); + static void backward(CartesianMultiPolygon & polygon); +}; + + +struct PType +{ + using Type = PType; +}; + + +template +void mercatorForward(Geometry & geometry) +{ + if constexpr (std::is_same_v) + return PointMercatorConverter::forward(geometry); + else if constexpr (std::is_same_v) + return RingMercatorConverter::forward(geometry); + else if constexpr (std::is_same_v) + return PolygonMercatorConverter::forward(geometry); + else if constexpr (std::is_same_v) + return MultiPolygonMercatorConverter::forward(geometry); + else + throw Exception("Unknown geometry type", ErrorCodes::LOGICAL_ERROR); +} + + +template +void mercatorBackward(Geometry & geometry) +{ + if constexpr (std::is_same_v) + return PointMercatorConverter::backward(geometry); + else if constexpr (std::is_same_v) + return RingMercatorConverter::backward(geometry); + else if constexpr (std::is_same_v) + return PolygonMercatorConverter::backward(geometry); + else if constexpr (std::is_same_v) + return MultiPolygonMercatorConverter::backward(geometry); + else + throw Exception("Unknown geometry type", ErrorCodes::LOGICAL_ERROR); +} + +} diff --git a/src/Functions/polygonArea.cpp b/src/Functions/polygonArea.cpp index fb1ba7c4a01..407d9e96a53 100644 --- a/src/Functions/polygonArea.cpp +++ b/src/Functions/polygonArea.cpp @@ -1,22 +1,6 @@ #include #include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - namespace DB { diff --git a/src/Functions/polygonConvexHull.cpp b/src/Functions/polygonConvexHull.cpp index 5f545cf8ea1..95c6453b84b 100644 --- a/src/Functions/polygonConvexHull.cpp +++ b/src/Functions/polygonConvexHull.cpp @@ -1,22 +1,6 @@ #include #include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - namespace DB { diff --git a/src/Functions/polygonPerimeter.cpp b/src/Functions/polygonPerimeter.cpp index c3aadbd187a..36af2927ade 100644 --- a/src/Functions/polygonPerimeter.cpp +++ b/src/Functions/polygonPerimeter.cpp @@ -1,22 +1,6 @@ #include #include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - namespace DB { namespace ErrorCodes diff --git a/src/Functions/polygonsDistance.cpp b/src/Functions/polygonsDistance.cpp index 074fb5a9798..e05ff3f7f36 100644 --- a/src/Functions/polygonsDistance.cpp +++ b/src/Functions/polygonsDistance.cpp @@ -1,24 +1,6 @@ #include #include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - namespace DB { diff --git a/src/Functions/polygonsEquals.cpp b/src/Functions/polygonsEquals.cpp index 12f4cf09fa5..b5c3129a616 100644 --- a/src/Functions/polygonsEquals.cpp +++ b/src/Functions/polygonsEquals.cpp @@ -1,24 +1,6 @@ #include #include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - namespace DB { namespace ErrorCodes diff --git a/src/Functions/polygonsIntersection.cpp b/src/Functions/polygonsIntersection.cpp index 0de3d023044..3f0b67ed722 100644 --- a/src/Functions/polygonsIntersection.cpp +++ b/src/Functions/polygonsIntersection.cpp @@ -1,22 +1,6 @@ #include #include - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include namespace DB { @@ -26,11 +10,29 @@ namespace ErrorCodes extern const int ILLEGAL_TYPE_OF_ARGUMENT; } -template +struct IntersectionCartesian +{ + static inline const char * name = "polygonsIntersectionCartesian"; + using Point = CartesianPoint; +}; + +struct IntersectionSpherical +{ + static inline const char * name = "polygonsIntersectionSpherical"; + using Point = SphericalPoint; +}; + +struct IntersectionMercator +{ + static inline const char * name = "polygonsIntersectionMercator"; + using Point = CartesianPoint; +}; + +template class FunctionPolygonsIntersection : public IFunction { public: - static inline const char * name; + static inline const char * name = Holder::name; explicit FunctionPolygonsIntersection() = default; @@ -62,6 +64,8 @@ public: ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & /*result_type*/, size_t input_rows_count) const override { + using Point = typename Holder::Point; + MultiPolygonSerializer serializer; callOnTwoGeometryDataTypes(arguments[0].type, arguments[1].type, [&](const auto & left_type, const auto & right_type) @@ -87,10 +91,19 @@ public: boost::geometry::correct(first[i]); boost::geometry::correct(second[i]); + if constexpr (std::is_same_v) + { + mercatorForward(first[i]); + mercatorForward(second[i]); + } + MultiPolygon intersection{}; /// Main work here. boost::geometry::intersection(first[i], second[i], intersection); + if constexpr (std::is_same_v) + mercatorBackward(intersection); + serializer.add(intersection); } } @@ -105,18 +118,10 @@ public: } }; - -template <> -const char * FunctionPolygonsIntersection::name = "polygonsIntersectionCartesian"; - -template <> -const char * FunctionPolygonsIntersection::name = "polygonsIntersectionSpherical"; - - void registerFunctionPolygonsIntersection(FunctionFactory & factory) { - factory.registerFunction>(); - factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); } - } diff --git a/src/Functions/polygonsSymDifference.cpp b/src/Functions/polygonsSymDifference.cpp index 9ab6b79c5f5..b7b20f3d6c3 100644 --- a/src/Functions/polygonsSymDifference.cpp +++ b/src/Functions/polygonsSymDifference.cpp @@ -1,21 +1,6 @@ #include #include - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include +#include namespace DB { @@ -26,11 +11,30 @@ namespace ErrorCodes } -template +struct SymDifferenceCartesian +{ + static inline const char * name = "polygonsSymDifferenceCartesian"; + using Point = CartesianPoint; +}; + +struct SymDifferenceSpherical +{ + static inline const char * name = "polygonsSymDifferenceSpherical"; + using Point = SphericalPoint; +}; + +struct SymDifferenceMercator +{ + static inline const char * name = "polygonsSymDifferenceMercator"; + using Point = CartesianPoint; +}; + + +template class FunctionPolygonsSymDifference : public IFunction { public: - static const char * name; + static inline const char * name = Holder::name; explicit FunctionPolygonsSymDifference() = default; @@ -61,6 +65,8 @@ public: ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & /*result_type*/, size_t input_rows_count) const override { + using Point = typename Holder::Point; + MultiPolygonSerializer serializer; callOnTwoGeometryDataTypes(arguments[0].type, arguments[1].type, [&](const auto & left_type, const auto & right_type) @@ -84,9 +90,18 @@ public: boost::geometry::correct(first[i]); boost::geometry::correct(second[i]); + if constexpr (std::is_same_v) + { + mercatorForward(first[i]); + mercatorForward(second[i]); + } + MultiPolygon sym_difference{}; boost::geometry::sym_difference(first[i], second[i], sym_difference); + if constexpr (std::is_same_v) + mercatorBackward(sym_difference); + serializer.add(sym_difference); } } @@ -101,16 +116,11 @@ public: } }; -template <> -const char * FunctionPolygonsSymDifference::name = "polygonsSymDifferenceCartesian"; - -template <> -const char * FunctionPolygonsSymDifference::name = "polygonsSymDifferenceSpherical"; - void registerFunctionPolygonsSymDifference(FunctionFactory & factory) { - factory.registerFunction>(); - factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); } } diff --git a/src/Functions/polygonsUnion.cpp b/src/Functions/polygonsUnion.cpp index eab2e2e588f..c2dd93d47d4 100644 --- a/src/Functions/polygonsUnion.cpp +++ b/src/Functions/polygonsUnion.cpp @@ -1,21 +1,6 @@ #include #include - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include +#include namespace DB { @@ -26,11 +11,30 @@ namespace ErrorCodes } -template +struct UnionCartesian +{ + static inline const char * name = "polygonsUnionCartesian"; + using Point = CartesianPoint; +}; + +struct UnionSpherical +{ + static inline const char * name = "polygonsUnionSpherical"; + using Point = SphericalPoint; +}; + +struct UnionMercator +{ + static inline const char * name = "polygonsUnionMercator"; + using Point = CartesianPoint; +}; + + +template class FunctionPolygonsUnion : public IFunction { public: - static inline const char * name; + static inline const char * name = Holder::name ; explicit FunctionPolygonsUnion() = default; @@ -61,6 +65,7 @@ public: ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & /*result_type*/, size_t input_rows_count) const override { + using Point = typename Holder::Point; MultiPolygonSerializer serializer; callOnTwoGeometryDataTypes(arguments[0].type, arguments[1].type, [&](const auto & left_type, const auto & right_type) @@ -86,10 +91,19 @@ public: boost::geometry::correct(first[i]); boost::geometry::correct(second[i]); + if constexpr (std::is_same_v) + { + mercatorForward(first[i]); + mercatorForward(second[i]); + } + MultiPolygon polygons_union{}; /// Main work here. boost::geometry::union_(first[i], second[i], polygons_union); + if constexpr (std::is_same_v) + mercatorBackward(polygons_union); + serializer.add(polygons_union); } } @@ -104,17 +118,12 @@ public: } }; -template <> -const char * FunctionPolygonsUnion::name = "polygonsUnionCartesian"; - -template <> -const char * FunctionPolygonsUnion::name = "polygonsUnionSpherical"; - void registerFunctionPolygonsUnion(FunctionFactory & factory) { - factory.registerFunction>(); - factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); } } diff --git a/src/Functions/polygonsWithin.cpp b/src/Functions/polygonsWithin.cpp index 68db1494a0d..47ecdaf2c8e 100644 --- a/src/Functions/polygonsWithin.cpp +++ b/src/Functions/polygonsWithin.cpp @@ -1,23 +1,6 @@ #include #include - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include +#include namespace DB { @@ -27,12 +10,29 @@ namespace ErrorCodes extern const int ILLEGAL_TYPE_OF_ARGUMENT; } +struct WithinCartesian +{ + static inline const char * name = "polygonsWithinCartesian"; + using Point = CartesianPoint; +}; -template +struct WithinSpherical +{ + static inline const char * name = "polygonsWithinSpherical"; + using Point = SphericalPoint; +}; + +struct WithinMercator +{ + static inline const char * name = "polygonsWithinMercator"; + using Point = CartesianPoint; +}; + +template class FunctionPolygonsWithin : public IFunction { public: - static inline const char * name; + static inline const char * name = Holder::name; explicit FunctionPolygonsWithin() = default; @@ -63,6 +63,7 @@ public: ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & /*result_type*/, size_t input_rows_count) const override { + using Point = typename Holder::Point; auto res_column = ColumnUInt8::create(); auto & res_data = res_column->getData(); res_data.reserve(input_rows_count); @@ -88,6 +89,12 @@ public: boost::geometry::correct(first[i]); boost::geometry::correct(second[i]); + if constexpr (std::is_same_v) + { + mercatorForward(first[i]); + mercatorForward(second[i]); + } + res_data.emplace_back(boost::geometry::within(first[i], second[i])); } } @@ -102,18 +109,11 @@ public: } }; - -template <> -const char * FunctionPolygonsWithin::name = "polygonsWithinCartesian"; - -template <> -const char * FunctionPolygonsWithin::name = "polygonsWithinSpherical"; - - void registerFunctionPolygonsWithin(FunctionFactory & factory) { - factory.registerFunction>(); - factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); } } diff --git a/src/Functions/tests/mercator.cpp b/src/Functions/tests/mercator.cpp index bc9299fdaf1..7174cd62550 100644 --- a/src/Functions/tests/mercator.cpp +++ b/src/Functions/tests/mercator.cpp @@ -1,7 +1,10 @@ +#include #include #include +#include #include +#include constexpr double PI = 3.14159265358979323846; @@ -78,6 +81,9 @@ void printMultiPolygon(DB::CartesianMultiPolygon & multi_polygon) std::cout << "--------------" << std::endl; } + +const char * example = "MULTIPOLYGON (((11.737519 -16.692578, 11.738507 -16.705822, 11.715794 -16.685006, 11.701973 -16.655674, 11.669394 -16.55721, 11.67137 -16.529744, 11.681244 -16.517436, 11.701977 -16.500393, 11.719746 -16.506083, 11.721528 -16.555434, 11.725759 -16.577325, 11.725759 -16.618422, 11.726659 -16.656627, 11.737519 -16.692578)), ((13.98233 -5.853285, 14.006307 -5.866928, 14.02119 -5.872509, 14.140149 -5.863517, 14.163094 -5.866101, 14.222212 -5.886978, 14.241849 -5.889562, 14.346132 -5.891526, 14.436669 -5.893386, 14.482144 -5.885531, 14.545706 -5.901654, 14.576609 -5.904651, 14.703733 -5.881397, 14.759652 -5.880469, 14.797164 -5.879847, 14.888424 -5.878296, 14.979581 -5.876746, 15.070842 -5.875299, 15.162102 -5.873749, 15.253363 -5.872199, 15.34452 -5.870752, 15.435781 -5.869201, 15.527041 -5.867754, 15.618302 -5.866204, 15.709563 -5.864757, 15.80072 -5.863207, 15.892084 -5.861657, 15.983241 -5.860106, 16.074502 -5.858556, 16.100856 -5.858108, 16.165659 -5.857006, 16.257023 -5.855559, 16.315727 -5.854629, 16.341255 -5.859796, 16.358515 -5.870235, 16.374328 -5.882844, 16.396136 -5.894109, 16.412465 -5.896797, 16.427452 -5.894626, 16.459491 -5.885221, 16.479335 -5.882224, 16.497318 -5.882844, 16.515095 -5.887081, 16.552922 -5.902378, 16.56026 -5.906408, 16.597364 -5.924702, 16.594056 -5.933177, 16.580621 -5.94899, 16.580724 -5.955398, 16.590336 -5.968007, 16.595297 -5.978549, 16.597157 -5.98785, 16.601188 -6.050586, 16.604288 -6.061851, 16.610076 -6.061231, 16.619481 -6.05658, 16.62837 -6.05534, 16.632194 -6.065262, 16.61111 -6.089756, 16.630953 -6.09172, 16.643046 -6.100712, 16.660099 -6.123966, 16.671778 -6.130167, 16.68511 -6.134301, 16.695859 -6.140916, 16.700407 -6.154352, 16.717873 -6.174092, 16.726762 -6.189182, 16.724384 -6.202411, 16.717253 -6.215123, 16.714773 -6.231556, 16.715393 -6.304834, 16.716943 -6.313309, 16.720147 -6.32261, 16.722317 -6.332429, 16.720974 -6.342351, 16.715289 -6.345968, 16.706091 -6.346692, 16.697409 -6.349792, 16.693585 -6.359817, 16.692965 -6.398368, 16.694722 -6.402192, 16.700407 -6.411287, 16.707021 -6.415421, 16.713636 -6.413974, 16.718907 -6.415318, 16.720974 -6.42834, 16.715186 -6.441363, 16.706091 -6.455212, 16.706091 -6.465031, 16.727795 -6.465961, 16.721284 -6.480534, 16.721697 -6.491799, 16.728002 -6.501101, 16.738337 -6.510609, 16.747329 -6.521978, 16.746812 -6.53159, 16.734513 -6.552364, 16.730792 -6.56983, 16.733996 -6.586057, 16.748672 -6.619543, 16.753013 -6.637216, 16.755907 -6.674113, 16.760351 -6.691994, 16.768103 -6.708323, 16.823086 -6.785114, 16.82691 -6.799791, 16.828564 -6.814363, 16.832905 -6.827799, 16.84448 -6.838445, 16.855332 -6.842165, 16.879414 -6.844646, 16.890783 -6.847126, 16.914967 -6.864076, 16.926956 -6.888571, 16.934501 -6.945725, 16.932124 -6.949859, 16.92861 -6.959264, 16.928713 -6.968669, 16.937601 -6.97301, 16.949074 -6.975387, 16.955275 -6.981485, 16.959305 -6.989443, 16.964576 -6.997195, 16.973155 -7.014765, 16.969331 -7.030371, 16.962303 -7.047424, 16.961166 -7.069231, 16.929126 -7.060653, 16.927059 -7.085665, 16.947523 -7.151087, 16.945663 -7.204624, 16.950831 -7.213202, 16.960546 -7.219093, 16.972845 -7.232219, 16.989071 -7.254853, 16.991655 -7.270563, 16.991655 -7.286066, 16.996099 -7.297951, 17.022867 -7.306013, 17.056664 -7.329887, 17.082502 -7.34229, 17.093354 -7.352315, 17.097798 -7.367404, 17.097895 -7.378294, 17.098108 -7.402338, 17.103999 -7.416084, 17.118159 -7.425489, 17.12622 -7.411433, 17.132215 -7.409572, 17.138209 -7.413707, 17.146167 -7.418047, 17.167458 -7.423525, 17.176553 -7.428176, 17.180274 -7.435411, 17.1749 -7.441612, 17.163117 -7.445539, 17.151542 -7.451224, 17.146167 -7.463109, 17.148545 -7.472618, 17.154952 -7.479129, 17.163427 -7.485227, 17.172832 -7.493805, 17.186268 -7.516336, 17.202908 -7.564292, 17.217791 -7.585996, 17.266574 -7.610387, 17.286417 -7.625167, 17.282697 -7.643977, 17.287451 -7.660203, 17.286521 -7.683664, 17.288898 -7.699477, 17.303781 -7.692449, 17.305951 -7.700097, 17.308121 -7.701854, 17.308121 -7.702371, 17.303781 -7.706712, 17.32042 -7.713637, 17.320627 -7.722422, 17.314219 -7.731827, 17.310602 -7.740818, 17.315976 -7.753634, 17.334063 -7.769654, 17.337887 -7.778646, 17.342435 -7.78402, 17.365482 -7.787327, 17.375404 -7.792288, 17.376954 -7.801693, 17.376128 -7.814096, 17.380985 -7.823191, 17.400002 -7.823397, 17.400002 -7.830219, 17.3907 -7.83921, 17.397625 -7.841381, 17.410854 -7.841484, 17.420569 -7.843861, 17.423567 -7.855127, 17.42305 -7.867942, 17.426357 -7.875487, 17.44093 -7.871146, 17.452402 -7.883962, 17.448681 -7.89285, 17.43938 -7.902152, 17.434109 -7.915795, 17.437829 -7.922409, 17.446821 -7.928921, 17.468318 -7.939463, 17.463564 -7.946904, 17.463047 -7.949798, 17.465218 -7.952588, 17.468318 -7.959926, 17.471109 -7.955586, 17.477207 -7.950521, 17.481858 -7.945664, 17.490953 -7.977496, 17.496224 -7.987212, 17.506352 -7.996513, 17.528366 -8.007778999999999, 17.536531 -8.015117, 17.540045 -8.032067, 17.528366 -8.060592, 17.536219 -8.075402, 17.536531 -8.075991999999999, 17.544283 -8.084777000000001, 17.600197 -8.098523, 17.628412 -8.098006, 17.713265 -8.068344, 17.74334 -8.070721000000001, 17.77724 -8.08333, 17.789539 -8.081778999999999, 17.851757 -8.047776000000001, 17.867984 -8.044468999999999, 17.901367 -8.048086, 17.930822 -8.062142, 17.981879 -8.105344000000001, 18.008544 -8.111235000000001, 18.098151 -8.109271, 18.091743 -8.084156999999999, 18.09288 -8.056355, 18.102181 -8.033307000000001, 18.120372 -8.022455000000001, 18.135771 -8.018528, 18.176596 -7.999201, 18.192719 -7.996927, 18.267339 -7.999821, 18.316225 -8.001681, 18.353639 -8.015943999999999, 18.366558 -8.016771, 18.381958 -8.012326, 18.403868 -8.000647000000001, 18.420508 -7.99827, 18.481797 -7.99734, 18.487894 -7.99827, 18.507635 -7.997547, 18.50226 -7.960133, 18.504327 -7.940703, 18.516523 -7.932228, 18.588663 -7.932331, 18.666901 -7.932331, 18.738525 -7.932331, 18.74731 -7.937809, 18.752064 -7.965921, 18.758265 -7.97822, 18.773768 -8.001991, 18.818003 -8.001991, 18.945437 -8.001991, 19.073078 -8.001991, 19.200616 -8.001991, 19.328256 -8.001991, 19.355542 -8.001991, 19.334044 -7.92427, 19.330944 -7.898638, 19.333838 -7.867322, 19.348514 -7.821537, 19.358022 -7.791565, 19.377762 -7.73007, 19.38138 -7.703921, 19.380966 -7.679737, 19.373215 -7.653795, 19.361846 -7.627027, 19.353681 -7.600258, 19.355645 -7.57411, 19.424685 -7.579691, 19.443908 -7.575247, 19.458274 -7.560261, 19.468713 -7.52109, 19.482356 -7.50352, 19.483079 -7.5029, 19.483906 -7.502383, 19.484733 -7.50197, 19.513155 -7.479439, 19.513775 -7.448433, 19.487213 -7.381977, 19.479462 -7.347664, 19.476361 -7.315935, 19.487213 -7.153877, 19.497032 -7.121735, 19.508607 -7.103235, 19.536202 -7.068405, 19.54261 -7.052282, 19.540233 -7.041636, 19.521836 -7.001949, 19.57403 -7.001949, 19.616094 -7.001949, 19.658055 -7.001949, 19.700017 -7.001949, 19.741978 -7.001949, 19.784043 -7.001949, 19.826107 -7.001949, 19.868068 -7.001949, 19.91003 -7.001949, 19.952094 -7.001949, 19.963079 -7.001949, 19.994056 -7.001949, 20.03612 -7.001949, 20.078185 -7.001949, 20.120146 -7.001949, 20.162107 -7.001949, 20.204069 -7.001949, 20.246237 -7.001949, 20.294296 -7.001949, 20.294192 -6.987479, 20.298637 -6.95451, 20.303184 -6.940144, 20.311246 -6.925054, 20.319514 -6.918543, 20.331089 -6.916786, 20.383696 -6.916683, 20.467308 -6.916373, 20.553711 -6.916166, 20.611486 -6.915959, 20.588128 -6.976834, 20.560946 -7.047837, 20.545443 -7.088558, 20.524463 -7.143129, 20.518261 -7.189741, 20.519398 -7.23718, 20.520535 -7.286376, 20.567044 -7.286169, 20.639804 -7.285962, 20.712565 -7.285859, 20.785222 -7.285549, 20.857982 -7.285342, 20.930743 -7.285239, 21.003503 -7.284929, 21.076263 -7.284722, 21.148921 -7.284619, 21.221784 -7.284412, 21.294338 -7.284205, 21.367098 -7.283999, 21.439962 -7.283792, 21.512619 -7.283585, 21.585483 -7.283379, 21.658243 -7.283172, 21.730901 -7.282965, 21.76449 -7.282758, 21.784954 -7.283379, 21.784644 -7.286893, 21.788261 -7.29175, 21.794773 -7.294024, 21.802524 -7.298882, 21.808829 -7.306426, 21.831359 -7.354175, 21.836941 -7.360583, 21.842418 -7.369885, 21.839938 -7.378153, 21.834977 -7.385285, 21.83291 -7.390762, 21.838698 -7.402028, 21.845726 -7.409056, 21.851617 -7.416497, 21.854097 -7.428899, 21.85296 -7.434997, 21.847793 -7.444092, 21.846656 -7.449053, 21.848929 -7.454841, 21.858645 -7.464039, 21.860918 -7.469827, 21.859058 -7.482643, 21.849963 -7.5029, 21.846656 -7.514269, 21.845932 -7.526775, 21.848206 -7.532976, 21.851513 -7.538453, 21.854097 -7.548375, 21.854097 -7.585996, 21.85079 -7.593644, 21.836217 -7.60832, 21.83291 -7.614211, 21.831049 -7.632815, 21.826558 -7.645601, 21.819577 -7.665474, 21.807898 -7.699374, 21.795083 -7.736271, 21.787228 -7.758595, 21.776169 -7.790324, 21.770485 -7.806758, 21.764594 -7.850682, 21.770898 -7.876521, 21.772138 -7.8882, 21.768831 -7.899878, 21.754362 -7.919619, 21.751054 -7.929231, 21.753948 -7.99734, 21.758496 -8.015117, 21.768211 -8.023178, 21.79963 -8.040851999999999, 21.806348 -8.052427, 21.808519 -8.076715, 21.815133 -8.096766000000001, 21.825985 -8.114439000000001, 21.851203 -8.143481, 21.857301 -8.156917, 21.860195 -8.173764, 21.862469 -8.216448, 21.873217 -8.264094, 21.881382 -8.282076999999999, 21.910631 -8.310499, 21.920553 -8.329000000000001, 21.913146 -8.333003, 21.905257 -8.337268, 21.899882 -8.348843, 21.911458 -8.374268000000001, 21.935953 -8.413024999999999, 21.943911 -8.455916999999999, 21.939983 -8.499945, 21.916212 -8.576840000000001, 21.921276 -8.578597, 21.924377 -8.580767, 21.928408 -8.582523999999999, 21.935953 -8.583144000000001, 21.917762 -8.615183999999999, 21.90691 -8.645466000000001, 21.895128 -8.718743, 21.884793 -8.782304999999999, 21.877765 -8.78923, 21.870117 -8.822303, 21.859885 -8.846384, 21.85172 -8.925862, 21.854097 -8.977849000000001, 21.839731 -9.092364, 21.851927 -9.192926, 21.851617 -9.233751, 21.841075 -9.275815, 21.810172 -9.338137, 21.803764 -9.372966999999999, 21.793326 -9.393534000000001, 21.791982 -9.406143, 21.79622 -9.417097999999999, 21.813169 -9.437459, 21.819887 -9.447691000000001, 21.832186 -9.488412, 21.843658 -9.576159000000001, 21.854097 -9.61781, 21.878902 -9.657083999999999, 21.94236 -9.72292, 21.95652 -9.76178, 21.962721 -9.758473, 21.978224 -9.752167999999999, 21.984425 -9.748758, 21.986285 -9.781107, 21.998378 -9.809116, 22.055842 -9.875365, 22.065764 -9.881049000000001, 22.072792 -9.878879, 22.079923 -9.871644, 22.090982 -9.877122, 22.107622 -9.891385, 22.146276 -9.915673, 22.159918 -9.931486, 22.167566 -9.953707, 22.175628 -9.988950000000001, 22.196092 -10.043624, 22.204877 -10.085792, 22.209734 -10.098194, 22.20281 -10.130647, 22.221103 -10.176225, 22.245701 -10.221184, 22.263478 -10.268209, 22.286939 -10.309137, 22.295517 -10.339316, 22.31009 -10.356989, 22.313397 -10.368565, 22.31226 -10.379934, 22.307093 -10.399571, 22.305956 -10.409803, 22.301098 -10.424892, 22.278671 -10.460962, 22.271849 -10.481736, 22.27402 -10.503027, 22.284045 -10.516463, 22.296447 -10.529692, 22.305956 -10.550673, 22.30947 -10.592944, 22.308573 -10.612519, 22.307609 -10.633562, 22.31009 -10.668805, 22.32642 -10.694643, 22.321045 -10.700741, 22.319495 -10.703842, 22.322389 -10.742186, 22.319495 -10.761306, 22.309677 -10.769781, 22.29066 -10.772675, 22.265855 -10.779909, 22.223997 -10.797066, 22.206014 -10.809882, 22.182759 -10.830449, 22.165499 -10.85236, 22.165706 -10.868793, 22.174801 -10.884296, 22.196092 -10.954162, 22.196092 -10.992299, 22.199296 -10.997364, 22.213972 -11.007906, 22.217176 -11.012763, 22.220586 -11.030023, 22.23733 -11.059376, 22.243841 -11.078289, 22.25552 -11.166552, 22.252006 -11.208617, 22.23764 -11.249545, 22.263064 -11.248201, 22.281771 -11.236729, 22.325696 -11.190324, 22.340269 -11.180195, 22.440315 -11.146915, 22.469357 -11.122421, 22.500983 -11.042426, 22.53757 -11.037155, 22.613637 -11.06754, 22.650948 -11.08232, 22.688982 -11.092965, 22.727739 -11.096789, 22.764222 -11.090485, 22.785306 -11.078496, 22.806907 -11.063096, 22.829231 -11.052141, 22.853106 -11.053071, 22.87357 -11.063716, 22.91119 -11.088314, 22.931137 -11.096789, 22.969585 -11.102474, 23.014336 -11.102474, 23.114692 -11.085524, 23.196754 -11.071881, 23.306515 -11.01173, 23.373281 -10.975143, 23.415449 -10.963257, 23.455963 -10.960984, 23.494824 -10.964291, 23.557042 -10.981344, 23.641585 -11.004495, 23.674865 -11.006976, 23.714139 -11.003875, 23.752276 -11.008216, 23.79372 -11.021135, 23.833718 -11.028473, 23.867411 -11.016381, 23.874129 -11.006872, 23.881777 -10.984548, 23.887771 -10.974419, 23.89728 -10.966461, 23.918571 -10.954059, 23.927976 -10.945377, 23.936141 -10.925223, 23.940585 -10.901556, 23.948646 -10.881505, 23.967457 -10.872307, 23.974278 -10.921399, 23.980582 -10.938349, 24.000013 -10.967805, 24.003733 -10.982481, 23.997325 -11.001705, 23.993708 -11.019585, 23.994535 -11.074982, 23.990091 -11.113532, 23.995775 -11.127382, 24.015309 -11.130482, 24.011175 -11.272903, 24.016963 -11.298431, 24.061094 -11.394962, 24.061714 -11.406951, 24.052102 -11.42049, 24.020787 -11.444572, 24.009935 -11.459454, 24.007557 -11.470513, 24.007247 -11.483122, 24.009831 -11.507203, 24.009728 -11.52343, 24.005387 -11.535212, 23.977688 -11.577277, 23.959912 -11.617171, 23.954641 -11.636911, 23.954641 -11.662233, 23.962289 -11.68156, 23.972727 -11.700577, 23.981306 -11.724761, 23.985543 -11.799485, 23.990194 -11.824083, 23.98854 -11.834212, 23.967043 -11.882891, 23.961049 -12.011669, 23.954331 -12.151919, 23.959602 -12.19667, 23.981306 -12.227676, 24.006627 -12.253721, 24.016859 -12.278939, 24.020993 -12.340021, 24.030812 -12.385083, 24.028021 -12.402136, 24.019856 -12.419189, 23.98606 -12.467662, 23.940791 -12.532774, 23.928699 -12.561609, 23.910716 -12.631269, 23.891699 -12.705063, 23.872269 -12.750125, 23.865654 -12.789709, 23.874749 -12.821749, 23.895109 -12.849757, 23.949576 -12.904638, 23.971797 -12.93337, 23.988851 -12.965099, 24.000633 -13.001479, 23.968283 -13.001479, 23.844157 -13.001479, 23.719823 -13.001479, 23.595593 -13.001479, 23.471259 -13.001479, 23.346926 -13.001479, 23.222696 -13.001479, 23.098362 -13.001479, 22.974029 -13.001479, 22.849799 -13.001479, 22.725465 -13.001479, 22.601235 -13.001479, 22.477005 -13.001479, 22.352775 -13.001479, 22.228545 -13.001479, 22.104211 -13.001479, 21.979878 -13.001479, 21.979981 -13.152168, 21.980084 -13.302701, 21.980188 -13.453493, 21.980291 -13.604181, 21.980353 -13.694822, 21.980394 -13.754973, 21.980498 -13.905558, 21.980601 -14.05635, 21.980704 -14.206935, 21.980808 -14.357624, 21.980911 -14.508416, 21.981014 -14.659104, 21.981118 -14.809793, 21.981221 -14.960481, 21.981325 -15.11117, 21.981428 -15.261858, 21.981531 -15.412546, 21.981531 -15.452337, 21.981531 -15.473525, 21.981531 -15.503807, 21.981531 -15.547835, 21.981428 -15.649948, 21.981221 -15.751957, 21.980911 -15.853967, 21.980808 -15.956079, 21.980601 -16.001244, 21.981531 -16.004035, 21.981531 -16.067494, 21.981531 -16.128162, 21.981531 -16.144285, 21.983805 -16.165886, 22.010367 -16.198132, 22.045197 -16.252289, 22.019875 -16.253115, 22.01171 -16.252289, 22.022356 -16.266345, 22.025973 -16.278954, 22.02773 -16.291666, 22.032174 -16.306342, 22.036618 -16.312233, 22.048607 -16.322362, 22.052018 -16.326806, 22.053672 -16.336521, 22.054188 -16.358639, 22.055842 -16.364633, 22.089122 -16.371971, 22.105555 -16.379413, 22.103591 -16.391918, 22.094289 -16.404734, 22.086021 -16.422304, 22.08075 -16.441011, 22.079923 -16.457754, 22.084574 -16.470156, 22.101731 -16.497958, 22.107312 -16.512324, 22.106588 -16.525967, 22.104004 -16.536716, 22.108138 -16.54395, 22.127259 -16.546431, 22.138111 -16.552632, 22.142452 -16.567101, 22.145139 -16.584051, 22.15165 -16.597694, 22.237743 -16.665493, 22.251282 -16.670041, 22.259034 -16.669214, 22.274123 -16.663633, 22.283735 -16.661359, 22.287352 -16.658259, 22.290763 -16.656398, 22.295621 -16.659189, 22.303062 -16.66694, 22.306989 -16.669214, 22.333654 -16.673658, 22.343473 -16.683167, 22.350088 -16.696292, 22.365797 -16.71686, 22.372618 -16.728849, 22.377993 -16.734843, 22.383574 -16.73753, 22.399594 -16.740424, 22.408895 -16.745798, 22.416647 -16.75448, 22.489097 -16.865378, 22.499742 -16.89349, 22.508527 -16.906202, 22.522894 -16.914677, 22.554519 -16.924185, 22.567232 -16.936898, 22.569299 -16.944959, 22.569196 -16.962426, 22.573433 -16.971004, 22.579324 -16.975345, 22.592037 -16.975449, 22.651671 -16.998703, 22.665624 -17.008625, 22.710479 -17.055444, 22.730736 -17.081592, 22.744792 -17.108257, 22.755851 -17.154869, 22.765153 -17.169649, 22.778278 -17.180397, 22.809388 -17.196417, 22.849179 -17.23104, 22.876154 -17.248093, 22.936512 -17.273311, 22.984157 -17.285817, 22.998627 -17.293775, 23.040381 -17.33708, 23.046376 -17.348449, 23.054127 -17.375321, 23.073041 -17.405086, 23.097639 -17.432165, 23.121513 -17.450872, 23.165748 -17.467408, 23.176187 -17.478157, 23.179081 -17.494177, 23.17691 -17.509783, 23.177531 -17.524046, 23.189726 -17.536551, 23.206986 -17.541202, 23.224246 -17.539342, 23.241299 -17.535104, 23.258352 -17.532831, 23.290805 -17.535414, 23.305378 -17.539548, 23.320158 -17.54637, 23.340621 -17.560736, 23.359432 -17.582853, 23.382273 -17.601043, 23.375141 -17.615409, 23.375968 -17.628225, 23.381652 -17.641144, 23.29804 -17.656854, 23.093918 -17.695405, 22.889796 -17.734059, 22.685674 -17.772816, 22.481449 -17.811366, 22.230508 -17.857565, 21.979464 -17.903764, 21.728523 -17.949859, 21.477583 -17.996058, 21.405546 -18.009287, 21.386839 -18.014455, 21.381154 -18.012595, 21.364825 -17.992027, 21.335059 -17.977971, 21.278112 -17.958541, 21.23274 -17.93446, 21.216617 -17.930636, 21.175792 -17.93322, 21.161323 -17.930636, 21.143133 -17.933736, 21.12608 -17.941074, 21.10944 -17.945002, 21.09311 -17.938077, 21.000713 -17.962055, 20.986455 -17.965771, 20.908315 -17.986136, 20.894466 -18.012595, 20.8616 -18.018796, 20.831937 -18.029338, 20.806202 -18.031405, 20.784602 -18.012595, 20.754423 -17.997918, 20.737473 -17.993474, 20.729928 -18.002363, 20.722487 -18.006497, 20.706157 -18.00381, 20.68962 -17.996988, 20.682179 -17.988617, 20.666263 -17.980245, 20.630089 -17.976938, 20.590712 -17.978798, 20.565494 -17.985206, 20.552885 -17.979108, 20.523946 -17.958541, 20.489529 -17.942108, 20.479504 -17.934356, 20.460074 -17.913686, 20.437543 -17.894462, 20.412635 -17.884127, 20.386797 -17.890328, 20.347729 -17.858909, 20.336154 -17.854878, 20.302771 -17.860769, 20.288921 -17.861596, 20.278173 -17.854878, 20.243446 -17.882783, 20.219882 -17.873378, 20.193113 -17.872138, 20.169239 -17.878132, 20.154563 -17.890328, 20.147121 -17.882783, 20.132962 -17.888778, 20.119939 -17.890741, 20.092551 -17.890328, 20.03426 -17.895909, 20.024545 -17.894566, 19.989508 -17.882783, 19.951991 -17.862319, 19.793964 -17.862319, 19.78766 -17.866454, 19.775981 -17.885057, 19.77102 -17.890328, 19.755207 -17.889088, 19.732056 -17.88206, 19.711282 -17.872965, 19.702187 -17.86573, 19.693195 -17.847747, 19.672628 -17.842682, 19.649787 -17.844956, 19.59284 -17.857255, 19.421274 -17.859426, 19.262421 -17.81395, 19.246608 -17.804028, 19.201856 -17.807129, 19.17209 -17.801238, 19.160825 -17.800928, 19.139327 -17.805269, 19.105118 -17.818188, 19.020575 -17.822322, 18.89004 -17.799274, 18.800847 -17.756589, 18.761986 -17.747701, 18.74824 -17.736332, 18.728293 -17.710907, 18.670932 -17.653133, 18.66132 -17.646725, 18.64282 -17.638044, 18.633312 -17.628949, 18.627937 -17.619854, 18.622873 -17.60218, 18.619669 -17.594842, 18.567476 -17.553294, 18.554144 -17.54637, 18.55094 -17.535311, 18.516626 -17.471336, 18.492752 -17.464514, 18.489858 -17.462447, 18.488101 -17.452112, 18.471668 -17.414285, 18.465157 -17.40922, 18.458645 -17.405293, 18.455028 -17.395991, 18.453581 -17.389893, 18.445726 -17.389273, 18.392293 -17.389273, 18.135668 -17.38917, 18.000483 -17.389116, 17.879146 -17.389067, 17.622624 -17.388963, 17.366102 -17.388963, 17.278972 -17.388928, 17.109477 -17.38886, 16.852852 -17.388757, 16.59633 -17.388757, 16.339808 -17.388653, 16.08339 -17.388653, 15.826765 -17.388653, 15.570243 -17.38855, 15.559114 -17.388545, 15.313721 -17.388447, 15.057199 -17.388343, 14.800574 -17.388343, 14.543949 -17.38824, 14.287427 -17.388136, 14.219112 -17.388136, 14.218801 -17.388136, 14.207432 -17.388033, 14.206502 -17.393097, 14.197097 -17.412941, 14.174979 -17.416248, 14.130744 -17.40922, 14.123923 -17.411598, 14.108213 -17.420486, 14.097258 -17.423587, 14.085372 -17.423587, 14.069146 -17.418626, 14.047442 -17.416042, 14.029148 -17.410461, 14.017883 -17.40922, 14.008891 -17.411494, 13.992975 -17.421313, 13.980573 -17.423587, 13.957318 -17.419142, 13.942745 -17.408187, 13.896857 -17.349069, 13.884351 -17.338527, 13.790403 -17.288091, 13.69413 -17.236621, 13.606487 -17.167375, 13.521324 -17.1219, 13.530936 -17.093271, 13.522254 -17.076941, 13.507785 -17.063505, 13.494659 -17.024024, 13.479776 -17.010278, 13.458899 -17.001803, 13.435128 -16.999013, 13.417248 -16.993742, 13.382004 -16.970384, 13.363711 -16.964183, 13.345947 -16.968711, 13.321543 -16.974932, 13.315238 -16.974415, 13.308417 -16.970178, 13.293018 -16.973795, 13.267489 -16.98537, 13.267489 -16.977929, 13.257154 -16.98165, 13.245269 -16.98134, 13.222841 -16.977929, 13.212092 -16.972761, 13.205478 -16.963046, 13.19814 -16.957362, 13.184911 -16.964183, 13.166307 -16.951057, 13.1445 -16.952401, 13.121762 -16.959842, 13.014275 -16.977929, 12.961668 -17.007385, 12.930456 -17.014206, 12.911025 -17.023508, 12.887151 -17.029812, 12.882293 -17.039527, 12.880536 -17.050793, 12.876402 -17.059784, 12.867721 -17.065572, 12.849944 -17.070843, 12.842296 -17.074047, 12.833097 -17.081799, 12.824932 -17.096371, 12.818318 -17.104846, 12.784315 -17.115078, 12.739873 -17.135542, 12.704733 -17.164274, 12.685923 -17.173576, 12.660705 -17.17709, 12.63621 -17.185151, 12.591458 -17.222565, 12.56717 -17.234554, 12.554561 -17.235588, 12.519215 -17.227836, 12.46051 -17.223082, 12.4417 -17.216984, 12.417929 -17.203445, 12.407594 -17.204065, 12.393951 -17.21471, 12.379482 -17.220395, 12.314679 -17.218121, 12.242642 -17.224839, 12.239335 -17.220705, 12.236545 -17.2113, 12.23179 -17.201895, 12.222282 -17.197657, 12.21174 -17.195177, 12.200474 -17.189286, 12.190656 -17.182568, 12.185075 -17.17709, 12.181148 -17.169235, 12.179494 -17.161587, 12.177117 -17.154766, 12.170709 -17.149185, 12.16151 -17.146291, 12.156653 -17.149081, 12.151279 -17.153629, 12.13991 -17.156006, 12.105597 -17.146084, 12.095261 -17.139676, 12.08813 -17.139159, 12.082239 -17.14133, 12.075211 -17.142983, 12.028909 -17.148978, 11.98302 -17.161897, 11.942092 -17.180501, 11.894963 -17.214607, 11.853932 -17.233417, 11.835536 -17.245406, 11.829644 -17.253468, 11.827474 -17.260082, 11.82241 -17.264423, 11.80763 -17.26587, 11.796882 -17.263803, 11.779518 -17.254915, 11.766184 -17.252751, 11.766124 -17.252699, 11.766124 -17.245294, 11.757986 -17.23919, 11.752778 -17.229181, 11.750743 -17.216892, 11.751801 -17.203709, 11.758637 -17.165216, 11.759288 -17.032973, 11.772114 -16.947026, 11.780013 -16.869467, 11.768144 -16.79852, 11.768141 -16.768251, 11.785921 -16.76352, 11.79087 -16.806082, 11.80371 -16.824033, 11.820474 -16.781472, 11.817638 -16.704685, 11.82309 -16.678969, 11.813813 -16.583917, 11.821951 -16.479099, 11.779145 -16.099867, 11.779796 -16.080255, 11.784516 -16.06406, 11.806977 -16.018813, 11.784356 -15.972633, 11.736618 -15.900203, 11.735525 -15.85711, 11.751801 -15.799086, 11.76352 -15.789972, 11.784679 -15.777276, 11.804942 -15.76922, 11.813813 -15.774998, 11.81837 -15.792413, 11.829845 -15.797784, 11.844249 -15.793552, 11.894705 -15.746677, 11.903331 -15.731378, 11.906505 -15.71795, 11.907481 -15.690037, 11.910167 -15.676202, 11.930512 -15.652439, 11.992035 -15.617283, 12.005138 -15.594334, 12.008474 -15.565362, 12.028494 -15.490167, 12.040375 -15.463311, 12.03004 -15.436944, 12.033458 -15.407403, 12.046641 -15.350681, 12.056407 -15.233087, 12.061778 -15.217869, 12.070567 -15.204685, 12.104991 -15.172784, 12.112478 -15.170994, 12.127778 -15.178969, 12.135997 -15.178969, 12.145274 -15.168634, 12.14975 -15.151951, 12.148936 -15.13421, 12.142833 -15.120701, 12.12794 -15.113377, 12.117361 -15.116632, 12.112478 -15.115167, 12.115001 -15.093927, 12.124848 -15.062188, 12.151134 -15.002048, 12.156505 -14.967055, 12.160492 -14.953546, 12.170095 -14.942478, 12.181407 -14.932306, 12.190603 -14.922052, 12.196137 -14.908461, 12.205333 -14.853611, 12.205414 -14.840427, 12.207774 -14.833266, 12.21518 -14.824151, 12.221934 -14.823989, 12.228526 -14.82586, 12.235606 -14.823012, 12.244314 -14.809991, 12.252778 -14.782322, 12.272716 -14.750584, 12.272309 -14.732843, 12.268077 -14.714776, 12.266368 -14.696059, 12.268728 -14.683526, 12.276622 -14.66074, 12.292735 -14.587498, 12.299001 -14.507582, 12.303884 -14.494073, 12.319672 -14.468683, 12.331309 -14.433526, 12.342133 -14.36712, 12.345388 -14.302992, 12.342133 -14.27044, 12.331554 -14.236749, 12.324229 -14.220636, 12.322113 -14.213067, 12.321056 -14.202732, 12.319672 -14.197442, 12.315196 -14.187921, 12.31422 -14.182224, 12.315603 -14.174981, 12.319021 -14.175388, 12.323578 -14.177504, 12.332205 -14.173435, 12.344249 -14.171319, 12.348888 -14.168552, 12.353038 -14.160903, 12.355235 -14.151788, 12.355805 -14.142348, 12.355154 -14.133722, 12.347179 -14.119887, 12.334972 -14.106378, 12.328787 -14.092218, 12.344737 -14.066827, 12.349783 -14.045505, 12.369884 -14.021905, 12.374522 -14.007582, 12.377289 -13.992446, 12.383067 -13.977309, 12.399913 -13.951593, 12.402843 -13.941339, 12.404145 -13.906345, 12.407237 -13.890558, 12.415538 -13.878595, 12.439301 -13.87127, 12.445079 -13.866143, 12.450531 -13.862481, 12.458181 -13.863865, 12.471853 -13.874444, 12.478363 -13.878025, 12.485688 -13.87713, 12.502452 -13.855239, 12.508962 -13.819594, 12.516287 -13.715102, 12.512706 -13.616795, 12.51588 -13.604913, 12.530121 -13.578709, 12.533865 -13.565199, 12.523611 -13.551202, 12.522146 -13.544203, 12.523936 -13.539972, 12.526541 -13.536228, 12.527029 -13.50449, 12.524587 -13.489353, 12.514903 -13.457615, 12.512706 -13.442071, 12.51531 -13.425958, 12.522146 -13.410577, 12.53297 -13.399021, 12.547211 -13.394627, 12.568044 -13.392348, 12.57545 -13.385919, 12.580821 -13.375258, 12.594737 -13.360447, 12.611095 -13.351983, 12.624197 -13.349216, 12.634451 -13.343357, 12.642426 -13.325616, 12.64324 -13.316339, 12.64088 -13.308852, 12.637869 -13.302016, 12.636241 -13.29461, 12.638438 -13.288018, 12.647716 -13.27809, 12.650076 -13.271091, 12.656505 -13.255629, 12.685069 -13.240818, 12.69158 -13.229425, 12.694102 -13.218357, 12.699962 -13.217869, 12.706798 -13.221449, 12.712087 -13.222589, 12.730642 -13.210545, 12.731781 -13.208917, 12.749766 -13.201349, 12.761485 -13.192966, 12.827159 -13.109796, 12.855724 -13.089532, 12.865977 -13.078709, 12.883149 -13.052016, 12.944835 -12.982354, 12.958669 -12.955499, 12.958832 -12.929132, 12.949474 -12.902114, 12.934825 -12.873793, 12.927501 -12.842055, 12.939464 -12.816664, 12.985688 -12.770115, 13.009613 -12.756524, 13.075043 -12.695001, 13.101085 -12.68141, 13.109223 -12.674493, 13.126475 -12.644464, 13.132823 -12.636651, 13.161632 -12.611261, 13.178559 -12.601739, 13.198009 -12.599379, 13.198904 -12.603611, 13.221039 -12.607192, 13.232758 -12.613051, 13.264415 -12.582615, 13.276866 -12.578302, 13.294281 -12.58115, 13.311534 -12.594496, 13.32838 -12.599379, 13.364024 -12.592706, 13.392914 -12.570408, 13.437673 -12.523696, 13.459727 -12.507257, 13.469249 -12.494806, 13.472992 -12.479099, 13.474946 -12.437758, 13.479015 -12.419122, 13.486583 -12.400811, 13.505626 -12.371352, 13.568614 -12.311456, 13.57545 -12.311456, 13.57545 -12.318292, 13.564952 -12.322035, 13.558279 -12.328302, 13.556814 -12.336602, 13.561778 -12.346124, 13.577485 -12.330987, 13.597504 -12.298761, 13.630219 -12.263442, 13.639822 -12.248712, 13.663585 -12.16961, 13.69337 -12.110284, 13.705089 -12.078058, 13.71518 -12.008396, 13.722504 -11.992771, 13.73699 -11.977716, 13.74879 -11.961196, 13.758556 -11.942478, 13.766449 -11.920505, 13.782481 -11.820896, 13.792247 -11.790948, 13.794607 -11.770196, 13.77768 -11.589125, 13.781912 -11.481052, 13.785981 -11.458266, 13.794607 -11.440606, 13.786632 -11.431573, 13.787364 -11.420343, 13.79184 -11.407973, 13.794607 -11.395929, 13.7942 -11.341485, 13.795258 -11.332208, 13.800141 -11.321384, 13.819021 -11.295587, 13.821625 -11.283624, 13.821788 -11.25628, 13.846528 -11.113702, 13.847423 -11.055434, 13.848481 -10.98211, 13.843435 -10.945733, 13.828624 -10.91367, 13.739268 -10.78338, 13.731456 -10.764255, 13.73113 -10.747166, 13.739431 -10.730239, 13.769786 -10.694268, 13.771739 -10.677911, 13.764985 -10.662042, 13.75294 -10.646173, 13.711436 -10.612074, 13.705089 -10.601983, 13.700857 -10.590916, 13.60613 -10.478204, 13.542328 -10.42669, 13.527599 -10.406508, 13.522634 -10.387791, 13.520763 -10.320245, 13.517345 -10.298435, 13.508962 -10.277032, 13.455089 -10.201755, 13.442638 -10.179376, 13.431163 -10.130548, 13.415294 -10.11004, 13.37672 -10.070733, 13.317393 -9.976331999999999, 13.319835 -9.961601999999999, 13.329112 -9.947524, 13.335216 -9.926690000000001, 13.327159 -9.885999999999999, 13.305431 -9.842461999999999, 13.278005 -9.801690000000001, 13.198578 -9.708672999999999, 13.191173 -9.690037, 13.196137 -9.672784, 13.218598 -9.649184, 13.225352 -9.63128, 13.223888 -9.614190000000001, 13.217784 -9.594170999999999, 13.209646 -9.577406999999999, 13.201427 -9.570489, 13.202403 -9.559015, 13.169932 -9.466404000000001, 13.168305 -9.447361000000001, 13.170665 -9.402520000000001, 13.166515 -9.38714, 13.147716 -9.352145999999999, 13.143403 -9.330254999999999, 13.120616 -9.313084, 13.045421 -9.18906, 13.016856 -9.122817, 12.996349 -9.093845, 12.992361 -9.038017999999999, 13.030284 -8.959568000000001, 13.086436 -8.892348, 13.136567 -8.871026000000001, 13.114757 -8.902927, 13.042817 -8.962498, 13.006847 -9.045586999999999, 13.000173 -9.072035, 13.013031 -9.083754000000001, 13.023448 -9.074965000000001, 13.0796 -8.980645000000001, 13.081879 -8.970473, 13.086925 -8.959731, 13.098888 -8.956476, 13.112478 -8.956149999999999, 13.122895 -8.954197000000001, 13.137462 -8.940851, 13.148285 -8.907973, 13.160411 -8.887953, 13.185557 -8.861586000000001, 13.191173 -8.850517999999999, 13.192149 -8.839532, 13.190603 -8.816095000000001, 13.194591 -8.806084999999999, 13.224132 -8.773858000000001, 13.241547 -8.760675000000001, 13.259532 -8.754815000000001, 13.209727 -8.804295, 13.198009 -8.823175000000001, 13.212169 -8.814874, 13.245372 -8.800063, 13.263682 -8.788263000000001, 13.271658 -8.786554000000001, 13.278005 -8.782484999999999, 13.280528 -8.771661, 13.281016 -8.764744, 13.28297 -8.759454, 13.28712 -8.756036, 13.2942 -8.754815000000001, 13.35613 -8.763604000000001, 13.380138 -8.75506, 13.393321 -8.704278, 13.408051 -8.666925000000001, 13.410899 -8.651951, 13.406098 -8.63714, 13.37672 -8.596612, 13.365408 -8.566827, 13.352061 -8.499688000000001, 13.342052 -8.467461999999999, 13.355479 -8.464613999999999, 13.365001 -8.465916, 13.372569 -8.464451, 13.379893 -8.45379, 13.382579 -8.444024000000001, 13.383556 -8.368748, 13.378917 -8.347101, 13.369395 -8.323499999999999, 13.276866 -8.178888000000001, 13.264903 -8.169692, 13.250824 -8.124444, 13.242442 -8.107192, 13.234548 -8.095961000000001, 13.222504 -8.069594, 13.215505 -8.059177, 13.198009 -8.02158, 13.189301 -7.975763, 13.122895 -7.857354, 12.986308 -7.550661, 12.939283 -7.435969, 12.911473 -7.335111, 12.883895 -7.305754, 12.869055 -7.288986, 12.849963 -7.265919, 12.855192 -7.231279, 12.849857 -7.205053, 12.833263 -7.005792, 12.823416 -6.975193, 12.8213 -6.959161, 12.819672 -6.954034, 12.816661 -6.950372, 12.815196 -6.946954, 12.817882 -6.942153, 12.824555 -6.934259, 12.827485 -6.929132, 12.829926 -6.918878, 12.832774 -6.915785, 12.833507 -6.912286, 12.828787 -6.904555, 12.799571 -6.923272, 12.779633 -6.914727, 12.706879 -6.814223, 12.620425 -6.734823, 12.550632 -6.632639, 12.458181 -6.465753, 12.421954 -6.380988, 12.395576 -6.324453, 12.368826 -6.287693, 12.344543 -6.254147, 12.319149 -6.22014, 12.279447 -6.147705, 12.27506 -6.114769, 12.290294 -6.096612, 12.312655 -6.090545, 12.333648 -6.078436, 12.327012 -6.093811, 12.324781 -6.122353, 12.346873 -6.120113, 12.382207 -6.110168, 12.432959 -6.108984, 12.496928 -6.094594, 12.527768 -6.074826, 12.549799 -6.067123, 12.580642 -6.062695, 12.632823 -6.034356, 12.645518 -6.028985, 12.669817 -6.02971, 12.690752 -6.037358, 12.716095 -6.045002, 12.742538 -6.049356, 12.77117 -6.041659, 12.817431 -6.03175, 12.861469 -6.016347, 12.882386 -6.000986, 12.927569 -5.981218, 12.94627 -5.955991, 12.966074 -5.931853, 12.97266 -5.913214, 12.98588 -5.90114, 13.011139 -5.895606, 13.029867 -5.893381, 13.046372 -5.885679, 13.064015 -5.887838, 13.100597 -5.891209, 13.111827 -5.890232, 13.129161 -5.883559, 13.169688 -5.861749, 13.183849 -5.856459, 13.183913 -5.856427, 13.184911 -5.856386, 13.26935 -5.863517, 13.311001 -5.873956, 13.342524 -5.890595, 13.353582 -5.882637, 13.37384 -5.860933, 13.380454 -5.856386, 13.41332 -5.857006, 13.493212 -5.858453, 13.522668 -5.867548, 13.53476 -5.867031, 13.553053 -5.859383, 13.562562 -5.857419, 13.641523 -5.865791, 13.807146 -5.852458, 13.943572 -5.841606, 13.98233 -5.853285)), ((12.801058 -4.410014, 12.814804 -4.412908, 12.830307 -4.409704, 12.842296 -4.40433, 12.854285 -4.403089, 12.869891 -4.411978, 12.884464 -4.432131, 12.902447 -4.480191, 12.921981 -4.502308, 12.961565 -4.533831, 13.027194 -4.612172, 13.073703 -4.635323, 13.065331 -4.663952, 13.029571 -4.676871, 12.833201 -4.722656, 12.802918 -4.739813, 12.786175 -4.758416, 12.774806 -4.7795, 12.768295 -4.801928, 12.766228 -4.825182, 12.756926 -4.837275, 12.711968 -4.86332, 12.696982 -4.875619, 12.6883 -4.897013, 12.686233 -4.912826, 12.678895 -4.924298, 12.6544 -4.932566, 12.61585 -4.93546, 12.606961 -4.94223, 12.603964 -4.96259, 12.587738 -5.000314, 12.550427 -5.024188, 12.466505 -5.053127, 12.458133 -5.054161, 12.450692 -5.053127, 12.444387 -5.055091, 12.439426 -5.064806, 12.43891 -5.073281, 12.44077 -5.08403, 12.444697 -5.093538, 12.450382 -5.098809, 12.51198 -5.120513, 12.524072 -5.129091, 12.530687 -5.162681, 12.52769 -5.239472, 12.524382 -5.324738, 12.519731 -5.444214, 12.514977 -5.568755, 12.512497 -5.63366, 12.508983 -5.726264, 12.435499 -5.725541, 12.344445 -5.724611, 12.258972 -5.736703, 12.210555 -5.763465, 12.210541 -5.763442, 12.210297 -5.763116, 12.161794 -5.681248, 12.147227 -5.617934, 12.170177 -5.55462, 12.182384 -5.543227, 12.19337 -5.540623, 12.204845 -5.539809, 12.218598 -5.534112, 12.228282 -5.523696, 12.232188 -5.510919, 12.232188 -5.479587, 12.229259 -5.466892, 12.214122 -5.431248, 12.19639 -5.396097, 12.171362 -5.329088, 12.172091 -5.302095, 12.132349 -5.232529, 12.124612 -5.184828, 12.069737 -5.119783, 12.023123 -5.045994, 12.023285 -5.035252, 12.035151 -5.038469, 12.054771 -5.042354, 12.067823 -5.046253, 12.074346 -5.052106, 12.080892 -5.075509, 12.100527 -5.080022, 12.116815 -5.069629, 12.127259 -5.053366, 12.128561 -5.039711, 12.137715 -5.034497, 12.137054 -5.014996, 12.132476 -5.005899, 12.123331 -5.002655, 12.112885 -5.00201, 12.10505 -5.013067, 12.103085 -5.027376, 12.103738 -5.048836, 12.097859 -5.054043, 12.09067 -5.050798, 12.086108 -5.030636, 12.079588 -5.020232, 12.071752 -5.017634, 12.066529 -5.02674, 12.056727 -5.027397, 12.04496 -5.020902, 12.030556 -5.022867, 12.009608 -5.019631, 12.018072 -5.0086, 12.130815 -4.912929, 12.15717 -4.870554, 12.187555 -4.768028, 12.192206 -4.763481, 12.204092 -4.763481, 12.213497 -4.769165, 12.222592 -4.780637, 12.235201 -4.803995, 12.244089 -4.796347, 12.258559 -4.790766, 12.273752 -4.787149, 12.307651 -4.783635, 12.321914 -4.778157, 12.332353 -4.765858, 12.374107 -4.683176, 12.378862 -4.662298, 12.377621 -4.619407, 12.387026 -4.605454, 12.414105 -4.608865, 12.429091 -4.607521, 12.497201 -4.5853, 12.608098 -4.565043, 12.623808 -4.559255, 12.634867 -4.54768, 12.656571 -4.507372, 12.670523 -4.491353, 12.686853 -4.47833, 12.70494 -4.467995, 12.718479 -4.451872, 12.726541 -4.427997, 12.737909 -4.40495, 12.761681 -4.391204, 12.775426 -4.396165, 12.782656 -4.400071, 12.801058 -4.410014)))"; + void test1() { DB::CartesianPolygon green, blue; @@ -158,6 +164,43 @@ void test3() printMultiPolygon(output); } + +void test4() +{ + DB::CartesianMultiPolygon green, blue; + boost::geometry::read_wkt(example, green); + + boost::geometry::read_wkt(example, blue); + + // boost::geometry::correct(green); + // boost::geometry::correct(blue); + + + // boost::geometry::correct(green); + + for (auto & polygon : green) + mercator(polygon); + + for (auto & polygon: blue) + mercator(polygon); + + std::cout << "----" << std::endl; + std::cout << boost::geometry::wkt(green) << std::endl; + std::cout << "----" << std::endl; + + DB::CartesianMultiPolygon output; + boost::geometry::intersection(green, blue, output); + + reverseMercator(output); + + // boost::geometry::correct(output); + // std::cout << boost::geometry::wkt(output) << std::endl; + + // printMultiPolygon(output); + + // std::cout << std::boolalpha << boost::geometry::equals(output, green) << std::endl; +} + int main(int argc, char ** argv) { (void) argc; @@ -165,5 +208,6 @@ int main(int argc, char ** argv) test1(); test2(); test3(); + test4(); return 0; } diff --git a/src/Functions/ya.make b/src/Functions/ya.make index 3ac64828b9c..a373ec88d54 100644 --- a/src/Functions/ya.make +++ b/src/Functions/ya.make @@ -335,6 +335,7 @@ SRCS( map.cpp match.cpp materialize.cpp + mercatorConverters.cpp minus.cpp modulo.cpp moduloOrZero.cpp diff --git a/tests/queries/0_stateless/01301_polygons_within.reference b/tests/queries/0_stateless/01301_polygons_within.reference index 5565ed6787f..1a2946b2542 100644 --- a/tests/queries/0_stateless/01301_polygons_within.reference +++ b/tests/queries/0_stateless/01301_polygons_within.reference @@ -2,3 +2,5 @@ 1 0 1 +0 +1 diff --git a/tests/queries/0_stateless/01301_polygons_within.sql b/tests/queries/0_stateless/01301_polygons_within.sql index 97e0573904a..25207dc398a 100644 --- a/tests/queries/0_stateless/01301_polygons_within.sql +++ b/tests/queries/0_stateless/01301_polygons_within.sql @@ -4,4 +4,5 @@ select polygonsWithinCartesian([[[(2., 2.), (2., 3.), (3., 3.), (3., 2.)]]], [[[ select polygonsWithinSpherical([[[(4.3613577, 50.8651821), (4.349556, 50.8535879), (4.3602419, 50.8435626), (4.3830299, 50.8428851), (4.3904543, 50.8564867), (4.3613148, 50.8651279)]]], [[[(4.346693, 50.858306), (4.367945, 50.852455), (4.366227, 50.840809), (4.344961, 50.833264), (4.338074, 50.848677), (4.346693, 50.858306)]]]); select polygonsWithinSpherical([[[(4.3501568, 50.8518269), (4.3444920, 50.8439961), (4.3565941, 50.8443213), (4.3501568, 50.8518269)]]], [[[(4.3679450, 50.8524550),(4.3466930, 50.8583060),(4.3380740, 50.8486770),(4.3449610, 50.8332640),(4.3662270, 50.8408090),(4.3679450, 50.8524550)]]]); - +select polygonsWithinMercator([[[(4.3613577, 50.8651821), (4.349556, 50.8535879), (4.3602419, 50.8435626), (4.3830299, 50.8428851), (4.3904543, 50.8564867), (4.3613148, 50.8651279)]]], [[[(4.346693, 50.858306), (4.367945, 50.852455), (4.366227, 50.840809), (4.344961, 50.833264), (4.338074, 50.848677), (4.346693, 50.858306)]]]); +select polygonsWithinMercator([[[(4.3501568, 50.8518269), (4.3444920, 50.8439961), (4.3565941, 50.8443213), (4.3501568, 50.8518269)]]], [[[(4.3679450, 50.8524550),(4.3466930, 50.8583060),(4.3380740, 50.8486770),(4.3449610, 50.8332640),(4.3662270, 50.8408090),(4.3679450, 50.8524550)]]]); diff --git a/tests/queries/0_stateless/01305_polygons_union.reference b/tests/queries/0_stateless/01305_polygons_union.reference index 64c6ac473e4..cf9c9fe8d5b 100644 --- a/tests/queries/0_stateless/01305_polygons_union.reference +++ b/tests/queries/0_stateless/01305_polygons_union.reference @@ -1,2 +1,7 @@ +-------- [[[(1,2.9),(1,4),(4,4),(4,1),(2.9,1),(3,0),(0,0),(0,3),(1,2.9)]]] +-------- +-------- [[[(4.3666052904432435,50.84337386140151),(4.366227,50.840809),(4.344961,50.833264),(4.338074,50.848677),(4.346693,50.858306),(4.3526804582393535,50.856658100365976),(4.3613577,50.8651821),(4.3613148,50.8651279),(4.3904543,50.8564867),(4.3830299,50.8428851),(4.3666052904432435,50.84337386140151)]]] +-------- +[[[(4.366505261795747,50.843273415405),(4.3661270000000005,50.840709),(4.344861,50.83316399999998),(4.337974,50.84857699999999),(4.346593,50.858205999999996),(4.352580404040105,50.85655765067624),(4.3612577,50.86508209999998),(4.361214800000001,50.8650279),(4.3903543,50.85638669999999),(4.382929900000001,50.842785099999986),(4.366505261795747,50.843273415405)]]] diff --git a/tests/queries/0_stateless/01305_polygons_union.sql b/tests/queries/0_stateless/01305_polygons_union.sql index a67c5a7d399..d022bf46971 100644 --- a/tests/queries/0_stateless/01305_polygons_union.sql +++ b/tests/queries/0_stateless/01305_polygons_union.sql @@ -1,5 +1,11 @@ +select '--------'; select polygonsUnionCartesian([[[(0., 0.),(0., 3.),(1., 2.9),(2., 2.6),(2.6, 2.),(2.9, 1),(3., 0.),(0., 0.)]]], [[[(1., 1.),(1., 4.),(4., 4.),(4., 1.),(1., 1.)]]]); +select '--------'; SELECT polygonsUnionCartesian([[[(2., 100.0000991821289), (0., 3.), (1., 2.9), (2., 2.6), (2.6, 2.), (2.9, 1), (3., 0.), (100.0000991821289, 2.)]]], [[[(1., 1.), (1000.0001220703125, nan), (4., 4.), (4., 1.), (1., 1.)]]]); -- { serverError 43 } +select '--------'; select polygonsUnionSpherical([[[(4.3613577, 50.8651821), (4.349556, 50.8535879), (4.3602419, 50.8435626), (4.3830299, 50.8428851), (4.3904543, 50.8564867), (4.3613148, 50.8651279)]]], [[[(4.346693, 50.858306), (4.367945, 50.852455), (4.366227, 50.840809), (4.344961, 50.833264), (4.338074, 50.848677), (4.346693, 50.858306)]]]); + +select '--------'; +select polygonsUnionMercator([[[(4.3613577, 50.8651821), (4.349556, 50.8535879), (4.3602419, 50.8435626), (4.3830299, 50.8428851), (4.3904543, 50.8564867), (4.3613148, 50.8651279)]]], [[[(4.346693, 50.858306), (4.367945, 50.852455), (4.366227, 50.840809), (4.344961, 50.833264), (4.338074, 50.848677), (4.346693, 50.858306)]]]); diff --git a/tests/queries/0_stateless/01306_polygons_intersection.reference b/tests/queries/0_stateless/01306_polygons_intersection.reference index 3ac2647e7f5..e48057e1eb3 100644 --- a/tests/queries/0_stateless/01306_polygons_intersection.reference +++ b/tests/queries/0_stateless/01306_polygons_intersection.reference @@ -1,4 +1,9 @@ +-------- [[[(1,2.9),(2,2.6),(2.6,2),(2.9,1),(1,1),(1,2.9)]]] [] +-------- [] [[[(4.3666052904432435,50.84337386140151),(4.3602419,50.8435626),(4.349556,50.8535879),(4.3526804582393535,50.856658100365976),(4.367945,50.852455),(4.3666052904432435,50.84337386140151)]]] +-------- +[] +[[[(4.366505261795747,50.843273415405),(4.3601419,50.8434626),(4.349456,50.8534879),(4.352580404040105,50.85655765067624),(4.367845,50.85235499999999),(4.366505261795747,50.843273415405)]]] diff --git a/tests/queries/0_stateless/01306_polygons_intersection.sql b/tests/queries/0_stateless/01306_polygons_intersection.sql index fd428c3d826..0a0aab2233b 100644 --- a/tests/queries/0_stateless/01306_polygons_intersection.sql +++ b/tests/queries/0_stateless/01306_polygons_intersection.sql @@ -1,5 +1,12 @@ + +select '--------'; select polygonsIntersectionCartesian([[[(0., 0.),(0., 3.),(1., 2.9),(2., 2.6),(2.6, 2.),(2.9, 1.),(3., 0.),(0., 0.)]]], [[[(1., 1.),(1., 4.),(4., 4.),(4., 1.),(1., 1.)]]]); select polygonsIntersectionCartesian([[[(0., 0.),(0., 3.),(1., 2.9),(2., 2.6),(2.6, 2.),(2.9, 1.),(3., 0.),(0., 0.)]]], [[[(3., 3.),(3., 4.),(4., 4.),(4., 3.),(3., 3.)]]]); +select '--------'; select polygonsIntersectionSpherical([[[(4.346693, 50.858306), (4.367945, 50.852455), (4.366227, 50.840809), (4.344961, 50.833264), (4.338074, 50.848677), (4.346693, 50.858306)]]], [[[(25.0010, 136.9987), (17.7500, 142.5000), (11.3733, 142.5917)]]]); select polygonsIntersectionSpherical([[[(4.3613577, 50.8651821), (4.349556, 50.8535879), (4.3602419, 50.8435626), (4.3830299, 50.8428851), (4.3904543, 50.8564867), (4.3613148, 50.8651279)]]], [[[(4.346693, 50.858306), (4.367945, 50.852455), (4.366227, 50.840809), (4.344961, 50.833264), (4.338074, 50.848677), (4.346693, 50.858306)]]]); + +select '--------'; +select polygonsIntersectionMercator([[[(4.346693, 50.858306), (4.367945, 50.852455), (4.366227, 50.840809), (4.344961, 50.833264), (4.338074, 50.848677), (4.346693, 50.858306)]]], [[[(25.0010, 136.9987), (17.7500, 142.5000), (11.3733, 142.5917)]]]); +select polygonsIntersectionMercator([[[(4.3613577, 50.8651821), (4.349556, 50.8535879), (4.3602419, 50.8435626), (4.3830299, 50.8428851), (4.3904543, 50.8564867), (4.3613148, 50.8651279)]]], [[[(4.346693, 50.858306), (4.367945, 50.852455), (4.366227, 50.840809), (4.344961, 50.833264), (4.338074, 50.848677), (4.346693, 50.858306)]]]);