[gdal-dev] Can we do Delaunay with 3D points?

Joaquim Manuel Freire Luís jluis at ualg.pt
Sun Jun 25 11:30:25 PDT 2023


Thanks Even

Your example actually also works for me too.

julia> g1 = fromWKT("MULTIPOINT Z(0 0 10,0 1 10,1 1 12,1 0 10)");

julia> d = delaunay(g1,0.0,false)
Geometry: GEOMETRYCOLLECTION (POLYGON ((0 1 10,0 0 10,1 0 10 ... 10)))

julia> toWKT(d)
"GEOMETRYCOLLECTION (POLYGON ((0 1 10,0 0 10,1 0 10,0 1 10)),POLYGON ((0 1 10,1 0 10,1 1 12,0 1 10)))"

It’s when I try to extract the data into a table (a GMT type) that the problem arises.
My code, so up to me to fix it.

julia> gd2gmt(d)
ERROR 6: Incompatible geometry for operation
ERROR 6: Incompatible geometry for operation
ERROR 6: Incompatible geometry for operation
ERROR 6: Incompatible geometry for operation
ERROR 6: Incompatible geometry for operation
ERROR 6: Incompatible geometry for operation
BoundingBox: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
2×3 GMTdataset{Float64, 2}
Row │   col.1    col.2    col.3
     │ Float64  Float64  Float64
─────┼───────────────────────────
   1 │     0.0      0.0      0.0

From: gdal-dev <gdal-dev-bounces at lists.osgeo.org> On Behalf Of Even Rouault
Sent: Sunday, June 25, 2023 7:05 PM
To: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] Can we do Delaunay with 3D points?

Joaquim,

Looked at the GDAL tests and there it also uses only 2D (a 3D test is commented).
I assume you're speaking about the PolyhedralSurface / TIN tests in ogr_geom.py.  The reason is that the code (and in particularly GEOS) is not ready for those geometry types.

I am doing something wrong or delaunay in GDAL is only possible with with 2D points?

Quick testing shows that it works with a multipoint z with a recent GEOS master version  (but might work with older ones perhaps)

>>> g = ogr.CreateGeometryFromWkt("MULTIPOINT Z (0 0 10,0 1 10,1 1 12,1 0 10)")

>>> triangulation = g.DelaunayTriangulation()

>>> triangulation.ExportToWkt()

'GEOMETRYCOLLECTION (POLYGON ((0 1 10,0 0 10,1 0 10,0 1 10)),POLYGON ((0 1 10,1 0 10,1 1 12,0 1 10)))'

Even



--

http://www.spatialys.com

My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230625/e3798345/attachment-0001.htm>


More information about the gdal-dev mailing list