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

Recently I was assigned with a task of setting up a portable offline OSM tile server. So naturally I went there:

https://switch2osm.org/serving-tiles/manually-building-a-tile-server-18-04-lts/

And tried to follow all the instructions on a virtual machine. (a VDI image with Ubuntu 19.10) And there I had soooooo much PAIN trying to install this freaking Mapnik thing! Literally I'm going to f*cking hate this name for god knows how long...but that's not the point. The point is that after I managed to install it using "pip", everything went smoothly until I tried to execute

renderd -f -c /usr/local/etc/renderd.conf

There I got in trouble once again as the following errors popped:

renderd[15908]: An error occurred while loading the map layer 'ajt': Could not create datasource for type: 'postgis' (no datasource plugin directories have been successfully registered)  encountered during parsing of layer 'landcover-low-zoom' in Layer of '/home/osboxes/src/openstreetmap-carto/mapnik.xml'

After some searching I found this topic:

https://github.com/mapnik/node-mapnik/issues/311

which hinted that I should

`Try calling mapnik.register_default_input_plugins(); at the top of your script.`

But where in the hell should I put this line I don't understand! I have no script. I suppose I have to launch python and somehow run it there but I haven't figured out how to do this. I could have gone and tried learning python to figure this out, sure, but this thing is taking too much time already and I don't think it should.

So I thought maybe somebody could help me out with this.

ALthough I anticipate a sh#tstorm coming my way about how incompetent I am and how I should go read the fcking manual (which one, god damn it!). I definitely could have chosen words more carefully but fck this, I am so sick of this cr@p. This freaking mapnik! Why does it have to take so much attention on itself!

P.S. I had to install postgres 11 because my packet manager didn't see version 10. And when I was compiling a "mode_tile" module I commented out whe whole "gen_tile_test.cpp" because it failed to find guess what...A FREAKING #include <mapnik/box2d.hpp>!

asked 21 Feb '20, 13:27

kartman1's gravatar image

kartman1
386711
accept rate: 0%

edited 21 Feb '20, 13:31

3

This forum is for questions which can be answered, not rants about your software installation experience. I note that you were installing on an entirely different version of the Operating System rather than 18.04 LTS: it is only to be expected that some things may have changed.

(21 Feb '20, 13:34) SK53 ♦

Ok, my bad, I ll go and try this with 18.04=( although it's strange that fundamentally most things worked as expected and yet they didn't

(21 Feb '20, 13:44) kartman1
2

This is not strange at all. Your error message seems to point at Mapnik's PostGIS plugin not being found, likely because it has not been installed (sometimes, between distributions, packages are split up in several parts and where you only needed to install one in version A you now need to install three in version B) or because it resides in a different directory than anticipated. Your swearing is inappropriate, even more so as you already suspected, when writing your message, that you might be criticised for it!

(21 Feb '20, 14:13) Frederik Ramm ♦

Perhaps this paragraph

Note that these instructions are have been written and tested against a newly-installed Ubuntu 18.04 server. If you have got other versions of some software already installed (perhaps you upgraded from an earlier Ubuntu version, or you set up some PPAs to load from) then you may need to make some adjustments

overdoes the "British reserve" somewhat (disclaimer - I wrote it). Maybe it should say "depending on where you are starting from, you may be in a whole world of pain".

It doesn't surprise me that you've had issues with Ubuntu 19. My experience with earlier Ubuntu interim releases haven't always been positive - I get the feeling that Ubuntu uses them to "throw functionality at the wall and see what sticks", which you probably don't want to be dealing with if you want a server to be around for more than a few months.

There's a new LTS version out this year, and I expect that we'll update the switch2osm guides once we've got something that works. Ubuntu 18.04 LTS is due to be receive regular support through 2023 though, so there's no hurry.

permanent link
This answer is marked "community wiki".

answered 21 Feb '20, 14:14

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

edited 22 Feb '20, 10:33

1

Yeah it worked on Ubuntu 18.04.3 Bionic Beaver (64bit). Although there was an error in a "sudo apt install npm nodejs" line: npm didn't want to install because one of its dependencies was broken. Luckly though there was a topic just on that matter (https://askubuntu.com/questions/1088662/npm-depends-node-gyp-0-10-9-but-it-is-not-going-to-be-installed) So I did "sudo apt-get install nodejs-dev node-gyp libssl1.0-dev" and it all worked. Although I had "default-libmysqlclient-dev libgdal-dev libmapnik-dev libmysqlclient-dev libssl-dev" removed in the process. I really hope that "libmapnik-dev" is not going to backfire... Thanks!

(21 Feb '20, 15:08) kartman1
1

You can test whether the lack of libmapnik-dev will cause a problem by building some other software that might need it locally (but not doing a "make install" or similar).

"node" changes every 5 mins - maybe we need to revisit that bit of the instructions. They're in github, so you can make a pull request there. There's one other postgres version oddity as an issue already, I think.

(21 Feb '20, 16:52) SomeoneElse ♦

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:

×341
×134
×105

question asked: 21 Feb '20, 13:27

question was seen: 2,851 times

last updated: 22 Feb '20, 10:33

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