Re: pw_images, UTC, TimeZones, LocalTime
Brought to you by:
iridium
|
From: Phil P. <phi...@sw...> - 2004-02-24 06:44:02
|
Martin Geisler wrote:
> I'm sorry that I haven't commented on those ideas before --- I would
> love to see that implemented! Do you have a SourceForge login? If so,
> then I would be very happy to add you to the project.
I do have a login (somewhere, just need to find it again), though I
would suggest you hold of on adding me to the project just yet.
So far I've been simply looking into the requirements and issues behind
adding this kind of functionality. I've even done most of the work
modifying sunrise/sunset calculations into a PHP function (probably
needs a few 'neatness' type cleanups {eg auto-convert DMS to degrees},
but it works).
function calc_SunriseSunset($date (=timestamp), $timezone (=hours from
GMT, inc DST),
$latitude (as decmal), $longitude (as decimal)) {}
returns an array being sunrise-timestamp, sunset-timestamp
On any page on my website (http://home.swiftdsl.com.au/~Phil.Pierotti/),
there's a 'widget' showing the weather (icons) for Sydney (Australia) as
extracted by PHPWeather. If you 'mouseover' the (details) link, a DHTML
popup (via overLib, see my credits page) in the window will show you the
full report. The last line in said detail report uses the rise/set times
as calculated by this function.
The other day I started looking at the PHPWeather code itself
(spefically, to integrate calc_SunriseSunset into day/night evaluation
for images) , and my initial (ten second) analysis was along the lines
of "this will be non-trivial" (mainly due to my lack of familiarity with
the code , and being relatively new to PHP programming).
Basically, I was hoping there was someone more familiar with the
PHPWeather code who was interested in running with this now that I've
gotten some of the basics started.
>>Or we could merely leverage the work already done by the developer
>>of AirSort:
>>
>> http://freshmeat.net/projects/airsort/
>>
>>AirSort uses a MySQL table which includes ICAO, latitude and
>>longitude.
>>
>>GPL, even :-)
I spent yesterday playing around with AirSort and integrated it with the
PHPWeather driven page on my site (though it's not 'live', currently
only on my private test server - I could post a small trimmed screenshot
for the impatient). The biggest hassle I had was that (I think due to
some CSS thing I'd done) IE wanted to not draw the table properly (for
the empty cells below the point), so the pinpointing was incorrect.
Adding in explicit heights for the table cell below the point fixed it.
I've also tweaked it for both 'large'(800x400) and 'small' (400x200)
maps (and made small maps from the existing large ones). Still need to
finish a few more minor 'flexibility' type changes, but it works nicely.
From my basic testing, I suspect some of the co-ordinates are off, and
several of the ICAOs from PHPWeather don't have entries in the AirSort
table. Obviously some data-cleanups due here.
So at this point I'm looking to tackle the AirSort flexibility cleanups,
and data correctness. Once that's done I'll look at more work on the
PHPWeather Lat/Long&Rise/Set issue (since I'll have clean data to work
with); however, as I mentioned earlier, it will probably be better (or
at least faster) handled by someone who is already familiar with the code.
Phil P
|