[postgis-tickets] [PostGIS] #3059: Allow passing per-dimension parameters in ST_Expand
PostGIS
trac at osgeo.org
Tue May 17 11:08:26 PDT 2016
#3059: Allow passing per-dimension parameters in ST_Expand
--------------------------+---------------------------
Reporter: strk | Owner: dbaston
Type: enhancement | Status: new
Priority: medium | Milestone: PostGIS 2.3.0
Component: postgis | Version: trunk
Resolution: | Keywords:
--------------------------+---------------------------
Changes (by dbaston):
* owner: strk => dbaston
* status: assigned => new
* milestone: PostGIS Future => PostGIS 2.3.0
Comment:
This seems like a nice way to improve hackish {{{ST_DWithin}}} queries on
WGS84 geometries stored as geometry.
So, to find polygons within 1km of a point, you could do:
{{{
SELECT * FROM polygons
WHERE geom && ST_Expand('POINT (37 52)', 1000.0/69000, 1000.0/111111, 0.0)
AND ST_Distance_Sphere(geom, 'POINT (37 52)') < 1000
}}}
where 69000 m approximates 1 degree of longitude, and 111111 m
approximates 1 degree of latitude (at 52 degrees N)
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3059#comment:3>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list