I just upgraded the site to WordPress 2.0.2, upgraded a few plugins and upgraded the Zmanim Calendar Generator to use v2 of the Google Maps API. I hope to have an update available for the Zmanim API that will allow easier porting to different languages. This will necessitate changing the API from using inheritance of the Java Calendar classes, to one that uses composition. I will try to keep you posted on this progress.
Category: Zmanim
Zmanim Calendar Generator Now using Google Maps
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 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 REST style elevation webservice made available by Jonathan Stott. My plan was to do this all via the client sided 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.
Zmanim RSS Feed in the Works
The Zmanim API currently has 2 sample classes in the output package (no longer available). One the ZmanimXLSGenerator outputs zmanim as an Excel spreadsheet and is currently used in the Zmanim Calendar Generator, the other that is not fully maintained outputs zmanim in a PDF format (no longer available). I just started work on the third output class. This will generate an RSS feed of zmanim for a given location. I plan on outputting zmanim for the current day and the following week. The API that will be used is ROME. It seems pretty stable and relatively easy to use.
Zmanim Calendar Generator TODO List
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’t know if the user was just testing, or just assumed that I picked up the geocoding 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:
- 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 the generation of a standard (not full as is the default now) calendar 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 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 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.
Hebrew Year Conversion
There was a request on the Correspondence page of Remy Landau’s Hebrew Calendar Science and Myths site for a utility that generated “Hebrew Year Number Transliteration”. Since I had already developed the code as part of PhpGedView (now forked and maintained by webtrees) and the Hebrew date plugin, I just ported it to JavaScript as a demo.