Live data from Hacker News

Ask YC: Want to learn about GPS/Location Based Programming. Where to start?

news.ycombinator.com

1–10 of 20 posts

Ask YC: Want to learn about GPS/Location Based Programming. Where to start?

#1
Hi all - I'm fascinated by the notion of GPS/Location Based programming and generally programming mobile apps that are location aware. I've read some primers and have a tech background, so wondering if the community had links or background to share to learn more?

I guess the fundamental questions are:

1) How much can a programmer do without striking deals with the big telecoms (i.e. can you now get around it with the new location aware phones). 2) What kind of APIs already exist? 3) At the end of the day, the challenge is to get the location (longitude/latititude) of a phone user. The rest is up to the idea/execution of the app. I need to know what to read/learn to enable me to hack an app to get that location.

I know this is HUGELY simplified, but hope you get the gist.

Re: Ask YC: Want to learn about GPS/Location Based Programming. Where to start?

#2
I can give you a teeny tiny head start. Here is the logic for determining the distance (in miles) between two points.

    sqrt((power(69.1 * (latitude1 - latitude2),2) + power(69.1 * (longitude1 - longitude2) * cos(latitude1 / 57.3), 2)))
This is coming from SQL server... it took a little fidgeting to get the actual distances right because of the weird curvature of the earth issue; but it should get you close for reasonable distances.

The Yahoo! geocoding API is pretty nice for getting lats and longs for addresses in the US:

http://developer.yahoo.com/maps/rest/V1/geocode.html

Re: Ask YC: Want to learn about GPS/Location Based Programming. Where to start?

#3
post #2

I can give you a teeny tiny head start. Here is the logic for determining the distance (in miles) between two points. sqrt((power(69.1 * (latitude1 - latitude2),2) + power(69.1 * (longitude1 - longitude2) * cos(latitude1 / 57.3), 2))) This is coming from SQL server... it took a little fidgeting to get the actual distances right because of the weird curvature of the earth issue; but it should get you close for reasona…

Wow, cool. This is the kind of stuff I'm looking for. Tips and tricks to help me start coding and experiment. Thanks!

Re: Ask YC: Want to learn about GPS/Location Based Programming. Where to start?

#5
The GPS chip/unit embeded in cell phones is incredibly minimal (at least when I reviewed the topic a couple years ago). The phone itself does not calculate lat/lon. The phone captures the bare timebase GPS signal, uplinks the raw sat numbers to a server which calculates the actual coords and transmits that back to the phone.

But privacy issues are probably the biggest reason lat/lon is not more available for app usage.

Re: Ask YC: Want to learn about GPS/Location Based Programming. Where to start?

#7
Here are my delicious location links:

http://del.icio.us/jmatt.peterson/location

There are a lot of APIs if you are going from address, city, zip. All sorts of variations - free, commercial, metadata, super accurate, international, US only, shipping, etc.

There are fewer and they are less reliable if you have a latitude / longitude and want address, major intersection, city, etc.

Initially I'd code for phones that provide basic location information like lat/long/precision. Personally I've written code for the iphone and android. I'd avoid any of the older phones that don't provide some sort of API. Your initial users presumably will be techies with newer phones. If you have some initial success you can add support for older phones that don't have a friendly API.

Re: Ask YC: Want to learn about GPS/Location Based Programming. Where to start?

#9
post #7

Here are my delicious location links: http://del.icio.us/jmatt.peterson/location There are a lot of APIs if you are going from address, city, zip. All sorts of variations - free, commercial, metadata, super accurate, international, US only, shipping, etc. There are fewer and they are less reliable if you have a latitude / longitude and want address, major intersection, city, etc. Initially I'd code for phones that pr…

Thanks this is fantastic. Going from address is fairly straightforward as you say.

However, I am looking to use the GPS or tower triangulation built into newer phones. I'm assuming this is available through the ipHone and android APAs?

Is any of your code open-source by any chance? Just looking for some tips as to how to get started - even the basics.

Re: Ask YC: Want to learn about GPS/Location Based Programming. Where to start?

#10
Having spent many years working on this problem in the US market, here's my two cents ...

There are tens of millions of mainstream handsets on the market that contain GPS, including virtually all phones sold by Sprint and Verizon in the past few years and most new AT&T phones going forward. However, location is typically locked down and requires a relationship with the carrier to access the handset location APIs. For location privacy and business reasons, making a deal with a carrier for a location-enabled application is often a multi-year process.

The other possibility is to target smart phones such as the Nokia N95, iPhone, Blackberry, Windows Mobile, or Android that provide more open access to location. This is a good audience of early adopters with high data usage, but it's a very small percentage of total phones on the market.

Handsets using carrier-assisted GPS will typically have better performance than smartphones. The 'autonomous GPS' in most smart phones takes a long time to get an initial fix and is less accurate than carrier assisted, or aGPS handsets, which utilize cell towers on the network to enhance performance. Note: The new iPhone will combine GPS, Wi-fi, and cell tower location and so should be fairly fast and accurate.

One means by which developers can gain access to location across multiple carriers is through WHERE http://developer.where.com (caveat: i work there).

I'm working on a white paper covering all of this in more detail. If you're interested in getting a preview copy, let me know.

Post reply on HN