Skip to content

Instantly share code, notes, and snippets.

@fhk
fhk / Broadband.md
Created May 23, 2024 17:16
Broadband Plan

First Steps for a Citywide Fiber Network

Here's a breakdown of the initial steps you'd take to initiate a citywide fiber project, incorporating elements from the provided feasibility studies and focusing on funding, ISP evaluation, and infrastructure considerations:

Phase 1: Strategy & Policy Development

  1. Establish a Broadband Policy: Define the city's vision for broadband. This should cover:
  • Goals: Ubiquity, affordability, competition, open access, desired speeds, and financial sustainability.
  • Roles: The city's role as owner, facilitator, or partner.
  • Community Engagement: Processes for gathering public input and ongoing communication.
from shapely.geometry import LineString, Point
from shapely.ops import unary_union
from geopy.distance import geodesic
def snap_to_nearest_node(point, nodes, tolerance):
for node in nodes:
if geodesic((point.y, point.x), (node.y, node.x)).meters <= tolerance:
return node
return point
@fhk
fhk / gemini_geograph.py
Created August 20, 2024 01:03
gemini_geograph.py
import momepy
import geopandas as gpd
def create_graph(linestrings):
gdf = gpd.GeoDataFrame(geometry=linestrings)
graph = momepy.gdf_to_nx(gdf, approach="primal")
return graph