Skip to content

not well-formed (invalid token) error when extendeddata added #15

@Duoquote

Description

@Duoquote

Is there a data limit for extendeddata? I am trying to write 20 columns, I thought maybe it has something to do with some characters but if I remove random a few columns it completes saving. I also am not abled to track down the issue as the error doesn't give me a reasonable information. What could be the issue?

county_fol = city_fol.newfolder(name=county[0])
for row in group_data:
    if row[-1] is None:
        continue
    geom = json.loads(row[-1])
    if geom is None:
        continue
    poly = county_fol.newpolygon(
        name="area",
        outerboundaryis=geom["coordinates"][0],
        innerboundaryis=geom["coordinates"][1:]
    )

    for idx, col in enumerate(data_cols):
        poly.extendeddata.newdata(col, row[idx])
Traceback (most recent call last):
  File "C:\Users\duoqu\miniconda3\envs\junk\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\duoqu\miniconda3\envs\junk\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "c:\Users\duoqu\.vscode\extensions\ms-python.python-2022.18.2\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy\__main__.py", line 39, in <module>
    cli.main()
  File "c:\Users\duoqu\.vscode\extensions\ms-python.python-2022.18.2\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 430, in main
    run()
  File "c:\Users\duoqu\.vscode\extensions\ms-python.python-2022.18.2\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 284, in run_file
    runpy.run_path(target, run_name="__main__")
  File "c:\Users\duoqu\.vscode\extensions\ms-python.python-2022.18.2\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 321, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "c:\Users\duoqu\.vscode\extensions\ms-python.python-2022.18.2\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "c:\Users\duoqu\.vscode\extensions\ms-python.python-2022.18.2\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code
    exec(code, run_globals)
  File "d:\Projects\test\convert.py", line 48, in <module>
    kml.save("areas.kml")
  File "C:\Users\duoqu\miniconda3\envs\junk\lib\site-packages\simplekml\kml.py", line 331, in save
    out = self._genkml(format)
  File "C:\Users\duoqu\miniconda3\envs\junk\lib\site-packages\simplekml\kml.py", line 243, in _genkml
    kml_str = xml.dom.minidom.parseString(xml_str.encode("utf-8"))
  File "C:\Users\duoqu\miniconda3\envs\junk\lib\xml\dom\minidom.py", line 1969, in parseString
    return expatbuilder.parseString(string)
  File "C:\Users\duoqu\miniconda3\envs\junk\lib\xml\dom\expatbuilder.py", line 925, in parseString
    return builder.parseString(string)
  File "C:\Users\duoqu\miniconda3\envs\junk\lib\xml\dom\expatbuilder.py", line 223, in parseString
    parser.Parse(string, True)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 13, column 198566

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions