utils#

swmmio.graphics.utils.angle_bw_points(xy1, xy2)[source]#
swmmio.graphics.utils.circle_bbox(coordinates, radius=5)[source]#

the bounding box of a circle given as centriod coordinate and radius

swmmio.graphics.utils.clip_to_box(df, bbox)[source]#

clip a dataframe with a coords column to a bounding box

swmmio.graphics.utils.length_bw_coords(upstreamXY, downstreamXY)[source]#
swmmio.graphics.utils.midpoint(xy1, xy2)[source]#
swmmio.graphics.utils.point_in_box(bbox, point)[source]#

check if a point falls with in a bounding box, bbox

swmmio.graphics.utils.px_to_irl_coords(df, px_width=4096.0, bbox=None, shift_ratio=None)[source]#

given a dataframe with element id (as index) and X1, Y1 columns (and optionally X2, Y2 columns), return a dataframe with the coords as pixel locations based on the targetImgW.

swmmio.graphics.utils.rotate_coord_about_point(xy, radians, origin=(0, 0))[source]#

Rotate a point around a given origin https://gist.github.com/LyleScott/e36e08bfb23b1f87af68c9051f985302

swmmio.graphics.utils.save_image(img, img_path, antialias=True, auto_open=False)[source]#