From 6859e0f9e0771b08800e3d368dbb713e96a9e92b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Re=CC=81mond?= Date: Fri, 26 Aug 2016 11:32:10 +0200 Subject: [PATCH] Follow up on PostGIS deprecation (ST_Distance_Sphere->ST_DistanceSphere) and add the missing ST_DistanceSpheroid function --- .../github/tminglei/slickpg/geom/PgPostGISExtensions.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/com/github/tminglei/slickpg/geom/PgPostGISExtensions.scala b/core/src/main/scala/com/github/tminglei/slickpg/geom/PgPostGISExtensions.scala index bff8122f..9777bf87 100644 --- a/core/src/main/scala/com/github/tminglei/slickpg/geom/PgPostGISExtensions.scala +++ b/core/src/main/scala/com/github/tminglei/slickpg/geom/PgPostGISExtensions.scala @@ -184,7 +184,8 @@ trait PgPostGISExtensions extends JdbcTypesComponent { driver: PostgresDriver => val Length3D = new SqlFunction("ST_3DLength") val Perimeter = new SqlFunction("ST_Perimeter") val Distance = new SqlFunction("ST_Distance") - val DistanceSphere = new SqlFunction("ST_Distance_Sphere") + val DistanceSphere = new SqlFunction("ST_DistanceSphere") + val DistanceSpheroid = new SqlFunction("ST_DistanceSpheroid") val MaxDistance = new SqlFunction("ST_MaxDistance") val HausdorffDistance = new SqlFunction("ST_HausdorffDistance") val LongestLine = new SqlFunction("ST_LongestLine") @@ -488,6 +489,9 @@ trait PgPostGISExtensions extends JdbcTypesComponent { driver: PostgresDriver => def distanceSphere[P2, R](geom: Rep[P2])(implicit om: o#to[Float, R]) = { om.column(GeomLibrary.DistanceSphere, n, geom.toNode) } + def distanceSpheroid[P2, R](geom: Rep[P2])(implicit om: o#to[Float, R]) = { + om.column(GeomLibrary.DistanceSpheroid, n, geom.toNode) + } def maxDistance[P2, R](geom: Rep[P2])(implicit om: o#to[Float, R]) = { om.column(GeomLibrary.MaxDistance, n, geom.toNode) }