mehrere oft verwendete Routinen in eigene utils.py eingebaut
This commit is contained in:
+2
-3
@@ -11,6 +11,8 @@ from shapely.strtree import STRtree
|
||||
import math
|
||||
import shapely
|
||||
|
||||
from utils import to_json
|
||||
|
||||
# Globale Variable, die in main aufgerufen wird und steuert ob Graphen in unittests gezeichnet werden
|
||||
draw = False
|
||||
class PointSorter:
|
||||
@@ -33,9 +35,6 @@ class PointSorter:
|
||||
|
||||
def get_sorted_by_y(self):
|
||||
return sorted(self.points, key = lambda p: p.y)
|
||||
|
||||
def to_json(d, pretty: bool = True) -> str:
|
||||
return json.dumps(d, indent=2 if pretty else None, default=str) #ensure_ascii false für darstellung von "ue"
|
||||
|
||||
class NodeIDs():
|
||||
''' Klasse, die Punkte verwaltet und NodeIDs zu Punkten zuordnet.
|
||||
|
||||
Reference in New Issue
Block a user