This is a simple example following Mike Bostock's Let's Make a Map Tutorial.
Created
August 5, 2016 20:22
-
-
Save j-chimienti/ff940be940b159bf0f2f7bfe725eb3e0 to your computer and use it in GitHub Desktop.
D3 tutorial let's make a map
This file contains 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
{ | |
"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": "" | |
} |
This file contains 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 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); | |
}); |
This file contains 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 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