Custom Models with Specific Road Names

Hi there,

I’m relatively new to GH, but find it very powerful tool.

My question is about using specific road names in custom model JSONs. I tried “road_name” key which turned out to be invalid. Please find an example below.

{
    "priority": [
        {
            "if": "!car_access",
            "multiply_by": "0"
        },
        {
            "if": "road_access == PRIVATE",
            "multiply_by": "0.1"
        }
    ],
    "speed": [
        {
            "if": "road_class == MOTORWAY && road_name == Anadolu Otoyolu",
            "limit_to": 70
        },
        {
            "else_if": "road_class == TRUNK",
            "limit_to": 50
        },
        {
            "else_if": "road_class == PRIMARY",
            "limit_to": 30
        },
        {
            "else_if": "road_class == SECONDARY",
            "limit_to": 25
        },
        {
            "else_if": "road_class == TERTIARY",
            "limit_to": 20
        },
		{
            "else_if": "road_class == RESIDENTIAL",
            "limit_to": 15
        },
        {
            "else": "",
            "limit_to": 60
        }
    ]
}

![Screenshot_2|237x500](upload://wpBSTsEf3G5FGNH2IrzSPBq9u3m.png)


what is your goal? why would you need the road names?

the available encoded values / road attributes show up if you press STRG + SPACE

more info here:

1 Like

This is a valid use case: changing the speed of bigger motorway by name. Unfortunately currently there is no support for selecting roads by name in a custom model. A possible workaround might be drawing an area around the motorway and using the ‘areas’ feature of the custom model.

Suppose I have historical GPS data collected from vehicle tracking system for a set of vehicles. Naturally, vehicles tend to use same roads within the city. To integrate actual traffic data, I need to be able assign average speeds to specific road segments, depending on the time of the day and the day of week, etc.