Skip to content

Commit

Permalink
Merge pull request #58 from whatnick/patch-1
Browse files Browse the repository at this point in the history
Add caveat for parsing files from disk
  • Loading branch information
cleder committed Oct 4, 2017
2 parents 7848886 + 20dc024 commit 56ec533
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/usage_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Example how to build a simple KML file from the Python interpreter.
Read a KML File
Read a KML File/String
---------------

You can create a KML object by reading a KML file as a string
Expand All @@ -102,7 +102,13 @@ You can create a KML object by reading a KML file as a string
# Start by importing the kml module
>>> from fastkml import kml
#Read file into string and convert to UTF-8 (Python3 style)
>>> with open(kml_file, 'rt', encoding="utf-8") as myfile:
... doc=myfile.read()
# OR
# Setup the string which contains the KML file we want to read
>>> doc = """<?xml version="1.0" encoding="UTF-8"?>
... <kml xmlns="http://www.opengis.net/kml/2.2">
Expand Down

0 comments on commit 56ec533

Please sign in to comment.