Returns the distance, in meters, between two Geography attributes or variables.
GeographyAttOrVar1.Distance(GeographyAttOrVar2)
Where:
GeographyAttOrVar1
Must be an attribute or variable based on the Geography data type.
GeographyAttOrVar2
Must be an attribute or variable based on the Geography data type.
Type Returned:
Numeric
Generators: Apple, Android
Level: Attribute, Variable (Geography data type)
The distance between two points is calculated, but the method accepts geographies and assumes centers or equidistance in the case of calculating it based on GeoLines or GeoPolygon.
Consider the following Transaction object:
Place
{
PlaceId*
PlaceName
PlaceGeo
}
and the following Structured Data Type (SDT) object:

In this example of 'Places NearBy', the places that are within 1km of the center of the Map are loaded in the &NearPlaces variable (based on the NearPlaces SDT). To do so, the following Procedure object was defined:
Rule:
Parm(&Center);
Variables:
&Center: Geography
&Radius: Numeric(4)
&NearPlaces: NearPlaces (SDT)
&Place: NearPlaces.NearPlacesItem
Source:
&Radius = 1000
For each Place
where PlaceGeo.Distance(&Center) <= &Radius
&Place = new()
&Place.PlaceName = PlaceName
&Place.PlaceDistance = PlaceGeo.Distance(&Center)/1000 // distance in Kilometers
&NearPlaces.Add(&Place)
endfor