Skip Menu |

This queue is for tickets about the Geo-KML CPAN distribution.

Report information
The Basics
Id: 74047
Status: resolved
Priority: 0/
Queue: Geo-KML

People
Owner: Nobody in particular
Requestors: BBYRD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.93
Fixed in: (no value)



Subject: Geo::KML fails to validate a basic example: tag `Placemark' not used at {Document}
use Geo::KML; use Log::Report mode => "DEBUG"; my $kml = Geo::KML->new( compression => 0, format => 2, version => '2.2.0', ); my $data = {}; my $doc = $data->{Document} = {}; $doc->{name} = "Name of KML"; $doc->{open} = 1; my $p = $doc->{Placemark} = {}; $p->{name} = "Name of Placemark"; $p->{Point} = { coordinates => '122.370,37.817,0' }; $kml->writeKML($data, 'test.kml') or die "test.kml: $!"; exit; This code produces: trace: substitutionGroup {http://www.opengis.net/kml/2.2}AbstractFeatureGroup SG={http://www.opengis.net/kml/2.2}AbstractFeatureGroup (AbstractFeatureGroup) {http://www.google.com/kml/ext/2.2}Tour Tour {http://www.opengis.net/kml/2.2}AbstractContainerGroup AbstractContainerGroup {http://www.opengis.net/kml/2.2}AbstractOverlayGroup AbstractOverlayGroup {http://www.opengis.net/kml/2.2}Document Document {http://www.opengis.net/kml/2.2}Folder Folder {http://www.opengis.net/kml/2.2}GroundOverlay GroundOverlay {http://www.opengis.net/kml/2.2}NetworkLink NetworkLink {http://www.opengis.net/kml/2.2}PhotoOverlay PhotoOverlay {http://www.opengis.net/kml/2.2}Placemark Placemark {http://www.opengis.net/kml/2.2}ScreenOverlay ScreenOverlay trace: available tags are: ObjectSimpleExtensionGroup, name, AbstractContainerSimpleExtensionGroup, Schema, id, targetId mistake: tag `Placemark' not used at {http://www.opengis.net/kml/2.2}kml/NetworkLinkControl/Update/Create/Folder/Document at /opt/local/lib/perl5/XML/Compile/Translate/Writer.pm line 530 Wait, what? Placemark is -right there- in the trace, as one of the valid tags. This might be a Writer.pm problem, but since it breaks here, figured this might be a good starting point.
*sigh* Okay, this is not very friendly at all: $VAR1 = { Document => { AbstractFeatureGroup => [ { Placemark => { name => 'YAPC::EU 2008 venue', description => 'YAPC::EU was held at the Copenhagen Business School, 13-15 August 2008', Point => { coordinates => [ '12.530516,55.681597,0' ] } } } ] } }; Is there a way to clean this up, so that substGroups will auto-resolve, instead of being embedded into the tree?
Subject: Re: [rt.cpan.org #74047] Geo::KML fails to validate a basic example: tag `Placemark' not used at {Document}
Date: Mon, 16 Jan 2012 22:43:55 +0100
To: Brendan Byrd via RT <bug-Geo-KML [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Brendan Byrd via RT (bug-Geo-KML@rt.cpan.org) [120116 19:38]: Show quoted text
> Queue: Geo-KML > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=74047 > > > *sigh* Okay, this is not very friendly at all: > $VAR1 = { > Document => { > AbstractFeatureGroup => [ > { Placemark => { > > Is there a way to clean this up, so that substGroups will auto-resolve, > instead of being embedded into the tree?
The schema which defines KML files is far from easy. The data-structure produced/required by Geo::KML follows the quirks of the schema, without offering higher level translation to some nice object model. It is *not* difficult to create an object model on top of this, but I did not take the time to do that. For now, I only want a valid XML message, that's all. One of the reasons is that these KML messages are structurally a mess. Not designed but grown. And nearly all official examples of KML I have tested work in GoogleEarth, but do not validate against their own standard. The complexity with "AbstractFeatureGroup" will probably only show-up in one spot in your program. Not that horrible. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #74047] Geo::KML fails to validate a basic example: tag `Placemark' not used at {Document}
Date: Mon, 16 Jan 2012 23:03:19 +0100
To: Brendan Byrd via RT <bug-Geo-KML [...] rt.cpan.org>
From: Mark Overmeer <secretaris [...] nluug.nl>
* Brendan Byrd via RT (bug-Geo-KML@rt.cpan.org) [120116 19:03]: Show quoted text
> Mon Jan 16 14:03:22 2012: Request 74047 was acted upon. > Transaction: Ticket created by BBYRD > Queue: Geo-KML > Subject: Geo::KML fails to validate a basic example: tag `Placemark' not > used at {Document} > Broken in: 0.93 > Severity: Critical > Owner: Nobody > Requestors: BBYRD@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=74047 > > > trace: substitutionGroup > {http://www.opengis.net/kml/2.2}AbstractFeatureGroup > SG={http://www.opengis.net/kml/2.2}AbstractFeatureGroup > (AbstractFeatureGroup) > {http://www.google.com/kml/ext/2.2}Tour Tour > {http://www.opengis.net/kml/2.2}AbstractContainerGroup > AbstractContainerGroup > {http://www.opengis.net/kml/2.2}AbstractOverlayGroup > AbstractOverlayGroup > {http://www.opengis.net/kml/2.2}Document Document > {http://www.opengis.net/kml/2.2}Folder Folder > {http://www.opengis.net/kml/2.2}GroundOverlay GroundOverlay > {http://www.opengis.net/kml/2.2}NetworkLink NetworkLink > {http://www.opengis.net/kml/2.2}PhotoOverlay PhotoOverlay > {http://www.opengis.net/kml/2.2}Placemark Placemark > {http://www.opengis.net/kml/2.2}ScreenOverlay ScreenOverlay > trace: available tags are: ObjectSimpleExtensionGroup, name, > AbstractContainerSimpleExtensionGroup, Schema, id, targetId > mistake: tag `Placemark' not used at > {http://www.opengis.net/kml/2.2}kml/NetworkLinkControl/Update/Create/Folder/Document > at /opt/local/lib/perl5/XML/Compile/Translate/Writer.pm line 530 > > Wait, what? Placemark is -right there- in the trace, as one of the > valid tags. This might be a Writer.pm problem, but since it breaks > here, figured this might be a good starting point.
The last "trace" message relates to the trace. The trace line which contains the Placemark is produced for an other node. -- MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
On Mon Jan 16 16:44:09 2012, Mark@Overmeer.net wrote: Show quoted text
> > The schema which defines KML files is far from easy. The data-structure > produced/required by Geo::KML follows the quirks of the schema, without > offering higher level translation to some nice object model.
All the more reason for some examples (per the other bug). Again, I'm not bitching about your code, just trying to help out. Don't mistake the frequency of these bug reports as that, either. Figured it's better to capture these, instead of working around it and not telling the dev. You may close this ticket.