- Notifications
You must be signed in to change notification settings - Fork15
[ISSUE #22] Created spoint_deg, scircle_deg, spoly_deg functions.#38
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
vitcpp commentedJul 31, 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.
@stepan-neretin7 In general, I'm ok with your patch except of some cosmetic issues (float -> float8 is important). To create a complete patch I would ask to change the version to 1.3.0 (API is changed) and create a new upgrade script with name pg_sphere--1.2.3--1.3.0.sql.in in upgrade_scripts subdirectory. Makefile should also be updated to add support for the new upgrade script. Upgrade scripts are used to alter the existing schema of previous version to the new schema. In our case we have to create new functions in the new upgrade script. Thank you! |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
aa46131 toe0c76c4Compare048e068 to5ccfedbComparedura0ok commentedAug 1, 2023
@vitcpp I have updated the version |
Uh oh!
There was an error while loading.Please reload this page.
dura0ok commentedAug 1, 2023
I also added the spoly_deg function, which accepts, as in the pr of 5 years ago, an array of float8, where there are consecutive pairs in the sequence of two float8 per point for the polygon |
esabol commentedAug 2, 2023
Thank you! I was just going to suggest that adding a |
dura0ok commentedAug 2, 2023
Sorry, I didn't really get your message. So I guessed your thought? :D |
esabol commentedAug 2, 2023
Sorry, I thought I already did. Approved! |
esabol commentedAug 2, 2023
Oh, sorry, I found one more minor thing: I saw you fixed the "radius must be not greater than 90 degrees" error message, but there is another version of that error on line 84 of src/circle.c. Could you fix line 84 similar to how you fixed line 366? |
dura0ok commentedAug 2, 2023
Of course, I've already fixed it. However, it is strange that there are no tests specifically for this error in circle.sql. |
vitcpp commentedAug 2, 2023
@stepan-neretin7 I added some review comments. Most of the comments are minor and related to the code formatting. I would propose to work out these comments. Another performance issue I've found is in spherepoly_deg(). It will work as it is now but it is not an effective solution. Anyway, I'm ok to apply PR without redesign of this function. |
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.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/polygon.c Outdated
| for (i=0;i<num_elements-1;i+=2) | ||
| { | ||
| point=DirectFunctionCall2( | ||
| spherepoint_from_long_lat_deg,Float8GetDatum(array_data[i]),Float8GetDatum(array_data[i+1]) |
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.
It is not an effective solution. spherepoint_from_long_lat_deg returns palloc-ed spoint. Later this spoint is copied into already pallocated points array. I propose to pfree it after line 892. It will work but I would rather think how to avoid unecessary palloc.
30a17c7 todf45187CompareUh 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.
Uh oh!
There was an error while loading.Please reload this page.
dura0ok commentedAug 2, 2023
I corrected all the comments |
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.
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.
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.
dura0ok commentedAug 3, 2023
Sorry for trivial coding style issues. I fixed it@esabol |
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.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/polygon.c Outdated
| ); | ||
| } | ||
| PG_RETURN_POINTER(spherepoly_from_array(points,np)); | ||
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 unecessary blank line please.
Uh oh!
There was an error while loading.Please reload this page.
9d8b007 to4199d35CompareUh oh!
There was an error while loading.Please reload this page.
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!
@esabol@vitcpp please, review it.