Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
OpenRailwayMap (openrailwaymap.org)
173 points by doener on Dec 20, 2017 | hide | past | favorite | 58 comments


Background: http://wiki.openstreetmap.org/wiki/OpenRailwayMap

It seems to consist of a set of railway specialised tags, which exist within the OpenStreetMap database. OpenRailwayMap then runs their own tiling/rendering infrastructure to generate maps with a rail emphasis.

If I understand correctly, there is no split here, as the OSM database remains the "mother lode" of mapping information?


Yes, all this data is tagged and available in the OSM database. In many countries the tagging of the railway lines is very thorough and often uses publicly available data sources from the national railway infrastructure operator.

http://wiki.openstreetmap.org/wiki/OpenRailwayMap


Interesting, I was wondering why the Rhaetian Railway was completely missing. Turns out it's tagged as "narrow gauge" railway[1], which doesn't seem to get picked up by OpenRailwayMap.

[1] http://wiki.openstreetmap.org/wiki/Tag:railway%3Dnarrow_gaug...


It would be very cool if someone combined this with open GTFS data and a public transport routing algorithm. Imagine having a "public transport" option in the list of routing services - just like Google Maps - but using free software/data and on a global scale.

It looks like Graphhopper introduced an algorithm for transport routing this year [0], although there are still performance improvements to be made. Project OSRM seems not to be interested in adding this feature for now.

[0] https://github.com/graphhopper/graphhopper/pull/1018


OpenTripPlanner already exists:

http://www.opentripplanner.org

I've only played around with it but it seems very capable. It also has a pretty cool analysis tool that lets you see the changes in transit accessibility when a bus/train is removed, etc.


Correct there is only one OSM database feeding both this map and the main map on openstreetmap.org (and other maps).

It shows the power of open data. You can take the OSM database, and slice out the bits you want and only show what you want.


What would make this super interesting to me would be a historical timeline and a way to contribute historical routes.

For example, here are some old branches off the main San Francisco Peninsula line:

• Hawthorne Avenue in Palo Alto (three blocks north of University) and Middlefield where it crosses San Francisquito Creek were originally a spur line that served the Catholic University (now Jesuit Seminary) in Menlo Park.

• What is now Fry's Electronics in Palo Alto and that row of buildings had loading docks in the back for the spur that branched off the main line there. This line went to where the Veterans' Hospital is now and then followed the path of Foothill Blvd, straight through the Trader Joe's parking lot at Homestead ends, then continued through to tracks that still exist on the other side of 280.

• If you ever wondered why Camden Avenue in Campbell/San Jose has that oddly smooth curve where it veers off Hillsdale, yes, it was another train line. This was the Campbell-Almaden line (thus the name cam-den) which started from the still-existing line that runs through Campbell (you can see some of the old loading docks from Railway Avenue). Where Camden bends right at Kooser, the train line continued straight through where the power lines are now, crossed a bridge to follow what is now Redmond Avenue in south San Jose, and on to the town of New Almaden.


Just what your ordered?

http://www.openhistoricalmap.org/

http://wiki.openstreetmap.org/wiki/Open_Historical_Map

Given that it is all based on the OSM database, I'd imagine OpenHistoricalMap would already cover historical railways? There is a renderer for the "railway" aspect of the OSM database (openrailwaymap.org), one for the "historic" aspect (openhistoricalmap.org), so it's a matter of programming for the railway map renderer to include the history aspect.

---

Edit: Just notice the following note about OHM: "As opposed to other projects such as OpenSeaMap, OHM makes use of its own database independent of OSM." A pity, as this means ORM won't automatically pick up history. OSM does have a "4D" proposal to include time: http://wiki.openstreetmap.org/wiki/OSM-4D , but it seems that it is not yet active.


OpenStreetMap, the (only?) backing dataset for OpenRailwayMap, is a little picky about purely historical features, as they generally seek to document current facts on the ground. Check OSM policies before you contribute.

That being said, there's plently of historical rail -- running the gamut from disused, abandoned, railbanked, to never-knew-it-was-there -- visible in OpenRailwayMap. A good example is zooming in on Lima, Ohio, between Columbus and Fort Wayne. Dashed lines are everywhere.


Disused or abandoned railway lines are still useful for old-fashioned map-based navigation.

Even if the track and ballast has been removed, there's still a narrow, graded path across the landscape, often easily visible from surrounding hills.


Those non existent tracks can be mapped in Openstreetmap as well, but not exactly as a railway.


There's definitely some historical routes on there. If you look at the old B&O mainline, they have the historical route of Mount Airy Loop, which was discontinued in the 1950s. They don't have the original planes, though, which was ripped up in 1839 (it was built in 1830). It's somewhat understandable, given that the location of some of the route is pure conjecture at this point.


Every time my family takes a trip to northern Wisconsin and the Upper Peninsula of Michigan, my father annoys... err, entertains us with recollection and speculation about where all the old lines ran.

(After the first hour or so, the demand on one's continued attention becomes a bit draining...)

He -- and his ilk -- would love something like that.

I wonder how far back DeLorme published its atlases. I should look for some old, second-hand copies.


A lot of the old rail lines in those areas were just temporary logging rails though. That narrow gauge stuff probably won't be on any maps, certainly no modern commercial map.

http://geo.msu.edu/extra/geogmich/rr-logging.html

If you poke around you can find digital copies of old plat books of Michigan, going back to when railroad companies owned most of the land.


Thanks!


> straight through the Trader Joe's parking lot at Homestead ends, then continued through to tracks that still exist on the other side of 280.

Huh, I was walking along Peninsular Avenue a while back and was wondering what that odd, straight, flat area beyond the fence was. Cool to know it used to be a rail line!


Yup, that's exactly where it was. If you look at the area in satellite view, you can see where you could draw a straight line extending from Foothill through the shopping center and behind the houses on Peninsular, and from there straight to the still-existing tracks south of 280 that serve the Permanente cement plant.

I find it interesting that when they built the shopping center at Foothill and Homestead and the Springwood Apartments next door - which I assume was long after the railroad tracks were gone - they avoided building directly on top of the old right of way but kept it as a driveway through each parking lot. No idea why - contamination?

Even more fun, look up the area in Google Earth (the desktop client, not the web-based "New" Earth), turn on View/Historical Imagery, and slide the timeline all the way back to 1948 when the railway ran through there. You can also see where it ran behind Fry's in Palo Alto.

This 1948 photo covers a big chunk of the Peninsula and South Bay - it's really interesting to see how things looked back then and compare with later years. All those regular patterns of dots you see when you zoom out? Orchards!


I don't know about the US, but in the UK one reason to avoid building on old railway lines is that they might technically still be railway infrastructure. For example, the newly-rebuilt Borders Railway, south from Edinburgh, was only able to be built because in a limited sense, it had never stopped being a railway so many of the required permissions were already in place.


Intersting…it seems that the two lines actually used to meet up at where Foothill and Grant intersect now, north of 280. The "meeting point" was moved to the other side of 280 and the old line was cut off later.



On the UK map you can see all the closed railways - zoom in to London then go south and see all the dotted lines.


If I had to bet, I'd say Bascom Ave also used to be a railroad.


OpenRailwayMap shows the train lines on a geographic map.

I drew a train map where the distance between stations is proportional to the time it takes to travel that far.

http://peterburk.github.io/tra/

To do the project, I rewrote my own version of Logo, and scraped the train timetable data from the train company's website. It was quite satisfying because Logo was my first programming language (when I was about 7 years old), and I finally found a use for it.

To my knowledge, there's no other graphing tool that can draw maps like mine. Other subway maps don't have lines that are proportional to the time.



I saw that here on HN a few months ago! It's cool, but it needs to be interactive. One thing I like about the way I drew my map is that it's a static image that could be printed and posted on train station platforms.


It would be really cool if this were implemented for the whole world and not just Taiwan.


If you can tell me where to get train timetable information for Australia, I can try!

I'll definitely be in Taiwan until the end of 2018. After that, I might be moving somewhere else (possibly New Zealand, Australia, or Canada). Depending on my future job's policies about side work, then I might be able to redraw a map like this one for wherever I'm living in future.

Another possibility is to clean up my GUI, write a tutorial, and use it as a lesson plan for kids. I'd need to talk to some teachers first though.


Ah, a well-researched answer. I'm genuinely curious how much digging was needed to find my location. It's not on page 1 of my profile, at least. (I like doing the same kind of digging... but then people are like "how did you find this old email address?!" and I can't win.)

I actually wound up having a look through your blog after your comment on the SD card factory (https://news.ycombinator.com/item?id=15890198) which was super interesting as I'm VERY fascinated with chip design at the moment. Would love to see how the photolithography machines work...

As for mapping data...

[Clarifying disclaimer: the following wall of text conveys no imposition you have to actually do this nor expectation that you will. This wall of text just wants to be helpful. :P]

Australia doesn't have a countrywide system; each state manages its own public transport infrastructure. I live in NSW (very possibly where you'd end up visiting if you came here looking for a job, as a FWIW aside), and this state happens to provide full info through https://opendata.transport.nsw.gov.au/.

This portal is... to be honest: on the one hand, it's an utterly confusing mess you could very reasonably and accurately sell as a technical IQ test, it's structured so confusingly. On the other hand, if you succeed at getting an OAuth2 key and figuring out the right URL to poke, it'll spit back little ~20-40KB protobuf-compressed blob files containing the live GPS coordinates for every train, bus, tram and ferry in NSW. And on top of that there's stuff like route shape information, realtime timetable data, etc.

So, figuring the site out will be a multi-day project of its own.

As far as I can figure out, you basically need a list of stops and the locations.

Methinks the GTFS Static feed for stop information may be a workable start: https://opendata.transport.nsw.gov.au/node/334/exploreapi

To get this, I a) logged in, b) made an app (just enable all the APIs), c) went to the above page, left "type" as the default "API key", hit "expand", scrolled down to the "try it!" button, opened the network tab in the devtools, clicked the "try it" button, right-clicked the in-flight download, went to "copy" > "copy as curl", reloaded the page to stop the download, then just ran the curl command.

