OpenRailway map added to Open Rail - Web Interface
#1
Posted 16 November 2022 - 07:35 AM
For the Open Rail - Web Interface I've added a Map entry. It shows an OpenRailway map with a locomotive icon on the current position of the train. Of course only useful for simulation of real railways. Example:
I use an extra monitor for displaying this map.
I've tested this for the Bernina Pass, the BNSF Scenic SUB and the Edingburgh - Glasgow route. When zooming in the position of the train is not always 100% accurate, but at least it gives you a nice idea where you are and heading for in the real world. The idea is from Flightgear, an open source flight simulator.
Until now this is a private change, but would it be an enhancement for the standard? This would be my first contribution to Open Rails.
regards, Siebren.
I use an extra monitor for displaying this map.
I've tested this for the Bernina Pass, the BNSF Scenic SUB and the Edingburgh - Glasgow route. When zooming in the position of the train is not always 100% accurate, but at least it gives you a nice idea where you are and heading for in the real world. The idea is from Flightgear, an open source flight simulator.
Until now this is a private change, but would it be an enhancement for the standard? This would be my first contribution to Open Rails.
regards, Siebren.
#2
Posted 16 November 2022 - 08:10 AM
Hello and welcome!
Very nice idea, as too often we have to look at map - for understanding, what is around the place, where our train currently is, and what can be watched else, riding along the route.
Must be i-net connection present for doing this, or it would be offline tool?
Very nice idea, as too often we have to look at map - for understanding, what is around the place, where our train currently is, and what can be watched else, riding along the route.
Must be i-net connection present for doing this, or it would be offline tool?
#3
Posted 16 November 2022 - 08:23 AM
You would need an internet connection for the openrailway map.
And by the way if not yet known, you can have a look the openrailway map by using this link https://www.openrailwaymap.org/.
And by the way if not yet known, you can have a look the openrailway map by using this link https://www.openrailwaymap.org/.
#4
Posted 16 November 2022 - 08:41 AM
Thanks, I didn't knew that. so Thank You.
Try to PM with Chris Jakeman for discussing technical details.
In parallel, sign-up on GitHub for uploading Your future ORTS contributions.
Try to PM with Chris Jakeman for discussing technical details.
In parallel, sign-up on GitHub for uploading Your future ORTS contributions.
#5
Posted 18 November 2022 - 02:00 AM
Would there be some compensation for the different projections used in OR/MSTS vs openrailwaymap? I can't recall if lat/long are similarly impacted....
#6
Posted 18 November 2022 - 07:21 AM
I have not much knowledge about these different projections. I used the latitude/longitude as shown in the compass view:
The conversion to this latitude/longitude is done in Source\Orts.Simulation\Common\WorldLatLon.cs. In https://bugs.launchp...or/+bug/1393111 from 2016 I found a description of a bug in this code. However it was never solved. If I use the numbers:
found in this bug description results are much better. Still not 100%. For instance: you cannot see in a station with more tracks which track the train is on. But as I already said, it gives you an idea. And it might be the original MSTS coordinates are not 100% correct anyway.
This conversion code is quite complicated. Comment found in the top of it:
The conversion to this latitude/longitude is done in Source\Orts.Simulation\Common\WorldLatLon.cs. In https://bugs.launchp...or/+bug/1393111 from 2016 I found a description of a bug in this code. However it was never solved. If I use the numbers:
int ul_x = -20013965; // -180 deg in Goode projection int ul_y = 8674008; // +90 deg lat in Goode projection
found in this bug description results are much better. Still not 100%. For instance: you cannot see in a station with more tracks which track the train is on. But as I already said, it gives you an idea. And it might be the original MSTS coordinates are not 100% correct anyway.
This conversion code is quite complicated. Comment found in the top of it:
* Contains equations that convert the camera (viewer) position on the current tile * to coordinates of world (as in planet earth) latitude and longitude. * MSTS uses the so-called "interrupted Goode homolosine projection" format * to define world (i.e. planet earth) latitude and longitude coordinates. * This class is used to convert the current location of the viewer * to world coordinates of latitude and longitude. * Adapted from code written by Jim "deanville" Jendro, which in turn was * adapted from code written by Dan Steinwand. */ // Principal Author: // Rick Grout
#7
Posted 18 November 2022 - 07:28 AM
Anyway, much better, than nothing, while studying new routes.
#8
Posted 18 November 2022 - 12:07 PM
Weter, on 16 November 2022 - 08:41 AM, said:
Try to PM with Chris Jakeman for discussing technical details.
Good suggestions; I have sent Siebren a PM.
#9
Posted 23 November 2022 - 11:20 AM
This enhancement is now available in the unstable build.
To test just open a webpage http://localhost:2150/ in your browser. Or replace localhost if you are not browsing and running OR on the same computer. A webpage with the title Open Rails - Web Interface appears. Which contains an option Map.
To test just open a webpage http://localhost:2150/ in your browser. Or replace localhost if you are not browsing and running OR on the same computer. A webpage with the title Open Rails - Web Interface appears. Which contains an option Map.