Does spatialite/mysql support 3D point?

邮差的信 提交于 2021-01-28 09:30:54

问题


Recently, I was studying spatialite.I can write 2D data(like this:POINT(1 1)) into the spatial data table,but I can't write 3D data(like this:POINT(1 1 1) ) into the spatial data table. Who can tell me spatialite whether support 3D? If support ,how can I write a 3D data?


回答1:


Yes, Spatialite supports 3D geometries (actually 2.5D geometries).

On why it does not work for you, probably your geometry column is not defined as XYZ. You can check geometry metadata with the query:

SELECT * FROM geometry_columns;



回答2:


To add points with three 3 dimensions you have to use the correct WKT expression: POINTZ(x,y,z).

(see also: https://www.gaia-gis.it/gaia-sins/spatialite-cookbook/html/wkt-wkb.html)

You also have to make sure, that you geometry column is correctly defined as XYZ column. (see functions: Dimension CoordDimension Is3D). GeometryType should therefore return POINTZ

(see also: http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.0.html)



来源:https://stackoverflow.com/questions/45992529/does-spatialite-mysql-support-3d-point

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!