[postgis-users] Buffer select from one layer to another?

Abram Gillespie abe.gillespie.lists at gmail.com
Wed Jun 11 12:21:58 PDT 2008


I think this bounced ... sorry if it's a dupe.

Indeed, that was noticeably faster.  Thanks!

This brings up a good point, albeit OT for this thread:

What's the difference between using st_* and other functions w/o the
st_ prefix.  For example, why is there both st_buffer() and buffer()?

-Abe
zigGIS Team
Obtuse Software, http://www.obtusesoft.com

On Wed, Jun 11, 2008 at 2:39 PM, Obe, Regina <robe.dnd at cityofboston.gov> wrote:
> Abe,
> David's is close but doesn't use an index
> Try
>
>
> SELECT  h.* FROM  houses h, roads r
> where r.gid=1663 and  ST_DWithin(h.the_geom, r.the_geom, 500)
>
>
> (although the above really translates to < 500 instead of <= 500)
>
> Hope that helps,
> Regina
> ________________________________
> From: postgis-users-bounces at postgis.refractions.net on behalf of David
> William Bitner
> Sent: Wed 6/11/2008 2:08 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] Buffer select from one layer to another?
>
> Abe --
>
> For this type of query, running a buffer is actually not necessary.
>
> select h.* from houses h,roads r where r.name like '%MAIN%' and
> distance(h.the_geom,r.the_geom)<=500;
>
> David
>
> On Wed, Jun 11, 2008 at 12:54 PM, Abram Gillespie
> <abe.gillespie.lists at gmail.com> wrote:
>> Hi All,
>>
>> I'm finally starting to do some real production work ... after years
>> of simply using PostGIS in example scenarios as I developed zigGIS.
>> Pretty funny, actually.  Anywho, could someone enlighten me on how to
>> buffer a road and return the surrounding buildings?  This is what I
>> have so far:
>>
>> select h.* from houses h,roads r where r.name like '%MAIN%' and
>> touches(h.the_geom, buffer(r.the_geom,500));
>>
>> Now I realize the above is a bit complex since " like '%MAIN%' "
>> returns multiple road segments, but even working on a single road:
>>
>> select h.* from houses h,roads r where r.gid=1663 and
>> touches(h.the_geom, buffer(r.the_geom,500));
>>
>> doesn't seem to return anything.  I'm positive the buffer query should
>> return some houses.
>>
>> Thanks for any help!
>>
>> -Abe
>> zigGIS Team
>> Obtuse Software, http://www.obtusesoft.com
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>
>
>
> --
> ************************************
> David William Bitner
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
> ________________________________
>
> The substance of this message, including any attachments, may be
> confidential, legally privileged and/or exempt from disclosure pursuant to
> Massachusetts law. It is intended solely for the addressee. If you received
> this in error, please contact the sender and delete the material from any
> computer.
>
> ________________________________
>
> Help make the earth a greener place. If at all possible resist printing this
> email and join us in saving paper.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>



More information about the postgis-users mailing list