-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05ad350
commit ab4d9c2
Showing
2 changed files
with
8 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ | |
__copyright__ = "Copyright 2007, Oliver White; Modifications: Copyright 2017, Mikolaj Kuranowski" | ||
__credits__ = ["Oliver White", "Mikolaj Kuranowski"] | ||
__license__ = "GPL v3" | ||
__version__ = "0.4" | ||
__version__ = "0.5" | ||
__maintainer__ = "Mikolaj Kuranowski" | ||
__email__ = "[email protected]" | ||
|
||
|
@@ -250,10 +250,10 @@ def storeWay(self, wayID, tags, nodes): | |
(node_id, x, y) = node | ||
if last[0]: | ||
if weight != 0: | ||
if oneway not in ("-1"): | ||
if oneway not in ["-1"]: | ||
self.addLink(last[0], node_id, weight) | ||
self.makeNodeRouteable(last) | ||
if oneway not in ("yes", "true", "1") or self.transport == 'foot': | ||
if oneway not in ["yes", "true", "1"] or self.transport == 'foot': | ||
self.addLink(node_id, last[0], weight) | ||
self.makeNodeRouteable(node) | ||
last = node | ||
|
@@ -263,12 +263,9 @@ def makeNodeRouteable(self, node): | |
|
||
def addLink(self, fr, to, weight=1): | ||
"""Add a routeable edge to the scenario""" | ||
try: | ||
if to in list(self.routing[fr].keys()): | ||
return | ||
self.routing[fr][to] = weight | ||
except KeyError: | ||
self.routing[fr] = {to: weight} | ||
if fr not in self.routing: | ||
self.routing[fr] = {} | ||
self.routing[fr][to] = weight | ||
|
||
def equivalent(self, tag): | ||
"""Simplifies a bunch of tags to nearly-equivalent ones""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,14 @@ | |
name = "pyroutelib3", | ||
packages = ["pyroutelib3"], | ||
license = "GPL v3", | ||
version = "0.4", | ||
version = "0.5", | ||
description = "Library for simple routing on OSM data", | ||
long_description = readme, | ||
author = "Oliver White", | ||
maintainer = "Mikolaj Kuranowski", | ||
maintainer_email = "[email protected]", | ||
url = "https://github.com/MKuranowski/pyroutelib3", | ||
download_url = "https://github.com/MKuranowski/pyroutelib3/archive/0.4.tar.gz", | ||
download_url = "https://github.com/MKuranowski/pyroutelib3/archive/0.5.tar.gz", | ||
keywords = "osm routing pyroutelib", | ||
classifiers = [], | ||
install_requires = ["osmapi"] | ||
|