You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to define a bounding box of a segment. for example:
(0, 0), to (2, 2), bounding box is (0,0,2,2) minx,miny,maxx,maxy
It worked perfectly.
But when I met segment (0,2) to (2, 0) , its bounding box is same as the former one. but they are different segments.
How should I define such segment?
The text was updated successfully, but these errors were encountered:
The entries in the R-tree index are minimum bounding rectangles (MBR) of point sets, not oriented line segments, and the intersection and nearest neightbour queries are point-MBR queries.
The MBR (min. bounding rectangle) of the line segment from (0, 2) to (2, 0) is given by (0, 0, 2, 2), using the (minx, miny, maxx, maxy) convention, same as for the line segment from (0, 0) to (2, 2). Geometrically, the two line segments have different orientation, but their MBRs are the same. You can check this.
In [1]: from shapely.geometry import Point, LineString
In [2]: p00, p22 = Point(0, 0), Point(2, 2)
In [3]: l1 = LineString((p00, p22))
In [4]: l1.bounds
Out[4]: (0.0, 0.0, 2.0, 2.0)
In [5]: p02, p20 = Point(0, 2), Point(2, 0)
In [6]: l2 = LineString((p02, p20))
In [7]: l2.bounds
Out[7]: (0.0, 0.0, 2.0, 2.0)
I tried to define a bounding box of a segment. for example:
(0, 0), to (2, 2), bounding box is (0,0,2,2) minx,miny,maxx,maxy
It worked perfectly.
But when I met segment (0,2) to (2, 0) , its bounding box is same as the former one. but they are different segments.
How should I define such segment?
The text was updated successfully, but these errors were encountered: