繁体   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