def process_roads()

in gemini/agents/research-multi-agents/ev_agent/api_handler/api_01_NeighborhoodSummary.py [0:0]


    def process_roads(elements: List[Dict]) -> RoadNetwork:
        roads = RoadNetwork()
        for element in elements:
            if element.get("type") != "way":
                continue

            tags = element.get("tags", {})
            if "highway" in tags:
                if tags["highway"] == "motorway":
                    roads.motorways += 1
                elif tags["highway"] == "trunk":
                    roads.trunks += 1
                elif tags["highway"] == "primary":
                    roads.primary_roads += 1
                elif tags["highway"] == "secondary":
                    roads.secondary_roads += 1
                elif tags["highway"] == "tertiary":
                    roads.tertiary_roads += 1
                elif tags["highway"] == "residential":
                    roads.residential_roads += 1
                elif tags["highway"] == "service":
                    roads.service_roads += 1
                elif tags["highway"] == "cycleway":
                    roads.cycleways += 1
                elif tags["highway"] == "footway":
                    roads.footways += 1

            if tags.get("bridge") == "yes":
                roads.bridges += 1
            if tags.get("tunnel") == "yes":
                roads.tunnels += 1
        return roads