Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
Fix H3_3 cell selection for routing network, include "unclassified" s…
Browse files Browse the repository at this point in the history
…treets for car routing
  • Loading branch information
nihar1024 committed Nov 7, 2024
1 parent dcf100b commit 2c26aa6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/crud/crud_catchment_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ async def read_network(
FROM point
),
cells AS (
SELECT h3_index
SELECT
basic.to_short_h3_6(h3_index::bigint) AS h3_6,
basic.to_short_h3_3(h3_lat_lng_to_cell(ST_Centroid(h3_geom)::point, 3)::bigint) AS h3_3
FROM buffer,
LATERAL basic.fill_polygon_h3_6(buffer.geom)
)
SELECT basic.to_short_h3_3(h3_cell_to_parent(h3_index, 3)::bigint) AS h3_3, ARRAY_AGG(basic.to_short_h3_6(h3_index::bigint)) AS h3_6
SELECT h3_3, ARRAY_AGG(h3_6) AS h3_6
FROM cells
GROUP BY h3_3;
"""
Expand Down
1 change: 1 addition & 0 deletions src/schemas/catchment_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"residential",
"living_street",
"trunk",
"unclassified",
"parking_aisle",
"driveway",
"alley",
Expand Down

0 comments on commit 2c26aa6

Please sign in to comment.