The-DataTank icon indicating copy to clipboard operation
The-DataTank copied to clipboard

Missing KML namespace?

Open tthoeye opened this issue 11 years ago • 5 comments

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

tthoeye avatar Mar 11 '13 14:03 tthoeye

Thanks for this bug report! Apparently this is only for some KML files. @coreation , can you look into this?

pietercolpaert avatar Mar 11 '13 14:03 pietercolpaert

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 ;).

coreation avatar Mar 11 '13 14:03 coreation

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 .

tthoeye avatar Mar 11 '13 14:03 tthoeye

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?

tthoeye avatar Mar 12 '13 17:03 tthoeye

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.

coreation avatar Mar 13 '13 09:03 coreation