Skip to content

Instantly share code, notes, and snippets.

View ragnarheidar's full-sized avatar

Ragnar Thrastarson ragnarheidar

View GitHub Profile
@ragnarheidar
ragnarheidar / GetBottleTimeAndCoordinates.py
Created August 17, 2017 12:33
Python code to parse a KML file XML notation) and write data to a CSV table
import xml.etree.ElementTree as ET
from datetime import datetime
StartTime = datetime.now()
Tree = ET.parse('Bottles.kml')
root = Tree.getroot()
OutFileName = "Bottles.csv"
f = open(OutFileName, "w")
f.write('bottle_id, time, lat, lon' + '\n')
@ragnarheidar
ragnarheidar / PlotWeatherStations.py
Last active October 1, 2017 08:36
Leaflet map created with folium and GeoJSON
"""
And example of a python code that uses the folium library to create a lightweight
leaflet web map. The example uses a GeoJSON file that is added to the map.
Folium documentation:
http://python-visualization.github.io/folium/docs-master/
How to add popups and cluster markers:
https://ocefpaf.github.io/python4oceanographers/blog/2015/12/14/geopandas_folium/
Leaflet maps from leaflet-providers:
https://leaflet-extras.github.io/leaflet-providers/preview/