A Rust example app that uses the public erdos-unit-distance crate against a public
point dataset.
The app fetches the USGS Earthquake GeoJSON feed, projects latitude/longitude into local kilometers, generates unit-distance templates, and ranks the best matching clusters by normalized pairwise-distance spectra.
erdos-unit-distance gives engineers certified point-set constructions. This
example shows how an application can use those constructions as templates for
real-world spatial data:
- generate unit-distance templates with
erdos-unit-distance - load a public dataset
- normalize point clusters
- score best matches
- display the dataset and selected match in Rust
cargo runThe app opens a native egui window. Press Fetch and match to refresh the
public dataset.
python3 -m http.server 8080 --directory webOpen:
http://127.0.0.1:8080
Default source:
https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.geojson
The USGS feed is GeoJSON and does not require an API key.
For each point in the dataset, the app takes the nearest n neighboring points,
where n is the selected template size. It then:
- centers the candidate cluster,
- scales it by median pairwise distance,
- sorts all pairwise distances,
- compares that distance spectrum to the selected unit-distance template.
Lower score means the candidate cluster is closer to the template shape. This is a practical shape-search demo, not a mathematical certificate.
- Moser spindle
- 3x3 square grid
- 10-point triangular grid
All templates come from the published erdos-unit-distance Rust crate.