Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View maptastik's full-sized avatar

Ryan Cooper maptastik

View GitHub Profile
@maptastik
maptastik / carto2geojson.md
Last active November 26, 2018 14:58
Troubleshooting converting a CARTO table to GeoJSON using ogr2ogr. Ultimately it does not seem I figured this out.

What has worked?

ogrinfo --config CARTO_HTTPS NO -ro "Carto:<username>" <some_public_table>

This streams all sorts of info including geometries and attributes for each feature in the dataset. This isn't what I want ultimately, but it tells me that ogr is able to suck in that Carto data table.

What hasn't worked

@maptastik
maptastik / example.py
Created November 1, 2017 18:02
Remote GeoJSON to GDF example
districts = remoteGeoJSONToGDF('http://data-ral.opendata.arcgis.com/datasets/9a5733e13dd14e2f80f8517738ce8cc6_2.geojson')
districts.plot(column = 'COUNCIL_DIST')
@maptastik
maptastik / remoteGeoJSONToGDF.py
Last active February 2, 2020 15:42
Pull GeoJSON from the toobz and create a GeoDataFrame
import requests, json, geopandas as gpd
def remoteGeoJSONToGDF(url, display = False):
"""Import remote GeoJSON to a GeoDataFrame
Keyword arguments:
url -- URL to GeoJSON resource on web
display -- Displays geometries upon loading (default: False)
"""
r = requests.get(url)
data = r.json()
@maptastik
maptastik / README.md
Last active September 25, 2017 15:26
Generate basic summary statistics for a field in a feature class using ArcPy

Generating summary statistics in ArcGIS is a bit more complicated than it needs to be. The Summary Statistics tool requires that you return your output to some sort of tabular data file. Sometimes you just need to see the number really quickly or see how they change if you filter the data differntly. This is function is the beginnings of a simple tool to generate summary statistics for a given field in a feature class. The function returns a dictionary containing the number of entries, the sum of the entries, and mean/median/standard deviatation value of the entries for the inputed field.

@maptastik
maptastik / .block
Last active September 4, 2017 15:06
RLT 3D in Mapbox GL JS
license: mit
@maptastik
maptastik / poi.geojson
Last active November 26, 2018 15:03
A very few Lenox, MA points of interest
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maptastik
maptastik / map.geojson
Last active November 26, 2018 15:03
GeoJSON of Schafer Tower at Ball State University
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maptastik
maptastik / data.geojson
Last active November 26, 2018 15:08 — forked from anonymous/data.geojson
10-minute walk isochrones for Dix Park access points. Compiled using Mapzen's isochrone API. Sadly, Mapzen is no more, but a similar result could be created using Mapbox's isochrone API.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maptastik
maptastik / fileList.py
Last active April 16, 2024 21:05
Create a Markdown formatted list of files in a directory
```
Create a Markdown formatted list of files in a directory
```
import os
dir = input("Directory to generate list: ")
list = os.listdir(dir)
file = open(dir + '\\' + 'list.txt', 'w')
for l in list:
@maptastik
maptastik / README.md
Last active June 3, 2017 04:12
Setting up and using a new Jupyter environment with Anaconda

Setting up and using a new Jupyter environment with Anaconda

First and foremost, you need to have Anaconda installed.

Create a new environment

conda create --name <name_of_env> jupyter

Append jupyter to the end of your command. Many packages are installed automatically, but you can specify some that aren't. Jupyter is not part of the automatic install list. There is a way to create your own install list, but let's forget that for now.