2

I need to have fields in my database for the following:

  • RA (hh:mm:ss.00)
  • Dec (Degrees:arcseconds:arcminutes.00)

I need to have the facility to search for a range within each field.

Any ideas?

3

1 Answer 1

1

If you just want to store the coordinates, for later searching, your best bet is to convert from degrees-minutes-seconds to decimal degrees, and store as DECIMAL. Here is an answer giving mysql functions that do that conversion, in both directions.

If you want to do more complex things like "Is this point within the constellation Orion" then you probably need to use spatial data extensions, as @RLF suggested in a comment. http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html http://dev.mysql.com/doc/refman/5.0/en/using-spatial-data.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.