Re: PostGIS return multiple points

From: maarten <maarten(dot)foque(at)edchq(dot)com>
To: trevor1940 <antonys(at)nsom(dot)org(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PostGIS return multiple points
Date: 2010-10-28 13:57:10
Message-ID: 1288274230.8169.19.camel@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hey,

I haven't used postgis yet, however,

assuming the normal rules still apply and st_Contains returns
true/false:

SELECT ... WHERE st_Contains(point1) OR st_Contains(point2) OR ...

or using the IN statement:
SELECT ... WHERE true IN (st_Contains(point1),st_Contains(point2),...)

That should give you a list of all polynames.
The trick is figuring out what polyname goes with which point. But I
leave that as an exercise to the reader, as it's tea time.

regards,
Maarten

On Thu, 2010-10-28 at 01:00 -0700, trevor1940 wrote:
> Hi
>
> I have a PostGIS table and I wish to get the location/name of multiple
> points at once the command for selecting one point is
>
> select PolyName from MyPolygones where st_Contains(the_geom,
> GeomFromText('point($LAT $LONG)4326');
>
> where $LAT $LONG are perl varables
> So how can i do this if iI have 100 points without hitting the database 100
> times?
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/PostGIS-return-multiple-points-tp3240107p3240107.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2010-10-28 14:05:49 Re: Can't take base back up with Postgres 9.0 on Solaris 10
Previous Message Gabriele Bartolini 2010-10-28 13:37:47 Re: DB become enormous with continuos insert and update