Elevation Lookup Added to Zmanim Calendar Generator

Sunrise Calendar

Note: The EarthTools elevation service used here is no longer available.

An elevation lookup tool was added to the Zmanim Calendar Generator page. This service is courtesy of Jonathan Stott’s earthtools.org elevation web service. The elevation data currently only covers all of mainland Europe (between latitudes 35 and 60 and longitudes -15 and 35) and all of the contiguous United States (between latitudes 20 and 50 and longitudes -125 and -65). 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 [sic] 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.

Java Zmanim API Update

Note: This post is about an old release. The current version of the KosherJava Zmanim API is available on GitHub and from the Zmanim Download page.

The first phase of the changes to allow easier porting to other languages took place with the change in the API from using inheritance of the Java Calendar classes to one that uses composition. Included in the update are a number of new zmanim, mostly new calculations for plag hamincha that are useful when trying to avoid a tartai desasri with early erev Shabbos minyanim.

Zmanim Calendar Generator Now using Google Maps

Vintage Map with CompassThe 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 that point on the map. This will update the longitude and latitude fields in the form. The Google API was pretty straightforward 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 web service. This seemingly simple task was not very straightforward. The approach was to grab the XML response from the REST-style elevation web service made available by Jonathan Stott. My plan was to do this all via client-side XML parsing. The first issue encountered was browser security that does not allow 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.

Update: The elevation lookup was added later that year. See Elevation Lookup Added to Zmanim Calendar Generator.

Zmanim Calendar Generator TODO List

Sunrise CalendarI 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 only the location label changed to Minneapolis, MN. I don’t know if the user was just testing or assumed that I picked up the geocoding information by parsing the location name. This led to the addition of a JavaScript confirmation when the location name is changed.

Items on the TODO list are:

  • Use JavaScript to convert the longitude and latitude when the format is changed from decimal to degrees, minutes and seconds
  • Provide links to locate longitude and latitude information
  • Add support for generating a standard calendar (not the full calendar, which is the current default) with a much smaller set of zmanim
  • Implement the generation of PDF calendars
  • Possibly use the Google Maps API to allow the selection of longitude and latitude information

The code for the PDF generation is already in the API, but it has not been updated in a while and does not work properly. It will also have to be updated for the standard calendar mentioned above.

The way I envision interacting with Google Maps is to let the user center their location on the map and have those coordinates used for the zmanim calendar. This would be relatively trivial if Google provided geocoding information, since the user could then enter their location as they do on Google Maps, but they currently do not provide geocoding information. I haven’t touched their API yet, and although it does not look too complex, it will probably take a while.

Zmanim Pages Updated

The static pages for the Zmanim project have been slightly updated. The main zmanim page has been revamped, an instruction page was added and some other minor changes were made. One change to the main page is the addition of a list of the types of zmanim that can be calculated. One reason for this change was search engine optimization. I ran AWStats on the log files for the last month and a half, and the following search phrases brought people to the site (listed in order of popularity):

“hebrew date”, “zman krias shema”, “hebrew date php”, “kosher coffee”, “zmanim nassau”, “zman tefilah”, “time of sun in zenith calculate”, “zmanim”, “wordpress hebrew”, “elevation of sun time of day”, “harfenes”, “asia generator”, “date hebrew”, “xsd time format”, “hebrew plugin”, “plag hamincha”, “get calendar java calc”, “zmanim calendar”, “jewish zmanim”, “calendar generator”, “milliseconds xsd time”, “annual calendar generator”, “java calculate start of the day”, “calculating sun zenith angle”, “calendrical spreadsheet”, “calculate mincha gedola”, “milliseconds into minutes”, “sun s zenith”, “javadoc api”, “time formats milliseconds”, “sof zman krias shema”.

The logs also showed that many people searching for zmanim-related terms never moved beyond the Javadoc pages that matched their query. The technical nature of those pages probably threw them off. The list of types of zmanim will hopefully lead many searchers to the main page instead of the Javadoc pages in the future.