I have built a query to obtain the minor distance given a point.
SELECT name, city, region, Distance(GeometryFromText('POINT(-56.237076563852 -34.8575427772688)',22181),the_geom) as distancia FROM line WHERE (Distance(GeometryFromText('POINT(-56.237076563852 -34.8575427772688)',22181),the_geom) < 0.01) AND (Distance(GeometryFromText('POINT(-56.237076563852 -34.8575427772688)',22181),the_geom) > 0) ORDER BY distancia LIMIT 2 But now my problem is that I want to perform this query given a list of points (lat, long), but they are 200 points!, and the performance it´s really awful executing this query 200 times!
It's there a way to make a single query to obtain the desired result?
Thanks!
أكثر...
SELECT name, city, region, Distance(GeometryFromText('POINT(-56.237076563852 -34.8575427772688)',22181),the_geom) as distancia FROM line WHERE (Distance(GeometryFromText('POINT(-56.237076563852 -34.8575427772688)',22181),the_geom) < 0.01) AND (Distance(GeometryFromText('POINT(-56.237076563852 -34.8575427772688)',22181),the_geom) > 0) ORDER BY distancia LIMIT 2 But now my problem is that I want to perform this query given a list of points (lat, long), but they are 200 points!, and the performance it´s really awful executing this query 200 times!
It's there a way to make a single query to obtain the desired result?
Thanks!
أكثر...