pandemia.world.location

Module Contents

Classes

Location

A location, for example an area of land or a building.

Functions

ETRS89_to_WGS84(→ LocationTuple)

Convert from ETRS89 grid format to WGS84 lat, lon format.

WGS84_to_ETRS89(→ LocationTuple)

Convert from WGS84 lat, lon format to ETRS89 grid format.

Attributes

LocationTuple

pandemia.world.location.LocationTuple
class pandemia.world.location.Location(typ: str, coord: LocationTuple)

A location, for example an area of land or a building.

During a simulation, agents move between locations according to their daily and weekly routines.

Parameters:

typstr

The type of location, as a string. For example “House” or “Restaurant”.

coordtuple

A 2-tuple of floats, representing x, y coordinates.

Attributes:

uuidstr

A universally unique identifier for this location.

typstr

The type of location, as a string. For example “House” or “Restaurant”.

coordtuple

A 2-tuple of floats, representing x, y coordinates.

distance_euclidean(other: Location) float

Calculate the Euclidean distance between two locations.

Parameters:
otherLocation

The other location.

Returns:
distancefloat

The Euclidean distance to the other location.

pandemia.world.location.ETRS89_to_WGS84(coord: LocationTuple) LocationTuple

Convert from ETRS89 grid format to WGS84 lat, lon format.

Parameters:

coordLocationTuple

A 2-tuple of floats.

Returns:

new_coordLocationTuple

If coord represents the coordinates of a location in ETRS89 format, then new_coord represents the coordinates of that location in WGS84 format.

pandemia.world.location.WGS84_to_ETRS89(coord: LocationTuple) LocationTuple

Convert from WGS84 lat, lon format to ETRS89 grid format.

Parameters:

coordLocationTuple

A 2-tuple of floats.

Returns:

new_coordLocationTuple

If coord represents the coordinates of a location in WGS84 format, then new_coord represents the coordinates of that location in ETRS89 format.