calc_antipode.get_antipode
calc_antipode.get_antipode(location, resolve_names=True)Calculate the antipode (opposite point on Earth) for a given location and identify its geographical description.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| location | str or tuple of float | The starting location. - If str: A query string for a place name (e.g., “Vancouver, Canada”). - If tuple: Coordinates in (latitude, longitude) format. | required |
| resolve_names | bool | Whether to reverse geocode the antipodal coordinates. Default is True. | True |
Returns
| Name | Type | Description |
|---|---|---|
| antipode_coords | tuple of float | The coordinates of the antipode in (latitude, longitude) format. |
| antipode_desc | str or None | Human-readable description of the antipode location. Returns None if resolve_names is False. |
Raises
| Name | Type | Description |
|---|---|---|
| ValueError | If the location string cannot be geocoded or coordinates are out of range. | |
| TypeError | If location is not a string or tuple of floats. |
Examples
>>> coords, desc = get_antipode("Madrid, Spain")
>>> print(coords)
(-40.4168, 176.2962)>>> coords, desc = get_antipode((49.2827, -123.1207))
>>> print(desc)
"French Southern and Antarctic Lands"