version | dependency | dep version | description |
---|
#!/usr/bin/env node | |
"use strict"; | |
var exists = require('fs').existsSync || require('path').existsSync; | |
var fs = require('fs'); | |
var usage = 'usage:'; | |
usage += '\n mapnik-info.js <tile.mvt> z x y'; | |
var tile = process.argv[2]; |
var mapnik = require('mapnik'); | |
var fs = require('fs'); | |
var iterations = 20000, | |
i = total = 0, | |
max = -Infinity, | |
min = Infinity, | |
tile = './785.vector.pbf'; | |
decode(); |
Website: http://www.ballardlabs.com/
Location: http://osm.org/go/WIX6yTfEt?node=4051961489
Type | cost / month | description |
---|---|---|
Open workspace | $299 | daytime access, open workspace |
var fs = require('fs'); | |
var map = new mapnik.Map(256, 256), | |
img = new mapnik.Image(256, 256), | |
data = fs.readFileSync('/path/to/data.shp'), | |
vectortile = new mapnik.VectorTile(0,0,0); | |
// add shapefile to vector tile | |
vectortile.addData(data, function(err) { | |
if (err) throw err; |
Blake described a painted tile like this:
Think about if I was rendering a 0/0/0 tile from postgis and there was only a small park in my data. It would probably collapse to nothing at 0/0/0
resolution so the entire tile would be empty. So the tile would be considered empty
, but there was originally data below it so for pyramid rendering we want to know that you can’t just copy this tile from now on. Therefore painted
says “hey! there was some data!"(edited)
Mapnik and the Mapnik-related tools have a series of useful debugging tools built into their repositories. Since these live across repos, it can be difficult to remember where they exist or even if know if they exist. This lists out all of the useful bin
commands that have been built for debugging purposes when working on Mapnik.
located at: https://github.com/mapnik/node-mapnik/tree/master/bin
mapnik-index.js
mapnik-inspect.js
mapnik-render.js
mapnik-shapeindex.js
node-mapnik
is a Node.js module that binds the functionality of Mapnik to be used via a a JavaScript API.
- Mocha.js is our javascript testing suite that uses a set of functions and "assertions" to ensure the results of our code are as expected.
coveralls.io
is a great tool that we use to check for coverage of our tests. It runs our tests for us, and is able to see which lines of code are used, and which are not during those tests. If a particular line of code isn't used during the tests, it shows as red, allowing us to write a particular test for that scenario.- The
/test
directory within the repository is where all of our tests are located. make test
is the command that runs our tests. This is actually runningmocha -R spec
Benchmark numbers from node-mapnik
version 3.4.15
.
This is a visualization of the encoding benchmarks for the Mapnik implemention of Mapbox Vector Tile specification located here. Hovering on a line will show the file name. Clicking on that line will open a new tab to the data file for inspection or reference.