Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shabbat times API accept decimal format coordinates #12

Closed
lukecarbis opened this issue Jun 12, 2015 · 3 comments
Closed

Shabbat times API accept decimal format coordinates #12

lukecarbis opened this issue Jun 12, 2015 · 3 comments

Comments

@lukecarbis
Copy link

The Shabbat times API only accepts cartesian style coordinates at the moment.

Typically, coordinates are obtained from devices in a decimal format, which look like this:
latitude: 31.7684025, longitude: 35.2132987

However, the API only accepts coordinates in radians, which looks like this:
31.44º N, 35.12º E

It is possible to convert decimal to radians with a fairly simple formula:
radians = decimal / π * 180

But unfortunately, this isn't very accurate due to the fact that the earth isn't exactly spherical.

It would be much easier if I could pass in a latitude in decimal format, e.g.:
?cfg=json&m=50&geo=pos&latitude= 31.7684025 &longitude= 35.2132987

Would this be difficult?

@lukecarbis lukecarbis changed the title Shabbat times API accept GPS style coordinates Shabbat times API accept decimal format coordinates Jun 12, 2015
@mjradwin
Copy link
Member

This shouldn't be too difficult. Thanks for suggesting it. We will try to
find the time in the next week or two.

Sent from my mobile device
On Jun 12, 2015 6:18 AM, "Luke Carbis" notifications@github.com wrote:

The Shabbat times API only accepts cartesian style coordinates at the
moment.

Typically, coordinates are obtained from devices in a decimal format,
which look like this:
latitude: 31.7684025, longitude: 35.2132987

However, the API only accepts coordinates in radians, which looks like
this:
31.44º N, 35.12º E

It is possible to convert decimal to radians with a fairly simple formula:
radians = decimal / π * 180

But unfortunately, this isn't very accurate due to the fact that the earth
isn't exactly spherical.

It would be much easier if I could pass in a latitude in decimal
format, e.g.:
?cfg=json&m=50&geo=pos&latitude= 31.7684025 &longitude= 35.2132987

Would this be difficult?


Reply to this email directly or view it on GitHub
#12.

@mjradwin
Copy link
Member

Easier than I thought. Just deployed 818b429 to hebcal.com. Give it a whirl and let me know what you find?

Note that in addition to lat/long, you'll also have to specify appropriate timezone identifier such as tzid=Asia/Jerusalem.

@lukecarbis
Copy link
Author

Works great! Thanks @mjradwin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants