简单的 PostGIS XYZ 设置?

Simple PostGIS XYZ set up?

我是 PostGIS 新手。我希望在普通 XYZ 图上有一个简单的有界(-200 < x, y, z < 200)数据集,包含 1,000,000 个点。我唯一需要的查询是一个快速的 K 最近邻居和所有邻居,使得距离小于 < N。似乎 PostGIS 有很多我不需要的额外功能。

谢谢!

What do SRID do I need? One that does not concern with feet or meters.

你不 "need" 一个 srid。如果你的数据是坐标系中的a,就找正确的srid,否则,就用0.

Am I right that I need to use the function ST_3DDistance to query for the K nearest neighbors with LIMIT K? or with a maximum distance of N.

是的,你是对的。

To add a column, I need to use SELECT AddGeometryColumn ('my_schema','my_spatial_table','geom_c',4326,'POINT',3, false);. Is that correct?

是的,但我会使用 0 表示 srid,而不是 4326(表示度数)。

What is the difference between a 3D point and a PointZ?

PointZ 是一个 3d 点。

Will AddGeometryColumn ensure that my distance query is fast?

AddGeometryColumn 只会向 table 添加一些约束,确保您插入的几何与列定义一致。

我认为您不需要它,但您可以尝试使用 CREATE INDEX index_name ON schema.table USING gist (geom_col);

Is PostGIS the right choice for my use case? The rest of my DB is already integrated with PostgreSQL

我认为这是最简单的方法,不一定是 "right" 方法。

您也可以在没有 postgis 的情况下实现距离函数,将三个坐标存储在三个数字字段中。