KeytreeKML utilities for the ElementTree API | |
Download |
Keytree Ranking & Summary
Advertisement
- License:
- BSD License
- Price:
- FREE
- Publisher Name:
- Sean Gillies
- Publisher web site:
- http://plone.org/products/pleiadesgeocoder
Keytree Tags
Keytree Description
KML utilities for the ElementTree API Keytree is a Python module that provides several functions for manipulating KML using the ElementTree API. Elements can be adapted to the Python geo interface and then used with packages like Shapely:>>> data = """< ?xml version="1.0" encoding="UTF-8"? >... < kml xmlns="http://www.opengis.net/kml/2.2" >... < Document >... < Placemark >... < name >point< /name >... < description >Point test< /description >... < Point >... < coordinates >... -122.364383,37.824664,0... < /coordinates >... < /Point >... < /Placemark >... < /Document >... < /kml >... """>>> from xml.etree import ElementTree>>> tree = ElementTree.fromstring(data)>>> kmlns = tree.tag.split('}')>>> placemarks = tree.findall('*/{%s}Placemark' % kmlns)>>> p0 = placemarks>>> import keytree>>> f = keytree.feature(p0)>>> from shapely.geometry import asShape>>> shape = asShape(f.geometry)>>> shape.buffer(1.5).exterior.length9.4209934708642571 Requirements: · Python
Keytree Related Software