Skip to content

Instantly share code, notes, and snippets.

View wboykinm's full-sized avatar

Bill Morris wboykinm

View GitHub Profile
@darribas
darribas / contextily_labels.ipynb
Created February 4, 2021 12:21
Contextily labels examples
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE qgis_style>
<qgis_style version="2">
<symbols>
<symbol alpha="1" force_rhr="0" clip_to_extent="1" type="fill" name="pencilish">
<layer class="MarkerLine" pass="0" locked="0" enabled="1">
<prop k="average_angle_length" v="4"/>
<prop k="average_angle_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="average_angle_unit" v="MM"/>
<prop k="interval" v="0.02"/>
<prop k="interval_map_unit_scale" v="3x:0,0,0,0,0,0"/>
@chriswhong
chriswhong / README.md
Created February 28, 2020 17:55
Using ogr2ogr to load a CSV into Postgres

The absolute easiest way to get a CSV into a postgresql table is to use ogr2ogr with AUTODETECT_TYPE=YES.

I learned a while back that this is what cartoDB uses to import your CSV into postgis (with a lot of other parameters added)

ogr2ogr -f PostgreSQL PG:"host=localhost user=postgres dbname=postgres password=password"  docs.csv -oo AUTODETECT_TYPE=YES
@IanColdwater
IanColdwater / twittermute.txt
Last active March 6, 2024 18:49
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
<html>
<head>
<title>Deckgl RGB PointCloud + Mapbox</title>
<script src="https://unpkg.com/deck.gl@^7.0.0/dist.min.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.js"></script>
<link rel="stylesheet" type="text/css" href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.css">
<style>
body {
background-color: #000000;
margin: 0;
@brambow
brambow / postgis-to-geojson-feature-collection.sql
Last active April 25, 2023 15:44
PostGIS query to build a GeoJSON FeatureCollection
SELECT json_build_object(
'type', 'FeatureCollection',
'crs', json_build_object(
'type', 'name',
'properties', json_build_object(
'name', 'EPSG:4326'
)
),
'features', json_agg(
json_build_object(
#! /bin/bash -ex
# Convert Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs.
#
# Requirements:
# * gdal http://www.mapbox.com/tilemill/docs/guides/gdal/
# * Dan Stahlke's https://github.com/gina-alaska/dans-gdal-scripts
# * convert (image-magick)
#
# Reference info:
Zoom Tile size at equator (km) Resolution at equator (m)
0 22568 88155
1 11284 44078
2 7656 29904
3 4577 17881
4 2443 9544
5 1244 4861
6 625 2442
7 313 1223
@rokotyan
rokotyan / .block
Last active December 12, 2023 13:07
Export SVG D3 visualization to PNG or JPEG
license: mit
import base64 as b64
import numpy as np
import cv2
import matplotlib.pyplot as plt
from ipywidgets import interact, interactive, fixed
from IPython.display import Image, display
import ipywidgets as widgets
from itertools import tee, izip
WINDOW_SIZE = 41 # size of window to use when computing averages. Endpoint images outside