Re: [Gpsbabel-code] LookAt element location PATCH
Brought to you by:
robertl
From: tsteven4 <tst...@qw...> - 2011-06-01 02:12:35
|
RJL, I am glad to have xmllint doing some checking, it is certainly better than nothing. Unfortunately I have had some experience with xmllint demonstrating shortcomings when used as a validator. I have a slightly modified sample from Xerces-C++ 3.1.1 that seems to work pretty well as a validator. I have been using it for kml and gpx. The sample was licensed by Apache under Apache License, Version 2.0. I could provide my modifications although I might have to make some changes related to notification to make sure I comply with the license. Unfortunately the Xerces-C++ library is not as widely available as xmllint, although it is possible to compile the library from source. Let me know if you would like to try it. With regards to the when element the kml reference http://code.google.com/apis/kml/documentation/kmlreference.html states "You can specify an empty <when> element for a missing value if necessary." However, this violates the kml 2.2 schema. I have raised this as an issue http://code.google.com/p/kml-samples/issues/detail?id=391&sort=-id&colspec=ID%20Type%20Summary%20Product%20Status%20Stars%20Internal Despite your frustration with kml.c I appreciate having it as part of gpsbabel. With some custom modifications it is central to my mapping efforts. Thanks. Best Regards, Steve On 5/31/2011 7:01 PM, Robert Lipe wrote: > > > On Mon, May 30, 2011 at 7:15 PM, tsteven4 <tst...@qw... > <mailto:tst...@qw...>> wrote: > > This patch moves the Document LookAt element into the proper > location so that valid KML is produced. It also fixes a bug in > the kml test case that failed to check the generated output for > one of the tests. > > As was remarked some time ago this takes another pass, but it is > easy and fast. > > > Yes, we already make so many passes over the data on output (sigh) > that another one hardly matters; and we're about to flood the I/O > system with the results anyway, so let's go with pedantic correctness > here. > > > > I note that the snippet of the original code in kml_mt_hdr > > // Add it to our bounding box so our default LookAt/flyto > does a good > // thing. > waypt_add_to_bounds(&kml_bounds, tpt); > > didn't do anything that wasn't done anyway. If the track waypt > count is non-zero track_disp_all was called with the > kml_track_disp callback, which called kml_output_point which > called waypt_add_to_bounds for every waypt anyway. > > > Yes, it should have been moved and not copied. Good catch. > > I have checked the validity of all the kml samples. > > > I have checked in a change that runs xmllint (commonly available on > Mac and Linux) so that the KML will stay tip-top from here on. > > Only one fails to validate now, segmented_tracks-track.kml. The > sole remaining issue has to do with the when elements that don't > have a valid value. > > > I'll argue with my KML guys about that. It's probably just > mis-expressed in the XSD as they reviewed the KML in question. (And > that part of the KML writer got replaced many times during the > development of gx:track...) > > Thanx for the patch. Applied. > > kml.c is one of our most frustrating bodies of code that shouldn't be. > (The various binary formats we've reverse engineered are just > painful, but they're at least deserved.) I've started a few times to > replace with libkml, but it just requires moving mountains that I've > not had time to do. > > RJL > > Using schmeaLocation: "http://www.opengis.net/kml/2.2 > http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd > http://www.w3.org/2005/Atom > http://schemas.opengis.net/kml/2.2.0/atom-author-link.xsd > http://www.google.com/kml/ext/2.2 > http://code.google.com/apis/kml/schema/kml22gx.xsd" > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 649, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 650, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 651, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 652, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 654, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 655, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 657, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 658, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 659, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 660, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 661, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 662, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 663, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 664, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 665, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 666, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 667, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 668, char 19 > Message: value '' does not match any member types of the union > > Error at file > /home/tsteven4/work/gpsbabel_2011-05-30_22:44:05Z/reference/track/segmented_tracks-track.kml, > line 669, char 19 > Message: value '' does not match any member types of the union > > Errors occurred, no output available > > Best Regards, > Steve > > ------------------------------------------------------------------------------ > vRanger cuts backup time in half-while increasing security. > With the market-leading solution for virtual backup and recovery, > you get blazing-fast, flexible, and affordable data protection. > Download your free trial now. > http://p.sf.net/sfu/quest-d2dcopy1 > _______________________________________________ > Gpsbabel-code mailing list http://www.gpsbabel.org > Gps...@li... > <mailto:Gps...@li...> > https://lists.sourceforge.net/lists/listinfo/gpsbabel-code > > |