Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtree.upsert should be rtree.insert #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 47,7 @@ Optional (only loaded when methods are called to rely on these packages):
To import GPX files
- [pykalman](https://pykalman.github.io):
So smooth paths using a Kalman filter
- [pyproj](https://jswhit.github.io/pyproj/):
- [pyproj](https://pyproj4.github.io/pyproj/):
To project latitude-longitude coordinates to an XY-plane
- [rtree](http://toblerity.org/rtree/):
To quickly search locations
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 14,7 @@ Optional (only loaded when methods are called that rely on these packages):
- `rtree <http://toblerity.org/rtree/>`__
- `nvector <https://github.com/pbrod/Nvector>`__
- `gpxpy <https://github.com/tkrajina/gpxpy>`__
- `pyproj <https://jswhit.github.io/pyproj/>`__
- `pyproj <https://pyproj4.github.io/pyproj/>`__
- `pykalman <https://pykalman.github.io>`__
- `matplotlib <http://matplotlib.org>`__
- `smopy <https://github.com/rossant/smopy>`__
Expand Down
4 changes: 2 additions & 2 deletions leuvenmapmatching/map/inmem.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 190,7 @@ def add_node(self, node, loc):
if self.use_rtree and self.rtree:
if type(node) is not int:
raise Exception(f"Rtree index only supports integer keys for vertices")
self.rtree.upsert(node, (loc[0], loc[1], loc[0], loc[1]))
self.rtree.insert(node, (loc[0], loc[1], loc[0], loc[1]))

def del_node(self, node):
if node not in self.graph:
Expand Down Expand Up @@ -352,7 352,7 @@ def fill_index(self):

for label, data in self.graph.items():
loc = data[0]
self.rtree.upsert(label, (loc[1], loc[0], loc[1], loc[0]))
self.rtree.insert(label, (loc[1], loc[0], loc[1], loc[0]))
logger.debug(f"After filling rtree, size = {self.rtree_size()}")

def to_xy(self, name=None, use_rtree=None):
Expand Down