Geoprojection: internal coordinates?

Forum for discussion about TSRE features.
Post Reply
rjz222
Posts: 3
Joined: 16 Jan 2019, 18:12
Hi Goku and all,

Working on routes in the Netherlands, using the standard map projection of MSTS and Open Rails gives quite a skew in routes that are globally oriented from north to south or vice-versa.

I found out about the option to move the center of the map projection to a central location in the route in this topic. However, when I try to use this, I get tangled up in the internal coordinates (the third and fourth parameter of the TSREGeoProjection () TRK parameter.

Is there a way we can calculate the correct value for these parameters? I have not found documentation about these parameters yet, and trying to convert the Lat/Long by copying the "ConvertToInternal(double lat, double long, IGHCoordinate* out)"-function in the code to create a converter does not seem to give the right solution.

Regards,

Robert

User avatar
Goku
Site Admin
Posts: 363
Joined: 15 Jan 2019, 18:10
Location: Poland
Contact:
Example of TSRE projection definition:

Code: Select all

TsreGeoProjection ( 44.506783 11.341884 -11717632 29826048 )
The first two values are LAT and LON of the center of your route.

The two second values are center of your route in MSTS coordinates in absolute meters. You calculate them this way:
X = W_TILE_X_NUMER * 2048 + x_coordinate (0-2048m range)
Y = W_TILE_Z_NUMER * 2048 + z_coordinate (0-2048m range)

For new route it doesn't matter what you choose, but it should be a MSTS correct value for MSTS/OR compatibility.
Anyway, OR won't use this projection and it will show false values.
Also this is just a proof of concept feature and the definition in TRK file will change in the future.

rjz222
Posts: 3
Joined: 16 Jan 2019, 18:12
Hi Goku,

Thanks! I'll try it tomorrow. As for the reserves of using this technique: In the case of this route I prefer a correct driving length over correct coordinates, as the route is already short, with also short platforms and tracks for shunting, which are shortened even further in the current projection OpenRails uses.

Cheers,

Robert

Post Reply