Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fun commandline js tools: render.js (like nik2img.py) and inspect.js …
…(pass it a shapefile, geojson, or mapnik xml and get back info)
- Loading branch information
Dane Springmeyer
committed
Jan 15, 2011
1 parent
b5823b9
commit ef7e4e9
Showing
2 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env node | ||
|
||
var sys = require('fs'); | ||
var child_process = require('child_process'); | ||
|
||
var usage = 'usage: render.js <stylesheet> <image>' | ||
|
||
var stylesheet = process.ARGV[2]; | ||
if (!stylesheet) { | ||
console.log(usage); | ||
process.exit(1); | ||
} | ||
|
||
var image = process.ARGV[3]; | ||
if (!image) { | ||
console.log(usage); | ||
process.exit(1); | ||
} | ||
|
||
var mapnik = require("mapnik"); | ||
|
||
var map = new mapnik.Map(600,400); | ||
map.load(stylesheet); | ||
map.zoom_all(); | ||
map.render_to_file(image); | ||
child_process.exec('open ' + image) |