Getting points from polygon

Hello,

how can I get single xy-points from a polygon like for example:

CREATE TABLE "public"."country"
(
"country_id" INTEGER NOT NULL,
"geo" polygon NOT NULL
)

SELECT geo.x, geo.y FROM country WHERE geo.x=5

or

SELECT geo[24th point].x FROM country

....

Thanks in advance and best regards,
Sebastian
albrechtt [ Do, 12 August 2004 18:59 ] [ ID #453254 ]

Re: Getting points from polygon

albrechtt [at] inseal.de (Sebastian Albrecht) writes:
> how can I get single xy-points from a polygon like for example:

[ looks through pg_proc... ] Hmm, this seems to be an oversight
in the polygon datatype. I don't think it'd be real practical
to support an array-subscript-like notation, but certainly a
function like point(polygon, n) wouldn't be too hard to add.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
tgl [ So, 15 August 2004 21:43 ] [ ID #453265 ]
Datenbanken » comp.databases.postgresql.sql » Getting points from polygon

Vorheriges Thema: Re: UNIQUE constraint
Nächstes Thema: Re: LIKE '%%' does not return NULL