Why not ask your question on the new OpenStreetMap Community Forum?

I'm having trouble with two things.

The first is that I want 2 maps, one without roads or highway shields and a second with only roads and highway shields in order to insert a traffic layer between them.

The second is that I would like to download, using C#, a .png file of each map described above.

In javascript using leaflet, this seems to support this download, but it seems to derived from the leaflet.js.

new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');

Any help with these would be welcome and appreciated.

Thank you

asked 11 Jan '18, 18:19

chascallaway's gravatar image

accept rate: 0%

edited 19 Jan '18, 20:43

aseerel4c26's gravatar image

aseerel4c26 ♦

At the risk of stating the obvious, if you want to download a .png map tile layer with only certain data on it (say, no roads) then you're going to need to create a map style that shows the information you want and render the tiles for the area that you're interested in.

Or, alternatively, look for a "non-png" based approach - there are various ways of creating "vector tiles" out there, not all documented very well unfortunately, but this may be a more suitable approach for you.

(12 Jan '18, 00:45) SomeoneElse ♦

I admit I'm a newbie, but I'm aware that I need to create a map style that shows the information I want but all I find at openstreetmap.org is a selection of styles - all without specific layer (badges, road, water, etc.) settings. For instance, I can choose a background but what if I don't want one at all?

If I need to create a stylesheet specifically disabling the hundred or so layers exposed by MapBox, I can, but what are they called?

And a C# sample I could find to download a (styled) .png file from a url???


(12 Jan '18, 01:40) chascallaway

So this is a question about OpenStreetMap in the Mapbox UI ?

(12 Jan '18, 04:26) escada

No. I wish not to use MapBox if possible.

(12 Jan '18, 06:58) chascallaway

OK. No answers yet.
So, is it possible to turn off the roads or background layers in open source openstreetmap? Can an openstreetmap map be saved as a .png file?

(17 Jan '18, 23:44) chascallaway

So, is it possible to turn off the roads or background layers in open source openstreetmap? Can an openstreetmap map be saved as a .png file?

The answer is "yes", but the problem is there are many different sorts of "OpenStreetMap map". You're going to have to find one that suits your needs.

OpenStreetMap is basically just a big lump of data. The process of turning that into a map is called rendering. As can be seen from that page, you have a huge number of options. Looking at one example, the "standard" map style that's the default at osm.org is described here. The map is composed of lots of smaller .png files joined together. These .pngs are sent from the map server to the client and knitted together there. The layers in that map are described in this file. Each of those layers is described by something like this. There are many more carto-based styles that work in the same basic way as this one, but there are many many more using different technologies altogether. Here, for example, is an in-depth discussion of some of the various vector tile technologies available for use with OpenStreetMap data. With vector tiles, instead of .pngs being sent from server to client data is, and the client then renders it.

You won't be able to start with an existing example and "turn off a layer" to create something that works for you; you'll need to start with something very simple that contains minimal information in the three layers that you're interested in and work up from there. You'll need to decide whether something based on raster tiles, vector tiles or a combination (data drawn on top of raster tiles) is best for you, and that'll depend on things like what is going to be the client and server in your example, available bandwidth, available storage space, the amount of the world you want to be able to process and many more variables.

permanent link

answered 18 Jan '18, 00:13

SomeoneElse's gravatar image

SomeoneElse ♦
accept rate: 16%

Thank you for your answer. It reflects a knowledge of OpenStreetMap maps far beyond mine. I'll gladly award points, but how many points are a lot? I would like to reflect the level of my appreciation. I naively thought this would be easy.

That said, at this time, I need to get static maps of about 2 dozen locations defined by bounding boxes but need two maps for each - a background, which I can get, but also a second map having only the road badges plus road and city names (.png - I'm adding an additional layer between them). I can get the first one without issue. Both maps will be saved as .png in a C# app. I like MapBox and Google maps, but the recurring cost is prohibitive.

Whom would you suggest I approach to get this done?

(19 Jan '18, 14:36) chascallaway
Your answer
toggle preview

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](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:


question asked: 11 Jan '18, 18:19

question was seen: 5,410 times

last updated: 19 Jan '18, 20:43

powered by OSQA