Client work · 2025 – present Project 3 of 20
Miletínská dopravní
Crashes, closures, fire brigade call-outs and weather in the Hradec Králové Region on one map.
Visit the site
Verified site status: Up, 48 ms response,
At a glance
- Role
- Design, development and operations
- Period
- 2025 – present
- Status
- Live
- Technologies
- 9 technologies
- Client
- Miletínská dopravní
Miletínská dopravní brings crashes, road closures, fire brigade call-outs and the weather in the Hradec Králové Region together in one place. It is built on open government data and OpenStreetMap, and most of the work is hidden under the map: in coordinate conversion, in finding locations and in going easy on other people's services.
Why it is technically interesting
- One map from several sources. The map (Leaflet on OpenStreetMap) combines call-outs from the public API of the Fire Rescue Service with markers added in the admin, and turns them into one shape that both the map and the overviews work with.
- Cameras placed by road markers. Traffic cameras run by ÚAMK are placed on the map by road kilometre markers from OpenStreetMap, looked up through the Overpass API.
- Weather from the nearest live station. For a chosen municipality the site finds the nearest automatic ČHMÚ station that is currently reporting and shows its latest measurement from ČHMÚ OpenData – ten-minute data if possible, hourly otherwise.
- The admin is a single-page app on its own API: posts with an editor, sources, ad slots, sponsors, users and roles with permissions for individual actions.
Obstacles and how I solved them
- A meridian 17° 40′ off. Municipalities are imported from RÚIAN, the Czech address register: the script streams the large VFR XML file through XMLReader and converts coordinates from S-JTSK (the Krovak projection) to WGS84. At first the conversion returned longitudes shifted by the difference between the Ferro and Greenwich meridians; the fix is documented in the script itself. The axis order in the data is not always the same either, so the script tries both and keeps the one that lands in Czechia.
- Call-outs without a location. Some events in the fire brigade feed have no coordinates. The site first places them in the centre of the municipality from its own RÚIAN table – fast and with no external limits – and asks Nominatim for a more precise location only for a few of the newest events per request, with a long cache. Coordinates outside Czechia or with swapped axes are thrown away.
- Services that sometimes cannot keep up. The Overpass API throttles traffic under load, so queries rotate between several servers, and an empty result is cached only briefly so that an outage does not stay on the map.
- Inconsistent data. The fire brigade feed sends some fields as text and others as objects (the region or district, for example). Normalisation turns them into one shape before they reach the map.
What you don't see
- Permissions on every action. The admin checks roles and permissions on every API call, not just in the menu, and writes every change to an audit log.
- A verified connection. The connection to the fire brigade API is checked against a pinned certificate chain.
- Going easy on other services. Nominatim, Overpass and ČHMÚ are called through a cache so that the site does not load them needlessly.
Technology
- Nette 3 and Latte on my own Nette Web Skeleton.
- MariaDB – posts, events, users, roles and the audit log.
- Leaflet and OpenStreetMap, the Overpass API and Nominatim – the map, road markers and geocoding.
- Open data: RÚIAN, ČHMÚ OpenData and the Hradec Králové Region fire brigade API.
- Quill – the post editor.
Screenshots
3 screenshots
Built with
- PHP 8.2
- Nette
- MariaDB
- Leaflet
- OpenStreetMap
- Overpass API
- RÚIAN
- ČHMÚ OpenData
- Quill