TransWikia.com

Build tile server manually with PostgreSQL db on a different server

Geographic Information Systems Asked by vaishnavi mukundhan on August 17, 2021

I have set up my map tile server and have used the following components:

  1. Mod_tile
  2. osm2pgsql
  3. postgres
  4. Mapnik
  5. open street map carto

In my configuration, postgres is on a different server. when I access the /osm_tiles/0/0/0.png, I get a blank square. I think the data is not being fetched from postgres database. I have mentioned the configuration in the osm2pgsql/project.yaml file.

  1. How do I tell my server that the PostgreSQL db is on another server? Do I need to mention the db details in some other place as well?
  2. Which of tool fetches the tiles from the PostgreSQL db to be displayed?

P.s I’ve used this link as the setup guide.

One Answer

Question 1 In the project-1.mml file (at this step) check the database value and rerun carto command:

carto project-1.mml > OSMDefault.xml

Values should like:

  osm2pgsql: &osm2pgsql
    type: "postgis"
    dbname: "gis"
    host: "<your-server-zone>.rds.amazonaws.com"
    user: "postgres"
    password: "<your-postgres-password>"
    ...

If you still have diffculties check the connection between your Mapnik EC2 instance and your database.

psql -h <host> -p <port> -U <username> -W <password> <database>

If you can't connect check your security groups the database server security group must allow inbound traffic from the mapnik server. A recommended practice is to reference the security group of the mapnik server from the security group definition of the database server (see details here).

Question 2

This is Mapnik that fetch the data from PostgreSQL and generate the tiles. The tiles are not in the database, this is Mapnik that generate them using geospatial data from the database and a stylesheet (to select the rendering colors and size of all elements)

Answered by xavierraffin on August 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP