geom

Manipulation of geometric/geographical data.

Geometric data transformation

Data type

transform_point_type(*pts[, as_geom])

Transforms iterable data to geometric type or vice versa.

get_coordinates_as_array(geom_obj[, unique])

Retrieves an array of coordinates from the input geometry object.

Coordinate system

wgs84_to_osgb36(longitudes, latitudes[, ...])

Converts latitude and longitude (WGS84) to British national grid (OSGB36).

osgb36_to_wgs84(eastings, northings[, as_array])

Converts British national grid (OSGB36) to latitude and longitude (WGS84).

Dimension / Projection

drop_axis(geom[, axis, as_array])

Drops an axis from a given 3D geometry object.

project_point_to_line(point, line[, ...])

Finds the projected point from a given point to a line.

Geometric data computation

Distance

calc_distance_on_unit_sphere(pt1, pt2[, ...])

Calculates the distance between two points on a unit sphere.

calc_hypotenuse_distance(pt1, pt2)

Calculates the hypotenuse distance between two points.

find_closest_point(pt, ref_pts[, as_geom])

Finds the closest point in a sequence of reference points to a given point.

find_closest_points(pts, ref_pts[, k, ...])

Finds the closest points from a list of reference points to a set of query points.

find_shortest_path(points_sequence[, ...])

Finds the shortest path through a sequence of points.

Locating

get_midpoint(x1, y1, x2, y2[, as_geom])

Gets the midpoint between two points (applicable for vectorised computation).

get_geometric_midpoint(pt1, pt2[, as_geom])

Gets the midpoint between two points.

get_geometric_midpoint_calc(pt1, pt2[, as_geom])

Gets the midpoint between two points by pure calculation.

get_rectangle_centroid(rectangle[, as_geom])

Gets coordinates of the centroid of a rectangle.

get_square_vertices(ctr_x, ctr_y, side_length)

Gets the four vertices of a square given its centre and side length.

get_square_vertices_calc(ctr_x, ctr_y, ...)

Gets the four vertices of a square given its centre and side length (by elementary calculation).

Geometric data sketching

sketch_square(ctr_x, ctr_y, side_length[, ...])

Sketches a square on a plot given its centre coordinates, side length and rotation angle.