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

Commit595ecc9

Browse files
committed
Fix found problems after review
1 parent9d5fa49 commit595ecc9

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

‎expected/poly.out

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,18 +350,18 @@ SELECT spoly(NULL::spoint[]);
350350
(1 row)
351351

352352
SELECT spoly(ARRAY[]::spoint[]);
353-
ERROR:spoly_deg: invalid number of arguments (must be >= 3)
353+
ERROR:spherepoly_from_point_array: invalid number of arguments (must be >= 3)
354354
SELECT spoly(ARRAY[spoint_deg(0, 0)]);
355-
ERROR:spoly_deg: invalid number of arguments (must be >= 3)
355+
ERROR:spherepoly_from_point_array: invalid number of arguments (must be >= 3)
356356
SELECT spoly(ARRAY[spoint_deg(0, 0), spoint_deg(10, 0)]);
357-
ERROR:spoly_deg: invalid number of arguments (must be >= 3)
358-
SELECT spoly(ARRAY[spoint_deg(0, 0), spoint_deg(10, 0), spoint_deg(10,10)]);
357+
ERROR:spherepoly_from_point_array: invalid number of arguments (must be >= 3)
358+
SELECT spoly(ARRAY[spoint_deg(0, 0), spoint_deg(10, 0), spoint_deg(10,10)]);
359359
spoly
360360
------------------------------------
361361
{(0d , 0d),(10d , 0d),(10d , 10d)}
362362
(1 row)
363363

364-
SELECT spoly(ARRAY[spoint_deg(0, 0), spoint_deg(10, 0), spoint_deg(10,10), spoint_deg(0, 10)]);
364+
SELECT spoly(ARRAY[spoint_deg(0, 0), spoint_deg(10, 0), spoint_deg(10,10), spoint_deg(0, 10)]);
365365
spoly
366366
-----------------------------------------------
367367
{(0d , 0d),(10d , 0d),(10d , 10d),(0d , 10d)}

‎sql/poly.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ SELECT spoly(ARRAY[spoint_deg(0, 0)]);
9696

9797
SELECT spoly(ARRAY[spoint_deg(0,0), spoint_deg(10,0)]);
9898

99-
SELECT spoly(ARRAY[spoint_deg(0,0), spoint_deg(10,0), spoint_deg(10,10)]);
99+
SELECT spoly(ARRAY[spoint_deg(0,0), spoint_deg(10,0), spoint_deg(10,10)]);
100100

101-
SELECT spoly(ARRAY[spoint_deg(0,0), spoint_deg(10,0), spoint_deg(10,10), spoint_deg(0,10)]);
101+
SELECT spoly(ARRAY[spoint_deg(0,0), spoint_deg(10,0), spoint_deg(10,10), spoint_deg(0,10)]);
102102

103103
--- incorrect input -----
104104

‎src/polygon.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,21 +1010,21 @@ spherepoly_deg(PG_FUNCTION_ARGS)
10101010
Datum
10111011
spherepoly_from_point_array(PG_FUNCTION_ARGS)
10121012
{
1013-
intnp;
1014-
ArrayType*inarr=PG_GETARG_ARRAYTYPE_P(0);
10151013
SPoint*points;
1016-
1017-
np=ArrayGetNItems(ARR_NDIM(inarr),ARR_DIMS(inarr));
1014+
ArrayType*inarr=PG_GETARG_ARRAYTYPE_P(0);
1015+
constintnp=ArrayGetNItems(ARR_NDIM(inarr),ARR_DIMS(inarr));
10181016

10191017
if (np<3)
10201018
{
1021-
elog(ERROR,"spoly_deg: invalid number of arguments (must be >= 3)");
1019+
elog(ERROR,"spherepoly_from_point_array: "
1020+
"invalid number of arguments (must be >= 3)");
10221021
PG_RETURN_NULL();
10231022
}
10241023

10251024
if (ARR_HASNULL(inarr))
10261025
{
1027-
elog(ERROR,"spoly_deg: input array is invalid because if has null values");
1026+
elog(ERROR,"spherepoly_from_point_array: "
1027+
"input array is invalid because it has null values");
10281028
PG_RETURN_NULL();
10291029
}
10301030

‎src/polygon.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,22 @@ Datumspherepoly_get_point(PG_FUNCTION_ARGS);
8787
int8poly_line_pos(constSPOLY*poly,constSLine*line);
8888

8989
/*
90-
* Input of a spherical from array of pair-consecutive numbers (lng, lat), in radians.
90+
* Creates a spherical polygon (spoly) from an array of pair-consecutive
91+
* numbers (lng, lat), in radians.
9192
*/
9293
Datumspherepoly_rad(PG_FUNCTION_ARGS);
9394

9495
/*
95-
* Input of a spherical from array of pair-consecutive numbers (lng, lat), in degrees.
96+
* Creates a spherical polygon (spoly) from an array of pair-consecutive
97+
* numbers (lng, lat), in degrees.
9698
*/
9799
Datumspherepoly_deg(PG_FUNCTION_ARGS);
98100

101+
/*
102+
* Creates a spherical polygon (spoly) from an array of spoint elements.
103+
*/
104+
Datumspherepoly_from_point_array(PG_FUNCTION_ARGS);
105+
99106
/*
100107
* Input of a spherical polygon.
101108
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp