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

Additional spoly constructors? #95

Closed
@esabol

Description

@esabol

Thespoly_deg() function can construct aspoly from an array offloat8:

CREATE FUNCTION spoly_deg(float8[])   RETURNS spoly   AS 'MODULE_PATHNAME', 'spherepoly_deg'   LANGUAGE 'c'   IMMUTABLE STRICT;

(Aside: Why is this function not PARALLEL SAFE? Should it be?)

But there's no correspondingspoly constructor that takes an array offloat8 in radians:

testdb=> SELECT spoly(ARRAY[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]);ERROR:  function spoly(numeric[]) does not existLINE 1: SELECT spoly(ARRAY[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]);               ^HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

I don't want to use a temporary table to construct aspoly in my PLpgsql functions. It's horribly inefficient and doesn't scale when operating over very large tables. So that means I have to either convert my coordinates to degrees (only forspherepoly_deg() to convert them back to radians) in order to avoid that or construct a string to contain the array of coordinates and use thespoly constructor on the string.

Also, I think it would be nice if there was a constructor that takes an array ofspoint as well, so that you can do this:

SELECT spoly([spoint(1.0, 2.0), spoint(3.0, 4.0), spoint(5.0, 6.0)]);

Should that be possible? What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp