Point
Point class useful to describe any kind of points
Point
Bases: DiscreteGeometryEntity
Point class
Source code in otary/geometry/discrete/point.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
area
property
Compute the area of the geometry entity
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
area value |
centroid
property
Return the point as the centroid of a point is simply the point
Returns:
Name | Type | Description |
---|---|---|
NDArray |
NDArray
|
centroid of the point |
edges
property
Get the edges of the point which returns empty array since a point has no edges
Returns:
Name | Type | Description |
---|---|---|
NDArray |
NDArray
|
empty array of shape (0, 2, 2) |
perimeter
property
Compute the perimeter of the geometry entity
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
perimeter value |
shapely_edges
property
Returns the Shapely.Point representation of the point. See https://shapely.readthedocs.io/en/stable/reference/shapely.Point.html
Returns:
Name | Type | Description |
---|---|---|
Point |
Point
|
shapely.Point object |
shapely_surface
property
Returns None since a point has no surface
Returns:
Name | Type | Description |
---|---|---|
None |
Point
|
None value |
distances_vertices_to_point(point)
Compute the distances to a given point
Parameters:
Name | Type | Description | Default |
---|---|---|---|
point
|
NDArray
|
point to which we want to compute the distances |
required |
Returns:
Name | Type | Description |
---|---|---|
NDArray |
NDArray
|
distance to the given point |
Source code in otary/geometry/discrete/point.py
order_idxs_points_by_dist(points, desc=False)
staticmethod
Beware the method expects points to be collinear.
Given four points [p0, p1, p2, p3], we wish to have the order in which each point is separated. The one closest to the origin is placed at the origin and relative to this point we are able to know at which position are the other points.
If p0 is closest to the origin and the closest points from p0 are in order p2, p1 and p3. Thus the array returned by the function is [0, 2, 1, 3].
Parameters:
Name | Type | Description | Default |
---|---|---|---|
points
|
NDArray
|
numpy array of shape (n, 2) |
required |
desc
|
bool
|
if True returns the indices based on distances descending order. Otherwise ascending order which is the default. |
False
|
Returns:
Name | Type | Description |
---|---|---|
NDArray |
NDArray
|
indices of the points |