Lat/Long

The MSTS 1 Route Editor can be a beast to use, but it's capable of some amazing results, here you can talk with the wizards that are building some of the fantastic routes available and learn how to make your own.

Moderator: Moderators

Locked
User avatar
mikesimpson
Very Active Forum Member
Posts: 6361
Joined: Mon Dec 03, 2001 12:00 am
Location: Southern Hemisphere Penal Colonies
Contact:

Lat/Long

Post by mikesimpson »

Does anyone know how to work out the Lat/Long of a position in MSTS from a position like the following in the routes .trk file?

RouteStart ( -6073 15136 -152 80 )

i.e. How do you convert these into something meaningful?
Mike in OZ - Author of TS-Tools & Route-Riter.
http://www.agenetools.com
I'm not arguing (just explaining why I'm right).
User avatar
saddletank
Very Active Forum Member
Posts: 14183
Joined: Mon Dec 03, 2001 12:00 am
Location: UK East Midlands

Post by saddletank »

Can you find the position in RE? Then use the lat and long given on the screen?
Martin
_______________________________________
ED209: "Please put down your weapon. You have 20 seconds to comply."
User avatar
alan2
Peak Rail Route Author
Posts: 5512
Joined: Tue Jan 01, 2002 12:00 am
Location: Secret Routebuilders Castle lost on the way to the toilet!

Post by alan2 »

in the RE, you can jump to these co-ordinate's.

in the Panel which shows the tile, x,y,z, lat/lon.

type the -6073 in the tileX box, 15136 in the tile Y box.

then press JUMP.

you should goto the loaction of the tile, now enter the -152 in the X box and the 80 in the Z box, now Press JUMP again.

You should be at the exact lat/lon of the location.

Hope I helped.
Alan Heath
Why does DOS never Say Excelent Command or filename ?!!?!??
To Err is human, computers output the errors at higher speed.
User avatar
mikesimpson
Very Active Forum Member
Posts: 6361
Joined: Mon Dec 03, 2001 12:00 am
Location: Southern Hemisphere Penal Colonies
Contact:

Post by mikesimpson »

Yes, I know how to get there in the RE etc. Reason I want to find the lat/long is for an update to Route-Riter whereby I can set sunrise/sunset for the location of the route. I was going to base this on the start tile of the route, and needed to know how to calculate it from the RouteStart coordinates.

I can get the user to type in the general location of the route, but it seems cleaner to do it automatically?
Mike in OZ - Author of TS-Tools & Route-Riter.
http://www.agenetools.com
I'm not arguing (just explaining why I'm right).
User avatar
saddletank
Very Active Forum Member
Posts: 14183
Joined: Mon Dec 03, 2001 12:00 am
Location: UK East Midlands

Post by saddletank »

Mike I would think (or hope) the tile number is directly linked to lattitude (which is all you need - distance from the pole). If you can work out the numbering system for tiles away from the poles that might do it for you. On the other hand for a route user to type in latitude is not too much of a chore - I doubt you get many complaints!

Are you considering seasonal variation too? At 52N (latitude of London) sunrise is about 3.30am in summer and 7.30am in winter... I have to say that doing a winter morning activity with the sun coming up at the right time and the hoar frost on the hedges and fields would be rather special.
Martin
_______________________________________
ED209: "Please put down your weapon. You have 20 seconds to comply."
User avatar
decapod
Building GWR Highworth Branch 1917-1926
Posts: 3097
Joined: Tue Dec 04, 2001 12:00 am
Location: Carshalton, Surrey
Contact:

Post by decapod »

Mick Trist (Zorcan) must know - he must use some calculation in TSTF to show tiles.

As far as latitude goes, each grid is 2km square
2km ir 1.0799136 nautical miles
1 nautical mile is a 1 minute (1/60th degree) arc on the earths surface along a great circle (e.g. a line of longitude)

given this, it looks like you have to subtract 180 degrees from the result (a kuju oddity?)

e.g.
15136/1.0799136/60 - 180 = 53deg 35 min & 56 secs ????

You'd have to confirm this with other route latitudes and could probably calculate the factors they're using more accurately.
DECAPOD
OOOOO
Zorcan
Established Forum Member
Posts: 303
Joined: Wed Dec 12, 2001 12:00 am

Post by Zorcan »

Well, at the moment I have code which can determine a tile's number and filename, given the longitude and latitude, but as yet I haven't coded the reverse function.

