Geometry Objects

geoVeRoPy uses lists and tuples to represent simple geometry objects such as points, lines, line segments, rays, line segment sequence, polygons and etc.

pt

A pt data type defines a point/location in Euclidean space or in lat/lon. It can be defined as a 2-tuple, such as (10, 10), or a 2-list, such as [10, 10]. In most cases, these two formats are interchangeable.

line

A line data type is a list of two pt s, the format is [pt, pt]. It can define lines, line segments, or rays. It will be considered differently when it is used in different functions. For example, for
>>> s = [(0, 0), (5, 5)]
s is considered as a line in the function isPtOnLine()
>>> res = geoVeRoPy.isPtOnLine(pt = (1, 1), line = s)
s is considered as a line segment in the function isPtOnSeg()
>>> res = geoVeRoPy.isPtOnSeg(pt = (1, 1), seg = s)
s is considered as a ray in the function isPtOnRay()
>>> res = geoVeRoPy.isPtOnRay(pt = (1, 1), ray = s)

poly

A poly data type is a list of pt s, the format is [pt, pt, …, pt]. It can define line segment sequences and polygons. It is more often used as representing polygons that does not have holes.

polys

A polys data type is a list of polys, which can define a list of polygons. The polys only contains the coordinate information of polygons, and neglect all other information such as the identifier, colors, styles, etc. If a function requires an input as ‘polys’, a polys will need to be provided, otherwise, if the function asks for ‘polygons’, a polygons will be needed as it may need those additional information. The polys are more often used in this package then polygons.