This file contains hidden or 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
# Author: | |
# Linwood Creekmore III | |
# email: [email protected] | |
# Custom functions for Twitter Geospatial Analysis Blog | |
################################# | |
# Class for corrupt json | |
################################# |
This file contains hidden or 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 geopandas as gpd | |
import numpy as np | |
import requests | |
import gdal | |
import fiona | |
import uuid | |
import re | |
# informaed by: https://gis.stackexchange.com/questions/225586/reading-raw-data-into-geopandas/225627 |
This file contains hidden or 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
# Author: Linwood Creekmore | |
# email: [email protected] | |
# date: 17 April 2017 | |
import matplotlib.pyplot as plt | |
from matplotlib import gridspec | |
import matplotlib.patches as patches | |
import datetime | |
import pandas as pd |
This file contains hidden or 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
def continentlabs(row): | |
shape = row['geometry'].centroid | |
x,y = shape.x,shape.y | |
return (x,y,row['name']) | |
%matplotlib inline | |
from matplotlib import legend | |
f, ax = plt.subplots(1, figsize=(20, 12)) | |
gpd.read_file(gpd.datasets.get_path('naturalearth_lowres')).plot(ax=ax,color='white',linewidth=0.2) | |
gdf.merge(countdf,left_on='name',right_on='NAME').plot(column='counted',cmap='OrRd',scheme='Fisher_Jenks',ax=ax,linewidth=0.1,edgecolor='white',legend=True,alpha=0.4) |
This file contains hidden or 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
# Author: Linwood Creekmore | |
# Email: [email protected] | |
# Description: Python script to pull content from a website (works on news stories). | |
#Licensed under GNU GPLv3; see https://choosealicense.com/licenses/lgpl-3.0/ for details | |
# Notes | |
""" | |
23 Oct 2017: updated to include readability based on PyCon talk: https://github.com/DistrictDataLabs/PyCon2016/blob/master/notebooks/tutorial/Working%20with%20Text%20Corpora.ipynb | |
18 Jul 2018: added keywords and summary |
This file contains hidden or 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
#Author: Linwood Creekmore | |
#Date: October 1, 2017 | |
# Instructions: | |
""" | |
Download and use my shapefilereader function in Python 2 OR just download the linked zip to your computer and read using geopandas | |
gist to shapefilereader - > https://gist.github.com/linwoodc3/72b2f24b6d2ff6ffde1597f1ca2dea3f | |
""" |
This file contains hidden or 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
# Created by: Linwood Creekmore III | |
# [email protected] | |
from tzwhere import tzwhere | |
tz = tzwhere.tzwhere() | |
import numpy as np | |
def getT(x): | |
try: | |
latitude=x[1] |
This file contains hidden or 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> | |
<html> | |
<title>QB-Spective</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | |
<style> | |
body { font-family: sans-serif; } |
This file contains hidden or 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
body { | |
background-color: #E5E5FF; | |
} | |
img.resize { | |
max-width:70%; | |
max-height:70%; | |
} | |
#the-string { | |
display: none; | |
} |
This file contains hidden or 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> | |
<html> | |
<title>QB-Spective</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | |
<style> | |
body { font-family: sans-serif; } |