Skip to content

Instantly share code, notes, and snippets.

@iboates
iboates / remove_psuedonodes.py
Last active April 6, 2020 15:20
Remove pseudonodes from geodataframe full of linestrings
from shapely.ops import linemerge
import geopandas as gpd
import networkx as nx
def remove_pseudonodes(gdf, geom_col="geometry"):
def _gdf_to_graph(gdf, geom_col) -> nx.Graph:
# Find all unique start & end points and assign them an id
@iboates
iboates / init.js
Created April 7, 2019 17:33
leaflet-spotlight demo
// Initialize map with spotlight enabled
var map = L.map(
'map', {
spotlight: true, // This one enables spotlight on the map
scrollWheelZoom:false,
zoomControl: false,
boxZoom: false,
doubleClickZoom: false,
dragging: false
}).setView([50.11703222529853, 8.679703474044802], 18);