<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>KosherJava &#187; Google Maps</title>
	<atom:link href="http://www.kosherjava.com/tag/google-maps/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kosherjava.com</link>
	<description>A weblog about Zmanim, Kosher Coffee (Kosher Java) and other odds &#38; ends</description>
	<lastBuildDate>Fri, 06 Jan 2012 18:28:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Bearing to Yerushalayim and Zmanim Map 3.0</title>
		<link>http://www.kosherjava.com/2011/09/11/bearing-to-yerushalayim-and-zmanim-map-3-0/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bearing-to-yerushalayim-and-zmanim-map-3-0</link>
		<comments>http://www.kosherjava.com/2011/09/11/bearing-to-yerushalayim-and-zmanim-map-3-0/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 01:53:34 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[Davening]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Great Circle]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Latitude and Longitude]]></category>
		<category><![CDATA[Rhumb Line]]></category>
		<category><![CDATA[Timezone]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=1298</guid>
		<description><![CDATA[The Bearing to Yerushalayim and Zmanim Map was recently updated to version 3.0. This new release adds a number of new features to the Zmanim Map version 2.0 update released in March 2010. The main change was updating the Google Map API version from the deprecated v2 to v3. This change increases performance and adds [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/sepiaMap.jpg" alt="World map" title="World map" />The <a href="http://www.kosherjava.com/maps/zmanim.html">Bearing to Yerushalayim and Zmanim Map</a> was recently updated to version 3.0. This new release adds a number of new features to the <a href="http://www.kosherjava.com/2010/03/14/bearing-to-yerushalayim-and-zmanim-map-2-0/">Zmanim Map version 2.0 update</a> released in March 2010. The main change was updating the Google Map API version from the deprecated <a href="http://code.google.com/apis/maps/documentation/javascript/v2/">v2</a> to <a href="http://code.google.com/apis/maps/documentation/javascript/">v3</a>. This change increases performance and adds much better support for mobile browsers. The upgrade also means that a Google Maps API key is no longer required. This makes it easy to drop it into any site without any configuration (<a href="http://www.kosherjava.com/contact/">contact me</a> for details). <img class="alignright" src="/images/zmanimTabV3.png" alt="Zmanim tab v3" title="Zmanim tab v3" />The technical notes on the original <a href="http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/">Technical Information about the Bearing to Yerushalayim Map</a> post are still relevant, with very little having changed since the initial implementation. 

The following is a partial list of the new features:
<ul>
<li>A number of additional zmanim in the More Zmanim tab, including <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/ComplexZmanimCalendar.html#getTchilasZmanKidushLevana3Days()">tchilas</a> and <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/ComplexZmanimCalendar.html#getSofZmanKidushLevanaBetweenMoldos()">sof zman kiddush levana</a> (if they occur on that day)
</li><li>A link to download a 12 month Zmanim calendar directly from the map (using the same spreadsheet used in the <a href="http://www.kosherjava.com/zmanim-project/zmanim-calendar-generator/">Zmanim Calendar Generator</a>). Clicking on the link from the Zmanim tab will generate a calendar with most typically used zmanim, while clicking on the link in the More Zmanim tab will download the full set of zmanim. These are available as the Calendar Type option in the Zmanim Calendar Generator</li>
<li>Increased use of <a href="http://jquery.com/">jQuery</a> and jQuery UI for formatting the zmanim tables to better match the site look &amp; feel</li>
<li>Refactoring to make the code more robust and slightly more maintainable</li>
<li>Timezones for all of Israel now display the timezone of Asia/Jerusalem as opposed to the Asia/Gaza returned for parts of Israel by the <a href="http://www.geonames.org/export/web-services.html">GeoNames TimeZone web service</a></li>
</ul>

From a technical perspective there were a number of changes required due to updating the Google Maps API from v2 to v3. These include:

<ul>
<li>v3 no longer supports <a href="http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GMap2.openInfoWindowTabs">tabbed info windows</a>, so the tabs are now implemented using <a href="http://jqueryui.com/">jQuery UI</a></li>
<li>Renaming of a number of classes and functions such as GLatLng to LatLng</li>
<li>A number of functions that were part of API v2 were removed in v3. One example is the removal of <a href="http://en.wikipedia.org/wiki/Radian">radians</a> in the LatLng that had been available as <a href="http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GLatLng.latRadians">GLatLng.latRadians()</a>. These missing functions required for the direction to Yerushalayim calculations are now supported in the Zmanim Map using <a href="http://en.wikipedia.org/wiki/JavaScript#Prototype-based">prototypes</a></li>
</ul>


]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2011/09/11/bearing-to-yerushalayim-and-zmanim-map-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bearing to Yerushalayim and Zmanim Map 2.0</title>
		<link>http://www.kosherjava.com/2010/03/14/bearing-to-yerushalayim-and-zmanim-map-2-0/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bearing-to-yerushalayim-and-zmanim-map-2-0</link>
		<comments>http://www.kosherjava.com/2010/03/14/bearing-to-yerushalayim-and-zmanim-map-2-0/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 05:32:53 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[Davening]]></category>
		<category><![CDATA[daylight savings time]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Great Circle]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Latitude and Longitude]]></category>
		<category><![CDATA[Rhumb Line]]></category>
		<category><![CDATA[Timezone]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=436</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/sepiaMap.jpg" alt="World map" title="World map" />The availability of the <a href="http://www.kosherjava.com/maps/zmanim.html">Bearing to Yerushalayim and Zmanim Map</a> was <a href="http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/">originally announced on December 30, 2007</a>. At the time there were a number of bugs related to the <a href="http://code.google.com/apis/maps/">Google Map API</a>. These bugs were reported to Google and eventually <a href="http://code.google.com/p/gmaps-api-issues/issues/list?can=1&#038;q=status%3AFixed%20reporter%3Akosherjava">fixed</a>. 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&#8217;s current browser timezone. This made it tricky to check zmanim in a different location or timezone than the user&#8217;s current timezone. <img class="alignright" src="/images/zmanimTab.png" alt="Zmanim tab using timezones" title="Zmanim tab using timezones" />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 <a href="http://www.geonames.org">geonames.org</a> <a href="http://www.geonames.org/export/web-services.html">timezone  web-service</a>. 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 <a href="http://en.wikipedia.org/wiki/Zoneinfo">Olson timezone database</a> changes a few times a year, there will almost certainly be cases where the proper timezone can&#8217;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 <a href="http://java.sun.com/javase/timezones/#tzu">TZ Updater tool</a>). In these cases a simple mapping between the old and new was added to the map. In cases where the timezone can&#8217;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 <a href="http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/">Technical Information about the Bearing to Yerushalayim Map</a> post for technical details about the original implementation.]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2010/03/14/bearing-to-yerushalayim-and-zmanim-map-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FAQ: How Much Earlier is Sunrise on Mount Everest Due to Elevation?</title>
		<link>http://www.kosherjava.com/2010/03/07/faq-how-much-earlier-is-sunrise-on-mount-everest-due-to-elevation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=faq-how-much-earlier-is-sunrise-on-mount-everest-due-to-elevation</link>
		<comments>http://www.kosherjava.com/2010/03/07/faq-how-much-earlier-is-sunrise-on-mount-everest-due-to-elevation/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 01:57:16 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[Elevation]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Sea level]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=427</guid>
		<description><![CDATA[Question:How Much Earlier is Sunrise on Mount Everest Due to Elevation?Answer:The greatest sunrise and sunset elevation effect on Earth is on Mount Everest (at 27.988056 N, 86.925278 E as seen on the Direction to Yerushalayim Map). With an elevation of 8,848 Meters (29, 029 feet), sunrise would be up to 15 minutes and 31 seconds [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/SunriseEverest.jpg" alt="Sunrise over Everest" title="Sunrise over Everest" /><h2>Question:</h2>How Much Earlier is Sunrise on Mount Everest Due to Elevation?<h2>Answer:</h2>The greatest sunrise and sunset elevation effect on Earth is on Mount Everest (at 27.988056 N, 86.925278 E as seen on the <a href="http://www.kosherjava.com/maps/zmanim.html?lat=27.988056&amp;lng=86.925278&amp;zoom=15&amp;type=p">Direction to Yerushalayim Map</a>). With an elevation of 8,848 Meters (29, 029 feet), sunrise would be up to 15 minutes and 31 seconds earlier on Mount Everest than on sea level. The range of the effect is from 15 minutes and 31 seconds on June 22nd, to a &#8220;low&#8221; of 13 minutes 41 seconds earlier on March 18th. Being in a large mountain range with obstructed horizons, it is likely never actually seen that early. In addition to questions about mountains, every few months I get asked about how much earlier sunrise/set can be seen in skyscrapers. There are various halacha questions as to whether this actually affects zmanim that I will mention later. Here are some raw numbers. <img class="alignright" src="/images/BurjKhalifa.jpg" alt="Burj Khalifa" title="Burj Khalifa" /><a href="http://en.wikipedia.org/wiki/Burj_Khalifa">Burj Khalifa</a> (at 25.197222 N, 55.274056 E as seen on the <a href="http://www.kosherjava.com/maps/zmanim.html?lat=25.197222&amp;lng=55.274056&amp;zoom=15">Direction to Yerushalayim Map</a>) is the tallest building in the world. With a height of 828 m (2,717 ft), visible sunrise to someone standing on top of the crown (something unrealistic) on June 22nd would be at 5:24:56 AM versus 5:29:31 AM on sea level, a difference of 4 minutes and 35 seconds. Sunset would be 7:16:35 PM versus 7:12:00 PM at sea level, a difference of 4 minutes and 35 seconds. A more realistic scenario would be the visibility sunrise on the highest floor (the 160th) , an elevation of 672 m at 5:25:23 AM, a difference of 4 minutes and 8 seconds earlier than sea level. Sunset on the 160th floor would be 7:16:08 PM, or 4 minutes and 8 seconds later than at sea level.
As far as the halacha being affected by the elevation of buildings, the Baal Hatanya seems to indicate that tall buildings would make sunset later. See Yisroel vehazmanim ישראל והזמנים Vol II, page 910. In the Shraga Lachaim שרגא לחיים footnotes Rabbi Harfenes states that <blockquote dir="rtl">ויש להוסיף שהו דבר תמוה לומר דעד שלא נבנו הבנינים הגבוהים היה זמן שבת התלוי בשקעה&#8221;ח (שקיעה ראשונה להגאנים ושקיעה שניה לר&#8221;ת) מוקדם, ולאחר שנבנו יש לאחר הזמנים, ועד עכשיו שהיו בניו יארק הבנינים התאומיות (טווין טאוע&#8221;ר בלע&#8221;ז) שכל א&#8217; מהם היה בת ק&#8221;י קומות היה זמן השקיעה מאוחר, ועתה לאחר שהפילו והרסו אותם רשעים וזדים ארורים ימ&#8221;ש חזר הדבר לקדמותו להקדים זמן השקיעה.</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2010/03/07/faq-how-much-earlier-is-sunrise-on-mount-everest-due-to-elevation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculating the Bearing/Direction to Har Habayis Using the Zmanim API</title>
		<link>http://www.kosherjava.com/2009/11/29/calculating-the-bearing-to-har-habayis-using-the-zmanim-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=calculating-the-bearing-to-har-habayis-using-the-zmanim-api</link>
		<comments>http://www.kosherjava.com/2009/11/29/calculating-the-bearing-to-har-habayis-using-the-zmanim-api/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 04:28:14 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Davening]]></category>
		<category><![CDATA[geoid]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Great Circle]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Rhumb Line]]></category>
		<category><![CDATA[WGS84]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=322</guid>
		<description><![CDATA[An earlier &#8220;Bearing to Yerushalayim and Zmanim Map&#8221; post demonstrated the use of JavaScript to render the bearing to Har Habayis on a Google Map. A more detailed follow-up post &#8220;Technical Information about the Bearing to Yerushalayim Map&#8221; dealt with detailed technical information on these calculations. The main Bearing to Yerushalayim and Zmanim Map page [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/javaDir.png" alt="Java direction"/>An earlier <a href="http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/">&#8220;Bearing to Yerushalayim and Zmanim Map&#8221;</a> post demonstrated the use of JavaScript to render the bearing to <a href="http://en.wikipedia.org/wiki/Temple_Mount">Har Habayis</a> on a <a href="http://www.kosherjava.com/maps/zmanim.html">Google Map</a>. A more detailed follow-up post <a href="http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/">&#8220;Technical Information about the Bearing to Yerushalayim Map&#8221;</a> dealt with detailed technical information on these calculations. The main <a href="http://www.kosherjava.com/zmanim-project/bearing-to-yerushalayim-and-zmanim-map/">Bearing to Yerushalayim and Zmanim Map</a> page usually has the most up to date information on the subject. What was not detailed in previously published posts and pages was that most of the calculations available via <a href="http://en.wikipedia.org/wiki/Javascript">JavaScript</a> are now in the core <a href="http://www.kosherjava.com/zmanim-project/">Zmanim API</a>. Available since the July, 2008 <a href="http://www.kosherjava.com/2008/07/17/zmanim-api-11-beta-2-released/">beta 2 release</a> of <a href="http://www.kosherjava.com/zmanim-project/downloads/">version 1.1</a> is the ability to bearings/directions using both the <a href="http://en.wikipedia.org/wiki/Great_circle">great circle</a> and <a href="http://en.wikipedia.org/wiki/Rhumb_line">rhumb line</a> methods in <a href="http://en.wikipedia.org/wiki/Java_%28programming_language%29">Java</a>. The <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/util/GeoLocation.html">GeoLocation Object</a> was modified to calculate the great circle bearings (both <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/util/GeoLocation.html#getGeodesicInitialBearing(net.sourceforge.zmanim.util.GeoLocation)">initial</a> and <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/util/GeoLocation.html#getGeodesicFinalBearing%28net.sourceforge.zmanim.util.GeoLocation%29">final</a>), and <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/util/GeoLocation.html#getRhumbLineBearing%28net.sourceforge.zmanim.util.GeoLocation%29">rhumb line bearing</a> from any GeoLocation Object to another. In addition, distance calculation between the two points using both of these line types is supported. What was not <a href="http://en.wikipedia.org/wiki/Porting">ported</a> from the JavaScript version was the less accurate <a href="http://en.wikipedia.org/wiki/Haversine_formula">Haversine formula</a>, or the simpler <a href="http://en.wikipedia.org/wiki/Spherical_trigonometry">spherical law of cosines</a> algorithms that yield identical results. Instead, the Zmanim API uses the far more accurate Vincenty formulae using the <a href="http://en.wikipedia.org/wiki/WGS84">WGS84</a> <a href="http://en.wikipedia.org/wiki/Geoid">geoid</a> model of the earth. Published by the geodesist/mathematician <a href="http://en.wikipedia.org/wiki/Thaddeus_Vincenty">Thaddeus Vincenty</a>, it is said to be accurate to about one-half millimeter, more than adequate for our calculation. The code in the API is a Java port of the previously published, slightly <a href="http://www.kosherjava.com/maps/glatlng.js">modified</a> version of <a href="http://www.movable-type.co.uk/">Chris Veness&#8217;s</a>  <a href="http://www.movable-type.co.uk/scripts/latlong-vincenty.html">JavaScript  implementation</a> . Below is a simple Java example of generating bearing and distances.

<pre class="brush: java; title: ; notranslate">
/**
 * This program demonstrates how to calculate bearing to Yerushalayim
 * using the kosherjava.com Zmanim API. Both the great circle and
 * rhumb line method are shown
 * To compile, ensure that the Zmanim Jar is in your classpath.
 */
import net.sourceforge.zmanim.util.GeoLocation;
import java.util.TimeZone;

public class BearingToYerushalayim{
	public static void main(String [] args) {
		GeoLocation lakewood = new GeoLocation(&quot;Lakewood, NJ&quot;, 40.09596, -74.22213, 0, TimeZone.getTimeZone(&quot;America/New_York&quot;));
		GeoLocation harHabayis = new GeoLocation(&quot;Har Habayis&quot;, 31.77805, 35.235149, 0, TimeZone.getTimeZone(&quot;Asia/Jerusalem&quot;));

		double greatCircleInitialBearing = lakewood.getGeodesicInitialBearing(harHabayis);
		double greatCircleDistance = lakewood.getGeodesicDistance(harHabayis);

		double rhumbLineBearing = lakewood.getGeodesicInitialBearing(harHabayis);
		double rhumbLineDistance = lakewood.getRhumbLineDistance(harHabayis);

		System.out.println(&quot;Great circle initial bearing: &quot; + greatCircleInitialBearing + &quot; degrees &quot;);
		System.out.println(&quot;Great circle distance: &quot; + greatCircleDistance/1000 + &quot; KM&quot;);

		System.out.println(&quot;Rhumb line bearing: &quot; + rhumbLineBearing + &quot; degrees&quot;);
		System.out.println(&quot;Rhumb line distance: &quot; + lakewood.getRhumbLineDistance(harHabayis)/1000 + &quot; KM&quot;);

	}
}
</pre>]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2009/11/29/calculating-the-bearing-to-har-habayis-using-the-zmanim-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Technical Information about the Bearing to Yerushalayim Map</title>
		<link>http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=technical-information-about-the-bearing-to-yerushalayim-map</link>
		<comments>http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 00:24:59 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[Davening]]></category>
		<category><![CDATA[Geodesic]]></category>
		<category><![CDATA[geoid]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Great Circle]]></category>
		<category><![CDATA[Rhumb Line]]></category>
		<category><![CDATA[Tfilah]]></category>
		<category><![CDATA[WGS84]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/</guid>
		<description><![CDATA[I have been asked a number of questions recently about the directional accuracy of the Bearing to Yerushalayim and Zmanim Map calculations. The rhumb line calculations are very straight forward and I will not spend much time on it in this article. As a side note, for those interested in the subject, I would like [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/sepiaMap.jpg" alt="World map" title="World map" />I have been asked a number of questions recently about the directional accuracy of the <a href="http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/">Bearing to Yerushalayim and Zmanim Map</a> calculations. The <a href="http://en.wikipedia.org/wiki/Rhumb_line">rhumb line</a> calculations are very straight forward and I will not spend much time on it in this article. As a side note, for those interested in the subject, I would like to mention that Rabbi Gavriel Goetz recently published a very comprehensive pamphlet Gevuras Moishe on the subject and it is well worth reading.
My original calculations and implementation of the <a href="http://en.wikipedia.org/wiki/Great_circle">great circle</a> route (geodesic line) used simple <a href="http://en.wikipedia.org/wiki/Spherical_trigonometry">spherical trigonometry</a> to calculate the initial bearing (and distance) based on a sphere using an <a href="http://en.wikipedia.org/wiki/Earth_radius">authalic mean radius</a> of 6371 km. These calculations were very similar to the method used by Rabbi Yehuda Herskowitz&#8217;s article in <a href="http://hebrewbooks.org/pdfpager.aspx?req=20264&#038;st=&#038;pgnum=596">Yeshurun volume III page 586</a>. This model of the earth is more than accurate enough for these calculations (you would need a very accurate “nose alignment” and the total lack of <a href="http://en.wikipedia.org/wiki/Shuckling">shuckling</a> to even get within a degree of being correct). Google Maps API, Yahoo Maps and Microsoft’s Live Maps for simplicity sake, all use very similar calculations as mentioned in the <a href="http://web.archive.org/web/20070908081438/http://cfis.savagexi.com/articles/2006/05/03/google-maps-deconstructed">cfis blog (archived)</a> quoting  <a href="http://www.sharpgis.net/">Morten Nielsen</a><blockquote>Google Maps / Virtual Earth / Yahoo Maps(?) all use a spherical datum based on WGS84. That is, it has the same center, orientation and scale as WGS84, but has no flattening. The radius of the sphere is the same as the semi-major axis of WGS84 (6378137 meters).</blockquote> Using a sphere, all the above mentioned mapping APIs use <a href="Spherical trigonometry">spherical law of cosines</a> formula for the calculations, that yield an <a href="http://www.movable-type.co.uk/scripts/latlong.html">identical result</a> to the more complex <a href="http://en.wikipedia.org/wiki/Haversine_formula">Haversine formula</a>. 

Curious how accurate these calculations really are, being based on a perfect sphere and not the <a href="http://en.wikipedia.org/wiki/Oblate_spheroid">oblate ellipsoid/spheroid</a> that the earth actually is, I started looking into the subject a little more. The most accurate current <a href="http://en.wikipedia.org/wiki/Geoid">geoid</a> model of the earth is the <a href="http://en.wikipedia.org/wiki/WGS84">WGS84</a> model.  The geodesist/mathematician <a href="http://en.wikipedia.org/wiki/Thaddeus_Vincenty">Thaddeus Vincenty</a> published the Vincenty formulae for this type of calculation that is said to be accurate to about one-half millimeter, more than adequate for our calculation. <a href="http://www.movable-type.co.uk/">Chris Veness</a> <a href="http://www.movable-type.co.uk/scripts/latlong-vincenty.html">implemented this formula</a> in JavaScript and released it under the LGPL, making it very simple to use. I slightly <a href="http://www.kosherjava.com/maps/glatlng.js">modified</a> his work to allow easier interaction with the Google Maps API. The implementation that I used when I finally published the map on December 30, 2007 uses the Vincenty formula with the WGS84 geoid model (the Vincenty formula can easily be used with different goeiod models). The table below shows a comparison of the results for the initial bearing and distances of the different calculations based an a Lakewood, NJ (latitude: 40.095965&deg;, longitude: -74.22213&deg;) to Har Habayis (latitude: 31.77805&deg;, longitude: 35.235149&deg;) example.

<table>
<tr>
    <th>Calculation Method</th>
    <th>Initial Bearing</th>
    <th>Distance</th>
</tr>
<tr>
    <td>6,371 km (authalic mean radius) sphere using spherical trigonometry</td>
    <td style="white-space: nowrap">53.86555&deg;</td>
    <td style="white-space: nowrap">9224.67442 km</td>
</tr>
<tr>
    <td>Google Maps API 6,378.137km (WGS84 equatorial mean radius) sphere using spherical trigonometry</td>
    <td style="white-space: nowrap">N/A</td>
    <td style="white-space: nowrap">9235.00819 km</td>
</tr>
<tr>
    <td>Vincenty formula using a WGS84 geoid</td>
    <td style="white-space: nowrap">53.81786&deg;</td>
    <td style="white-space: nowrap">9244.61686 km</td>
</tr>
<tr>
    <td>rhumb line</td>
    <td style="white-space: nowrap">95.37152&deg;</td>
    <td style="white-space: nowrap">9891.16074 km</td>
</tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bearing to Yerushalayim and Zmanim Map</title>
		<link>http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bearing-to-yerushalayim-and-zmanim-map</link>
		<comments>http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 17:06:17 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[Davening]]></category>
		<category><![CDATA[Geodesic]]></category>
		<category><![CDATA[geoid]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Great Circle]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Rhumb Line]]></category>
		<category><![CDATA[Tfilah]]></category>
		<category><![CDATA[WGS84]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/</guid>
		<description><![CDATA[Did you ever find yourself unsure of the correct bearing (direction) to Yerushalayim (Jerusalem)? &#160; The new Zmanim/Bearing to Yerushalayim map will help you find it very easily. &#160;The map draws two lines from your location to Yerushalayim. The blue line uses the commonly used (Levush and others) rhumb line (a straight line on a [...]]]></description>
			<content:encoded><![CDATA[<iframe src="/maps/zmanim.html?z=n" height="400" width="600" frameborder="0"></iframe>
<br />Did you ever find yourself unsure of the correct <a href="http://en.wikipedia.org/wiki/Bearing_%28navigation%29">bearing</a> (direction) to Yerushalayim (Jerusalem)? &nbsp; The new <a href="http://www.kosherjava.com/maps/zmanim.html">Zmanim/Bearing to Yerushalayim map</a> will help you find it very easily. &nbsp;The map draws two lines from your location to Yerushalayim. The blue line uses the commonly used (Levush and others)  <a href="http://en.wikipedia.org/wiki/Rhumb_line">rhumb line</a> (a straight line on a <a href="http://en.wikipedia.org/wiki/Mercator_projection">Mercator projection</a> map), while the green line shows the <a href="http://en.wikipedia.org/wiki/Great_circle">great circle route</a> (Emunas Chachamim and others) on a map. &nbsp; While it appears that the circle line is not a straight line, on a globe, the shortest (and straightest) line between two points follows the great circle route. &nbsp; Future posts will detail the technical aspects of the work involved. &nbsp; For additional information of the correct bearing for tefila, see Rabbi Yehuda Herskowitz&apos;s article in <a href="http://hebrewbooks.org/pdfpager.aspx?req=20264&#038;st=&#038;pgnum=596">Yeshurun volume III page 586</a> and Rabbi Gavriel Goetz comprehensive pamphlet Gevuras Moishe on the subject.
<h3>How to Use</h3>
Find your exact location on the map by dragging the marker to your exact location or by clicking anywhere on the map. You can also click on the search button and enter your location (such as &quot;Lakewood, NJ&quot; (the default), &quot;Vilnius, Lithuania&quot;) or just enter a zip code (Canadian or British postal codes work as well) to zoom in on your location. &nbsp; Changing to satellite view and zooming in farther will make the job easier (assuming that you can identify your roof). &nbsp; Once the red marker is centered on your location, click the red marker to show your exact latitude, longitude and bearing to Yerushalayim in an info window. &nbsp; There are two additional tabs that show today&apos;s zmanim. &nbsp; You can click on the &quot;Link&quot; button to refresh the page with the URL that contains coordinates to the currently displayed map with it&apos;s zoom level so that it can be bookmarked or emailed. <br />I would like to thank Rabbi Yehuda Herskowitz for his excellent article and additional information that he provided.
<h3>Known Issues</h3>
<h4>Google Maps API Bugs (All Fixed by Google)</h4>
<ol style="text-decoration: line-through;">
<li>Zmanim data sometimes fails to show in Firefox. This seems to be a bug the the Google Maps API when dealing with synchronous AJAX calls.</li>
<li>Locations close to 180&deg; from Yerushalayim (Alaska is a good test case) sometimes shows an incorrect rhumb line bearing (though the circle route shows correctly). The information in the info widow is correct. This is a known issue with the Google Maps API </li>
<li>Related to the above issue, sometimes the lines are drawn a &#8220;world away&#8221; and horizontal scrolling of the map is required to see the lines. Again this is a known Google Maps issue</li>
</ol>
<h4>To Do (related to Zmanim)</h4>
<ol>
<li style="text-decoration: line-through;">Support Daylight savings time (supported by the timezone webservice used, but not yet implemented in the map)</li>
<li style="text-decoration: line-through;">Link to a <a href="http://www.kosherjava.com/zmanim-project/zmanim-calendar-generator/">yearly calendar</a></li>
<li style="text-decoration: line-through;">Elevation lookup (already available in the yearly calendar)</li>
<li>Allow changing of the date</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zmanim Calendar Generator Now using Google Maps</title>
		<link>http://www.kosherjava.com/2006/01/26/zmanim-calendar-generator-now-using-google-maps/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=zmanim-calendar-generator-now-using-google-maps</link>
		<comments>http://www.kosherjava.com/2006/01/26/zmanim-calendar-generator-now-using-google-maps/#comments</comments>
		<pubDate>Thu, 26 Jan 2006 21:45:11 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Latitude and Longitude]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/2006/01/26/zmanim-calendar-generator-now-using-google-maps/</guid>
		<description><![CDATA[The Zmanim Calendar Generator now has a simple way to look up longitude and latitude information using the Google Maps API. To use this feature, click on the Google Maps icon to display the map (location centered on Bais Medrash Gevoha in Lakewood), find the location that you want to generate zmanim for, and click [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/sepiaMap.jpg" alt="World map" title="World map" />The <a href="http://www.kosherjava.com/zmanim-project/zmanim-calendar-generator/">Zmanim Calendar Generator</a> now has a simple way to look up longitude and latitude information using the <a href="http://maps.google.com/">Google Maps</a> <a href="http://www.google.com/apis/maps/">API</a>. To use this feature, click on the Google Maps icon to display the map (location centered on <a href=" http://en.wikipedia.org/wiki/Lakewood_yeshiva">Bais Medrash Gevoha</a> in Lakewood), find the location that you want to generate zmanim for, and click that point in the map. This will update the longitude and latitude fields in the form. The Google API was pretty straight forward and simple. At the same time I tried to integrate an elevation lookup. Google does not provide elevation information, but I attempted to look it up using a webservice. This seemingly simple task was not very straight forward. The approach was to grab the SOAP response from the <a href="http://rest.blueoxen.net/cgi-bin/wiki.pl?FrontPage">REST</a> style <a href="http://www.earthtools.org/webservices.htm#height">elevation webservice</a> made available by <a href="http://www.earthtools.org">Jonathan Stott</a>. My plan was to do this all via the client sided XML parsing. The first issue encountered was browser security that <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/9ad3c67d-6695-42cf-95fb-0310d0950a06.asp">does not allow</a> cross-domain loading of XML documents (By the way this was not using XMLHttpRequest, but the same security restrictions apply). This was solved by a simple PHP page that was just a proxy for the call. That done, I managed to get it to work in IE, but it crashed the browser every second call or so. The crashing was solved by adding a small delay. I never managed to get it working in Mozilla. I later tried to use the existing Google Maps API to load it, but never got it working. I commented out all elevation code, and will get to that part at some future date. I also removed the non decimal longitude and latitude option. I hope this will be useful.]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2006/01/26/zmanim-calendar-generator-now-using-google-maps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zmanim Calendar Generator TODO List</title>
		<link>http://www.kosherjava.com/2005/07/27/zmanim-calendar-generator-todo-list/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=zmanim-calendar-generator-todo-list</link>
		<comments>http://www.kosherjava.com/2005/07/27/zmanim-calendar-generator-todo-list/#comments</comments>
		<pubDate>Wed, 27 Jul 2005 22:14:43 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Latitude and Longitude]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/2005/07/27/zmanim-calendar-generator-todo-list/</guid>
		<description><![CDATA[I slightly updated the Zmanim Calendar Generator to add some user input validation. Looking at the logs, I noticed that someone generated a calendar with the longitude and latitude of Lakewood, NJ (the default), with just the location label changed to Minneapolis, MN. I don&#8217;t know if the user was just testing, or just assumed [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/calendarJava.png" alt="Java Calendar"/>I slightly updated the <a href="http://www.kosherjava.com/zmanim-project/zmanim-calendar-generator/">Zmanim Calendar Generator</a> to add some user input validation.
Looking at the logs, I noticed that someone generated a calendar with the longitude and latitude of Lakewood, NJ (the default), with just the location label changed to Minneapolis, MN. I don&#8217;t know if the user was just testing, or just assumed that I picked up the <a href=" http://en.wikipedia.org/wiki/Geocoding">geocoding</a> information by parsing the location name. This led to the addition of a JavaScript confirm when the location name is changed. 
Items on the TODO list are:
<ul>
<li>Use JavaScript to convert the longitude and latitude when the format is changed from decimal to degrees, minutes and seconds</li>
<li>Provide links to locate longitude and latitude information</li>
<li>Add support for the generation of a standard (not full as is the default now) calendar with a much smaller set of zmanim</li>
<li>Implement the generation of PDF calendars</li>
<li>Possibly use the <a href="http://maps.google.com/">Google Maps</a>  <a href="http://www.google.com/apis/maps/">API</a> to allow the selection of longitude and latitude information</li>
</ul>

The code for the PDF generation is already in the API but has not been updated in a while and does not work properly. This will also have to be updated for the standard calendar mentioned above.
The way I envision interacting with Google Maps would be to allow the user to center their location in the map, and have those coordinates used for the zmanim calendar. This would have been relatively trivial if they provided geocoding  information, by just allowing the user to enter their location as it can be done at Google Maps, but they currently <a href="http://www.google.com/apis/maps/documentation/#Geocoding_Routing_Etc">do not provide geocoding </a> information. I haven’t touched their API yet, and although it does not look too complex, it will probably take a while.
]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2005/07/27/zmanim-calendar-generator-todo-list/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

