Hello every body I have read guidlien swithc2oms and I have installed osm on ubuntu 18.04. How to do i change stylesheet like Goolge Map?

asked 12 Dec '18, 08:09

mehdints's gravatar image

mehdints
11112
accept rate: 0%


There isn't a "one size fits all" method, but these tutorials may be helpful. Also the OSM Carto area has a Docker example designed for this. I tend to use a couple of scripts here and here to handle style changes and reload map data if needed.

permanent link
This answer is marked "community wiki".

answered 12 Dec '18, 18:00

SomeoneElse's gravatar image

SomeoneElse ♦
32.3k63333754
accept rate: 15%

In order to change style you can use Kosmtik (OSM carto tutorial Kosmtik and git). It is easy to use and it's great that it shows changes right away.

The other solution would be manual change of .mss files in ~/src/openstreetmap-carto (most usual path). You can edit them with your favorite text editor and change every style of map. But before manually changing stuff, I would recommend that you make backup of every .mss file. Also you can use Scripts like generate_road_colours.py and others for easier style change. And then you need to restart renderd.

I usually remove all files at /var/lib/mod_tile -> there are generated tiles in meta file extenstion. Be aware that removal of that files will remove your previous render. Command I use is sudo rm -rf /var/lib/mod_tile/default. You just need to check what is the name of your folder inside mod_tile (mine is default). After that you need to create XML file. Go into ~/src/openstreetmap-carto and create XML like this carto project.mml > mapnik.xml (Be aware that mapnik.xml can be named differently and you need to check what is your name of xml file -> it could be style.xml or something else). And after all you need to start new renderd sudo -u 'USERNAME' renderd -f -c /etc/renderd.conf where you swap 'USERNAME' with your username. And that's it, you can refresh your map in browser and check your new style!

If there are errors at command sudo -u 'USERNAME' renderd -f -c /etc/renderd.conf like "Socket bind failed for: /var/run/renderd/renderd.sock", you need to check if you have folder /var/run/renderd. If you don't have it, create one and grant access to your user like this:

sudo mkdir /var/run/renderd
sudo chown 'USERNAME' /var/run/renderd

(Swap 'USERNAME' with your account username).

Also if you get an error while renderd is generating, then probably you didn't edit .mss files correctly and you need to check them. Just take your time and read errors & backup data.

permanent link

answered 10 Oct, 08:53

LukashArts's gravatar image

LukashArts
163
accept rate: 0%

edited 11 Oct, 05:21

Your answer
toggle preview

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:

×549
×53
×29
×20

question asked: 12 Dec '18, 08:09

question was seen: 695 times

last updated: 11 Oct, 05:21

powered by OSQA