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.