Jump to content
Gr1mR33fer

Conversion

Recommended Posts

I am building a Map using the Google Maps API. I need to convert GTA IV / SCripthook X,Y to Google Maps Lng,Lat. I suck at math and this is just getting frustrating, does anyone know how to do this or that is really good with math? lol I need an equation to use

 

I have gone in game and matched up some random coord, they are below...

 

Where CONVERT TO is I need an equation there...It can be a differnet one for X and Y if needed.

    

     GTA                                            GOOGLE

Location 1

X: 2333.487  ==> CONVERT TO ==> 82.846545

Y: 416.7385   ==> CONVERT TO ==>  -131.6271972

 

Location 2

X: 1229.228  ==> CONVERT TO ==> 83.0912764

Y: 610.1171  ==> CONVERT TO ==>  -142.514648

 

 

Location 3

X: 36.9755 ==> CONVERT TO ==> 82.4991273

Y: 133.485==> CONVERT TO ==>  -154.4458

 

 

 

 

Share this post


Link to post
Share on other sites

Your Google coordinates cannot possibly be correct. Latitude cannot be outside [-90, 90]; any system in which a latitude is outside that range does not qualify for the term "latitude", and is not a model of a sphere.

Share this post


Link to post
Share on other sites

To add to that, to find a function that produces a known result from a known dataset using an unknown algorithm/function, you can use polynomial fitting.


Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Share this post


Link to post
Share on other sites

Polynomial fitting needs more data points - whatever degree polynomial turns out to match the data, you want at least two more points. This is because there is *always* a degree-n polynomial fitting any n+1 points; the fact that it does so doesn't mean anything about fitting the rest of the data. 3 points works if it's linear (normally a decent assumption, but you still want to check), but these 3 points aren't linear. You could fit a quadratic to them, but that means nothing - there's no reason to suspect it'd have anything to do with any other points.

Share this post


Link to post
Share on other sites

Your Google coordinates cannot possibly be correct. Latitude cannot be outside [-90, 90]; any system in which a latitude is outside that range does not qualify for the term "latitude", and is not a model of a sphere.

 

Not sure what you mean by they are not correct, I am getting them from the Google Maps API. I will send you a link to it so you can sse for yourself.

Share this post


Link to post
Share on other sites

Based on the link, you mixed up latitude and longitude. The equations are:

Lat = 82.33224782018947 + 0.0012411918012966094 Y

Long = -154.78609580837022 + 0.009937143825312363 X

These numbers have ludicrous precision; you could probably lop off a number of digits and it'd be more accurately reflecting the precision of the input, but I don't feel like working out what precision they should have.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...