Yep, a giant hack, but it worked. The site's basically broken, but it works.™

The result was a 100MB ZIP file (remember to add "-o gtfs.zip" or something to the curl command) with a bunch of CSV text files in it that conform to this format: https://developers.google.com/transit/gtfs/examples/gtfs-fee...

The above URL may be helpful for basic familiarization but I had a look at the data from the standpoint of "how would I turn this into a proportionally accurate map".

stops.txt has all the train stations buried in it. I particularly like that each platform at a station is listed separately, each with its own (ever so slightly different) GPS coordinate :D

This is the second approach to look at everything that occurred to me, but I've kept the first one below.

Each station is noted in stops.txt both as an actual station as well as a series of platforms. (I'm guessing the GPS coordinates in the station reference are for the actual building.) The actual station entry IDs seem to all start with PST (the IDs are allowed to be random FWIW). The platform entries are listed as "___ Station, Platform _" and have a numeric ID, and you'll see the PST___ identifier in the "parent" column off toward the right.

If you grab the ID for a station platform, you'll find a ton of references to the ID in stop_times.txt, which represent a train stopping at the platform as part of a route. This is useful because of the "shape_dist_traveled" column, which records how far the train traveled as part of the route it happens to be on.

If you crossreference all the platforms against all the routes in stop_times.txt, you'll be able to derive the distance between each stop by just looking at the route as it travels between stations.

--

This was where I started: the routes are structured by startpoint and an endpoint. If you ^F for "Train" inside routes.txt to find a train route and grab the ID, and you'll find a ton of matches for that ID inside shapes.txt. This describes every single little twist and turn in the track as a discrete GPS coordinate. You may find it fun to feed this to your Logo implementation - but you don't _have_ to, thanks to the "dist_traveled" column (which is not a standard GDFS column but got added here).

Searching trips.txt for the same ID will yield a ton of matches that represent all the stations associated with a particular route. (The GPS locations for the station platforms are of course back in stops.txt.)

Each route is distinguished by a unique ID which explains the extra characters. I don't think there's a pattern to these.

--

I unfortunately don't know whether the ___dist_measured columns measure the distance in feet, miles, meters, kilometers, or what. It might be meters. You could probably derive it from a pair of GPS positions (I have no idea how to).

I don't mind seeing if I can figure out the distance information between the stops. It sounds like a fun project, in theory... :P


Wow! Thank you for all that. I stalked you via the data URI on your profile to get your email address, then I Googled that to find your DeviantArt, which had your location.

I'll look in the details of NSW transport when I get back to my computer. It sounds complicated, but similar to the way I derived the Kaohsiung bus network from the real-time GPS coordinates. I didn't make a map for that yet though, just KML files.


It was fun to figure it out! The offer to headscratch through the actual data stands :)

Ah, deviantart, haven't seriously used that for a few years :) heh

It unfortunately sounds complicated-ish to me too. Interesting to hear that real-time route data is a worldwide thing nowadays. It makes sense, really, now that M2M over 3G/4G is pretty widespread.


The OpenRailwayMap project is great; I just wish their default map viewer had the Query/Inspect feature. When I'm browsing railways (don't ask...), I find myself using OpenStreetMap side-by-side to Query for more details about a way or relation, while OpenRailwayMap gives me a better overview and labels in the main map.


Have you used urbanrail.net? I love that site.


I know you said don't ask, but what do you use this for?



Thanks.


Red means high speed and it's sad to see almost no high speed in the u.s. sigh

The one from NY to Boston shouldn't even be called "high speed", if anyone has ridden in one before.

It's actually slower than driving!


Where does it say what the colors mean? What is yellow? And the dotted lines?


OSM is popular in Europe, and Germany in particular. So when the German train nerds are mapping and choosing colours, they tend to have a European focus.


Make a proper argument for high speed rail. I think it's rare in the U.S. in part because it's not an idea which is popular with people who need to get around and move things. High speed rail is popular with government, since it's an attractive sophisticated infrastructure program, but (perhaps TGV aside) I don't think any high speed rail service could be considered a success in any real way.


