簡體   English   中英

將 Postgis SRID 與 Redis 的球形 model 匹配?

[英]Match Postgis SRID with Redis' spherical model?

我正在使用 Postgres(帶有 PostGIS),並且我有 SRID 為 4326 的幾何列。在我的堆棧中,Redis 充當緩存並使用它的地理功能保存位置數據,具體來說,假設我在Postgres 像這樣:

INSERT INTO locations(geom) VALUES(ST_GeomFromText('POINT(40.7547 -73.9614)', 4326)) RETURNING 'id';

然后將 object 添加到 Redis 中:

redis> GEOADD someId -73.9614 40.7547

問題是,因為 Redis 使用了一個完全球形的 model,所以對 postgres 使用類似球形的 model SRID 是否有益? 我發現EPSG:4047是一個球體。

是否有我沒有看到的時間、准確性或其他好處或缺陷?

將數據保存在 EPSG:4326 中,如果所有計算都在 Redis 環境中完成,則無所謂; you cannot pass in spatial reference information, and Redis seems to assume the WGS84 based (Spherical) Web Mercator projection ('seems' because they state to use a wrongly assigned and deprecated EPSG code for it...), at least for their indexing執行。

通過 Haversines 的距離計算不受這些參考系統(以及 Redis 使用的 CRS)之間變化的影響; 這些公式獨立於除球面半徑之外的任何空間參考。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM