The most central station in the Netherlands
Prior to RustWeek 2026 Mara Bos posted a series of posts on BlueSky and ActivityPub hyping up RustWeek (which I can say lived up to it all). One of them made me ponder a question most likely not meant to be pondered.
The RustWeek conference venue is right next to Utrecht Central Station, the biggest and most central train station of the Netherlands, just 30 minutes from one of the most connected airports of Europe, and very easy to reach by international train! đźš„
Mara Bos (BlueSky, ActivityPub)
Now the big question: Is Utrecht Centraal the most central train station in the Netherlands?
What even is the center of the Netherlands[^1]?
Wikipedia lists 6 definitions:
The origin of the “Dutch grid reference system” was moved southwest to southeast of Paris in 1960, so maybe that is also a possible center point.
There is another one not listed here which I personally want to use, which is the centroid of the Netherlands. As far as I can tell this is at 52.132633, 5.291266.
Where are the train stations?
A great repository of all kinds of data is Wikidata. Wikidata is an online database under the Wikimedia umbrella. They have a query interface where you can query the whole database with a SQL-like language called SPARQL, made to query RDF like structures. (I want to write about dictionaries in the future where these kinds of query systems are used as well; let me know if it is something you want to read about.)
So after a bit of banging my head into a rather slow query lookup site I have made a lookup that works:
SELECT DISTINCT ?item ?itemLabel ?geo WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
{
SELECT DISTINCT ?item ?itemLabel ?geo WHERE {
?item wdt:P31 wd:Q55488;
wdt:P17 wd:Q55;
wdt:P5817 wd:Q55654238;
wdt:P625 ?geo.
}
}
}
Well, this is not great code. What does wdtP31 and wd:Q55654238 mean???
So I think I will write up an annotated version of the same code:
# INVALID SPARQL
SELECT DISTINCT ?item ?itemLabel ?geo WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
{
SELECT DISTINCT ?item ?itemLabel ?geo WHERE {
?item "Instance of" "railway station";
"country" "Netherlands";
"state of use" "in use";
"coordinate location" ?geo.
}
}
}
This makes it a bit easier to see what we want. We want to select distinct objects that: Are an instance of a railway station; have the country Netherlands; and are in use. Then we bind the coordinates to ?geo.
We then also want to get the name in English, if available, just to make it easier for us.
When you run the query in the web interface at query.wikidata.org you get the option to download a GeoJSON file containing the result. GeoJSON is a format for sharing simple geographical data so I thought that would be a good format for it.
So now we have a GeoJSON file with 411 active stations in the Netherlands.
The GeoJSON contains a FeatureCollection where all the different stations are contained. For this data it is rather straightforward to figure out how to read the data:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
7.200833333,
53.184722222
]
},
"properties": {
"item": "http://www.wikidata.org/entity/Q47303",
"itemLabel": "Bad Nieuweschans railway station"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
6.899444,
52.790278
]
},
"properties": {
"item": "http://www.wikidata.org/entity/Q800729",
"itemLabel": "Emmen railway station"
}
},
...
]
}
Here we have two stations: Bad Nieuweschans railway station and Emmen railway station, both of which have a point measured in decimal degrees.
Finding the most central station
What even is distance?
I can’t say I know too much about geodesy or geospatial calculations, so if you find anything wrong here let me know.
So the way I want to calculate distances is the same way a train would travel. That means that I want to follow the surface of the Earth. This is called geodesics in general and the maths gets quite hairy when you have to calculate it on an oblate ellipsoid, which is what the Earth is. To help with this I ended up using the geo crate for doing the geospatial calculations.
One thing that is easy to trip up on is that geo does not use Latitude-Longitude ordering when defining points, but instead uses Longitude-Latitude.
This means that when you want to get the coordinates 52.132633, 5.291266 you have to write it as Point::new(5.291266f64, 52.132633f64), which is a bit confusing. But as you can see in the GeoJSON that is apparently the order it is usually done in.
The Centroid
The code to figure out which station is closest to centroid of the Netherlands is quite easy to follow:
let geojson = // Parse the file somehow.
let nl_center = Point::new(5.291266f64, 52.132633f64);
let utrecht_centraal = Point::new(5.181111, 52.226944);
let center_station = geojson
.iter()
.min_by(|x, y| {
Geodesic
.distance(nl_center, x.point)
.total_cmp(&Geodesic.distance(nl_center, y.point))
})
.unwrap();
println!("Station closest to NL center");
println!("{:#?}", center_station);
println!(
"Distance to NL center: {} Meters",
Geodesic.distance(nl_center, center_station.point)
);
println!(
"Distance to Utrecht Centraal from NL center: {} Meters",
Geodesic.distance(nl_center, utrecht_centraal)
);
This will then print out the result:
Station closest to NL center
Station {
point: POINT(5.241388888 52.14),
item: "http://www.wikidata.org/entity/Q2554652",
item_label: "Den Dolder railway station",
}
Distance to NL center: 3512.0497478401467 Meters
Distance to Utrecht Centraal from NL center: 12918.962850037015 Meters
So the station closest to the centroid of the Netherlands is Den
Dolder railway station.
If we print out the list we can see which stations are closest by:
0 3512.0497478401467 m: Den Dolder railway station
1 3720.984578593838 m: Soest Zuid railway station
2 4677.072721982359 m: Soest railway station
3 5699.898706235108 m: Soestdijk railway station
4 5895.473728527002 m: Bilthoven railway station
5 6148.372673161352 m: Amersfoort Centraal railway station
6 7835.048533188128 m: Driebergen-Zeist railway station
7 8421.071411976876 m: Baarn railway station
8 8422.194722746633 m: Baarn railway station
9 8441.02295634114 m: Baarn railway station
10 9003.131834572378 m: Amersfoort Schothorst railway station
11 9187.258641010287 m: Hollandsche Rading railway station
12 9324.25774024847 m: Maarn railway station
13 10208.381020905303 m: Bunnik railway station
14 11644.46847418688 m: Utrecht Overvecht railway station
15 11726.743356899686 m: Hilversum Sportpark railway station
16 11800.520025108719 m: Amersfoort Vathorst railway station
17 12036.606932918543 m: Hoevelaken railway station
18 12041.85898963482 m: Utrecht Maliebaan railway station
19 12588.490552739504 m: Utrecht Lunetten railway station
20 12918.962850037015 m: Hilversum railway station
21 13068.714692168156 m: Utrecht Vaartsche Rijn railway station
22 13322.530378505777 m: Utrecht Centraal railway station
23 13845.467545991209 m: Houten railway station
Here we can see that Utrecht Centraal is actually only the 23rd closest station to the centroid of the Netherlands at 13.3 km.
So we can conclude that Utrecht Centraal is not the most central station, at least using this method.
Some other methods I tried:
Smallest average distance to all other stations
Another method I thought about was the station that is closest to all other stations and then sorting by that.
If we run that code we get a slightly surprising result: Amersfoort Centraal railway station. It’s a bit interesting because Amersfoort used to be the geographical centrum of the Netherlands. The average distance to all other train stations is 74.278 km. Utrecht Centraal railway station has an average distance of 75.947 km to all other train stations.
From that we can also see that Eemshaven railway station is the furthest away from all the other stations with an average distance of 178.113 km to other stations.
The Centroid of the Stations
The last possible center I thought of was to make a “country” out of the stations and then take the centroid of the stations and look at which stations are closest there.
In my calculations the centroid of this collection of stations is 52.1558908061241, 5.486107726902676, and the most central station of the station centroid is Hoevelaken railway station, only 2.230 km away from the centroid. Utrecht Centraal railway station is 26.805 km away from the centroid and is the 43rd closest.
Unsurprisingly, the station furthest away from the centroid is still Eemshaven railway station.
Conclusion
So what can we conclude from this post? Well, I think the only thing we can conclude that sometimes it is fun to take something too literally. What Mara meant was clearly that Utrecht Centraal is one of, if not the most, well connected stations and it’s easy to get to it from pretty much anywhere in the Netherlands.
But if we just took it literally we could go down a rabbit hole about geodesy, and that was quite fun and interesting.
In the end this post is probably not one that had to be written, but the idea got stuck in my head so I had to, even if it is just for fun.
The code I used to generate can be found here: https://git.sr.ht/~erk/nsnl.
Thank you reader if you got to the end!
Thanks to Zephyra for doing some copyediting of the post.
Footnotes