I am working with PostgreSQL v9.1.11 and PostGIS 2.1.0. I am using st_distance_sphere to calculate the distance between various points and am getting unusual results. According to the documentation, that function should return the distance in meters between the 2 points supplied. Here are two examples that I have run:
select st_distance_sphere(
st_setsrid(st_makepoint(33.44, -82.60), 4326), -- location near Warrenton, GA
st_setsrid(st_makepoint(33.533, -82.517), 4326) -- locaton near Thomson, GA
)
which returns 9325.862 meters, or 5.8 miles, which seems correct
select st_distance_sphere(
st_setsrid(st_makepoint(33.44, -82.60), 4326), -- location near Warrenton, GA
st_setsrid(st_makepoint(32.819, -97.361), 4326) -- location near Forth Worth, TX
)
which returns 9873.560 meters, or 6.1 miles, which ain't even close.
I have read and re-read the PostGIS docs and can't find anything I am doing wrong. Is that function just misbehaving?
