1 /***********************************************************************
2  * Copyright (c) 2013-2024 Commonwealth Computer Research, Inc.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Apache License, Version 2.0
5  * which accompanies this distribution and is available at
6  * http://www.opensource.org/licenses/apache2.0.php.
7  ***********************************************************************/
8 
9 package org.locationtech.geomesa.spark.sql
10 
11 import org.apache.spark.sql.SQLContext
12 import org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer
13 import org.geotools.referencing.crs.DefaultGeographicCRS
14 import org.geotools.referencing.{CRS, GeodeticCalculator}
15 import org.locationtech.geomesa.spark.jts.util.SQLFunctionHelper.nullableUDF
16 import org.locationtech.jts.geom.{Coordinate, Geometry, LineString}
17 
18 object GeometricDistanceFunctions {
19   import java.{lang => jl}
20 
21   val ST_DistanceSpheroid: (Geometry, Geometry) => jl.Double =
22     nullableUDF((s, e) => fastDistance(s.getCoordinate, e.getCoordinate))
23 
24   // Assumes input is two points, for use with collect_list and window functions
25   val ST_AggregateDistanceSpheroid: Seq[Geometry] => jl.Double = a => ST_DistanceSpheroid(a(0), a(1))
26 
27   val ST_LengthSpheroid: LineString => jl.Double =
28     nullableUDF(line => line.getCoordinates.sliding(2).map { case Array(l, r) => fastDistance(l, r) }.sum)
29 
30   val ST_Transform: (Geometry, String, String) => Geometry = nullableUDF { (geometry, fromCRSCode, toCRSCode) =>
31     val transformer = new GeometryCoordinateSequenceTransformer
32     val fromCode = CRS.decode(fromCRSCode, true)
33     val toCode = CRS.decode(toCRSCode, true)
34     transformer.setMathTransform(CRS.findMathTransform(fromCode, toCode, true))
35     transformer.transform(geometry)
36   }
37 
38   val distanceNames = Map(
39     ST_DistanceSpheroid -> "st_distanceSpheroid",
40     ST_AggregateDistanceSpheroid -> "st_aggregateDistanceSpheroid",
41     ST_LengthSpheroid -> "st_lengthSpheroid",
42     ST_Transform -> "st_transform"
43   )
44 
45 
46   def registerFunctions(sqlContext: SQLContext): Unit = {
47     sqlContext.udf.register(distanceNames (ST_DistanceSpheroid), ST_DistanceSpheroid)
48     sqlContext.udf.register(distanceNames (ST_AggregateDistanceSpheroid), ST_AggregateDistanceSpheroid)
49     sqlContext.udf.register(distanceNames (ST_LengthSpheroid), ST_LengthSpheroid)
50     sqlContext.udf.register(distanceNames (ST_Transform), ST_Transform)
51   }
52 
53   @transient private val geoCalcs = new ThreadLocal[GeodeticCalculator] {
54     override def initialValue(): GeodeticCalculator = new GeodeticCalculator(DefaultGeographicCRS.WGS84)
55   }
56 
57   def fastDistance(c1: Coordinate, c2: Coordinate): Double = {
58     val calc = geoCalcs.get()
59     calc.setStartingGeographicPoint(c1.x, c1.y)
60     calc.setDestinationGeographicPoint(c2.x, c2.y)
61     calc.getOrthodromicDistance
62   }
63 
64 
65 }
Line Stmt Id Pos Tree Symbol Tests Code
22 72013 1063 - 1078 Apply org.locationtech.jts.geom.Geometry.getCoordinate e.getCoordinate()
22 72012 1046 - 1061 Apply org.locationtech.jts.geom.Geometry.getCoordinate s.getCoordinate()
22 72015 1033 - 1079 ApplyImplicitView scala.Predef.double2Double scala.Predef.double2Double(GeometricDistanceFunctions.this.fastDistance(s.getCoordinate(), e.getCoordinate()))
22 72014 1033 - 1079 Apply org.locationtech.geomesa.spark.sql.GeometricDistanceFunctions.fastDistance GeometricDistanceFunctions.this.fastDistance(s.getCoordinate(), e.getCoordinate())
22 72016 1011 - 1080 Apply org.locationtech.geomesa.spark.jts.util.SQLFunctionHelper.nullableUDF org.locationtech.geomesa.spark.jts.util.SQLFunctionHelper.nullableUDF[org.locationtech.jts.geom.Geometry, org.locationtech.jts.geom.Geometry, Double](((s: org.locationtech.jts.geom.Geometry, e: org.locationtech.jts.geom.Geometry) => scala.Predef.double2Double(GeometricDistanceFunctions.this.fastDistance(s.getCoordinate(), e.getCoordinate()))))
25 72017 1253 - 1257 Apply scala.collection.SeqLike.apply a.apply(0)
25 72019 1233 - 1264 Apply scala.Function2.apply GeometricDistanceFunctions.this.ST_DistanceSpheroid.apply(a.apply(0), a.apply(1))
25 72018 1259 - 1263 Apply scala.collection.SeqLike.apply a.apply(1)
28 72021 1369 - 1370 Literal <nosymbol> 2
28 72020 1341 - 1360 Apply org.locationtech.jts.geom.LineString.getCoordinates line.getCoordinates()
28 72023 1398 - 1416 Block org.locationtech.geomesa.spark.sql.GeometricDistanceFunctions.fastDistance GeometricDistanceFunctions.this.fastDistance(l, r)
28 72022 1398 - 1416 Apply org.locationtech.geomesa.spark.sql.GeometricDistanceFunctions.fastDistance GeometricDistanceFunctions.this.fastDistance(l, r)
28 72025 1341 - 1422 ApplyToImplicitArgs scala.collection.TraversableOnce.sum scala.Predef.refArrayOps[org.locationtech.jts.geom.Coordinate](line.getCoordinates()).sliding(2).map[Double](((x0$1: Array[org.locationtech.jts.geom.Coordinate]) => x0$1 match { case scala.Array.unapplySeq[org.locationtech.jts.geom.Coordinate](<unapply-selector>) <unapply> ((l @ _), (r @ _)) => GeometricDistanceFunctions.this.fastDistance(l, r) })).sum[Double](math.this.Numeric.DoubleIsFractional)
28 72024 1419 - 1419 Select scala.math.Numeric.DoubleIsFractional math.this.Numeric.DoubleIsFractional
28 72027 1321 - 1423 Apply org.locationtech.geomesa.spark.jts.util.SQLFunctionHelper.nullableUDF org.locationtech.geomesa.spark.jts.util.SQLFunctionHelper.nullableUDF[org.locationtech.jts.geom.LineString, Double](((line: org.locationtech.jts.geom.LineString) => scala.Predef.double2Double(scala.Predef.refArrayOps[org.locationtech.jts.geom.Coordinate](line.getCoordinates()).sliding(2).map[Double](((x0$1: Array[org.locationtech.jts.geom.Coordinate]) => x0$1 match { case scala.Array.unapplySeq[org.locationtech.jts.geom.Coordinate](<unapply-selector>) <unapply> ((l @ _), (r @ _)) => GeometricDistanceFunctions.this.fastDistance(l, r) })).sum[Double](math.this.Numeric.DoubleIsFractional))))
28 72026 1341 - 1422 ApplyImplicitView scala.Predef.double2Double scala.Predef.double2Double(scala.Predef.refArrayOps[org.locationtech.jts.geom.Coordinate](line.getCoordinates()).sliding(2).map[Double](((x0$1: Array[org.locationtech.jts.geom.Coordinate]) => x0$1 match { case scala.Array.unapplySeq[org.locationtech.jts.geom.Coordinate](<unapply-selector>) <unapply> ((l @ _), (r @ _)) => GeometricDistanceFunctions.this.fastDistance(l, r) })).sum[Double](math.this.Numeric.DoubleIsFractional))
30 72034 1486 - 1815 Apply org.locationtech.geomesa.spark.jts.util.SQLFunctionHelper.nullableUDF org.locationtech.geomesa.spark.jts.util.SQLFunctionHelper.nullableUDF[org.locationtech.jts.geom.Geometry, String, String, org.locationtech.jts.geom.Geometry](((geometry: org.locationtech.jts.geom.Geometry, fromCRSCode: String, toCRSCode: String) => { val transformer: org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer = new org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer(); val fromCode: org.geotools.api.referencing.crs.CoordinateReferenceSystem = org.geotools.referencing.CRS.decode(fromCRSCode, true); val toCode: org.geotools.api.referencing.crs.CoordinateReferenceSystem = org.geotools.referencing.CRS.decode(toCRSCode, true); transformer.setMathTransform(org.geotools.referencing.CRS.findMathTransform(fromCode, toCode, true)); transformer.transform(geometry) }))
31 72028 1560 - 1601 Apply org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer.<init> new org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer()
32 72029 1621 - 1650 Apply org.geotools.referencing.CRS.decode org.geotools.referencing.CRS.decode(fromCRSCode, true)
33 72030 1668 - 1695 Apply org.geotools.referencing.CRS.decode org.geotools.referencing.CRS.decode(toCRSCode, true)
34 72031 1729 - 1774 Apply org.geotools.referencing.CRS.findMathTransform org.geotools.referencing.CRS.findMathTransform(fromCode, toCode, true)
34 72032 1700 - 1775 Apply org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer.setMathTransform transformer.setMathTransform(org.geotools.referencing.CRS.findMathTransform(fromCode, toCode, true))
35 72033 1780 - 1811 Apply org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer.transform transformer.transform(geometry)
38 72039 1839 - 2046 Apply scala.collection.generic.GenMapFactory.apply scala.Predef.Map.apply[Object, String](scala.Predef.ArrowAssoc[(org.locationtech.jts.geom.Geometry, org.locationtech.jts.geom.Geometry) => Double](GeometricDistanceFunctions.this.ST_DistanceSpheroid).->[String]("st_distanceSpheroid"), scala.Predef.ArrowAssoc[Seq[org.locationtech.jts.geom.Geometry] => Double](GeometricDistanceFunctions.this.ST_AggregateDistanceSpheroid).->[String]("st_aggregateDistanceSpheroid"), scala.Predef.ArrowAssoc[org.locationtech.jts.geom.LineString => Double](GeometricDistanceFunctions.this.ST_LengthSpheroid).->[String]("st_lengthSpheroid"), scala.Predef.ArrowAssoc[(org.locationtech.jts.geom.Geometry, String, String) => org.locationtech.jts.geom.Geometry](GeometricDistanceFunctions.this.ST_Transform).->[String]("st_transform"))
39 72035 1848 - 1892 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[(org.locationtech.jts.geom.Geometry, org.locationtech.jts.geom.Geometry) => Double](GeometricDistanceFunctions.this.ST_DistanceSpheroid).->[String]("st_distanceSpheroid")
40 72036 1898 - 1960 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[Seq[org.locationtech.jts.geom.Geometry] => Double](GeometricDistanceFunctions.this.ST_AggregateDistanceSpheroid).->[String]("st_aggregateDistanceSpheroid")
41 72037 1966 - 2006 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[org.locationtech.jts.geom.LineString => Double](GeometricDistanceFunctions.this.ST_LengthSpheroid).->[String]("st_lengthSpheroid")
42 72038 2012 - 2042 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[(org.locationtech.jts.geom.Geometry, String, String) => org.locationtech.jts.geom.Geometry](GeometricDistanceFunctions.this.ST_Transform).->[String]("st_transform")
47 72041 2135 - 2170 Apply scala.collection.MapLike.apply GeometricDistanceFunctions.this.distanceNames.apply(GeometricDistanceFunctions.this.ST_DistanceSpheroid)
47 72040 2150 - 2169 Select org.locationtech.geomesa.spark.sql.GeometricDistanceFunctions.ST_DistanceSpheroid GeometricDistanceFunctions.this.ST_DistanceSpheroid
47 72043 2111 - 2192 ApplyToImplicitArgs org.apache.spark.sql.UDFRegistration.register sqlContext.udf.register[Double, org.locationtech.jts.geom.Geometry, org.locationtech.jts.geom.Geometry](GeometricDistanceFunctions.this.distanceNames.apply(GeometricDistanceFunctions.this.ST_DistanceSpheroid), GeometricDistanceFunctions.this.ST_DistanceSpheroid)(({ val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); $u.TypeTag.apply[Double]($m, { final class $typecreator1 extends TypeCreator { def <init>(): $typecreator1 = { $typecreator1.super.<init>(); () }; def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; $m.staticClass("java.lang.Double").asType.toTypeConstructor } }; new $typecreator1() }) }: reflect.runtime.universe.TypeTag[Double]), ({ val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); $u.TypeTag.apply[org.locationtech.jts.geom.Geometry]($m, { final class $typecreator2 extends TypeCreator { def <init>(): $typecreator2 = { $typecreator2.super.<init>(); () }; def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; $m.staticClass("org.locationtech.jts.geom.Geometry").asType.toTypeConstructor } }; new $typecreator2() }) }: reflect.runtime.universe.TypeTag[org.locationtech.jts.geom.Geometry]), ({ val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); $u.TypeTag.apply[org.locationtech.jts.geom.Geometry]($m, { final class $typecreator3 extends TypeCreator { def <init>(): $typecreator3 = { $typecreator3.super.<init>(); () }; def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; $m.staticClass("org.locationtech.jts.geom.Geometry").asType.toTypeConstructor } }; new $typecreator3() }) }: reflect.runtime.universe.TypeTag[org.locationtech.jts.geom.Geometry]))
47 72042 2172 - 2191 Select org.locationtech.geomesa.spark.sql.GeometricDistanceFunctions.ST_DistanceSpheroid GeometricDistanceFunctions.this.ST_DistanceSpheroid
48 72045 2221 - 2265 Apply scala.collection.MapLike.apply GeometricDistanceFunctions.this.distanceNames.apply(GeometricDistanceFunctions.this.ST_AggregateDistanceSpheroid)
48 72044 2236 - 2264 Select org.locationtech.geomesa.spark.sql.GeometricDistanceFunctions.ST_AggregateDistanceSpheroid GeometricDistanceFunctions.this.ST_AggregateDistanceSpheroid
48 72047 2197 - 2296 ApplyToImplicitArgs org.apache.spark.sql.UDFRegistration.register sqlContext.udf.register[Double, Seq[org.locationtech.jts.geom.Geometry]](GeometricDistanceFunctions.this.distanceNames.apply(GeometricDistanceFunctions.this.ST_AggregateDistanceSpheroid), GeometricDistanceFunctions.this.ST_AggregateDistanceSpheroid)(({ val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); $u.TypeTag.apply[Double]($m, { final class $typecreator4 extends TypeCreator { def <init>(): $typecreator4 = { $typecreator4.super.<init>(); () }; def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; $m.staticClass("java.lang.Double").asType.toTypeConstructor } }; new $typecreator4() }) }: reflect.runtime.universe.TypeTag[Double]), ({ val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); $u.TypeTag.apply[Seq[org.locationtech.jts.geom.Geometry]]($m, { final class $typecreator5 extends TypeCreator { def <init>(): $typecreator5 = { $typecreator5.super.<init>(); () }; def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; $u.internal.reificationSupport.TypeRef($u.internal.reificationSupport.SingleType($u.internal.reificationSupport.SingleType($u.internal.reificationSupport.thisPrefix($m.RootClass), $m.staticPackage("scala")), $m.staticModule("scala.package")), $u.internal.reificationSupport.selectType($m.staticModule("scala.package").asModule.moduleClass, "Seq"), scala.collection.immutable.List.apply[$u.Type]($m.staticClass("org.locationtech.jts.geom.Geometry").asType.toTypeConstructor)) } }; new $typecreator5() }) }: reflect.runtime.universe.TypeTag[Seq[org.locationtech.jts.geom.Geometry]]))
48 72046 2267 - 2295 Select org.locationtech.geomesa.spark.sql.GeometricDistanceFunctions.ST_AggregateDistanceSpheroid GeometricDistanceFunctions.this.ST_AggregateDistanceSpheroid
49 72049 2325 - 2358 Apply scala.collection.MapLike.apply GeometricDistanceFunctions.this.distanceNames.apply(GeometricDistanceFunctions.this.ST_LengthSpheroid)
49 72048 2340 - 2357 Select org.locationtech.geomesa.spark.sql.GeometricDistanceFunctions.ST_LengthSpheroid GeometricDistanceFunctions.this.ST_LengthSpheroid
49 72051 2301 - 2378 ApplyToImplicitArgs org.apache.spark.sql.UDFRegistration.register sqlContext.udf.register[Double, org.locationtech.jts.geom.LineString](GeometricDistanceFunctions.this.distanceNames.apply(GeometricDistanceFunctions.this.ST_LengthSpheroid), GeometricDistanceFunctions.this.ST_LengthSpheroid)(({ val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); $u.TypeTag.apply[Double]($m, { final class $typecreator6 extends TypeCreator { def <init>(): $typecreator6 = { $typecreator6.super.<init>(); () }; def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; $m.staticClass("java.lang.Double").asType.toTypeConstructor } }; new $typecreator6() }) }: reflect.runtime.universe.TypeTag[Double]), ({ val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); $u.TypeTag.apply[org.locationtech.jts.geom.LineString]($m, { final class $typecreator7 extends TypeCreator { def <init>(): $typecreator7 = { $typecreator7.super.<init>(); () }; def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; $m.staticClass("org.locationtech.jts.geom.LineString").asType.toTypeConstructor } }; new $typecreator7() }) }: reflect.runtime.universe.TypeTag[org.locationtech.jts.geom.LineString]))
49 72050 2360 - 2377 Select org.locationtech.geomesa.spark.sql.GeometricDistanceFunctions.ST_LengthSpheroid GeometricDistanceFunctions.this.ST_LengthSpheroid
50 72053 2407 - 2435 Apply scala.collection.MapLike.apply GeometricDistanceFunctions.this.distanceNames.apply(GeometricDistanceFunctions.this.ST_Transform)
50 72052 2422 - 2434 Select org.locationtech.geomesa.spark.sql.GeometricDistanceFunctions.ST_Transform GeometricDistanceFunctions.this.ST_Transform
50 72055 2383 - 2450 ApplyToImplicitArgs org.apache.spark.sql.UDFRegistration.register sqlContext.udf.register[org.locationtech.jts.geom.Geometry, org.locationtech.jts.geom.Geometry, String, String](GeometricDistanceFunctions.this.distanceNames.apply(GeometricDistanceFunctions.this.ST_Transform), GeometricDistanceFunctions.this.ST_Transform)(({ val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); $u.TypeTag.apply[org.locationtech.jts.geom.Geometry]($m, { final class $typecreator8 extends TypeCreator { def <init>(): $typecreator8 = { $typecreator8.super.<init>(); () }; def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; $m.staticClass("org.locationtech.jts.geom.Geometry").asType.toTypeConstructor } }; new $typecreator8() }) }: reflect.runtime.universe.TypeTag[org.locationtech.jts.geom.Geometry]), ({ val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); $u.TypeTag.apply[org.locationtech.jts.geom.Geometry]($m, { final class $typecreator9 extends TypeCreator { def <init>(): $typecreator9 = { $typecreator9.super.<init>(); () }; def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; $m.staticClass("org.locationtech.jts.geom.Geometry").asType.toTypeConstructor } }; new $typecreator9() }) }: reflect.runtime.universe.TypeTag[org.locationtech.jts.geom.Geometry]), ({ val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); $u.TypeTag.apply[String]($m, { final class $typecreator10 extends TypeCreator { def <init>(): $typecreator10 = { $typecreator10.super.<init>(); () }; def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; $u.internal.reificationSupport.TypeRef($u.internal.reificationSupport.SingleType($m.staticPackage("scala").asModule.moduleClass.asType.toTypeConstructor, $m.staticModule("scala.Predef")), $u.internal.reificationSupport.selectType($m.staticModule("scala.Predef").asModule.moduleClass, "String"), scala.collection.immutable.Nil) } }; new $typecreator10() }) }: reflect.runtime.universe.TypeTag[String]), ({ val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); $u.TypeTag.apply[String]($m, { final class $typecreator11 extends TypeCreator { def <init>(): $typecreator11 = { $typecreator11.super.<init>(); () }; def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; $u.internal.reificationSupport.TypeRef($u.internal.reificationSupport.SingleType($m.staticPackage("scala").asModule.moduleClass.asType.toTypeConstructor, $m.staticModule("scala.Predef")), $u.internal.reificationSupport.selectType($m.staticModule("scala.Predef").asModule.moduleClass, "String"), scala.collection.immutable.Nil) } }; new $typecreator11() }) }: reflect.runtime.universe.TypeTag[String]))
50 72054 2437 - 2449 Select org.locationtech.geomesa.spark.sql.GeometricDistanceFunctions.ST_Transform GeometricDistanceFunctions.this.ST_Transform
50 72056 2406 - 2406 Literal <nosymbol> ()
53 72059 2492 - 2495 Apply org.locationtech.geomesa.spark.sql.GeometricDistanceFunctions.$anon.<init> new $anon()
54 72057 2607 - 2633 Select org.geotools.referencing.crs.DefaultGeographicCRS.WGS84 org.geotools.referencing.crs.DefaultGeographicCRS.WGS84
54 72058 2584 - 2634 Apply org.geotools.referencing.GeodeticCalculator.<init> new org.geotools.referencing.GeodeticCalculator(org.geotools.referencing.crs.DefaultGeographicCRS.WGS84)
58 72060 2718 - 2732 Apply java.lang.ThreadLocal.get GeometricDistanceFunctions.this.geoCalcs.get()
59 72061 2769 - 2773 Select org.locationtech.jts.geom.Coordinate.x c1.x
59 72063 2737 - 2780 Apply org.geotools.referencing.GeodeticCalculator.setStartingGeographicPoint calc.setStartingGeographicPoint(c1.x, c1.y)
59 72062 2775 - 2779 Select org.locationtech.jts.geom.Coordinate.y c1.y
60 72065 2826 - 2830 Select org.locationtech.jts.geom.Coordinate.y c2.y
60 72064 2820 - 2824 Select org.locationtech.jts.geom.Coordinate.x c2.x
60 72066 2785 - 2831 Apply org.geotools.referencing.GeodeticCalculator.setDestinationGeographicPoint calc.setDestinationGeographicPoint(c2.x, c2.y)
61 72067 2836 - 2863 Apply org.geotools.referencing.GeodeticCalculator.getOrthodromicDistance calc.getOrthodromicDistance()