DOC: Enhance description of STRtree to indicate that geometries are indexed and queried based on extents
See original GitHub issueExpected behavior and actual behavior.
STRTree
returns a collision where there is none.
A minimal case:
Steps to reproduce the problem.
from shapely import wkt
from shapely.strtree import STRtree
poly_query = wkt.loads('POLYGON ((58.27 44.72, 56.96 47.18, '
'58.47 47.98, 59.78 45.52, '
'58.27 44.72))')
poly_in_tree = wkt.loads('POLYGON ((57.94 44.73, 57.94 44.42, '
'56.02 44.42, 56.02 44.73, '
'57.94 44.73))')
query_tree = STRtree([poly_in_tree])
collide_objects = query_tree.query_geoms(poly_query)
assert not poly_in_tree.intersects(poly_query)
assert 0 == len(collide_objects)
Operating system
Windows
Shapely version and provenance
Shapely 1.8.2 via conda
.
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
DOC: Improve STRtree docstrings #1626 - GitHub
Resolves #1622 Improves STRtree docstrings in an attempt to make it more clear that the tree is based on 2-dimensional bounding boxes.
Read more >STRTree — pygeos documentation - Read the Docs
A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. For two-dimensional spatial data. The tree is constructed directly at initialization.
Read more >Shapely Documentation - Read the Docs
list of geometry objects to the STRtree constructor to create a spatial index that you can query with another geometric object.
Read more >R-tree Spatial Indexing with Python - Geoff Boeing
First we have our GeoDataFrame (called gdf) create an R-tree spatial index for its geometry. Then we intersect this index with the bounding ......
Read more >Spatial Indexes Overview - SQL Server | Microsoft Learn
A spatial column is a table column that contains data of a spatial data type, such as geometry or geography. Tip. SQL Server...
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
correct. We can try to make the description of STRtree more clear in this respect.
I’m using Shapely 1.8, so I have to do the filtering manually.