Skip to content

Instantly share code, notes, and snippets.

View tdhopper's full-sized avatar
©️
𝔀𝓸𝓻𝓴𝓲𝓷𝓰 𝓱𝓪𝓻𝓭

Tim Hopper tdhopper

©️
𝔀𝓸𝓻𝓴𝓲𝓷𝓰 𝓱𝓪𝓻𝓭
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
<Document id="feat_17054">
<Placemark id="feat_17055">
<name>Kirstenbosch</name>
<Point id="geom_17038">
<coordinates>44.05053477,-91.6477914,0.0</coordinates>
</Point>
</Placemark>
<Placemark id="feat_17056">
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
<Document id="feat_17054">
<Placemark id="feat_17055">
<name>Kirstenbosch</name>
<Point id="geom_17038">
<coordinates>44.05053477,-91.6477914,0.0</coordinates>
</Point>
</Placemark>
<Placemark id="feat_17056">
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
<Document id="feat_17146">
<Placemark id="feat_17147">
<name>Holy hannah banana jeebus this vape has me baked as cake</name>
<Point id="geom_17128">
<coordinates>44.05053477,-91.6477914,0.0</coordinates>
</Point>
</Placemark>
<Placemark id="feat_17148">
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
<Document id="feat_47">
<Placemark id="feat_48">
<name>Holy hannah banana jeebus this vape has me baked as cake</name>
<Point id="geom_45">
<coordinates>44.05053477,-91.6477914,0.0</coordinates>
</Point>
</Placemark>
<Placemark id="feat_49">
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
<Document id="feat_93">
<Placemark id="feat_94">
<name>Holy hannah banana jeebus this vape has me baked as cake</name>
<Point id="geom_90">
<coordinates>-91.6477914,44.05053477,0.0</coordinates>
</Point>
</Placemark>
<Placemark id="feat_95">
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
<Document id="feat_185">
<Placemark id="feat_186">
<name>Holy hannah banana jeebus this vape has me baked as cake</name>
<Point id="geom_180">
<coordinates>-91.6477914,44.05053477,0.0</coordinates>
</Point>
</Placemark>
<Placemark id="feat_187">
@tdhopper
tdhopper / dataframe to kml
Created March 26, 2013 18:21
Pandas dataframe to KML in 4 lines
import simplekml
kml = simplekml.Kml()
df.apply(lambda X: kml.newpoint(name=X["name"], coords=[( X["longitude"],X["latitude"])]) ,axis=1)
kml.save(path = "data.kml")
This file has been truncated, but you can view the full file.
{
"metadata": {
"name": "bokennotebook"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
<Document id="feat_63">
<Placemark id="feat_64">
<name>New York city</name>
<Point id="geom_50">
<coordinates>-74.007124,40.71455,0.0</coordinates>
</Point>
</Placemark>
<Placemark id="feat_65">
# Why does this work fine
from rescrape.AbstractScraper import RecipeScraper
RecipeScraper(url)
# But this fails with "AttributeError: 'module' object has no attribute 'AbstractScraper'"
import rescrape
rescrape.AbstractScraper.RecipeScraper(url)