Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SEDONA-540] Fix failed ST_Buffer and ST_Snap Snowflake tests #1356

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,11 @@ public void test_ST_Buffer() {
"POLYGON ((1 1, 0.9807852804032304 0.8049096779838718, 0.9238795325112867 0.6173165676349102, 0.8314696123025452 0.4444297669803978, 0.7071067811865476 0.2928932188134525, 0.5555702330196023 0.1685303876974548, 0.3826834323650898 0.0761204674887133, 0.1950903220161283 0.0192147195967696, 0.0000000000000001 0, -0.1950903220161282 0.0192147195967696, -0.3826834323650897 0.0761204674887133, -0.555570233019602 0.1685303876974547, -0.7071067811865475 0.2928932188134524, -0.8314696123025453 0.4444297669803978, -0.9238795325112867 0.6173165676349102, -0.9807852804032304 0.8049096779838714, -1 0.9999999999999999, -0.9807852804032304 1.1950903220161284, -0.9238795325112868 1.3826834323650896, -0.8314696123025455 1.555570233019602, -0.7071067811865477 1.7071067811865475, -0.5555702330196022 1.8314696123025453, -0.3826834323650903 1.9238795325112865, -0.1950903220161287 1.9807852804032304, -0.0000000000000002 2, 0.1950903220161283 1.9807852804032304, 0.38268343236509 1.9238795325112865, 0.5555702330196018 1.8314696123025453, 0.7071067811865474 1.7071067811865477, 0.8314696123025452 1.5555702330196022, 0.9238795325112865 1.3826834323650905, 0.9807852804032303 1.1950903220161286, 1 1))"
);
registerUDF("ST_Buffer", byte[].class, double.class, boolean.class);
registerUDF("ST_ReducePrecision", byte[].class, int.class);
registerUDF("ST_Area", byte[].class);
verifySqlSingleRes(
"select ST_AsText(ST_ReducePrecision(ST_GeomFromText(sedona.ST_AsText(sedona.ST_Buffer(sedona.ST_GeomFromText('LINESTRING(0.05 15, -0.05 15)'), 10000, true))), 8))",
"POLYGON((-0.06809794 14.91143929,-0.0855181 14.91657277,-0.10157458 14.92491089,-0.11565095 14.93613348,-0.12720661 14.94980963,-0.13579747 14.96541421,-0.14109307 14.98234798,-0.14288927 14.99996056,-0.14111623 15.01757534,-0.13584121 15.03451549,-0.12726608 15.05012991,-0.11571978 15.0638183,-0.10164567 15.07505424,-0.08558461 15.0834055,-0.06815417 15.08855069,-0.05002481 15.09029174,0.0500174 15.09029949,0.06814888 15.08856105,0.08558242 15.08341775,0.10164727 15.07506734,0.11572543 15.06383098,0.12727556 15.05014087,0.13585382 15.03452355,0.1411309 15.01757961,0.14290466 14.99996055,0.14110774 14.98234371,0.13581008 14.96540615,0.12721607 14.94979867,0.11565658 14.93612079,0.10157617 14.92489779,0.08551591 14.91656051,0.06809265 14.91142893,0.04997533 14.90969989,-0.04998274 14.90970765,-0.06809794 14.91143929))"
"select sedona.ST_Area(sedona.ST_ReducePrecision(sedona.ST_GeomFromText(sedona.ST_AsText(sedona.ST_Buffer(sedona.ST_GeomFromText('LINESTRING(0.05 15, -0.05 15)'), 10000, true))), 8))",
0.04424254827358593
);
}

Expand Down Expand Up @@ -816,7 +818,7 @@ public void test_ST_StartPoint() {
public void test_ST_Snap() {
registerUDF("ST_Snap", byte[].class, byte[].class, double.class);
verifySqlSingleRes(
"SELECT sedona.ST_AsText(sedona.ST_Snap(ST_GeomFromWKT('POLYGON((2.6 12.5, 2.6 20.0, 12.6 20.0, 12.6 12.5, 2.6 12.5 ))'), ST_GeomFromWKT('LINESTRING (0.5 10.7, 5.4 8.4, 10.1 10.0)'), 2.525))",
"SELECT sedona.ST_AsText(sedona.ST_Snap(sedona.ST_GeomFromText('POLYGON((2.6 12.5, 2.6 20.0, 12.6 20.0, 12.6 12.5, 2.6 12.5 ))'), sedona.ST_GeomFromText('LINESTRING (0.5 10.7, 5.4 8.4, 10.1 10.0)'), 2.525))",
"POLYGON ((2.6 12.5, 2.6 20, 12.6 20, 12.6 12.5, 10.1 10, 2.6 12.5))"
);
}
Expand Down
Loading