Reputation: 727
I have the following query in plpgsql:
FOR _t IN EXECUTE 'select distinct_network_point.id AS network_point_id
from distinct_network_point, all_points_ordered
where road_id='||road_id||' AND distinct_network_point.point = all_points_ordered.point AND all_points_ordered.point != st_setsrid(st_makepoint('||new_point||'),4326)
order by st_distance(all_points_ordered.point,st_setsrid(st_makepoint('||new_point||'),4326))
limit 1'
For some it is giving me the following error:
If I use this <> operator it will give me this than:
Can anyone explain what it really mean?. The query works fine in sql.
Upvotes: 0
Views: 46
Reputation: 37398
Since you're dealing with geometric types, neither the !=
or <>
operators are valid.
Instead, please refer to the following list of geometric operators.
In this case, since you want to check that two points are not the same, I believe you can use the distance between operator, <->
, and check if the distance between your two points is greater than some sort of very small epsilon value.
Something like:
AND all_points_ordered.point <-> st_setsrid(st_makepoint('||new_point||'),4326) > 0.0001
Upvotes: 1