LocationTool

class sitchlib.LocationTool[source]

Class with location-oriented functions.

classmethod get_distance_between_points(point_1, point_2)[source]

Calculate distance between points.

Parameters:
  • point_1 (tuple) – (lon, lat) for first point.
  • point_2 (tuple) – (lon, lat) for second point.
Returns:

Kilometers between point_1 and point_2.

Return type:

int

classmethod get_geo_for_ip(ip_address)[source]

Get geo coordinates for IP address.

Parameters:ip_address (str) – IP address.
classmethod validate_geo(latlon)[source]

Validate that lon/lat are valid numbers for Planet Earth