pythongeopandasr-tree

Is it possible to bypass pygeos when using geopandas sindex?


I am currently using Geopandas, and I need to search for the k-nearest neigbour efficiently in a data frame. According to the documentation, the implementation of sindex depends on wether or not pygeos is available. Unfortunatly, this change the api for nearest method, which only supports k-nearest when using rtree implementation instead of pygeos.

Is there a way to force geopandas to bypass pygeos and use rtree instead?


Solution

  • Yes. From docs:

    You can still toggle the use of PyGEOS when it is available, by: