[low] fix: [wifi_geolocation_kml] gx: prefix is used but never declared, so every KML is not namespace-well-formed - #254
Open
elhoim wants to merge 1 commit into
Open
Conversation
…element Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
elhoim
force-pushed
the
fix/kml-gx-namespace
branch
from
September 9, 2026 07:30
d89d355 to
16f4973
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BLUF
gx:prefix is used but never declared. The root element declares only the default KML namespace, while five elements below usegx:—gx:Tour,gx:Playlist,gx:FlyTo,gx:duration,gx:flyToMode.xml.etree.ElementTree.fromstring()on the current output raisesParseError: unbound prefix: line 2, column 54.ElementTreewill not catch this on the writing side. It treats"gx:Tour"as an opaque tag name and serialises it verbatim, so generation succeeds silently and the failure only appears when something tries to read the file — Google Earth, a KML library, or an analyst's own tooling.xmlns:gx="http://www.google.com/kml/ext/2.2"— the standard Google KML extension namespace that these elements belong to — on the root element.wifi_geolocation_kml.py, plus a regression test.Before
After
Parses cleanly; root tag resolves to
{http://www.opengis.net/kml/2.2}kml.Test
test_generated_kml_is_namespace_well_formedgenerates a KML from a one-network input and runsET.fromstring()over it, asserting the root tag resolves in the KML namespace and thegxnamespace URI is present.Verified to fail on
mainwithParseError: unbound prefixand pass with this change. The existingtest_analyse_wifi_geolocation_kmlonly asserts the output file is non-empty, so it is unaffected.