Skip to content

Instantly share code, notes, and snippets.

@j-chimienti
Created August 5, 2016 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j-chimienti/ff940be940b159bf0f2f7bfe725eb3e0 to your computer and use it in GitHub Desktop.
Save j-chimienti/ff940be940b159bf0f2f7bfe725eb3e0 to your computer and use it in GitHub Desktop.
D3 tutorial let's make a map

Lets Make a map

This is a simple example following Mike Bostock's Let's Make a Map Tutorial.

{
"name": "lets-make-a-map",
"version": "1.0.0",
"main": "server.js",
"dependencies": {
"express": "^4.14.0",
"gdal": "^0.9.2",
"ogr2ogr": "^0.5.1",
"topojson": "^1.6.26"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": ""
}
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var express = require('express'),
app = express(),
path = require('path'),
port = process.env.PORT || 8000;
app.use(express.static(path.join(__dirname, '/public')));
app.get('/', function(req, res){
res.sendFile(path.join(__dirname, "/public", "index.html"));
console.log('on main page');
}).listen(port, function(){
console.log('listening at port %s', port);
});
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var ogr2ogr = require('ogr2ogr')
var url = "https://gist.github.com/wavded/7376428/raw/971548233e441615a426794c766223488492ddb9/test.geojson"
ogr2ogr(url).format('kml').stream().pipe(process.stdout)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment