我正在使用PostgreSQL v9.1.11和PostGIS 2.1.0。我正在使用st_distance_sphere來計算各個點之間的距離,並得到不尋常的結果。根據文件,該功能應返回所提供的2個點之間的距離,單位爲米。下面是我所遇到的兩個例子:來自PostGIS的st_distance_sphere返回意外值?
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
)
返回9325.862米,5.8英里,似乎是正確的
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
)
返回9873.560米,或6.1英里,甚至還沒有接近。
我已閱讀並重新閱讀PostGIS文檔,找不到任何我做錯的地方。這個功能只是行爲不端?
詢問這裏http://gis.stackexchange.com/ – huckfinn