iRail / The-DataTank

DEPRECATED - new repo at http://github.com/tdt/core
http://thedatatank.com
26 stars 9 forks source link

Missing KML namespace? #149

Open tthoeye opened 11 years ago

tthoeye commented 11 years ago

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/publichtml/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

pietercolpaert commented 11 years ago

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

coreation commented 11 years ago

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

tthoeye commented 11 years ago

Thanks for the quick response guys. Will let you know if this fix works at @digipolis

On 11 March 2013 15:23, Jan Vansteenlandt notifications@github.com 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 commented 11 years ago

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?

coreation commented 11 years ago

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.