KML to CSV

87 views
Skip to first unread message

martyn...@my.westminster.ac.uk

unread,
Sep 5, 2013, 7:01:53 AM9/5/13
to pykml-...@googlegroups.com
Hi,

First, apologies, I am fairly new to Python and so struggling a little with syntax etc. I'm trying to convert a kml file to csv using python. I found the pykml library and am trying to use it to convert a large (15mb) kml file to a csv. I have been following instructions on http://pythonhosted.org/pykml/tutorial.html#parsing-existing-kml-documents but keep running into this error:

with open(kml_file) as f:
  File "<ipython-input-129-726913e083f2>", line 1
    with open(kml_file) as f:
                             ^
SyntaxError: unexpected EOF while parsing

Could anyone help me with this, or post instructions on how to read the kml then write out to csv?

Many, many thanks in advance

Marty



This message and its attachments are private and confidential. If you have received this message in error, please notify the sender and remove it and its attachments from your system.

The University of Westminster is a charity and a company limited by guarantee. Registration number: 977818 England. Registered Office: 309 Regent Street, London W1B 2UW.

Rebecca Williams

unread,
Nov 4, 2014, 3:59:30 PM11/4/14
to pykml-...@googlegroups.com
I think whatever your kml_file string is, is formatted improperly.
Reply all
Reply to author
Forward
0 new messages