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

I'm accessing the OSM standard tile layer through "https://{s}{z}/{x}/{y}.png". I'm displaying it with Leaflet interactive maps.

Is there any way to get it not to display the buildings?

asked 21 Nov '18, 18:34

noncomp's gravatar image

accept rate: 0%

edited 21 Nov '18, 18:35

Not without creating your own tile layer that doesn't include buildings, no.

Is that something that you're interested in doing?

permanent link

answered 21 Nov '18, 18:36

SomeoneElse's gravatar image

SomeoneElse ♦
accept rate: 16%

Yes, how would you suggest I go about doing that?

(21 Nov '18, 18:39) noncomp

I'd follow the switch2osm guide and set up a tile server exactly like OSM's standard layer then I'd remove the bit from that that displays buildings.

That probably means editing this file so that the layer corresponding to buildings (which I've highlighted the start of) is removed. There may be a bit more to do than that (specifically generic building labels) but that should start you off.

(21 Nov '18, 18:47) SomeoneElse ♦

Alright, thank you very much for your great help! I also thought of a quick-fix that doesn't require setting up a tile server, that may work: get the geometry of the buildings and display polygons over them the same color as the background to make them invisible.

(21 Nov '18, 18:58) noncomp

You'd still need a tile layer for your "anti-buildings" though, so I'm not sure how that would help?

Also decisions about whether things are displayed or not (where there are clashes) are made on the fly by Mapnik, so you'd need to reverse that logic too...

(21 Nov '18, 19:04) SomeoneElse ♦

Leaflet allows you to display polygons on top of the existing tile layer, so you don't need to setup another one.

(21 Nov '18, 19:11) noncomp

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 21 Nov '18, 18:34

question was seen: 3,056 times

last updated: 21 Nov '18, 19:11

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