As mentioned briefly in the “Why Some Zmanim Never Occur” post, the Lubavitch Jewish Center of Anchorage, Alaska has an interesting davening (prayer) direction question. As explained in the “Bearing to Yerushalayim and Zmanim Map” (additional technical information is available in the “Technical Information about the Bearing to Yerushalayim Map” post), there are two opinions about the proper direction to face during Tfilah (prayers). The Levush and others are of the opinion that one should face the rhumb line direction to Yerushalayim, while the Emunas Chachamim and others are of the opinion that one should face the initial bearing of the great circle route. Both of these opinions would clearly use the shortest rhumb or great circle lines to Yerushalayim. As an example, a person standing on Har Hazaisim (Mount of Olives) a mile east of Har Habayis would not daven east using the logic that continuing east for approximately 21,175 miles[1] would reach Yerushalayim via global circumnavigation, when Har Habayis is just one mile to the west. The shul in Anchorage is located at a longitude of -149.861°. The antipode of Har Habayis is on the -144.764851 longitude line – 180° of longitude from Har Habayis. People on different sides of this line will daven in opposite directions. The Anchorage shul with a longitude of -149.861° is 169.69 miles (273.1 km) west of the -144.764851° longitude line[2]. For this reason, the shul should daven not east, but west (255.78° from the north, or slightly south-west) if using the common rhumb line calculation, or north (355.67° from the north, or slightly west of north) if using the great circle calculation. Alaska is the only location in the world that has the -144.764851° longitude line cut across dry land, and is therefore the only non-ocean location to face this issue.

Notes:
1. Based on a rhumb line along the 31° 50′ circle of latitude as opposed to 24,901 miles at the equator) using a WGS84 Reference ellipsoid.
2. Rhumb line calculation as calculated by Movable Type using the same latitude for both points. The ellipsoidal shape of the earth is factored into this calculation. The short distance means that the 169.66 mi (272.98 km) great circle distance is very close to the rhumb line distance.

## Question:

Why do some zmanim never occur in some locations? Developers Beware!

While most people realize that the sun may not rise or set in the Arctic and Antarctic Circles (see the Rabbi Dovid Heber’s article When Does One Pray When There Is No Day in the Star-K’s Kashrus Kurrents), many are not aware that some twilight dips will not occur during part of the year as far south of the Arctic Circle as London. For example around the summer solstice in London (on the zmanim map) the sun will never dip far enough below the horizon to reach alos 16°. This happens in London from June 4th through July 8th. The image seen on the top right (original at timeanddate.com) shows various civil twilights centered on London on Midnight June 21st. Look carefully to see the various bands of twilight. Gateshead will not have alos 16° from May 16th through July 28th, while Anchorage, Alaska (yes there is a Frum Shul in Anchorage with an interesting davening direction issue that is discussed in the Davening Direction from Alaska post ) will not have alos 16.1° from April 25th to August 20th. Zmanim based on sunrise such as alos 72 that is a 72 minute offset of sunrise can be calculated as long as sunrise can be calculated, something that will happen as long as you are not in the Arctic or Antarctic Circles.
For this reason, the Zmanim API will return a null when a zman will not happen. A Long.MIN_VALUE will be returned when a long is expected such as in the case of a shaah zmanis. While an inconvenience to developers who have to code for this, the alternative of a default date would mean that developers unaware of this would return incorrect zmanim, something far worse than a program error from a NullPointerException.
In recent weeks two publicly available programs using the Zmanim API ran into issues due to nulls returned for early alos times. Being something not anticipated by the developers, the nulls generated errors in the programs that quickly led to fixes. For this reason, Yitzchok updated the Zmanim .NET project to return the nullable DateTime? instead of the regular DateTime that it had previously been returning. While the Zmanim API documentation always made the possibility of a null being returned possible, I modified the documentation to make this clear on the return value documentation for every zman. Code with the modified documentation was part of the recently released Zmanim API 1.2.1.

## Bearing to Yerushalayim and Zmanim Map 2.0

The availability of the Bearing to Yerushalayim and Zmanim Map was originally announced on December 30, 2007. At the time there were a number of bugs related to the Google Map API. These bugs were reported to Google and eventually fixed. Since that time, the only change was a minor JavaScript fix for IE. The Bearing to Yerushalayim worked, but the zmanim tabs had a major issue because the timezone calculated was done based on the user’s current browser timezone. This made it tricky to check zmanim in a different location or timezone than the user’s current timezone.I recently updated the map to look-up the actual timezone of the latitude and longitude selected by the user. This was implemented by doing a look-up at the geonames.org timezone web-service. The timezone is passed to the Zmanim API and used to generate the XML output of a list of daily zmanim that is displayed in the map. Since the Olson timezone database changes a few times a year, there will almost certainly be cases where the proper timezone can’t be determined. Some of these are changes of timezone names, such as the change from Asia/Calcutta to Asia/Kolkata (my host will not run the TZ Updater tool). In these cases, a simple mapping between the old and new was added to the map. In cases where the timezone can’t be determined the timezone will default to GMT. Ocean locations within 10 km of land will use the closest landmass, but anywhere beyond 10 km will default to GMT. One issue with using the geonames.org webservice, is that when it is down, the map will timeout. I experimented with various ways of dealing with this, but unless my host updates the Java version from 1.4, they are too complex to use at this time.

See the Technical Information about the Bearing to Yerushalayim Map post for technical details about the original implementation.

## Elevation Lookup Added to Zmanim Calendar Generator

A lookup tool for elevation lookup was added to the Zmanim Calendar Generator page. This service is courtesy of Jonathan Stott’s earthtools.org elevation webservice. This Elevation data currently only covers all of mainland Europe (between latitudes 35°N and 60°N and longitudes 35°E and 15°W) and all of the contiguous states of the United States of America (between latitudes 20°N and 50°N and longitudes 65°W and 125°W). The source of the data is:

The terrain model used to find heights above sealevel is from the Shuttle Radar Topography Mission (SRTM) which was a joint project between the US National Geospatial-Intelligence Agency (NGA) and the National Aeronautics and Space Administration (NASA). Data was recorded for 11 days from the Space Shuttle Endevour from 11th February 2000. The data used here is at a resolution of 3 arc seconds (approximately 90m).

The lookup is done via an AJAX call.