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 JSONStream = require('JSONStream'), | |
| fs = require('fs'), | |
| Terraformer = require('Terraformer'); | |
| var incoming = fs.createReadStream("./buildings.json", { encoding: "utf8" }); | |
| var outgoing = fs.createWriteStream("./processed.json", { encoding: "utf8" }); | |
| var stream = JSONStream.parse(['features', true]); | |
| var downtown = new Terraformer.Polygon( | 
  
    
      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
    
  
  
    
  | /* | |
| "crime": | |
| { | |
| "equals": "arson" | |
| } | |
| index -> specific index that references the property keyword | |
| query -> object containing the specific queries for the index | |
| set -> object containing keys of all of the id's matching currently | 
  
    
      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
    
  
  
    
  | function foo() { | |
| return "foo"; | |
| } | |
| foo.bar = function () { | |
| return "bar"; | |
| }; | |
| module.exports = exports = foo; | 
  
    
      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
    
  
  
    
  | CREATE OR REPLACE FUNCTION _st_distance(geography, geography, double precision, boolean) | |
| RETURNS double precision AS | |
| '$libdir/postgis-2.2', 'geography_distance_uncached' | |
| LANGUAGE c IMMUTABLE STRICT | |
| COST 100; | 
  
    
      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
    
  
  
    
  | est=# CREATE TABLE test (id serial, condition_geo geography); | |
| CREATE TABLE | |
| test=# INSERT INTO test (condition_geo) VALUES (ST_Buffer(ST_GeogFromWKB(ST_MakePoint(20.0,30.0)),10.0)); | |
| INSERT 0 1 | |
| test=# SELECT id FROM test WHERE ST_Intersects("condition_geo", ST_Buffer(ST_GeogFromText('POINT(20.0 30.0)'), 20.0)) IS TRUE; | |
| id | |
| ---- | |
| 1 | |
| (1 row) | 
  
    
      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 Terraformer = require('../Terraformer/'), | |
| GeoStore = require('../terraformer-geostore/node/terraformer-geostore.js').GeoStore, | |
| RTree = require('../terraformer-geostore-rtree/').RTree, | |
| LevelStore = require('../terraformer-geostore-leveldb/').LevelStore; | |
| fs = require('fs'); | |
| var JSONStream = require('JSONStream'); | |
| var index = new RTree(); | |
| var store = new GeoStore({ | 
  
    
      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
    
  
  
    
  | for (var i = 0; i < 1000; i++) { | |
| setTimeout(function () { | |
| console.log(i); | |
| }, 1000); | |
| } | 
  
    
      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
    
  
  
    
  | function(msg) { | |
| if(/^hawthorne/.test(msg.message)) { | |
| var match = msg.message.match(/^hawthorne\s+(.+)/); | |
| var tap; | |
| var taps = [ ]; | |
| json = http.get("http://api.legitimatesounding.com/api/hawthorne"); | |
| feed = JSON.parse(json); | |
| // keep only the first 20 | 
  
    
      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
    
  
  
    
  | function(msg) { | |
| if(/^hawthorne/.test(msg.message)) { | |
| var match = msg.message.match(/^hawthorne\s+(.+)/); | |
| var tap; | |
| var taps = [ ]; | |
| json = http.get("http://api.legitimatesounding.com/api/hawthorne"); | |
| feed = JSON.parse(json); | |
| // delete the first 20 | 
  
    
      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
    
  
  
    
  | function(msg) { | |
| if(/^baileys/.test(msg.message)) { | |
| var match = msg.message.match(/^baileys\s+(.+)/); | |
| var tap; | |
| var taps = [ ]; | |
| json = http.get("http://api.legitimatesounding.com/api/baileys"); | |
| feed = JSON.parse(json); | |
| var tap_list = "Bailey's Taps: "; |