From 0443cbfff217c1e1be4a5615da7d94518460235a Mon Sep 17 00:00:00 2001 From: Victor Zhu Date: Wed, 9 Oct 2019 18:36:46 +1100 Subject: [PATCH] Add new wrap api: Distance3D --- ogr.go | 9 +++++++++ 1 file changed, 9 insertions(+) mode change 100644 => 100755 ogr.go diff --git a/ogr.go b/ogr.go old mode 100644 new mode 100755 index 469f53f..0c7713e --- a/ogr.go +++ b/ogr.go @@ -570,6 +570,15 @@ func (geom Geometry) Distance(other Geometry) float64 { return float64(dist) } +// Compute 3D distance between thie geometry and the other. +// This method is built on the SFCGAL library, +// check it for the definition of the geometry operation. +// If OGR is built without the SFCGAL library, this method will always return -1.0 +func (geom Geometry) Distance3D(other Geometry) float64 { + dist := C.OGR_G_Distance3D(geom.cval, other.cval) + return float64(dist) +} + // Compute length of geometry func (geom Geometry) Length() float64 { length := C.OGR_G_Length(geom.cval)