[postgis-tickets] [PostGIS] #2363: st_distance with an added Integer value is not working in 2.0

PostGIS trac at osgeo.org
Tue Jun 18 13:30:21 PDT 2013


#2363: st_distance with an added Integer value is not working in 2.0
---------------------+------------------------------------------------------
 Reporter:  vbalent  |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  blocker  |   Milestone:  PostGIS 2.0.4
Component:  postgis  |     Version:  2.0.x        
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by robe):

 You should right it like this below.  It's example like you Distance <=
 5280 except the distance value is part of the function.
 http://postgis.net/docs/manual-2.0/ST_DWithin.html

 {{{
 SELECT * FROM PART_1_CRIMES WHERE ST_DWithin(geom,
 ST_TRANSFORM(ST_GeomFromText('POINT(-73.76545859999999 42.658618)', 4326),
 2260),  5280.0) ;
 }}}

 You can use ST_PointFromText as you have but ST_GeomFromText works for all
 geometries and is also faster speed wise.  ST_PointFromText does an extra
 check to verify you gave it a point which is unnecessary for your use
 case.

 BTW: this is all covered in first chapter of my upcoming 2nd edition book:
 http://www.postgis.us/chapter_01_edition_2  and first chapter is a free
 download

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2363#comment:4>
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