I think I have hardcopy C source for this function - I'll look it out this weekend.
User avatar
mikesimpson
Very Active Forum Member
Posts: 6361
Joined: Mon Dec 03, 2001 12:00 am
Location: Southern Hemisphere Penal Colonies
Contact:

Post by mikesimpson »

For Martin,

Yes, I am working on seasonal variations. Before my hard-drive disaster, I had set up RR so that you enter a lat/long for somewhere in the route, and it calculates sunrise/set for the 4 equinox dates, then produces 12 .env files. e.g. springsun.env, springrain.env,springsnow.env and the other seasons.

The .trk file for the route is altered to include the 12 .env files (Kuju were obviously working on this as they have slots in the .trk file for 12 different env files).

I have also managed to get different water textures for the different seasons, flowing water, and done things like turned the sun/moon off when there is heavy cloud - I am awaiting Michael Vone's next release of his route building guide as he tells me there are a lot more environment settings in that.

Of course there are a lot of limitations, no matter where the sun rises, it sets 180 degrees away from it and moves through the overhead position (overhead sun at Berwick in winter was not something I seem to remember from my schooldays? Maybe it was overhead, we just never saw it in any case :D )

Thanks for the help from all of you, should have something out one of these months.
Mike in OZ - Author of TS-Tools & Route-Riter.
http://www.agenetools.com
I'm not arguing (just explaining why I'm right).
User avatar
mikesimpson
Very Active Forum Member
Posts: 6361
Joined: Mon Dec 03, 2001 12:00 am
Location: Southern Hemisphere Penal Colonies
Contact:

Post by mikesimpson »

Thanks also to Paul and Zorcan for your help.

I only need an approx result in any case as the sunrise/set times for a route will have to be the same over the whole route due to the limitations of MSTS (even for those building the Trans-Siberia railroad). So results down to seconds do not matter.
Mike in OZ - Author of TS-Tools & Route-Riter.
http://www.agenetools.com
I'm not arguing (just explaining why I'm right).
User avatar
saddletank
Very Active Forum Member
Posts: 14183
Joined: Mon Dec 03, 2001 12:00 am
Location: UK East Midlands

Post by saddletank »

Mike, just getting rid of the sun/moon when its raining would be a step forward!
Martin
_______________________________________
ED209: "Please put down your weapon. You have 20 seconds to comply."
davec
TsTools Development Team
Posts: 263
Joined: Thu Dec 13, 2001 12:00 am
Location: back in blighty, somewhere near the GER
Contact:

Post by davec »

Hi Mike,

I'll knock up a little converter for you tonight and post a url for you tomorrow. I have all the code already, just need to put a front end on it.

Cheers

Dave C
User avatar
mikesimpson
Very Active Forum Member
Posts: 6361
Joined: Mon Dec 03, 2001 12:00 am
Location: Southern Hemisphere Penal Colonies
Contact:

Post by mikesimpson »

Thanks very much for that Dave, I thought someone would have done it already.
Mike in OZ - Author of TS-Tools & Route-Riter.
http://www.agenetools.com
I'm not arguing (just explaining why I'm right).
davec
TsTools Development Team
Posts: 263
Joined: Thu Dec 13, 2001 12:00 am
Location: back in blighty, somewhere near the GER
Contact:

Post by davec »

Mike (and anyone else interested)

I have uploaded a calculator to:

http://ts-tools.com/TsTileCalc.zip


Its very basic - just enter row and column refs of the tile , then x and z coords within the tile, click the button and the lat/lon is returned.

If you want the source code, or some kind of dll version, let me know.

cheers

Dave
Zorcan
Established Forum Member
Posts: 303
Joined: Wed Dec 12, 2001 12:00 am

Post by Zorcan »

Dave,

Well done, you've saved me the effort :)
User avatar
mikesimpson
Very Active Forum Member
Posts: 6361
Joined: Mon Dec 03, 2001 12:00 am
Location: Southern Hemisphere Penal Colonies
Contact:

Post by mikesimpson »

davec wrote:Mike (and anyone else interested)

I have uploaded a calculator to:

http://ts-tools.com/TsTileCalc.zip


Its very basic - just enter row and column refs of the tile , then x and z coords within the tile, click the button and the lat/lon is returned.

If you want the source code, or some kind of dll version, let me know.

cheers

Dave
Thanks for that Dave,

Would appreciate the source code, please send to virtualtrains@optushome.com.au

Many Thanks

Mike.
Locked

Return to “[MSTS1] Route Building”