OSM buildings colorization

Hi,
The OSM buildings are being populated with a single grey color and can be easily colorized with the 3Dtilset style object.
I am looking for a way to have all the item colorized by the standard acceptable color scheme.
Is there a quick way to do it with Cesium (Maybe a color by type/material json file) or even an existing out of the box style function.

Thx!
Liron.

viewer.scene.primitives.add(Cesium.createOsmBuildings({
  style: new Cesium.Cesium3DTileStyle({
    color: {
      conditions: [
        ["${feature['building']} === 'hospital'", "color('#0000FF')"],
        ["${feature['building']} === 'school'", "color('#00FF00')"],
        [true, "color('#ffffff')"]
      ]
    }
  })
}));

Thx for the comment.
As mentioned in my original post, it is easy to add styles to the building primitives and I know exactly how it is done.
What I’m looking for, is a style data base that represent the acceptable OpenStreetMap color scheme.

There is a sandcastle example showing how to style buildings based on type, material, and other features. I’m not sure what you are referring to when you say “standard acceptable style”. Can you provide some examples or resources?
There is not a way to style Cesium OSM buildings with an imported json file. You would need to style it programmatically with buildings.style.

Hi Liron,

By “acceptable OpenStreetMap color scheme” do you mean the designated colors in the OSM data itself? If so, that’s what you get by default when you use the createOsmBuildings, and you can see the effect in this Sandcastle: Cesium Sandcastle

New York has a lot of building colors, but unfortunately not every part of the world has such rich data.

You can see how this style is constructed here:

If you’re looking for some other style, you’ll have to give us some more details about what you’re after.

Hi again,
I appreciate your persistency explaining the “how”.
There are some standard colors that symbols buildings by their type.
Please look at OSM wiki.
I am trying to avoid manually creating the key value pair mapping and wondering if there is such a list already.
So, if you are aware of one, it will be extremely helpful. If you don’t, that also OK.

Thx!
Liron.

Ah cool, I wasn’t aware of this mapping. Though it looks like that might be specific to a particular OSM browser rather than a standard OSM thing. Either way, it looks useful! I don’t know of an existing style like this, but hopefully it’s not too hard to create one. Let us know how you go!

Kevin

No worries, I’ll have someone from my team assemble a key value pair based on OSM tables and write a simple function to return the collection as style object.
Lmk if you want me to share for the sake of all…

Liron

Yes please, that sounds very useful.