If that won’t work, the state of a LocationItem is a PointType (PointType (openHAB Core 4.2.0-SNAPSHOT API)) which has a getLatitude() and getLogitude() method (among others) including it’s own distanceFrom() method.
NOTE: The Tutorials and Examples category is a place to post a tutorial, not a place to ask for one.