Skip to content

Instantly share code, notes, and snippets.

View almccon's full-sized avatar
🔣

Alan McConchie almccon

🔣
View GitHub Profile
@tmcw
tmcw / archive_tweets.py
Created July 31, 2012 21:31
Archive Tweets
import requests, os, glob, json
you = 'tmcw'
data = 'tweets'
try: os.mkdir(data)
except Exception: pass
def run(max_id = False):
already = glob.glob("%s/*.json" % data)
@skorasaurus
skorasaurus / Osm_Terms.md
Last active March 20, 2016 19:58
OpenStreetMap cheat sheet for Common terms and lexicon used in OSM. [assuming node, line, and polygon is covered in the presentation itself)

Changeset: A group of changes that you made to OSM data. Once uploaded to OSM, your edits are instantly available to others if they download OSM data. They may take a few minutes or several hours to appear on the map.

Extract: A large chunk of OSM data for a specific area (like a state, country, or geographic area).

Layer: A data source that's displayed on a slippy map (often is thought of as a group of tiles stitched together). (It also has another meaning in OSM, but don't worry about it right now).

Render: to convert from the OSM data into an image. Rendered data is a map.

Stylesheet: it means a text file of rules that define what features (like roads, buildings) are displayed, and how (what color should the road be ? How wide should be? What icon should be used for a restaurant?) on a map.

This is my default career advice for people starting out in geo/GIS, especially remote sensing, adapted from a response to a letter in 2013.

I'm currently about to start a Geography degree at the University of [Redacted] at [Redacted] with a focus in GIS, and I've been finding that I have an interest in working with imagery. Obviously I should take Remote Sensing and other similar classes, but I'm the type of person who likes to self learn as well. So my question is this: What recommendations would you give to a student who is interested in working with imagery? Are there any self study paths that you could recommend?

I learned on my own and on the job, and there are a lot of important topics in GIS that I don’t know anything about, so I can’t give comprehensive advice. I haven’t arrived anywhere; I’m just ten minutes ahead in the convoy we’re both in. Take these recommendations critically.

Find interesting people. You’ll learn a lot more from a great professor (or mentor, or friend, or conference) o

@TheMapSmith
TheMapSmith / basemaps.md
Last active August 6, 2016 23:52
Quick basemap thoughts

Basemaps

Or baemaps if you're typing too quickly

First question:

How much work do you want to do

  1. All teh works
    Then desktop GIS is for you! Go ahead and find every single background layer you could ever think of and download it! Parks, roads, cemeteries, buildings, streams, water bodies, railroads, wetlands, parking lots, forests, farms...
    Now load them all up in your desktop GIS of choice (who are we kidding. It's ArcGIS). Style away! Don't forget to think about scale ranges. So style each thing for each scale range!
    Not keen on GUIs? Then grab an old dusty copy of Tilemill, load up each of your layers per usual, and then start writing CartoCSS. It's fun!
@mojodna
mojodna / README.md
Last active September 7, 2016 14:44
TileMill in bash + AppleScript

TileMill in bash + AppleScript

Installation (OS X)

In the project directory:

npm install tessera tilelive-mapnik tilelive-carto
brew install fswatch
states = fl la nc ok va \
al ga ma nd or vt \
ar hi md ne pa wa \
az ia me nh ri wi \
ca id mi nj sc wv \
co il mn nm sd wy \
ct in mo nv tn \
dc ks ms ny tx \
de ky mt oh ut
@clhenrick
clhenrick / carto-design-resources.md
Last active March 30, 2017 18:47
Cartographic Design Resources, a by no means exhaustive list and work in progress.

Cartographic Design Resources

by Chris Henrick

Tools

  • Color Brewer: Tool created by Cynthia Brewer that offers advice for using color on maps, specifically with thematic mapping. Lets you export color schemes to various formats.

  • Mapshaper for generalizing your geospatial data which helps your maps not only look better but load faster. Mapshaper let's you preview how generalized it looks before you export it.

Guides & Tutorials

  • Nathaniel Kelso's Geo How To wiki though now a little out dated still has lots of great info in it.
@gka
gka / cartogram.py
Created December 5, 2011 12:09
Generator for Dorling cartograms
"""
Generator for packed circle cartograms
"""
import proj, gisutils
class Cartogram:
def loadCSV(self, url, key='id', value='val', lon='lon', lat='lat'):
import csv
doc = csv.reader(open(url))

Overview

In general, it seems there are roughly five (5) ways to get "file data" (e.g. a GeoTIFF) out of a PostGIS geoprocessing workflow:

  • Export just the raster field as an ASCII grid
  • Connect to the database using a desktop client (e.g. QGIS) [1]
  • Use a procedural language (like PLPGSQL or PLPYthon) [2]
  • Use the COPY declaration to get a hex dump out and convert it to a binary file
  • Fill a 2D NumPy array with a byte array and serialize it to a binary file using GDAL or psycopg2 [3, 4]
  • Use ST_AsTiff() or the more general ST_AsGDALRaster() to get a byte array, which can be written to a binary file
@meetar
meetar / HOTQuickstart.md
Last active July 30, 2020 12:15
How to get started contributing to a Humanitarian OpenStreetMap task

##How to get started contributing to a Humanitarian OpenStreetMap Team task

###Overview

OpenStreetMap (OSM) is an open-source map of the world that anyone can edit. But like any map, it's incomplete.

The Humanitarian OpenStreetMap Team (HOT) helps organize people to improve the OSM map for crisis areas, mostly so aid workers can find their way around and make decisions about undermapped places. The data in these crisis areas is often very poor, or completely non-existent. Therefore any contribution you make at all will be a vast improvement, and could materially help people who are on the ground right now, looking at this data as you edit it, and deciding where to go and who to help.

There are many HOT tasks active at once. As of August 2014, the highest-priority tasks are Gaza and areas affected by the West African Ebola outbreak.