I've been asked to develop a bit of PHP that will query a remote server which will return the elevation and azimuth of an object in the sky. To make this query for a particular user, I will need to get their longitude and latitude. I will also need to display a sky map suitable to their location. A few questions occur to me:

1) How to determine a users's longitude and latitude?
I now that Google Maps offers geolocation if you enter an address or zip code, but was rather hoping to automatically detect a user's location. Does anyone know of a technique whereby you can locate someone based on their IP address or some other criteria?

2) How to draw a sky map?
Drawing a sky map sounds a bit challenging. There's a free app for the iPhone called Planets which has a really nice display. You swipe your finger across it and it rotates a sky globe so you can see where various planets are in your local night sky. I'm thinking some fancy Javascript and CSS or perhaps just Actionscript would be good for this. Has anyone seen anything like this?

3) Possible to calculate elevation, azimuth of other celestial bodies?
Given a user's latitude and longitude, it would be great to put other celestial bodies on the map for reference (e.g., sun, moon, planets). Does anyone know if it's possible to calculate this within a PHP script or must one access a remote service to locate this information?

Any help would be much appreciated.

    4 days later

    I haven't played with it enough to know if it does all that, but do you mean something like Google Sky?

      Write a Reply...