The-DataTank
The-DataTank copied to clipboard
Missing KML namespace?
I'm having trouble posting a KML file. Getting complaints about a missing id: Undefined offset: 0 on line 214 in file /nfs/webroot/domains/datatank.gent.be/public_html/custom/strategies/KML.class.php.
Replacing
$id = $placemark->xpath('@id');
with
$id = $placemark->xpath('kml:@id');
in KML.class.php:214 seems to do the trick
Thanks for this bug report! Apparently this is only for some KML files. @coreation , can you look into this?
We've already discussed this via e-mail @pietercolpaert , so I'm aware of this issue. I'll look into the issue as soon as I find the time for it. Might re-endulge myself first into the wonderous world of KML first ;).
Thanks for the quick response guys. Will let you know if this fix works at @digipolis
On 11 March 2013 15:23, Jan Vansteenlandt [email protected] wrote:
We've already discussed this via e-mail @pietercolpaerthttps://github.com/pietercolpaert, so I'm aware of this issue. I'll look into the issue as soon as I find the time for it. Might re-endulge myself first into the wonderous world of KML first ;).
— Reply to this email directly or view it on GitHubhttps://github.com/iRail/The-DataTank/issues/149#issuecomment-14715643 .
Sorry, but my suggestion was completely misguided. The problem is simply that we are missing an "id" attribute in the Placemark nodes themselves.
However, i would argue that it's quite harsh to have this as a strict requirement, we have a bunch of KML files lying around that don't have these attributes. Is it absolutely necessary to have a PK for each placemark? Can we make the ID optional or otherwise default to a simple auto increment?
I think a check can be built in if an id exists, if not it will assume that no id exists in any of the placemarks, and that you can create your own id's by auto-increment.