Git Product home page Git Product logo

mdsplib's Introduction

Linux CI Windows CI

METAR Decoder Software Package Library

METAR is a format for reporting weather information that is commonly used in aviation worldwide.

mdsplib parses metars into a data structure that breaks out different weather conditions such as winds, clouds, visibility, temperature, and dew point. Many weather conditions are included such as rain, snow, lightning, smoke, haze, fog, hail and thunderstorms.

ABOUT THE MDSP LIBRARY

The MDSP Library provides a programmer with two functions, the major one being decode_metar, which decodes a METAR into C structures provided by the library. Also print_decoded_metar, which prints out a decoded METAR structure.

The MDSP was written by Carl McCalla and released to the public by the US National Weather Service. The MDSP Library is the original MDSP modified to compile and run on *NIX systems.

Please read the file README.MDSP included in this package. It's the README that comes with the original MDSP from the NWS. You must read the LICENSE before using this program (it's the LGPL).

COMPILING

Switch into the mdsplib directory and run "make". If you also want the test program to be produced, run "make metar_test" instead. Both commands will produce "metar.a". This is the library. The header file for this library is "metar.h". The test application will be named "dmetar", it takes no parameters.

"make install" will install the include file to /usr/local/include and the library to /usr/local/lib by default. There is no modern autoconf or cmake-style build architecture so you are limited to editing the source by hand to get it to build on odd operating systems and/or architectures. This isn't super likely or won't take much, though, as it is pretty much sstraight C and doesn't delve into the operating system very much.

USING

After installing the header file "metar.h" and the library "metar.a", include and use the functions and structures as defined in that file.

FLIGHTAWARE

FlightAware has made a number of fairly important bug fixes to mdsplib over the years. Also we've smoothed things out, expanded function names past fifteen characters and you know, stuff like that to improve readability.

As the sourceforge project that's reported to be mdsplib's home seems pretty inactive and isn't configured to receive bug reports or patches, and as we're using git internally, it was ever so easy to put this repo on github.

As of September 2014 mdsplib can ingest more than 350,000,000 METARs issued between 2008 and 2014 without crashing. The same can not be said for unpatched mdsplib.

SECURITY

mdsplib was written in the early 90s and is not up to date with current security practices for C coding. Specifically it generally assumes that target strings are large enough to contain whatever is being assembled into them.

PARSING FAILURES

mdsplib has other problems like because of how it parses and how it is structured in many cases if there is more than one report of something in the remarks, all the remarks pertaining to that thing will be thrown away. That's not good and it's not going to be easy to change it. We're thinking about what to do about it.

ORIGINAL CONTACT

If you find any bugs/errors or otherwise have questions about the MDSP Library let me know. I'd also welcome any changes and additions to the code.

Eric McCarthy [email protected]

mdsplib's People

Contributors

andrie avatar bovine avatar conej730 avatar jeramey avatar lehenbauer avatar pm-conej avatar snoe925 avatar wingunder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mdsplib's Issues

Compilation errors

When I run Make, I get compilation errors that indicate variable names that conflict with the names of variables in stdlib.

I'm using gcc v8.3.0 on Windows

gcc -g -O2 -fPIC -c src/antoi.c -o src/antoi.o
gcc -g -O2 -fPIC -c src/charcmp.c -o src/charcmp.o
In file included from src/charcmp.c:25:
src/local.h:1096:11: error: conflicting types for 'itoa'
 MDSP_BOOL itoa(int, char *, int);
           ^~~~
In file included from src/local.h:55,
                 from src/charcmp.c:25:
C:/rtools40/mingw64/x86_64-w64-mingw32/include/stdlib.h:637:17: note: previous declaration of 'itoa' was here
   char *__cdecl itoa(int _Val,char *_DstBuf,int _Radix) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
                 ^~~~
In file included from src/charcmp.c:25:
src/local.h:1179:5: error: conflicting types for 'strcmpi'
 int strcmpi(char *, char *);
     ^~~~~~~
In file included from src/local.h:56,
                 from src/charcmp.c:25:
C:/rtools40/mingw64/x86_64-w64-mingw32/include/string.h:109:15: note: previous declaration of 'strcmpi' was here
   int __cdecl strcmpi(const char *_Str1,const char *_Str2) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
               ^~~~~~~
make: *** [Makefile:29: src/charcmp.o] Error 1

mdsplib headers incompatible with C++

The following sample program does not compile:
#include "src/metar_structs.h" int main() { return 0; }

Below is the output from the compiler:

$ g++ -o foo foo.cpp In file included from src/metar_structs.h:40:0, from foo.cpp:1: src/local.h:902:13: error: expected identifier before ‘;’ token char class; ^ src/local.h:902:13: error: multiple types in one declaration src/local.h:902:13: error: declaration does not declare anything [-fpermissive] src/local.h:1101:40: error: new declaration ‘void* memrchr(const void*, int, size_t)’ void *memrchr(const void *, int, size_t); ^ In file included from src/local.h:54:0, from src/metar_structs.h:40, from foo.cpp:1: /usr/include/string.h:114:26: error: ambiguates old declaration ‘const void* memrchr(const void*, int, size_t)’ extern "C++" const void *memrchr (const void *__s, int __c, size_t __n) ^

class is a keyword in C++, and cannot be used as a variable name. However, it seems
the variable is unused, and can just be deleted. The memrchr forward declaration also
seems to be unnecessary. The library compiles file as does the sample C++ program
if both lines are just deleted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.