intersection of linestring and polygen are wrong in some situations
See original GitHub issue# # -*- coding: utf-8 -*-
from pygeos import set_operations
from pygeos import linestrings
from pygeos import polygons
import numpy as np
if __name__ == '__main__':
area = np.array([[1240, 8], [70, 30], [70, 704], [1250, 689], [1240, 8]])
area = polygons(area)
edge1 = linestrings(np.array([[600, 117.1], [635, 117.1]]))
intersection = set_operations.intersection(area, edge1)
print(area, edge1, intersection)
edge2 = linestrings(np.array([[600, 116], [635, 117.1]]))
intersection = set_operations.intersection(area, edge2)
print(area, edge2, intersection)
it works correctly in version 0.8.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Does shapely LineString intersection works wrong?
While working with shapely I faced a strange issue. There're 2 points p1 and p2, where the first one belongs to polygon and...
Read more >Intersection gives wrong result · Issue #1216 · shapely/shapely
I ran into a case where an intersection between two (valid) (multi)polygons results in a wrong result. One example results in an "invalid" ......
Read more >Polygon covered by the intersection of multiple linestrings ...
Polygonize the set of noded lines (this automatically discards any lines which do not form polygons); Compute the area of the polygonal result....
Read more >The ST_Crosses() function - IBM
The ST_Crosses() function returns TRUE if the intersection object contains points that are interior to both source geometries, but is not equal to...
Read more >Geography functions | BigQuery - Google Cloud
Functions that return TRUE or FALSE for some spatial relationship between two geographies or some property of a geography. These functions are commonly...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
pygeos 0.10 was just released yesterday, and the wheels are built with GEOS 3.9.1. So you should be able to update to that.
I’m sorry about my expression, I’m not mean to be rude. I do don’t know this capital rule. Sorry about that.
As this problem, in 0.9 the output is:
In 0.8, the output is:
And the weird thing is that intersection is wrong when I input a linestring with same y. Like (600 117, 635 117), same y as 117.