[postgis-users] Calculation of Radius in PostGIS

Nicolas Ribot nicolas.ribot at gmail.com
Mon Jul 8 02:55:22 PDT 2013


Hi,

st_buffer does work with GEOGRAPHY type
(http://postgis.net/docs/manual-2.0/ST_Buffer.html).
To check if objects lie in a certain distance to a point, you should
use st_dwithin on geography type directly. It prevents you from
reprojecting data
(http://postgis.net/docs/manual-2.0/ST_DWithin.html):

SELECT i.id_impediments
FROM THE impediments i
WHERE st_dwithin (i.geometry_data::geography, GeogFromText ('POINT
(-16.675297 -49.260196)', 4326), 100)

Nicolas

On 5 July 2013 19:06, Diego Roberto <diegorrborges at gmail.com> wrote:
> Hello,
>
> I need to generate a calculation of lightning and I'm not getting. I have
> the following situation. I have a point with the coordinates -16.675297,
> -49.260196 and was stored in the database in spatial format with SRID 4326.
> Need to generate a buffer of 100 meters from this point and check which
> other points are within this buffer to return to the user.
> Realize the following conversion to make this calculation:
> http://spatialreference.org/ref/epsg/2163/
>
> SELECT i.id_impediments
> FROM THE impediments i
> WHERE st_dwithin (transform (i.geometry_data, 2163),
> transform (GeomFromText ('POINT (-16.675297 -49.260196)', 4326), 2163),
> 100)
>
> My questions are:
> This is the best way to calculate a buffer and from the moment I work with
> the conversion to SRID 2163 SELECT can do this only for the range of
> coordinates described in this link:
> I believe that this conversion also realize that is not the correct way.
> Could help me transferring any material or link so I can study?
>
> I know there's no way I generate a buffer with WGS84 (4326) so I convert to
> 2163. Working with this?
>
> Thank you.
> And I appreciate the attention.
>
> --
> ________________________________________________
> Diego Roberto
>
> ________________________________________________
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>


More information about the postgis-users mailing list