Shop OBEX P1 Docs P2 Docs Learn Events
Has anyone seen/written an XML/KML parser for the Prop? — Parallax Forums

Has anyone seen/written an XML/KML parser for the Prop?

timmehtimmeh Posts: 9
edited 2011-10-20 01:03 in General Discussion
Hi All,

I'm chasing some code to parse XML/KML files in order to read coordinates or other data into an array, or other data structure. Something similar to the Attopilot, but for a land based vehicle.

Appreciate any tips.

Cheers,

Timmeh

Comments

  • AleAle Posts: 2,363
    edited 2011-10-19 08:13
    XML ?... I'd recommend libxml, probably you can strip it so down that it compiles in few kb. I'd just go for RAW data or simple comma separated values
  • max72max72 Posts: 1,155
    edited 2011-10-19 08:44
    There is GPS parsing code on the obex. The input strings are NMEA, but I think it would be a good start.
    There is also a regexp object...
    Massimo
  • timmehtimmeh Posts: 9
    edited 2011-10-19 17:05
    Thanks guys,

    The reason I'm using KML, is it can quite often be exported from mapping applications, and also used by various other GPS devices. I'll be using GPS parsing for data logging back the other way, but need to be able to read waypoints from an SD card.

    I'm hoping to be able to strip out a lot of the unnecessary info, and simply gather the waypoints and any other 'useful' information I need. As it's going to be ground based, there's no need for altitude.

    I might be able to use a variation of ConfigReader to do the job, but will need some work.

    For practical purposes there will probably have to be a set limit of waypoints that can be used in a single file.

    Let me know what you think?

    Massimo, do you have a link to the regexp object, I don't think I've seen it.

    Cheers,

    Timmeh
  • max72max72 Posts: 1,155
    edited 2011-10-20 00:12
    Here it is the regexp object:

    http://forums.parallax.com/showthread.php?117496-Pattern-matching-and-data-extraction-in-Spin-using-regular-expressions.

    Check also all the GPS objects... NMEA strings and KML are not so far apart...

    Massimo

    Massimo
  • timmehtimmeh Posts: 9
    edited 2011-10-20 01:03
    Thanks Massimo,

    Regexp looks like it will come in very handy for parsing both KML and GPS data and may help free up a cog or two.

    Thanks for the tip.
Sign In or Register to comment.