You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a6940e6
Browse filesBrowse the repository at this point in the historyBrowse files
Add ISTAT comune-coordinates validation as a second data source (v0.4.0)
New geocoding.py module fetches and caches an ISTAT-derived comune->(lat, lon)
reference (opendatasicilia/comuni-italiani, 97.5% match against MIMIT). In
query_stations: stations whose stored coord deviates >30km from their declared
comune's true location are now flagged coordinate_suspect (works for single-
station comuni that the centroid heuristic could not reach), and --near
additionally excludes stations whose declared comune is outside radius_km+30km
of the query point. The original "Agip Tankstelle Rasen" case no longer
appears in --near 46.498,11.354 --radius 6. --no-comune-validate disables.
Copy file name to clipboardExpand all lines: README.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Unofficial community project. Not affiliated with or endorsed by MIMIT. Fuel dat
16
16
-**Known caveats:**
17
17
- Some operators report placeholder values (e.g. `1.000`); use `--min-price` (e.g. `1.2`) to drop them.
18
18
- Some price records are **stale** (a few were last updated years ago); use `--fresh-within-days` and check the `UPDATED` column / `updated` field.
19
-
- Some stations are **mis-geocoded** in the registry. v0.3.0 annotates stations >30 km from their comune's median (or outside Italy) as `coordinate_suspect` (`*` in the table), and `--near`skips coordinates outside the Italy bounding box. Single-station comuni cannot be validated this way and need a second source (planned).
19
+
- Some stations are **mis-geocoded** in the registry. As of v0.4.0 `pitstop` joins a second data source (ISTAT-derived comune coordinates from [opendatasicilia/comuni-italiani](https://github.com/opendatasicilia/comuni-italiani), 97.5% match) to validate each station's coordinate against its declared comune's *true* location. Stations >30 km off are flagged `coordinate_suspect` (`*` in the table), and `--near`excludes stations whose declared comune is geographically too far from the query point — even single-station comuni like RASUN-ANTERSELVA. Pass `--no-comune-validate` to disable.
20
20
21
21
## Install
22
22
@@ -87,13 +87,17 @@ pytest -q
87
87
88
88
## Status & roadmap
89
89
90
-
v0.3.0 — fuel-price core (registry+price join, filters, proximity, cheapest, `--min-price` floor, `--fresh-within-days` freshness filter, `coordinate_suspect` geocoding signal, JSON), an MCP server, a Claude skill, tests, and CI.
90
+
v0.4.0 — fuel-price core (registry+price join, filters, proximity, cheapest, `--min-price` floor, `--fresh-within-days` freshness filter, ISTAT-derived comune-coordinate validation, JSON), an MCP server, a Claude skill, tests, and CI.
91
91
92
92
Planned, roughly in order:
93
-
- a **second data source** of Italian comune coordinates (e.g. ISTAT) to validate single-station-comune coordinates that the self-contained method can't reach;
94
93
-**EV charging** (locations via Open Charge Map; prices via the AFIR National Access Point / DATEX II as that data matures);
95
94
- additional countries behind a per-country source adapter (e.g. Germany Tankerkönig, France/Spain official feeds).
96
95
96
+
## Data sources & attributions
97
+
98
+
- Fuel stations and prices: **MIMIT Osservaprezzi Carburanti** open data.
99
+
- Comune coordinates (validation): **opendatasicilia/comuni-italiani** (ISTAT-derived).
100
+
97
101
## Links
98
102
99
103
- MIMIT fuel open data: https://www.mimit.gov.it/it/open-data/elenco-dataset/carburanti-prezzi-praticati-e-anagrafica-degli-impianti
-**`--fuel` is a substring match** — `Gasolio` also matches `Gasolio Premium`, `Gasolio Oro Diesel`, etc. Use `pitstop fuels` to pick exact names; inspect the `fuel` field in results.
48
48
-**Placeholder prices** — some operators report junk values like `1.000`; with `--cheapest` these can rank first. Pass `--min-price 1.2` (petrol/diesel) to drop them; use a lower floor for cheaper fuels like GPL. Still sanity-check the lowest result.
49
49
-**Stale prices** — some records were last updated years ago and may be far below the current market. Pass `--fresh-within-days 90` and check the `updated` field before reporting a price as current.
50
-
-**Mis-geocoded stations** — a few registry coordinates are wrong. Results carry a `coordinate_suspect: true` flag (table marker `*`) when a stationis far from its comune's other stations or outside Italy. When you see it, treat the result as low-confidence and double-check the `comune`/`address`. **Single-station comuni cannot be flagged** with the current method, so for `--near` results in remote/small comuni, always sanity-check the comune name against the user's query.
50
+
-**Mis-geocoded stations** — some registry coordinates are wrong. `pitstop` now joins an ISTAT-derived comune-coordinates reference (97.5% coverage): a `coordinate_suspect: true` flag (table marker `*`) appears when a station's coord is far from its declared comune's true location, and `--near` excludes stations whose declared comune is geographically too far from the query point. Even single-station comuni are now caught. Still: when you see `coordinate_suspect`, treat as low-confidence and surface the `address`/`comune` to the user.
0 commit comments