route from/to custom locations

This commit is contained in:
Laura Klünder 2017-11-28 23:08:47 +01:00
parent f5ee24495e
commit b92c871bc2
5 changed files with 39 additions and 17 deletions

View file

@ -69,6 +69,8 @@ def assert_multilinestring(geometry: Union[LineString, MultiLineString, Geometry
def good_representative_point(geometry):
if isinstance(geometry, Point):
return geometry
c = geometry.centroid
x1, y1, x2, y2 = geometry.bounds
lines = (tuple(assert_multilinestring(LineString(((x1, c.y), (x2, c.y))).intersection(geometry))) +

View file

@ -227,6 +227,8 @@ def get_custom_location_for_request(slug: str, request):
class CustomLocation:
can_search = True
can_describe = True
access_restriction_id = None
def __init__(self, level, x, y):
x = round(x, 2)