{
    "circuit": {
        "slug": "motorland-aragon",
        "name": "MotorLand Aragón"
    },
    "licence": {
        "name": "Open Database Licence 1.0",
        "url": "https://opendatacommons.org/licenses/odbl/1-0/"
    },
    "attribution": "© OpenStreetMap contributors",
    "source": "OpenStreetMap, through the Overpass API",
    "search": {
        "query": "way[\"highway\"=\"raceway\"] within the given distance of the given point",
        "around": {
            "latitude": 41.0775,
            "longitude": -0.209,
            "metres": 2500
        },
        "skip_ways": [
            871207237,
            871207238
        ]
    },
    "fetched_at": "2026-11-09T15:46:57Z",
    "ways": [
        {
            "id": 193797400,
            "version": 5
        },
        {
            "id": 230256659,
            "version": 2
        },
        {
            "id": 230256660,
            "version": 3
        },
        {
            "id": 230256661,
            "version": 4
        },
        {
            "id": 230258022,
            "version": 5
        },
        {
            "id": 230261828,
            "version": 7
        },
        {
            "id": 863006820,
            "version": 1
        },
        {
            "id": 863006821,
            "version": 1
        },
        {
            "id": 863006824,
            "version": 1
        },
        {
            "id": 1418978354,
            "version": 1
        },
        {
            "id": 1418982615,
            "version": 1
        },
        {
            "id": 1418982616,
            "version": 1
        },
        {
            "id": 1418983512,
            "version": 1
        },
        {
            "id": 1418983513,
            "version": 1
        },
        {
            "id": 1418983514,
            "version": 1
        },
        {
            "id": 1418983515,
            "version": 1
        },
        {
            "id": 1418983516,
            "version": 1
        },
        {
            "id": 1418983517,
            "version": 1
        }
    ],
    "reproducible": true,
    "join": {
        "method": "fetch-circuit-outlines",
        "published_length_km": 5.345,
        "steps": [
            "Ask the Overpass API for the OpenStreetMap ways tagged highway=raceway within \"around.metres\" of \"around.latitude\" and \"around.longitude\", as OpenStreetMap held them on \"fetched_at\" (the date setting [date:\"<fetched_at>\"]), with their geometry.",
            "Keep the ways that are the lap. Leave out the ways in \"skip_ways\", a pit lane (service=pit_lane or raceway=pit_lane), an area (area=yes), a way named for a pit lane, a bypass, a go-kart or a rally track, and a way for another sport than motor racing. The ways left are the ones listed in \"ways\", at the versions given there.",
            "Make a junction of each end of a way and each node that two ways or two places in a way share. Junctions within 6 m of each other are one. Cut every way at its junctions: each piece is an edge that runs both ways.",
            "Find every simple closed loop of edges, one that visits no junction twice, no longer than 1.12 times \"published_length_km\". Keep the loop at least 0.88 times that long whose length is nearest it. The loop must close within 12 m.",
            "Close the loop on itself: drop its last point when that lies within 12 m of its first, since the path closes the loop, not a repeat. Put every point on a plane around the mean point of the loop: x is the longitude difference in degrees times pi/180 times 6,371,000 m times the cosine of the mean latitude, and y is the latitude difference times pi/180 times 6,371,000 m, so north is up.",
            "Cut out each dead end the loop runs along and back, up to 250 m long and within 5 m of where it left. Look again from the middle of the loop, so a dead end over its first point is found too.",
            "Thin the line with the Douglas-Peucker method to at most 200 points: split the closed loop at the point farthest from its first point, and keep the smallest tolerance that leaves 200 points or fewer.",
            "Remove the tip of any dead end that is left: a point where the line turns back by more than 150 degrees and one of its two legs is shorter than 4% of the longer side of the line's extent. Repeat until none is left.",
            "Fit the line into a box 1000 units on its longer side, north up, and round each coordinate to a whole unit. The outline is that line, closed."
        ]
    },
    "geojson_on_request": "hello@apexscout.app"
}