Leaflet map for a Geovisualization class at Lehman Collage/CUNY (GEP-660, Instructor: Gretchen Culp). Base map provided by Stamen and icons by Font Awesome.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import csv | |
from tempfile import NamedTemporaryFile | |
import shutil | |
readfile = "SOME\\PATH\\input.csv" | |
writefile = "SOME\\PATH\\output.csv" | |
tempfile = NamedTemporaryFile(delete=False) | |
with open(readfile, 'rb') as csvfilein, tempfile: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script> |
Data retrieved with Python with Beautiful Soup. Earthquake data is from automatic processing and might include errors. Only earthquakes with a measurement quality higher or equal than 50 are used.
Earthquake data: Icelandic Met Office Glacier outlines: National Land Survey of Iceland Lava fields: The Icelandic Institute of Natural History
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Icelandic earthquakes in Iceland for the past 48 hours into CartoDB. | |
This script will: | |
1. Scrape earthquakes from the Iceland Met Office (past 48 hrs.) | |
2. Parse the resaults into a csv table and save it | |
3. Create a Python list from csv file | |
4. Use CartoDB SQL API to: | |
a) Truncate a table in CartoDB | |
b) Insert new records into the same table by wrapping Python list into SQL query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A script that uses the arcpy site-package to read the filename | |
of a feature class, create a field called Name and wirites the | |
filename as an attribute in the newly create filed. | |
""" | |
import arcpy | |
from arcpy import env | |
arcpy.env.workspace = "SOME/PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""" | |
Tool Name: Starting Zones to SAMOS | |
Source Name: StartingZonesToSamos.py | |
Version: ArcGIS 10.3.1 | |
Author: Icelandic Meteorology Office/Ragnar H. Thrastarson | |
Created: 2015-07-20 | |
Description: A python script tool that uses the ArcPy site-package | |
to convert a polygon feature class to a specific text based | |
output. Output includes parameters, number of vertices in each |
NewerOlder