NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I want to render tiles and I have a problem.

I made postGIS db, succesfully run TileMill with OSMBright style. I read that I need now export mapnik xml from TileMill. I checked Mapnik as in python tutorial- everything works fine.

I've changed generate_tiles.py:

  • changed the .xml file to read
  • changed the bbox (I have checked bbox of small area while exporting to PNG in TileMill)
  • changed the render line to render_tiles(bbox, mapfile, tile_dir, 15, 16 , "mymap")

but an error occures:

Failed to load fonts from: ./fonts in Map at line 3 of '/home/myacc/bin/mapnik/osm.xml/'

I think the .xml is not made properly (it has written path as reference to current path) but maybe I am wrong.

I have checked :

python -c "import mapnik;print mapnik.fontscollectionpath"

and changed the fontpath in osm.xml, but there is no such fonts registered by Mapnik . I printed out known fonts by:

python -c "from mapnik import FontEngine as e;print '\n'.join(e.instance().face_names())"

but there isn't a font face 'Free Sans Semibold'

My questions:

  1. I am doing it wrong (generate xml from tilemill, put it into ~/bin/mapnik and changing generate_tiles.py)
  2. Is there a better way to make this tiles
  3. If not- what I should do to make this work (where are those fonts it cant find (I think there will be more errors with reading files) )

asked 20 May '14, 11:00

r2d2's gravatar image

r2d2
1112
accept rate: 0%


I think the .xml is not made properly (it has written path as reference to current path) but maybe I am wrong.

When exporting from TileMill, I've seen the same effect when moving to a different machine where paths are different. I got around it (with the "standard" OSM map style, not OSMBright) by editing paths where they varied to match the target machine. Using the "carto" utility to do the export rather than TileMill (as mentioned here) may also fix the problem, but I've not tried that with OSMBright, and I've not tried that on a machine with TileMill also installed, so I can't guarantee there won't be node.js package mismatches between what TileMill needs and what carto does.

(someone please edit if that last sentence is me worrying unnecessarily).

permanent link
This answer is marked "community wiki".

answered 20 May '14, 11:11

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

I have used OSMBright becouse it creates project for TileMill- I dont have to add layers manually. Is there sth. like this for carto?

(20 May '14, 12:54) r2d2

The OSM standard style can be loaded into TileMill. It's quite big with lots of layers (you'll need to use an external editor to edit files as TileMill will run out of tabs) but it does load and export without problems.

(20 May '14, 13:17) SomeoneElse ♦

could You tell me how to do this because I'am a bit confused- I use this style when osm2pgsql. And than what I should do? (how to add all the layers)

Ok, I've just pasted the files to my project pff this coses errors ;/ how can it be easily loaded??

(20 May '14, 13:22) r2d2

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×710
×341
×287

question asked: 20 May '14, 11:00

question was seen: 5,249 times

last updated: 20 May '14, 14:18

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum