Skip to content

Instantly share code, notes, and snippets.

View rclark's full-sized avatar

Ryan Clark rclark

View GitHub Profile
{
"crs": {
"type": "name",
"properties": {
"name": "urn:ogc:def:crs:OGC:1.3:CRS84"
}
},
"geometry": {
"type": "polygon",
"coordinates": [
@rclark
rclark / email-that-isnt-spam
Created September 18, 2013 16:39
Thoughts for Christoph and Raj
You've got 1M points in your system. Here are the places where that's going to bottleneck you:
- Asking Geoserver for WMS or WFS results is going to mean pulling those 1M points from the database and then running them through a pipeline that results in either a) a large XML document (WFS) or b) an image (WMS). In both cases, query results will be held in memory on the server until the processing is complete.
- There is probably much less processing involved in building the XML doc than there is to render the image. However, the next step in the process is sending the result to the client. The XML doc will be huge (either in the "shortened" content model form, or the enormous flat form you mention). It will take forever to get across the wire, and you'll probably start timing out in various parts of the pipeline.
- The data arrives at the client's web browser. In the case of the WMS request, you're fine, because its a little file and a minimal amount of processing required to draw that image on the map. In
function mblConnect() {
var $cont = $('#connect'),
$site = $('#site'),
isOpen = false,
$overlay = $('<div id="mbl-overlay" class="mbl-overlay js-connect-btn" />'),
dropdown = {
enable: function () {
var $btns = getBtns();
$btns.off().on('click', clicked);
@rclark
rclark / option1.js
Last active December 23, 2015 06:59
function MyThing() {
var theThing = new Thing();
theThing.privateMethod();
return theThing;
}
// Somewhere else...
var whatIWant = MyThing();
@rclark
rclark / segment-page.js
Created September 17, 2013 14:39
class / function pattern for chaining
trailguide.models.segment('segment-2').fetch({
success: function(segment, response, xhr) {
var butt = new trailguide.views.details({
model: segment,
el: '#details'
});
butt.render();
}
});
@rclark
rclark / ngds-ckan-pacakge.json
Last active December 23, 2015 00:49
An NGDS-styled CKAN Package
{
"id": "12340kjfha1092412",
"metadata_modified": "2013-09-13T20:35:03.757357",
"metadata_created": "2013-09-12T20:35:03.757357",
"title": "Whatever the title is",
"notes": "The abstract / description of this thing",
@rclark
rclark / what-spatial-gives.json
Created September 13, 2013 22:02
what the ckanext-spatial csw_harvester gives you
{
"name": "missouri-rock-chemistry",
"title": "Missouri Rock Chemistry",
"notes": "This is a collection of rock chemistry observations compiled by the Missouri Geological Survey and published as a Web feature service, a web map service, an ESRI service and as an Excel spreadsheet for the National Geothermal Data System by the AZGS. The document contains 12 worksheets including resource provider information and the data, which is documented in Whole Rock Major Element, U-Series, Isotope Series, Rare Earth, Volatile Gas and Noble Gas analyte suites. Data from a total of 2613 wells are included.",
"tags": [
{
"name": "Whole Rock Chemisty Analysis"
},
{
"name": "Geothermal"
<div class="highlight"><pre><code class="bash"> <span class="nv">$ </span>virtualenv pycsw <span class="o">&amp;&amp;</span> <span class="nb">cd </span>pycsw <span class="o">&amp;&amp;</span> . bin/activate
<span class="nv">$ </span>git clone git@github.com:geopython/pycsw.git <span class="o">&amp;&amp;</span> <span class="nb">cd </span>pycsw
<span class="nv">$ </span>pip install -e . <span class="o">&amp;&amp;</span> pip install -r requirements.txt
<span class="nv">$ </span>cp default-sample.cfg default.cfg
<span class="nv">$ </span>vi default.cfg
<span class="c"># adjust paths in</span>
<span class="c"># - server.home</span>
<span class="c"># - repository.database</span>
<span class="c"># set server.url to http://localhost:8000/</span>
<span class="c"># init database</span>
@rclark
rclark / index.html
Last active December 21, 2015 20:09
How to drag-drop files into the browser
<!doctype html>
<html>
<head>
<meta charset="utf8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<style type="text/css">
* {
margin: 0;
padding: 0;
@rclark
rclark / hkey-algorithm.js
Last active December 21, 2015 19:59
An algorithm for converting NCGMP09 HierarchyKey strings into a useful, structured data object that represents the parent-child relationships in a Geologic Map Legend
var _ = require('underscore'),
assert = require('assert');
// This is the input array of hkeys
var input = [
"0001",
"0001|0001",
"0001|0002",
"0001|0002|0001",
"0001|0003",