I have to queries, one tries to calculate the distance between floats coordinates (x1,y1,x2,y2), and the other tries to calculate the distance between a geom and an float coordinate, both should return distance in meters.
I'm using the following query for the 2 floats:
ST_Distance_Sphere(st_setsrid(st_makepoint(longitude, latitude),4326), st_setsrid(st_makepoint(?,?),4326)) AS distance
And The querty for geom and float is:
ST_Distance_Sphere(geom, st_setsrid(st_makepoint(?,?),4326)) AS distance
I can't to fully understand the SRID concept, and I'm having the feeling that my numbers are incorrects because of it.
Can someone help to output a distance in meters?
Thanks, Itay.