Getting points from polygon

Поиск
Список
Период
Сортировка
Искать

Getting points from polygon

От:
albrechtt@inseal.de (Sebastian Albrecht)
Дата:
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

Re: Getting points from polygon

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
albrechtt@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

FAQ