nrel.hive.util.wkt

Module Contents

Functions

polygon_empty(→ str)

_point_to_string(→ str)

converts a point tuple into a string pair for wkt printing

point_2d(→ str)

creates a point when provided a pair, otherwise, returns an empty polygon

linestring_2d(→ str)

creates a linestring from a sequence of points, or, returns an empty

nrel.hive.util.wkt.polygon_empty() str[source]
nrel.hive.util.wkt._point_to_string(point: Tuple[float, float], x_y_ordering: bool) str[source]

converts a point tuple into a string pair for wkt printing

Parameters:
  • point – a point in (Lat, Lon) ordering (y, x)

  • x_y_ordering – if the output should be reversed into (x, y) ordering

Returns:

a string pair for wkt printing

nrel.hive.util.wkt.point_2d(point: Tuple[float, float], x_y_ordering: bool) str[source]

creates a point when provided a pair, otherwise, returns an empty polygon

Parameters:
  • point – a point in (Lat, Lon) ordering (y, x)

  • x_y_ordering – if the output should be reversed into (x, y) ordering

Returns:

a wkt point, tuple order preserved

nrel.hive.util.wkt.linestring_2d(points: Tuple[Tuple[float, float], Ellipsis], x_y_ordering: bool) str[source]

creates a linestring from a sequence of points, or, returns an empty polygon if no points are provided

Parameters:
  • points – a sequence of points in (Lat, Lon) ordering (y, x)

  • x_y_ordering – if the output should be reversed into (x, y) ordering

Returns:

a wkt representation