The US had the largest rail system in the world and more streetcar lines that Europe not over 100 years ago. They're all gone now. Here's a great video:

https://www.youtube.com/watch?v=-cjfTG8DbwA

"America is too spread out" is a bullshit argument. You put the rail architecture back in and you'll watch communities draw inward, zoning laws merge and neighborhoods get closer and more sustainable.

Access to transportation is the biggest factor in being able to move out of poverty. That's not a subjective statement. It's been verified in study after study.

Don't like living next to people and hate public transport? That's fine. There are tons of Europeans and Australians like that who live outside the cities and drive. They have that choice, because the cities are affordable and livable. Every Australian capital has commuter rail except Darwin, Hobart and ACT. In America, it's incredibly difficult to live without a car in almost every major city and most of our capitals, and we have a far far greater population density.


> "America is too spread out" is a bullshit argument.

It may well be a bullshit argument, but it's also an argument that I did not make.

My point was entirely that the markets do not seem to value high speed rail highly enough to justify its costs, and that the U.S. (for its faults) largely represents this low market valuation of high speed rail by not financing it. You seem to make an argument with the assumption that you know the utility of high speed rail is higher than the cost, I avoid this assumption.

High speed rail is apparently worth less than it costs, state pricing distortions included. You might like it, it might be attractive, it might make things more dense, you might think that's a good thing... and none of that matters because apparently it's just not worth it to the market which will be tasked with funding it, all things considered.


IMO this shouldnt be a cost decission but quality of life for the tax payer. Pretty sure governments arent ment to be profitable in all what they do.


Germany's ICE trains?

https://en.wikipedia.org/wiki/Intercity-Express

Or the Shinkansen:

https://en.wikipedia.org/wiki/Shinkansen

(a major cultural touchstone for Japan in additon to the economic aspects).


TGV falls into the same class as Thalys, ICE, etc

When a Thalys route was opened between Paris and Brussels (200 miles), Air France withdrew their flights and booked seats on the train instead. American, Delta and JetA also operate a code sharing route on the train route.

Beyond Brussels, Skyteam group uses Thalys to link Brussels with Schipol.

So, yeah, link cities as you would with plane (airport time included), and High Speed Rail works. I've used it, and it's a vast improvement over wasting time in airports and jumping through air travel 'security' hoops.


High speed rail connects city centers with comfortable, fast, dependable transportation. Look for example at the Shinkansen system in Japan. You can travel from Tokyo to Kyoto (~450km by car) in about three hours door to door for about a hundred dollars. The trains run every couple of minutes.

Shinkansen are very popular in Japan. I don't know how you could not call them a success story.


> Shinkansen are very popular in Japan. I don't know how you could not call them a success story.

The Shinkansen may have some popular (profitable) lines, but it took a long time for the service to shed the lines which were built for purely political reasons under JNR. The fascist approach to building rail lines relies on hiding the true cost of rail (across private land) in subsidies and loans which are structured out of successors and written off by the government.


They are a success in that people ride them regularly. Less of a success in that the tickets are often more expensive than a comparable flight, although secondary factors like security, terminal location, and legroom can make the train the preferable option even at a higher price.


Train rides <= 3 hours are also often faster than the related flight when you account for airports usually beeing more far out of the city and all the time you waste within the airport. Also if you connect 2 cities without major airport (which would lead to having to change plane) i found this rule to be true for 7+ hours train rides as well.


I love this site. In the UK there are so many old railways no longer in existence that you can find on this site. It's really interesting to see how old tunnels and paths near where you live used to be used.


Cool! It would be awesome to see the trains moving in real-time (even if it wasn't "live", and just based on posted schedules).


http://tracker.geops.ch/

Where the data is available, it shows live movements of the trains, and where that data is not available, the trains follow scheduled movements.

A further explanation of this is here: http://geops.de/blog/worldwide-travic (German)


Netherlands, based on live data: http://spoorkaart.mwnn.nl/ . It exists for some other European countries too, I think.


Click on the "Spoorkaarten in het buitenland" link in the bottom right for more countries.



Is there a site to print maps from OSM? I'd love to print a map of London's train system (an happy to pay for it)


There are lots of options:

http://wiki.openstreetmap.org/wiki/OSM_on_Paper

I haven't used any of them so I don't have anything resembling a recommendation. You could try asking on https://lists.openstreetmap.org/listinfo/talk-gb , the community there is pretty active so someone might have a suggestion for a nicely done map.


I make a lot of maps in my spare time and have access to a large scale printer. Give me a ping in the next few days and I'll see what I can do for you.


I"m surprised at how few trains there are in Africa.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: