Bad Cams - Similar ALPRs

The following cameras had a similar direction as its closest peer camera (within <30m). Likely indicating a duplication of efforts.

Code
import pandas as pd
import geopandas as gpd
import folium
import itables
from datetime import datetime
from folium.plugins import MarkerCluster

m = folium.Map([37, -100], zoom_start=4)

similarcamsgdf = gpd.read_file("../../../osmbadcams/noanglediff.gpkg")
similarcamsgdf = similarcamsgdf.rename({"STUSPS":"State", "NAME":"State Full"},axis=1)

filterinvalid = similarcamsgdf.apply(lambda x: (x.geometry.is_valid) and (not x.geometry.is_empty), axis=1)

marker_cluster = MarkerCluster(disableClusteringAtZoom=10).add_to(m)
for idx, row in similarcamsgdf[filterinvalid].reset_index().iterrows():
    popup_html = f"<style> th\
                {{border:1px solid black;\}}</style>\
                <table><tr>\
                    <th>State: </th>\
                    <th>{row['State Full']}</th>\
                </tr><tr>\
                    <th>ALPR 1 ID: </th>\
                    <th>{row['cam1id']}</th>\
                </tr><tr>\
                    <th>ALPR 1 Direction: </th>\
                    <th>{row['cam1direction']}</th>\
                </tr><tr>\
                    <th>ALPR 2 ID: </th>\
                    <th>{row['cam2id']}</th>\
                </tr><tr>\
                    <th>ALPR 2 Direction: </th>\
                    <th>{row['cam2direction']}</th>\
                </tr><tr>\
                    <th text-align='center' colspan='2'>{row['url']}</th>\
                </tr></table>"
    folium.Circle(
        location=[row.geometry.centroid.y, row.geometry.centroid.x], 
        popup=popup_html, fill=True, radius=30, weight=9,color="#9E2F02",opacity=0.8,fillOpacity=0.5
    ).add_to(marker_cluster)

m
<string>:18: SyntaxWarning: "\}" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\}"? A raw string is also an option.
<>:18: SyntaxWarning: "\}" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\}"? A raw string is also an option.
<string>:18: SyntaxWarning: "\}" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\}"? A raw string is also an option.
<>:18: SyntaxWarning: "\}" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\}"? A raw string is also an option.
/tmp/ipykernel_439078/4117384829.py:18: SyntaxWarning: "\}" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\}"? A raw string is also an option.
  {{border:1px solid black;\}}</style>\
<string>:18: SyntaxWarning: "\}" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\}"? A raw string is also an option.
Make this Notebook Trusted to load map: File -> Trust Notebook
Code
itables.show(pd.DataFrame(similarcamsgdf.drop(["geometry"], axis=1)),  maxBytes=300000, allow_html=True)
cam1id cam1direction cam2id cam2direction url State State Full
60434388[355, 175]60435343[355, 175]link 1, link 2NHNew Hampshire
60435343[355, 175]12929809719[335]link 1, link 2NHNew Hampshire
60435343[355, 175]12929809720[335]link 1, link 2NHNew Hampshire
61400195[60, 240]621520376[60, 240]link 1, link 2MAMassachusetts
61450132[120, 300]3340157470[120, 300]link 1, link 2MAMassachusetts
63060949[40, 220]6040835544[40, 220]link 1, link 2MAMassachusetts
69988650[125, 305]6040835545[125, 305]link 1, link 2MAMassachusetts
94073676[160]13613458449[149]link 1, link 2PAPennsylvania
123666100[95]13470940401[80]link 1, link 2LALouisiana
151316843[360]14115124102[340]link 1, link 2TXTexas
(5,420 more rows not shown)

Started with 2,637 datapoints on 2026-06-01
Last updated: 2026-09-13