Hot answers tagged

7 votes
Accepted

How to render PostGIS raster with Mapnik XML?

For those who will stumble on this question like me.. It appears that the plugin has been generated (https://github.com/strk/mapnik/tree/2.3.x-pgraster) and has been merged in official Mapnik Repo. ...
user avatar
  • 168
7 votes

Serving multiple styles from tile server

Just edit the renderd.conf and add a section for your second style (make sure the "URI" entry points to a different path than that of your default style). For example, my renderd.conf contains the ...
user avatar
  • 211
7 votes
Accepted

osm2pgsql vs imposm rendering performance

Besides hardware and other software, rendering performance depends on the database, custom indexes, and the SQL in the style rendered. The style makes a huge difference, and badly written layer ...
user avatar
  • 1,479
5 votes
Accepted

artifacts in SRTM contour layers processed with GDAL tools and rendered with mapnik?

Here was my problem: No way the SRTM data is that messed up. The SRTM data IS that messed up. The warping above is actually in the DEMs in the SRTM3 dataset (downloaded from http://dds.cr.usgs.gov)...
user avatar
5 votes
Accepted

Permission Denied when installing openstreetmap server

The problem you ran into has nothing to do with carto, it's an issue with your shell command, when you run sudo carto project.mml > OSMBright.xml carto runs as root, but the file write happens as ...
user avatar
5 votes
Accepted

Custom tile server - how to create a layer using Mapnik and mod_tile using POSTGIS db

This page has an awesome tutorial on how to create a complete Tile server using the stack Mod_tile, renderd, mapnik, osm2pgsql, and a PostgreSQL/PostGIS database. If you already have a style created ...
user avatar
  • 278
4 votes

Python, OGR and Mapnik: Possibility of passing existing ogr.Open() datasource into Mapnik without using mapnik.Ogr()?

Depending on your version of mapnik, yes it's possible. Mapnik 2.1 introduced the Python Plugin as a data source. You would need to subclass mapnik.PythonDatasource and implement a features method ...
user avatar
  • 15.3k
4 votes
Accepted

CartoCSS: labels along inside of polygon boundary

try to add this text-dy: -10; you can look at file admin.mss in openstreetmap-carto project dir and find code #nature-reserve-text[zoom >= 13][way_pixels > 192000] { text-name: "[name]"; ...
user avatar
4 votes

pre-rendering for whole planet using render_list is very very slow

Firstly, that is a LOT of data/tiles you are rendering, so you should expect it to take a long time. You need to reconsider exactly what you are rendering. If you are using OSM_Bright and OSM data ...
user avatar
3 votes
Accepted

mapnik rendering with OSM Carto style

First, the OSM "default" style resides here, along with instructions for deploying it. You cannot import data in PostGIS without a style. Osm2pgsql requires a style file to function. There is one in ...
user avatar
  • 2,238
3 votes
Accepted

Generating Interactive Tiles using Nodejs, Mapnik, and PostGIS for Leaflet

It's a bit high time I answered, but here goes: Since the use of Wax is deprecated as you mentioned, here are some Mapbox examples to get you started. Bear in mind that the Leaflet API is embedded ...
user avatar
3 votes

How to install everything "geo" in Ubuntu?

In my experience using Ubuntu with GIS products will not be problematic. But you should try to keep to Long Term Support (LTS) versions of Ubuntu. The reasons are among others: Cutting edge versions ...
user avatar
  • 3,131
3 votes

Orthographic reprojection with mapnik

The ortho projection does not cover the whole world, only the visible half. Using the QGIS GUI, your globe would look like this: What you see as nasty artefacts will kill the python script. So you ...
user avatar
  • 74.9k
3 votes
Accepted

Adding another style to an OpenStreetMap server using Mapnik, PostGIS, etc

The style is invoked in renderd.conf with something like XML=/home/jburgess/osm/svn.openstreetmap.org/applications/rendering/mapnik/osm-local.xml So you can exchange that call to another xml file, ...
user avatar
  • 74.9k
3 votes

How can i set up the "own OSM" for own maps, having no relation to the current real spacial photos

It sounds like what you are really wanting is to be able to override specific tiles in a map. I have implemented this with TileLayers in Google Maps in the past. Not sure how to do this with OSM, but ...
user avatar
3 votes
Accepted

Python, OGR and Mapnik: Possibility of passing existing ogr.Open() datasource into Mapnik without using mapnik.Ogr()?

Stepping back, if you have data in PostGIS and you want to render it with Mapnik you really should be using Mapnik's native PostGIS support - aka mapnik.PostGIS datasource in python (https://github....
user avatar
  • 444
3 votes

Error while building OSMBright

Line 9 on your osm-bright.osm2pgsql.mml file, you left out a comma when adding the line "type": "shape", You need to have proper JSON format.
user avatar
  • 31
3 votes

Generating vector tiles with Mapnik

You could find a good point to start here.
user avatar
3 votes
Accepted

renderd not rendering

This issue happened due to an error in my configuration of renderd in /usr/local/etc/renderd.conf. Parts of the configuration file looked like th following snippet: [renderd] socketname=/var/run/...
user avatar
  • 257
3 votes

Rendering tm2 projects?

Preparing the vector PBF tiles is the first step. The MapBox Studio Classic is able to generate for you the vector PBF tiles (packed in MBTiles format) from any vector source (ShapeFiles, PostGIS, ......
user avatar
  • 1,513
3 votes

Render all roads with an equal width in Mapnik

Take a look at Skeletron, which is a Python tool to merge adjacent lines. (Incidentally, I came here via your request in #osm IRC, but it would be polite for you to wait there a little more than 30 ...
user avatar
3 votes
Accepted

How to export Mapnik style to XML?

You can use mapnik.save_map() import mapnik m = mapnik.Map(1440,800) # ... add styling and layers ... mapnik.save_map(m, "output.xml")
user avatar
  • 2,575
3 votes

Tilestrata XML error

What you're encountering is an unfortunate side-effect of a breaking change in 0.4 of tilestrata-mapnik (changelog). When specifying the path to an XML file, use pathname instead of xml. This ...
user avatar
3 votes

Link between tile server and QGIS

Install QuickMapServices Plugin (https://plugins.qgis.org/plugins/tags/qms/) Add your TMS source Enjoy
user avatar
3 votes
Accepted

Mapnik on 64 bit Windows

According to http://mapnik.org/pages/downloads.html, there are only 32-bit builds for Mapnik 2.2.0 on Windows. https://gist.github.com/springmeyer/5651701 and https://github.com/mapbox/windows-builds ...
user avatar
  • 74.9k
3 votes
Accepted

Show both label and icon for amenities using Carto CSS

You can add labels as attachments using a CartoCSS similar to this one: #layer { marker-width: 20; marker-fill: #EE4D5A; marker-fill-opacity: 0.9; marker-file: url('https://s3.amazonaws.com/...
user avatar
  • 4,316
3 votes

Drawing polygon border on inside only in Mapnik?

Yes, you can apply an offset. Indeed, the openstreetmap-carto style does this in CartoCSS: line-offset: -0.9; The final XML for Mapnik is: <LineSymbolizer offset="-0.9" stroke="#82643a" stroke-...
user avatar
3 votes
Accepted

How to draw a marker with Mapnik?

You can find below a sample to do it. import json import mapnik mapnik_xml = "openstreetmap-carto/mapnik.xml" map_output = "region_map_mapnikXml.png" epsg_3857 = "+proj=merc +...
user avatar
  • 28.6k
2 votes

Using render_list to render only map extract

Try this script. It uses render_list utility in proper way and converts geo coordinates (WGS-84) to tile coordinates on several zoom levels and generates many tiles in one round. For example: ./...
user avatar
  • 21
2 votes

Only Draw Geometric Objects Above 8th Parallel North

A straightforward way to do this - there is probably a faster way - is with ST_Difference against a constructed mask polygon: SELECT ST_Difference(ST_Transform(the_web_geom, 4326), ...
user avatar
  • 12.4k

Only top scored, non community-wiki answers of a minimum length are eligible