- Notifications
You must be signed in to change notification settings - Fork15
Add spoly_is_convex#43
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
d89edcf toa0be9d3Compare
vitcpp left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
In general everything is ok except of some trivial issues.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
vitcpp commentedAug 3, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@ggnmstr thank you for the PR. I think everything is ok except of some trivial issues. The tests should be fixed - could you please try to run tests without healpix:
I would also ask to start the commit comment from capital lettet as it was done for other commits. |
b61c748 to5d264e6Comparedura0ok commentedAug 4, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
fix_tests.patch |
ggnmstr commentedAug 4, 2023
@stepan-neretin7 Thank you, it works, seems like there's a problem with healpix on my computer. |
dura0ok commentedAug 4, 2023
@ggnmstr please, start commit with capital letter |
esabol commentedAug 4, 2023
@stepan-neretin7 wrote:
Do you mean the title of the pull request,@stepan-neretin7 ? The one commit message athttps://github.com/postgrespro/pgsphere/pull/43/commits does start with a capital letter. |
dura0ok commentedAug 4, 2023
Yes, I think it's a good idea. I also suggest that you also specify the issue number in the comment, so that he automatically linked it to the desired issue even before the merge. |
vitcpp commentedAug 5, 2023
@ggnmstr There are some conflicts. Could you please do rebase on the newest version and fix the conflicts? |
esabol commentedAug 5, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@ggnmstr: CI failures. Please check and fix "make test" results. https://app.travis-ci.com/github/postgrespro/pgsphere/jobs/607409643 |
544f4f6 to4570340Compareexpected/init_test.out.in Outdated
| psql:pg_sphere.test.sql:8594: NOTICE: argument type pointkey is only a shell | ||
| psql:pg_sphere.test.sql:8600: NOTICE: argument type pointkey is only a shell | ||
| psql:pg_sphere.test.sql:9167: NOTICE: return type smoc is only a shell | ||
| psql:pg_sphere.test.sql:9173: NOTICE: argument type smoc is only a shell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Add linefeed to the end of this file.
expected/init_test_healpix.out.in Outdated
| psql:pg_sphere.test.sql:9181: NOTICE: return type smoc is only a shell | ||
| psql:pg_sphere.test.sql:9187: NOTICE: argument type smoc is only a shell | ||
| psql:pg_sphere.test.sql:9167: NOTICE: return type smoc is only a shell | ||
| psql:pg_sphere.test.sql:9173: NOTICE: argument type smoc is only a shell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Add a linefeed to the end of this file.
2620fa7 toa35e842Compareexpected/init_test_healpix.out.in Outdated
| psql:pg_sphere.test.sql:9181: NOTICE: return type smoc is only a shell | ||
| psql:pg_sphere.test.sql:9187: NOTICE: argument type smoc is only a shell | ||
| psql:pg_sphere.test.sql:9167: NOTICE: return type smoc is only a shell | ||
| psql:pg_sphere.test.sql:9173: NOTICE: argument type smoc is only a shell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
You are almost there! Change "9167" to "9195" on line 1. Change "9173" to "9201" on line 2.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
vitcpp commentedAug 7, 2023
To finalize PR the following changes are required:
|
ggnmstr commentedAug 8, 2023
@stepan-neretin7, this "return null" behavior is common among all functions, I don't think it is possible to change something just in place. |
dura0ok commentedAug 8, 2023
but in your code you return false.. Very strange for me.. |
esabol left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
A couple more minor tweaks, please,@ggnmstr. Thank you!
src/polygon.c Outdated
| wsv, | ||
| crs; | ||
| float8cur=0, | ||
| prev=0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do the variables on lines 1487-1493 line up vertically for you? They don't line up vertically in the diff output here on GitHub.com.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes, they do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
src/polygon.h Outdated
| /* | ||
| * Checks whether a polygon is convex | ||
| */ | ||
| Datumspherepoly_is_convex(PG_FUNCTION_ARGS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Add spaces afterDatum so thatspherepoly_is_convex lines up vertically with the names of the functions above this.
doc/functions.sgm Outdated
| Spoly is convex | ||
| </title> | ||
| <para> | ||
| Returns true if the specified spherical polygon is convex. Returns false otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Is this line longer than 79 characters? I can't tell looking at it in the web browser here. If it is, please word-wrap it.
ff10fe4 toe740d2cComparevitcpp commentedAug 8, 2023
I agree, it should return false. The third value is unnecessary. To fix it STRICT keyword should be removed in CREATE FUNCTION command. I also propose to update the tests by adding this case. |
ggnmstr commentedAug 8, 2023
@vitcpp. I fixed it and added a test, thanks for the information. |
dura0ok commentedAug 8, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
for (int i = 0; i < poly->npts; i++) |
vitcpp left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
spherepoly_is_convex() functions seems to be ok as the first working version, but the code is not optimized. There are duplicate calculations in the for loop that can slowdown the performance.
vitcpp commentedAug 9, 2023
There are some conflicts that should be resolved.@ggnmstr Could you please rebase your branch to the latest postgrespro/pgsphere version and fix conflicts? |
ggnmstr commentedAug 9, 2023
Yes, I agree with that. I think I'll optimize it a bit later. |
| refer to the same occurrence and cover its | ||
| latitude and longitude, respectively.'; | ||
| <<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Remove the line
esabol left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Still need to getmake test working.
expected/init_test.out.in Outdated
| psql:pg_sphere.test.sql:8628: NOTICE: argument type pointkey is only a shell | ||
| psql:pg_sphere.test.sql:8634: NOTICE: argument type pointkey is only a shell | ||
| psql:pg_sphere.test.sql:8640: NOTICE: argument type pointkey is only a shell | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Why did you add this blank line? I think it should be removed.
Take a look at the diff output at the bottom of the log here:
https://app.travis-ci.com/github/postgrespro/pgsphere/jobs/607714835
You need to change the line numbers in this file to match the results so that there are no differences.
expected/init_test_healpix.out.in Outdated
| @@ -1,2 +1,3 @@ | |||
| psql:pg_sphere.test.sql:9207: NOTICE: return type smoc is only a shell | |||
| psql:pg_sphere.test.sql:9213: NOTICE: argument type smoc is only a shell | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Remove this blank line. In this file, change "9207" to "9221" and change "9213" to "9227".
006ad50 toe642169Compare
esabol left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good to me! Thank you for your contribution and perseverance,@ggnmstr!
vitcpp commentedAug 11, 2023
vitcpp commentedAug 11, 2023
@ggnmstr Could you please do one more iteration - re-sync your branch with this repo, resolve conflicts and force-push your changes? Your PR will be the next. Thank you in advance! |
ggnmstr commentedAug 12, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@vitcpp, Ok, I did it. The tests are OK, I guess, I just realized that I was typing "HEAPLIX" all the time and then wondering why is it not working on my PC |
vitcpp commentedAug 12, 2023
@ggnmstr Thank you very much! |

Adds function to determine whether the spoly is convex.
Algorithm based on
https://mathoverflow.net/questions/193569/determining-orientation-of-spherical-polygons