Skip to content

Commit

Permalink
add notes for reading and saving KML files in quickstart documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cleder committed Nov 20, 2024
1 parent 16a4015 commit 164c9a8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,17 @@ Read in the KML string
>>> k = kml.KML.from_string(doc)
.. note::

To read a KML file directly, you can use the parse method:

.. code-block:: Python
k = kml.KML.parse("path/to/file.kml")
Next we perform some simple sanity checks, such as checking the number of features.

.. code-block:: pycon
Expand Down Expand Up @@ -206,3 +217,11 @@ Finally, print out the KML object as a string:
</Document>
</kml>
<BLANKLINE>
.. note::

To save the KML object to a file, you can use the write method:

.. code-block:: Python
k.write("path/to/file.kml")

0 comments on commit 164c9a8

Please sign in to comment.