Re: [RfC] Services_Weather

From: Date: Fri, 03 Oct 2003 09:18:40 +0000
Subject: Re: [RfC] Services_Weather
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-22346@lists.php.net to get a copy of this message
Hi Yavor, thanks for your input, but apparently you misunderstood the purpose of the DB connection in some way. The DB part is _only_ for searching a valid ICAO for a location-name or coordinates, it has _nothing_ to do with the actual fetching and parsing of the weather data. If you have an ICAO you can pull the weather just with that. The other maybe-dependance is the cache, but you can do without that as well. Concerning the images, I don't think, that they belong here, as this class is planned as an API not as a all-inclusive package. I don't want to have people pulling a large file only because they have to get all the images. There are other ways to do that. I'll take a look at the code you provided, thanks for that one, maybe I find an eyeopener or two ;-) Alex Yavor Shahpasov wrote: > Hello > > A long way back I proposed a similar class, based on the code from > phpweather project. Here are some comments > > it has the metar data url hard coded > > "http://weather.noaa.gov/pub/data/observations/metar/stations/".$id.".TXT" > > I might want to have a local data source th e weather.noaa.gov server is > not very reliable > > it requires a data base, I don't see why I have to setup a database to > use this, it is an extra layer of complexity which increases the > difficulty, and even if you do allow it it should have the option of > passing a existing database connection. Maybe changing the parameters to > a single string/object with dsn or database object. > > > I believe metar parsing should be disconnected from database access, > maybe you could have a backend class which parses the metar data, the > url should be configurable and not hard coded, it should allow for a > data string and a local file o be passed also. If you must have the > database stuff it should use the class above the do the parsing. It > would be nice if you could distribute images (for weather conditions) > maybe as a subpackage, and return a valid image for the location, also > the prefix of the image should be configurable > > > Although it might be useless for you am attaching my class if you want > to have a look at it. the metart parsing is borrowed from the phpweather > project > http://phpweather.sourceforge.net/ > > Yavor -- | Alexander Wirtz | eMail: mailto:alex[at]pc4p[dot]net | | PDF Class for PHP | www: http://www.pc4p.net/ | |----------------------------------------------------------------------| | Did I help you? Please consider a gift: http://www.pc4p.net/Wishlist |

« previous php.pear.dev (#22346) next »