geom

Manipulation of geometric/geographical data.

Geometric data transformation

Data type

transform_point_type(*pts[, as_geom])

Transform iterable data to geometric type or vice versa.

get_coordinates_as_array(geom_obj[, unique])

Retrieve an array of coordinates from the input geometry object.

Coordinate system

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

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

osgb36_to_wgs84(eastings, northings[, as_array])

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

Dimension / Projection

drop_axis(geom[, axis, as_array])

Drop an axis from a given 3D geometry object.

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

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

Geometric data computation

Distance

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

Calculate the distance between two points on a unit sphere.

calc_hypotenuse_distance(pt1, pt2)

Calculate the hypotenuse distance between two points.

find_closest_point(pt, ref_pts[, as_geom])

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

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

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

find_shortest_path(points_sequence[, ...])

Find the shortest path through a sequence of points.

Locating

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

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

get_geometric_midpoint(pt1, pt2[, as_geom])

Get the midpoint between two points.

get_geometric_midpoint_calc(pt1, pt2[, as_geom])

Get the midpoint between two points by pure calculation.

get_rectangle_centroid(rectangle[, as_geom])

Get coordinates of the centroid of a rectangle.

get_square_vertices(ctr_x, ctr_y, side_length)

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

get_square_vertices_calc(ctr_x, ctr_y, ...)

Get 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[, ...])

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