route from/to custom locations
This commit is contained in:
parent
f5ee24495e
commit
b92c871bc2
5 changed files with 39 additions and 17 deletions
|
@ -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))) +
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue