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

Hello, I have setup a rendering stack (osm2pgsql, mapnik, apache, mod_tile) and am able to create a map for region specified by gps co-ordinates using render_list_geo.pl The maps look great! I used openstreetmap-carto style to render my map tiles.

Though I was interested to customize it by removing all text labels (street names, building names, park names, landmark names, all types of text). I have the XML files with me that go as input to Mapnik, though I am not sure what should I edit in them to disable the text completely.

asked 19 May '22, 12:36

royrod's gravatar image

royrod
31223
accept rate: 0%


You have a couple of options:

  1. Remove the places where names are rendered from the .mss and .mml files (there will be quite a lot of these)
  2. Edit the .lua file used when loading the database to rewrite the "name" and "ref" etc. with an empty string or delete those tags.

The OSM Carto lua has a "delete tags" section; it might be as simple as adding "name" and "ref" to that list. If for any reason that does not work adding the code to change those tags to filter_tags_generic would.

permanent link

answered 19 May '22, 12:57

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

edited 19 May '22, 12:58

I followed step 2 and edited the Lua file. Then I ran osm2pgsql and used render_list_geo.pl Still my tiles have text labels at all places. Did I miss something ?

(19 May '22, 15:19) royrod

Just to be absolutely clear, you'll need to make sure you're not looking at cached information.

  • after a change to the .lua you'll need to reload the data
  • you'll want to restart apache2 and renderd to make sure that you're serving fresh files
  • you'll want to delete existing meta tiles from below e.g. /var/lib/mod_tile/yourstylename
  • you'll want to make requests from an incognito browser and watch the server as it renders your new tile (hopefully without names)
(20 May '22, 09:41) SomeoneElse ♦

This made it clear, thankyou for listing it down.

(30 May '22, 12:28) royrod

My approach would have been to take the project.xml you have generated and - with a text editor - comment out all the occurrences of <textsymbolizer ...="">. That is certainly a hack but should work nicely.

permanent link

answered 19 May '22, 15:49

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 19 May '22, 15:50

I tried to remove the lines corresponding to <textsymbolizer ...=""> in the XML file, after that I ran, render_list_geo.pl there were no changes in the rendered files.

I cleared all previous tiles from memory. Is there a way to apply the changes that were made.

(20 May '22, 01:57) royrod

How did you "clear all previous tiles from memory"? Try the list from the "Just to be absolutely clear" list in the other comment.

(20 May '22, 09:43) SomeoneElse ♦

This solution also worked for me thankyou for answering it

(30 May '22, 12:28) royrod

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
×84
×16

question asked: 19 May '22, 12:36

question was seen: 1,858 times

last updated: 30 May '22, 12:28

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