Thread: [Q]process for 'contains'.

[Q]process for 'contains'.

From
hkkang@aiit.or.kr
Date:
hi~ my name is kang-hae kyong. i'm korean.

i have two question.
one is
        topological data structure of postgresql.
        i wonder that
        how to related each spatial object-point, polygon, path..
        in postgres.

another is..
        process of spatial operator.
        eg: 'contains' search points in polygon.
             how to search??
             how to relate between point table and polygon table.
             (the table has only set of coordinate..)

where reference book or site ...talk to me, please.
i hope to your reply.
have a nice time~ bye~



Re: [HACKERS] [Q]process for 'contains'.

From
"Thomas G. Lockhart"
Date:
> i have two question.
> one is
>         topological data structure of postgresql.
>         i wonder that
>         how to related each spatial object-point, polygon, path..
>         in postgres.

I'm not certain of your question. Most geometric objects consist of
collections of points. The exception is the circle, which consists of a
point and a radius. In order of complexity, the geometric objects are
point, lseg, line, box, path, polygon, and circle.

> another is..
>         process of spatial operator.
>         eg: 'contains' search points in polygon.
>              how to search??
>              how to relate between point table and polygon table.
>              (the table has only set of coordinate..)

Hmm. Again not certain of your question, but here are some example
queries using geometric types:

  CREATE TABLE pointtbl (name text, location point);
  CREATE TABLE polytbl (region text, boundary polygon);

  -- find which region each point is in
  SELECT p.name, y.region FROM pointtbl p, polytbl y
  WHERE p.location @ y.boundary;

> where reference book or site

There is a small description of each geometric type in the new User's
Guide.

                       - Tom