mirrorworld.geo

tile_coord_to_wgs84(x, y, zoom)[source]

Converts XYZ tile coordinates to WGS84 coordinates.

Parameters:
  • x (float) – X coordinate.

  • y (float) – Y coordinate.

  • zoom (int) – Z coordinate.

Returns:

WGS84 coordinates.

Return type:

Tuple[float, float]

wgs84_to_tile_coord(lat, lon, zoom)[source]

Converts WGS84 coordinates to XYZ coordinates.

Parameters:
  • lat (float) – Latitude.

  • lon (float) – Longitude.

  • zoom (int) – Z coordinate.

Returns:

The X and Y coordinates.

Return type:

Tuple[int, int]

wgs84_to_isn93(lat, lon)[source]

Converts WGS84 coordinates to ISN93 coordinates.

Parameters:
  • lat (float) – Latitude.

  • lon (float) – Longitude.

Returns:

ISN93 coordinates.

Return type:

Tuple[float, float]

wgs84_to_bd09mc(lat, lon)[source]

Converts WGS84 coordinates to BD09 Mercator coordinates.

Parameters:
  • lat (float) – Latitude.

  • lon (float) – Longitude.

Returns:

BD09 Mercator coordinates.

Return type:

Tuple[float, float]

bd09_to_bd09mc(lat, lon)[source]

Converts BD09 coordinates to BD09 Mercator coordinates.

Parameters:
  • lat (float) – Latitude.

  • lon (float) – Longitude.

Returns:

BD09 Mercator coordinates.

Return type:

Tuple[float, float]

gcj02_to_bd09mc(lat, lon)[source]

Converts GCJ-02 coordinates to BD09 Mercator coordinates.

Parameters:
  • lat (float) – Latitude.

  • lon (float) – Longitude.

Returns:

BD09 Mercator coordinates.

Return type:

Tuple[float, float]

bd09mc_to_wgs84(x, y)[source]

Converts BD09 Mercator coordinates to WGS84 coordinates.

Parameters:
  • x (float) – X coordinate.

  • y (float) – Y coordinate.

Returns:

WGS84 coordinates.

Return type:

Tuple[float, float]

bd09mc_to_gcj02(x, y)[source]

Converts BD09 Mercator coordinates to GCJ-02 coordinates.

Parameters:
  • x (float) – X coordinate.

  • y (float) – Y coordinate.

Returns:

GCJ-02 coordinates.

Return type:

Tuple[float, float]

create_bounding_box_around_point(lat, lon, radius)[source]

Creates a square bounding box around a point.

Parameters:
  • lat (float) – Latitude of the center point.

  • lon (float) – Longitude of the center point.

  • radius (float) – Shortest distance from the center point to the edges of the square.

Returns:

Latitude and longitude of the NW and SE points.

Return type:

Tuple[Tuple[float, float], Tuple[float, float]]

opk_to_rotation(omega, phi, kappa)[source]

Creates a SciPy rotation object from omega/phi/kappa angles.

Parameters:
Return type:

Rotation

get_bearing(lat1, lon1, lat2, lon2)[source]

Returns the bearing from point 1 to point 2.

Parameters:
  • lat1 (float) – Latitude of point 1.

  • lon1 (float) – Longitude of point 2.

  • lat2 (float) – Latitude of point 2.

  • lon2 (float) – Longitude of point 2.

Returns:

The bearing in radians.

Return type:

float

get_geoid_height(lat, lon)[source]

Returns the EGM2008 geoid height at a WGS84 coordinate.

Parameters:
  • lat (float) – Latitude.

  • lon (float) – Longitude.

Returns:

Geoid height in meters.

Return type:

float