I have a kmz file from the www and wish to read it into csv or such using pykml. The file is in UTF8, or at least it claims to - see header below. Reading it works, but triggers an error when coming on the first accented character.
<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns='http://www.opengis.net/kml/2.2'>
<Document>
<name>
from pykml import parser
with open(KMZFIL) as f:
folder=parser.parse(f).getroot().Document.Folder
for pm in folder.Placemark:
print(pm.name)
Ablitas (militar) (Emerg)
Ademuz (forestal)
Ager (PL%)
Alcala del Rio (ILIPA MAGNA)(Esc.)
Traceback (most recent call last):
File "bin4/b21_xxxxxxx", line 15, in <module>
print(pm.name)
grep "name" $INFIL | head -7
( ... )
<name>Ablitas (militar) (Emerg)</name>
<name>Ademuz (forestal)</name>
<name>Ager (PL%)</name>
<name>Alcala del Rio (ILIPA MAGNA)(Esc.)</name>
<name>Ainzón</name>