Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix sline_sline_pos#36

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vitcpp merged 1 commit intopostgrespro:masterfromggnmstr:spherepoly_check_fix
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes fromall 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
9 changes: 9 additions & 0 deletionsexpected/poly.out
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -350,6 +350,15 @@ SELECT spoly '{(0d,0d),(10d,10d),(0d,10d),(10d,0d)}';
ERROR: spherepoly_from_array: a line segment overlaps or polygon too large
LINE 1: SELECT spoly '{(0d,0d),(10d,10d),(0d,10d),(10d,0d)}';
^
--- degenerate polygons -----
SELECT spoly '{(0d,1d),(0d,2d),(0d,3d)}';
ERROR: spherepoly_from_array: a line segment overlaps or polygon too large
LINE 1: SELECT spoly '{(0d,1d),(0d,2d),(0d,3d)}';
^
SELECT spoly '{(1d,0d),(2d,0d),(3d,0d)}';
ERROR: spherepoly_from_array: a line segment overlaps or polygon too large
LINE 1: SELECT spoly '{(1d,0d),(2d,0d),(3d,0d)}';
^
--- functions
SELECT npoints( spoly '{(10d,0d),(10d,1d),(15d,0d)}');
npoints
Expand Down
6 changes: 6 additions & 0 deletionssql/poly.sql
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -96,6 +96,12 @@ SELECT spoly_deg(NULL::float8[]);

SELECT spoly '{(0d,0d),(10d,10d),(0d,10d),(10d,0d)}';

--- degenerate polygons -----

SELECT spoly '{(0d,1d),(0d,2d),(0d,3d)}';

SELECT spoly '{(1d,0d),(2d,0d),(3d,0d)}';

--- functions

SELECT npoints( spoly '{(10d,0d),(10d,1d),(15d,0d)}');
Expand Down
18 changes: 9 additions & 9 deletionssrc/line.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -494,15 +494,6 @@ sline_sline_pos(const SLine *l1, const SLine *l2)
vector3d_spoint(&p[2], &v[1][0]);
vector3d_spoint(&p[3], &v[1][1]);

/* check connected lines */
if (FPgt(il2->length, 0.0) && (vector3d_eq(&v[0][0], &v[1][0]) ||
vector3d_eq(&v[0][0], &v[1][1]) ||
vector3d_eq(&v[0][1], &v[1][0]) ||
vector3d_eq(&v[0][1], &v[1][1])))
{
return PGS_LINE_CONNECT;
}

/* Check, sl2 is at equator */
if (FPzero(p[2].lat) && FPzero(p[3].lat))
{
Expand All@@ -527,6 +518,15 @@ sline_sline_pos(const SLine *l1, const SLine *l2)
return PGS_LINE_AVOID;
}

/* check connected lines */
if (FPgt(il2->length, 0.0) && (vector3d_eq(&v[0][0], &v[1][0]) ||
vector3d_eq(&v[0][0], &v[1][1]) ||
vector3d_eq(&v[0][1], &v[1][0]) ||
vector3d_eq(&v[0][1], &v[1][1])))
{
return PGS_LINE_CONNECT;
}

/* Now sl2 is not at equator */

if (FPle(il2->length, seg_length))
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp