Latitude and Longitude (geolocation) of current location

Hello,
I’d like to find the lat and long of the computer running an application, but I’m on a desktop app not a web app.
I’d prefer not to have to use an HTMLviewer if I can help it. I don’t mind using MBS plugins, but I think that CoreLocation is only available on a Mac.
Any pointers on how to do this?
Cheers,
Hamish

There are some web services that will give you a location based on IP - decent ones charge a fee
But they are only so accurate

For a long time some services showed I was in Nova Scotia or something way down east (off by about 3500 miles)
Now some show me in the correct location and others are off

And you only need an HTTPSocket to get at them

Yeah, I’m wondering if there’s a way of using the Google Maps Distance Matrix. (I want to say ‘how far is from where I am now?’ - I can get it to work out how far is from , but I don’t want to have to put in what is…)

Unless the devices your app is running in have a GPS, as Norman points out, you will have to approximate the location based on IP. Check this: http://www.ipinfodb.com seem they have a free API.

Geobytes seems to correctly locate me, is free for moderate use, and has an API.
http://www.geobytes.com/iplocator/

[quote=219957:@Michel Bujardet]Geobytes seems to correctly locate me, is free for moderate use, and has an API.
http://www.geobytes.com/iplocator/[/quote]
This site “guesses” based on service provider…
It says I’m in “SAN DIEGO” which is true to the extent that it is “SAN DIEGO COUNTRY”
but the city of San Diego is 18 miles from where I live
so it depends on how accurate you need to be…

I have software I wrote for work that has to be accurate to < 0.5 miles so we paid dearly for data to geo-code down to the actual street address

As dave notes there’s all kinds of things can mess geolocation via ip up
My IP used to show me being in Nova Scotia - because thats where the address was registered to a subsidiary etc
A VPN may mess it up - which is exactly why you use a VPN for Netflix if you live in Canada :slight_smile:

[quote=219959:@Dave S]This site “guesses” based on service provider…
It says I’m in “SAN DIEGO” which is true to the extent that it is “SAN DIEGO COUNTRY”
but the city of San Diego is 18 miles from where I live
so it depends on how accurate you need to be…

I have software I wrote for work that has to be accurate to < 0.5 miles so we paid dearly for data to geo-code down to the actual street address[/quote]

Without a GPS, IP location depends highly on the quality of the database. The kind of thing that costs…

Or in Paris when you don’t want to be forced to the local Netflix with outdated and badly dubbed versions.

Or if you want to watch House of Cards, which is not available there, because a television channel has bought the exclusive rights before Netflix got to France.

Blessed be VPNs :slight_smile:

I use http://lite.ip2location.com converted to SQLite, but it only works to ISP level and it creates a 399 MB database!

This thread’s been pretty much my own research before coming here… Never mind; I’ll just get the person to tell me where their home is before doing directions stuff. I was trying to be clever and avoid that but it saves virtually no time for them, is much more complicated, and geolocation would probaqbly serve no purpose other than showing how clever I am to do geolocation :

If you look at ‘Find my Mac’, you will see that the location of your iMac or MBP is very accurate. Way more accurate than just IP checking yet iMacs and MB’s don’t have build in GPS.

Apple stores the WIFI networks that iPhones accessed (or detected) previously. By comparing the available WIFI networks and their signal strengths, the location is very accurate.
Before they used their own DB, they used: SkyHook
No idea what they’re charging though.

Edit: Found this Google solution on Stackoverflow

Edit2: Sorry. The above Google API is old. It’s replaced by this: https://developers.google.com/maps/documentation/geolocation/intro?hl=en