1

I've been following the instructions at Manually building a tile server (18.04 LTS) but am stuck on the following step:

The following command will insert the OpenStreetMap data you downloaded earlier into the database. This step is very disk I/O intensive; importing the full planet might take many hours, days or weeks depending on the hardware. For smaller extracts the import time is much faster accordingly, and you may need to experiment with different -C values to fit within your machine’s available memory.

osm2pgsql -d gis --create --slim  -G --hstore --tag-transform-script ~/src/openstreetmap-carto/openstreetmap-carto.lua -C 2500 --number-processes 1 -S ~/src/openstreetmap-carto/openstreetmap-carto.style ~/data/azerbaijan-latest.osm.pbf

However when I run it, I keep getting the following error:

osm2pgsql version 0.96.0 (64 bit id space)
Allocating memory for dense node cache
Allocating dense node cache in one big chunk
Allocating memory for sparse node cache
Sharing dense sparse
Node-cache: cache=2500MB, maxblocks=40000*65536, allocation method=11
Mid: pgsql, cache=2500
DB writer thread failed due to ERROR: Connection to database failed: FATAL:  role "localuser" does not exist

I've gone through to ensure I've followed all the steps. I've also tried adding -U renderaccount -W options to set it run as the renderaccount, not the localuser account, but still no improvement.

asked 27 Apr '19, 10:30

breno-au's gravatar image

breno-au
26113
accept rate: 0%

Thank you.

(15 May '19, 12:39) breno-au

One Answer:
4

Looks like you are running it from a unix account localuser. You need to replace "renderaccount" with the account your mod_tile/renderd will run under (not necessarily your regular logon). See this bit on switch2osm:

Now you need to create a postgis database. The defaults of various programs assume the database is called gis and we will use the same convention in this tutorial, although this is not necessary. Substitute your username for renderaccount where is is used below. This should be the username that will render maps with Mapnik. sudo -u postgres -i createuser renderaccount # answer yes for superuser (although this isn't strictly necessary) createdb -E UTF8 -O renderaccount gis

permanent link

answered 27 Apr '19, 10:37

SK53's gravatar image

SK53 ♦
23.6k46238372
accept rate: 20%

While mostly a description of how to solve a different problem, https://www.openstreetmap.org/user/SomeoneElse/diary/47027 does describe what you need to have different map layers (or just one map layer) rendering from different databases not called "gis".

(16 May '19, 12:10) SomeoneElse ♦

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:

×224
×175
×43
×31

question asked: 27 Apr '19, 10:30

question was seen: 1,137 times

last updated: 16 May '19, 12:10

powered by OSQA