This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Different Street color

-1

Hi everyone.

I'm interesting in road painting. I try to explain. For example I have some roads in DB ( _ways) and I want to show them with polylines but each road color depends on it's variable: road "Brown. st" has value 1 and its color is green, "St. Jorge st" has value is 2 - it's color yellow and so on. I found out similar great project to my question (http://resultmap.neis-one.org/japan.html)

So there are two questions:

1)How can I select a definite road from the DB ( or all roads ) and show them with layers?

2)How can I paint with random color each road?

Thanks in advance for a reply.

asked 07 Dec '11, 21:10

zzzzteph's gravatar image

zzzzteph
30557
accept rate: 0%

2

I think I should somehow modify osm.xml to generating only road lines and other features and using ./generate_tiles.py generate necessary layer. Am I right ?

(08 Dec '11, 11:03) zzzzteph

I dont understand this question. What are the 1 and 2 values for? Do you just want all the roads to each have their own randomly selected colour (the result might be quiet interesting I suppose but generally would be a multicoloured mess!) or... what do you mean? Could you maybe add a picture of the kind of output you want. Also "Brown St" is a confusing street name example.

(10 Dec '11, 12:58) Harry Wood

Something like this imagelink.

(11 Dec '11, 17:32) zzzzteph

One Answer:

0

Openlayers and Leaflet can easily color features loaded from vector data in different colours. This will be unusable if you have too many streets or an old browser, that map you link will probably work.

answered 14 Dec '11, 12:36

emj's gravatar image

emj
2.0k123547
accept rate: 15%

Source code available on GitHub .