I want to add additional speed values to my OSM data. There is a maxspeed value for some of the roads, but a lot of values are 'null'. Therefore, I would like to add additional values based on the OSM road type categorisation (e.g primary roads have a maximum speed of 90 in case the maxspeed value is 'null'). That way, I can make isochrone analysis based on more accurate maxspeed inputs.
So I tried the following in a virtual field of the OSM data using the expression builder:
If("maxspeed"is null) AND ("highway" = 'primary' ),90, if("maxspeed"is null) AND ("highway" = 'secondary'),50, "maxspeed")
This should then be done for every category, but the formula is not working. Could anyone help me out?