This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>CartoDB Sketch View</title> | |
<script type="text/javascript" src="../js/core.js"></script> | |
<script type="text/javascript" src="../js/settings.js"></script> | |
<script type="text/javascript" src="../js/mercator.js"></script> | |
<script type="text/javascript" src="../js/geometry.js"></script> | |
<script type="text/javascript" src="../js/model.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#points_na{ | |
marker-fill:#FF6600; | |
marker-opacity:0; | |
marker-width:35; | |
marker-line-color:white; | |
marker-line-width:3; | |
marker-line-opacity:0; | |
marker-placement:point; | |
marker-type:ellipse; | |
marker-allow-overlap:true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var twitter = require('ntwitter'); | |
var http = require('http'); | |
var cartodb_username = '' // your CartoDB username | |
, cartodb_password = '' // your CartoDB password | |
, cartodb_consumer_key = '' // Your CartoDB API Key ('YOUR KEY') | |
, cartodb_consumer_secret = '' // Your CartoDB API Secret ('YOUR SECRET') | |
, cartodb_private_query = '' // An SQL query to run eg. 'SELECT cartodb_id FROM cables LIMIT 20' | |
, cartodb_request_url = 'https://' + cartodb_username + '.cartodb.com/oauth/request_token' | |
, cartodb_access_url = 'https://' + cartodb_username + '.cartodb.com/oauth/access_token' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OAuth supports 3 legged and 2 legged (aka XAuth) authentication. | |
// This app demonstrates how to use 2 legged authentication with CartoDB | |
var sys = require('sys') | |
, querystring = require('querystring') | |
, OAuth = require('oauth').OAuth | |
, EventEmitter = require('events').EventEmitter; | |
function CartoDBClient(user, password, consumer_key, consumer_secret) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH inp as ( SELECT ST_Centroid(ST_Collect(ST_envelope(the_geom_webmercator))) as centroid, | |
ST_ConvexHull(ST_Collect(ST_Envelope(the_geom_webmercator))) as hull | |
FROM table_name GROUP BY some_column) | |
SELECT ST_Buffer(centroid, | |
ST_Length( ST_LongestLine(centroid, hull))) as the_geom_webmercator | |
FROM inp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PostGIS 2.0SVN Homebrew Formula | |
# | |
# To use, place this file in /usr/local/Library/Formula/, then: | |
# | |
# > brew install gdal --HEAD --with-postgres | |
# > brew install postgis --HEAD --with-raster | |
# | |
# If you want the original formula back just go to /usr/local and do: | |
# | |
# > git checkout Library/Formula/postgis.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#If you don't have Postgres installed yet: | |
# https://github.com/tsaleh/tammer-saleh/blob/master/views/posts/installing-postgresql-for-rails-3-1-on-lion.html.textil | |
#1. Install postgis 1.5.3. Latest is 2.0.0, so using url old formula on github | |
brew install https://raw.github.com/mxcl/homebrew/8a04a43763906e6a9bef68881acf997f3a6f6687/Library/Formula/postgis.rb | |
#2. Create a template to be used on creating GIS-enabled databases | |
createdb template_postgis | |
#3. Import Postgis Data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Configure | |
$DB_USER = 'admin'; | |
$DB_PASS = 'qwerty'; | |
$DB_HOST = 'localhost'; | |
$DB_NAME = 'postgis-2-0'; | |
// Param 3 when ran in shell will override this value | |
$DB_TABLE = 'public.florida_establishments_garman'; | |
// Param 2 when ran in shell will override this value | |
$CATEGORY = 'misc'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Portions of this code and logic copied from OpenLayers and | |
* redistributed under the original Clear BSD license terms: | |
* | |
* http://trac.osgeo.org/openlayers/browser/license.txt | |
* | |
* Copyright 2005-2010 OpenLayers Contributors, released under | |
* the Clear BSD license. See authors.txt for a list of contributors. | |
* All rights reserved. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<script src='./leaflet/leaflet.js'></script> | |
<link rel="stylesheet" href="./leaflet/leaflet.css" /> | |
<body> | |
<div id='map' style="width: 600px; height: 400px"></div> | |
</body> | |
<script> | |
// Set up the map. | |
var map = new L.Map('map'); | |
var tileUrl = 'http://otile1.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.jpg'; |