Does spatialite/mysql support 3D point?

2.6k views Asked by At

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?

2

There are 2 answers

0
Sga On

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;
0
Marcel Gangwisch On

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)