Skip to content

Instantly share code, notes, and snippets.

@eflowbeach
eflowbeach / index.html
Created July 23, 2018 02:36 — forked from tsauerwein/index.html
OpenLayers 3 + windy.js
<!doctype html>
<html lang="en">
<head>
<title>windy.js integration example</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="http://openlayers.org/en/v3.15.0/css/ol.css" type="text/css">
<style type="text/css">
#map {
@eflowbeach
eflowbeach / .block
Last active October 18, 2017 11:36 — forked from mbostock/.block
U.S. Counties TopoJSON Color Selector
license: gpl-3.0
height: 600
border: no
{
"FGZ":["Flagstaff","Arizona","AZ"],
"PSR":["Phoenix","Arizona","AZ"],
"TWC":["Tucson","Arizona","AZ"],
"EKA":["Eureka","California","CA"],
"LOX":["Los Angeles/Oxnard","California","CA"],
"STO":["Sacramento","California","CA"],
"SGX":["San Diego","California","CA"],
"MTR":["San Francisco Bay Area/Monterey","California","CA"],
"HNX":["San Joaquin Valley/Hanford","California","CA"],
@eflowbeach
eflowbeach / .block
Last active February 12, 2016 15:53 — forked from mbostock/.block
Raster & Vector III
license: gpl-3.0
@eflowbeach
eflowbeach / README.md
Created December 18, 2015 18:05 — forked from couchand/README.md
Adjustable ranges on color scale

An example illustrating a scale that allows the ranges to be adjusted by the user.

This example is based on this one.

This example demonstrates how to construct a key from a threshold scale, in the style of Ford Fessenden’s map of police stops involving force. A linear scale is used to set the x-position of each colored rectangle in the key. There is one rectangle per color in the threshold scale’s range, and one tick per value in the threshold scale’s domain. The linear scale’s domain sets the implied extent of the key, here spanning 0 to 100%.

<?php
/**
* PostGIS to GeoJSON
* Query a PostGIS table or view and return the results in GeoJSON format, suitable for use in OpenLayers, Leaflet, etc.
*
* @param string $geotable The PostGIS layer name *REQUIRED*
* @param string $geomfield The PostGIS geometry field *REQUIRED*
* @param string $srid The SRID of the returned GeoJSON *OPTIONAL (If omitted, EPSG: 4326 will be used)*
* @param string $fields Fields to be returned *OPTIONAL (If omitted, all fields will be returned)* NOTE- Uppercase field names should be wrapped in double quotes
* @param string $parameters SQL WHERE clause parameters *OPTIONAL*