Filter hubs to rail/sea and add graph-based nearest
All checks were successful
Build Docker Image / build (push) Successful in 3m9s
All checks were successful
Build Docker Image / build (push) Successful in 3m9s
This commit is contained in:
@@ -81,11 +81,18 @@ def _fetch_nodes(db, west, south, east, north, transport_type=None, node_type=No
|
||||
nodes = list(cursor)
|
||||
|
||||
# Filter by transport type if specified (only for logistics nodes)
|
||||
if transport_type and node_type in (None, 'logistics'):
|
||||
nodes = [
|
||||
n for n in nodes
|
||||
if transport_type in (n.get('transport_types') or [])
|
||||
]
|
||||
if node_type in (None, 'logistics'):
|
||||
if transport_type:
|
||||
nodes = [
|
||||
n for n in nodes
|
||||
if transport_type in (n.get('transport_types') or [])
|
||||
]
|
||||
else:
|
||||
# Default: only rail/sea hubs
|
||||
nodes = [
|
||||
n for n in nodes
|
||||
if ('rail' in (n.get('transport_types') or [])) or ('sea' in (n.get('transport_types') or []))
|
||||
]
|
||||
|
||||
return nodes
|
||||
|
||||
@@ -151,4 +158,3 @@ def get_clustered_nodes(db, west, south, east, north, zoom, transport_type=None,
|
||||
logger.info("Returning %d clusters/points for zoom=%d res=%d", len(results), zoom, resolution)
|
||||
return results
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user