Installation problems
Parse and decode METAR, TAF, SYNOP, BUOY, AMDAR and write data as XML
Brought to you by:
metaf2xml
Hello,
I tried to install metaf2xml. Unfortunately it doesn't work at all.
I don't understand the install description. Could you please tell me where I have to write " set METAF2XML=c:\Program Files\metaf2xml-1.48"? Or do I have to change the path? If yes, then where? Only in "install.pl" or in "MAKEFILE"?
I'm sorry for those questions but I'm a raw recruit.
I look forward to your reply! Thank you very much!
Best regards,
KR
Hi KR,
> Is it also possible to define a start date/ a period more than 72 hours?
It is possible but I would recommend against it. For sources with 72 hours or less of data, this is not a limit, anyway. For other sources (I know only one) this limit is to protect the service from overload due to (possibly accidential) mass data download.
> Because I need Metars of multple months/years. So it would be nice, when I
> can get datas from at least one month...
From the bits of information you provided here and there it looks like you you want to accomplish a specific task: store historical METAR data for some or all airports with Ogimet as the message source. If this is correct, I would strongly recommend to get in touch with the provider (Guillermo B. Valor, e-mail on ogimet.com) before starting any mass downloads with metaf.pl. This script is not intended and not suited for this task. Also, please respect the wish of the provider to "not to abuse [this service]".
There are several better ways to accomplish the task:
1) Use getmetar (see ogimet.com/getmetar_help.phtml.en) to download the METAR messages (full date is also included, but in a format different from display_metars.php). You can then use metaf2xml::parser (with metaf2xml.pl or a script of your own) to parse the messages.
Please respect the wish of the provider: "No more than 100000 METAR per request."
2) Ask the provider if he can make a dump for the messages you need. This would cause much less load on his system and it is faster and less work for you.
3) Ask the provider if he can make a dump for the data you need. He has already extracted and stored in his database some parameters (wind, weather, air and dew point temperature, possibly more), and maybe this is all you need.
I would recommend to try 3), 2), and then 1).
I found that Guillermo is very helpful, friendly and responsive, and I know of one case where he even allowed direct access to his database for a master thesis. He offers a very useful public service for free, to which I know no alternative, and I wouldn't like to have this service terminated due to unnecessary or accidential abuse.
> Is ist possible to get just the Metar. Because I don't need the TAF...
It depends on the source. For those which offer it, it is implemented for mode=summary.
Again, I could give you better advice if you would be more specific and provide more details as to what you actually want to accomplish. If you are concerned about privacy: you can mark the support request "Private" or even contact me via e-mail (PROJECTNAME at users.sf.net).
> I uploaded a modified xml.pm, which creates a xml-output for MySQL.
Thanks for providing it. Note that there were some changes in the latest release.
> In parser.pm should be a function for decoding the timestamps.
These timestamps are not part of the original message. They are provided by some sources, only, and with differing formats (Ogimet even has more than one format). parser.pm parses only what is in a message and therefore provides only information which is in a message.
Supplementary data could be passed to parse_report() or print_report(), but this would also require to specify its format and how to use it (e.g. for timestamps: in seconds since 1970, or just month and year? Should it simply overwrite the date in the message, or should be checked if the METAR is actually from the previous/next month? And for other supplementary data: where in the XML tree and in which format should it be added? And so on. These are details which depend on external requirements and providers, and none of them is relevant to parsing.) One way to add more data with XSLT was shown in a different support request, another way would be to use the callback functions.
> timeAt => { year=>2012, month=>8 ,day => $1, hour => $2, minute => $3 }
> But it doesn't work:-(
For version 1.49, the patch:
$metar{$is_taf ? 'issueTime' : 'obsTime'} = {
s => "$2$3$4Z",
- timeAt => { day => $2, hour => $3, minute => $4 }
+ timeAt => { year => 2012, month => 8 ,day => $2, hour => $3, minute => $4 }
};
and the example message from the GUI, the XML output of metaf2xml.pl contains:
<obsTime s="090600Z">
<timeAt>
<day v="09"/>
<hour v="06"/>
<minute v="00"/>
<month v="8"/>
<year v="2012"/>
</timeAt>
</obsTime>
The data is in the XML, please explain what you mean by "doesn't work". Note that this XML not valid according to the metaf2xml DTD (there is no child "year" for the node "timeAt"), and may give unexpected results if processed by scripts from the project. In particular, to show the year in the HTML or text output created by the XSLT scripts of the project, the processing of the node "timeAt" must be extended.
Kind regards,
Thomas
(continued via PM)
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
Hi, I just went through this
when you install using install.pl and you don't want it to use the default /opt/metaf2xml/share use METAF2XML
perl install.pl xsl METAF2XML=<my chosen="" location=""></my>
then when running the functions you need to change the environment variable PERL5LIB
PERL5LIB=<my chosen="" location="">
export PERL5LIB</my>
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
I tried to download some weather information by using version 1.56.
But somehow it doesn´t work with:
perl metaf.pl format=xml type_metaf=icao src_metaf=ogimet msg_metaf="KJFK" mode=summary end_date="2012-01-31 14:00" hours=24 >KJFK.xml
it results in:
<data>
<options format="xml" hours="24" lang="de" mode="summary" msg_buoy="" msg_metaf="KJFK" msg_synop="" src_buoy="nws" src_metaf="ogimet" src_synop="nws" type_buoy="buoy" type_metaf="icao" type_synop="synop">
<reports xmlns="http://metaf2xml.sourceforge.net/1.56" query_start="Wed Apr 22 09:31:12 2015">
</reports>
</options></data>
Can anybody help?
Last edit: Anonymous 2015-04-22
Hi,
at some time since January, Ogimet introduced new PHP scripts to fetch and show historical data. In metaf2xml-1.56 they are not used, so only current data can be fetched. The changes to use the new scripts are in the branch "unstable", but not released yet.
Note that the new scripts restrict access to historical data and will just output "#Sorry, Your quota limit for slow queries rate has been reached" and no data for the second and all following requests (from the same IP address, I assume). I haven't found out how old data must be to be "historical", or how soon a new request which returns data can be made.
Ogimet offers other programs for "fast queries" (getmetar, gettafor, getsynop, getbuoy), but they allow only one station (pattern) per query and would require changes to metaf.pl.
Kind regards,
Thomas
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
Dear Thomas,
thank you for your prompt answer.
That´s bad news for me.
I am not interested in automatically downloading the Ogimet data in the first instance (although convenient), but to have a tool that decodes the raw Metar-codes. Thus a possible solution could be to download the Metar data manually, e.g. as a txt-file, and translate it afterwards to XML-files by using metaf2xml. Do you see a way to "manipulate" the metaf2xml-tool in order to do this?
Hi,
no need to manipulate anything: to convert METAR/TAF/etc. to XML, please use metaf2xml.pl from the command line.
Please note that contrary to what I thought, Ogimet's
getmetaretc. have the same restrictions for historical data as the new scripts used bymetaf.pl. I assume there was some abuse in the past. Sorry, I can't help you there.Kind regards,
Thomas
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
Ok, thanks for your help!