Skip to main content

A Python 3.4 tool kit for converting KML files to GeoJSON files

Project description

kml2geojson
************
kml2geojson is a Python 3.4+ program to convert KML files to GeoJSON files.

Much of the code is a translation into Python of the Node.js package `togeojson <https://github.com/mapbox/togeojson>`_.
But kml2geojson also adds the following features.

- Preserve KML object styling, such as color and opacity
- Optionally write one JSON file cataloging all the KML styles used
- Optionally create several GeoJSON files of FeatureCollections, one for each KML folder


Installation
=============
``pip install kml2geojson``


Usage
======
At the command line type ``k2g --help`` for instructions.
You can also use kml2geojson as a library.


Documentation
==============
In ``docs`` and on RawGit `here <https://rawgit.com/araichev/kml2geojson/master/docs/_build/singlehtml/index.html>`_.


Notes
========
- Development status: Alpha
- This project uses semantic versioning (major.minor.micro), where each breaking feature or API change is considered a major change


Authors
========
- Alex Raichev (2015-10-03)


Contributing
===================
If you want to help develop this project, here is some background reading.

- The `KML reference <https://developers.google.com/kml/documentation/kmlreference?hl=en>`_
- Python's `Minimal DOM implementation <https://docs.python.org/3.4/library/xml.dom.minidom.html>`_, which this project uses to parse KML files


History
========

4.0.0, 2016-11-24
-------------------
- Moved command line functionality to separate module
- Renamed some functions


3.0.4, 2015-10-15
-------------------
Disambiguated filenames in ``main()``.


3.0.3, 2015-10-13
-------------------
Improved ``to_filename()`` again.


3.0.2, 2015-10-12
-------------------
Improved ``to_filename()`` and removed the lowercasing.


3.0.1, 2015-10-12
-------------------
Tweaked ``to_filename()`` to lowercase and underscore results.
Forgot to do that last time.


3.0.0, 2015-10-12
---------------
Changed the output of ``build_layers()`` and moved layer names into the GeoJSON FeatureCollections


2.0.2, 2015-10-12
-------------------
- Replaced underscores with dashes in command line options


2.0.1, 2015-10-12
-------------------
- Set default border style for colored polygons


2.0.0, 2015-10-08
------------------
- Added documentation
- Tweaked the command line tool options


1.0.0, 2015-10-05
------------------
- Changed some names
- Added lots of tests


0.1.1, 2015-10-03
-------------------
Fixed packaging to find ``README.rst``


0.1.0, 2015-10-03
-----------------
First

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kml2geojson-4.0.0.tar.gz (8.0 kB view details)

Uploaded Source

File details

Details for the file kml2geojson-4.0.0.tar.gz.

File metadata

  • Download URL: kml2geojson-4.0.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for kml2geojson-4.0.0.tar.gz
Algorithm Hash digest
SHA256 b465c0afdabf196e27dafbbace675a26eab6f23a97f5af21631ce933cf6cf45d
MD5 14f6e65ca0dae807c2d63959012cdff6
BLAKE2b-256 5d3e552e1e9f7fbc72f9e84a9a0217dd99ad36f2ba1e93bc091e85e59874c4d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page