Skip to content

Instantly share code, notes, and snippets.

Adam Erispaha aerispaha

Block or report user

Report or block aerispaha

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aerispaha
aerispaha / zoomtofeat.js
Created Oct 2, 2018
Zoom to Feature in MapBox Map
View zoomtofeat.js
var zoomToFeat = function(feature, map) {
// based on this: https://www.mapbox.com/mapbox-gl-js/example/zoomto-linestring/
// Geographic coordinates of the LineString
var coordinates = feature.geometry.coordinates;
// Pass the first coordinates in the LineString to `lngLatBounds` &
// wrap each coordinate pair in `extend` to include them in the bounds
// result. A variation of this technique could be applied to zooming
// to the bounds of multiple Points or Polygon geomteries - it just
View philadelphia_cso_areas.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aerispaha
aerispaha / read_shapefile.py
Created Jan 14, 2017
Read a shapefile into a Pandas dataframe
View read_shapefile.py
def read_shapefile(shp_path):
"""
Read a shapefile into a Pandas dataframe with a 'coords' column holding
the geometry information. This uses the pyshp package
"""
import shapefile
#read file, parse out the records and shapes
sf = shapefile.Reader(shp_path)
fields = [x[0] for x in sf.fields][1:]
@aerispaha
aerispaha / import_arcpy,py
Created Jan 10, 2017
import arcpy into Anaconda Jupyter notebook
View import_arcpy,py
#change path to appropriate ArcGIS directory
import sys
env = r'C:\Python27\ArcGIS10.3;C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcToolbox\Scripts;C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy;C:\Program Files (x86)\ArcGIS\Desktop10.3\bin'
env.split(';')
[sys.path.append(p) for p in env.split(';')]
@aerispaha
aerispaha / index.html
Created Jan 6, 2017
Make Plotly figures responsive in Bootstrap by assigning class
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Responsive Plotly Charts</title>
<!-- Bootstrap -->
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
You can’t perform that action at this time.