I'm writing a query that needs to be able to work with data of any SRID. The basic problem is very simple - I get two pieces of information:
proj_point = ST_Transform(point, (SELECT ST_SRID(geom) FROM table LIMIT 1));proj_dist = Something... But what?SELECT * FROM table WHERE ST_Distance(geom, proj_point) < proj_dist ORDER BY geom proj_point LIMIT 10;My problem is the conversion of the units. I can look up the SRID of the native data and transform the point no problem. But how do I do the same with the distance?
I've seen answers to related questions, but they have all involved reprojecting the queried data. Holy overkill! This should be doable with a single lookup and multiplication...
Pointers, anyone? Thanks very much in advance!
أكثر...
- A point (SRID = 900913)
- A distance (unit = meters)
proj_point = ST_Transform(point, (SELECT ST_SRID(geom) FROM table LIMIT 1));proj_dist = Something... But what?SELECT * FROM table WHERE ST_Distance(geom, proj_point) < proj_dist ORDER BY geom proj_point LIMIT 10;My problem is the conversion of the units. I can look up the SRID of the native data and transform the point no problem. But how do I do the same with the distance?
I've seen answers to related questions, but they have all involved reprojecting the queried data. Holy overkill! This should be doable with a single lookup and multiplication...
Pointers, anyone? Thanks very much in advance!
أكثر...