Tag: mapnik

在mapnik中渲染function标签

我正在尝试渲染mapnik样式表,但是我没有尝试渲染标签。 这是我的样式表: <Map srs="+init=epsg:4326"> <Style name="Polygon"> <Rule> <LineSymbolizer stroke="black" stroke-width="2" /> <TextSymbolizer face-name="DejaVu Sans" placement="interior" allow-overlap="true">[name]</TextSymbolizer> </Rule> </Style> <Layer name="polygon" srs="+init=epsg:4326"> <StyleName>Polygon</StyleName> <Datasource> <Parameter name="type">geojson</Parameter> <Parameter name="inline"><![CDATA[ { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "coordinates": [[ [18.6609649658203, -32.59028569040753], [18.6536693572998, -32.59762547484460], [18.6737108230590, -32.59892704873228], [18.6609649658203, -32.59028569040753] ]], "type": "Polygon" }, "properties": { "name": "polygon" […]

错误:找不到模块'mime'

我正试图在Ubuntu 12.04上安装cartodb。 我已经完成了所有在https://github.com/danseely/cartodb-install/blob/master/DEV-INSTALLATION.md上提到的步骤,我被困在安装Windshaft-cartodb步骤。 以下步骤工作正常: cd ~ git clone git://github.com/CartoDB/Windshaft-cartodb.git cd Windshaft-cartodb git checkout master npm install cp config/environments/development.js.example config/environments/development.js 每当我点击命令节点app.js开发,它给我以下错误: module.js:340 throw err; ^ Error: Cannot find module 'mime' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/home/user/Windshaft- cartodb/node_modules/windshaft/node_modules/grainstore/node_modules/millstone/lib/millstone.js:6:12) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at […]

哪些工具构build完整的交互式地图应用程序/ Web应用程序?

我也想build立一个Web应用程序,我正在寻找我将不得不使用的工具。 我想要使​​用我正在考虑的实时地图: Tilemill得到.png为了组成我的地图的背景,或者从shp文件中的webite中获取数据以在mapnik中为此构build图层。 Mapnik用我想在地图上添加的数据构build图层。 Mapnik :将图层放在一起并生成地图。 TileStache :为我的应用程序生成瓷砖。 Openlayers :在浏览器中显示我的地图。 一旦我的地图显示,我想添加交互性。 例如,当你走过一条线或一个圆圈(一个城镇/一个事件)时,它会给你这个对象的属性。 但是线条和圆圈将直接集成到mapnik地图中,所以我需要添加一些javascript以使其dynamic并打开popup窗口。 我该怎么做呢 ? 使用Openlayer JavaScript库或node.js。 对于我想要使用这些工具的问题/方式,您有什么build议? 非常感谢!

Mapnik PostGIS GeoJSON / TopoJSON渲染

我成功地使用PostGIS从一个定制的dynamicnode-mapnik tile服务器渲染并提供了美国县级的.pbf图块,但是现在我也想从同一个服务器渲染和提供topojson和/或geojson图块。 有没有办法扩展下面的代码示例(完整示例在要点)返回geojson的瓷砖,甚至更好的topojson格式? https://gist.github.com/nautilytics/75cbbb2d854de608e81c map.render(new mapnik.VectorTile(+params.z, +params.x, +params.y), opts, function (err, image) { if (err || !image) { res.removeHeader('Content-Encoding'); res.writeHead(500, { 'Content-Type': 'application/x-protobuf' }); res.end(); return; } // Fake empty RGBA image.isSolid(function (err, solid, key) { if (err) { res.writeHead(500, { 'Content-Type': 'text/plain' }); res.end(err.message); return; } // Solid handling. var done = function (err, […]

为MapboxGL客户端自行托pipe的vector切片呈现不正确

我正在尝试在Node.js中设置一个Web服务器,该服务器使用MapboxGL JS提供要在浏览器中显示的vector图块。 vector图块的数据存储在PostGIS数据库中。 我目前的设置似乎正确的方向,因为我可以看到vector瓷砖被加载和显示在浏览器中。 然而,渲染的结果是不正确的(这是我的地图的一个截图): 绿色build筑脚印的上半部分重复在图像的下半部分。 我还注意到,在放大和缩小时,build筑物会发生“变化”的位置,这表明某种程度上,这些贴图会被渲染为偏移量或不正确的程度。导入的数据位于SRID 4326中。 这是我的代码: var zlib = require('zlib'); var express = require('express'); var mapnik = require('mapnik'); var Promise = require('promise'); var SphericalMercator = require('sphericalmercator'); var mercator = new SphericalMercator({ size: 256 //tile size }); mapnik.register_default_input_plugins(); var app = express(); app.get('/vector-tiles/:layerName/:z/:x/:y.pbf', function(req, res) { var options = { x: parseInt(req.params.x), y: […]