Update Distance function to access Spatial layer

Modifies Distance function signature to take third arguments, the
String name of the Spatial Layer.
Use configured GeometryEncoder for specified layer to convert
node/string parameters to JTS Geometry for distance calculation.