SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2007.09547 · 2020

Sat2Graph: Road Graph Extraction through Graph-Tensor Encoding

arXiv · PDF · Open in the Atlas

Code that ran

9 of 15 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 0 failures of our instrument; 6 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2007.09547.json · badge: /api/ran/2007.09547.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
songtaohe/Sat2Graph community (classifier label)
classifier basis not recorded on the link
9 ran · 6 no recorded run
FunctionStatusWhere it lives
distance Ran
ran on a synthesized input
songtaohe/Sat2Graph/model/douglasPeucker.py
code served (permissive licence) · get_code("f17d07d137a2bf6d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math

# The function distance takes two points p1 and p2
# Each point is expected to be indexable (like a tuple or list) with at least 2 elements
# It accesses p1[0], p1[1], p2[0], p2[1]

p1 = (3.0, 4.0)
p2 = (0.0, 0.0)

ARGS = {
    "p1": p1,
    "p2": p2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
douglasPeucker Ran
ran on a synthesized input
songtaohe/Sat2Graph/model/douglasPeucker.py
code served (permissive licence) · get_code("8e0f3f8c25ac050d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math

def distance(p1, p2):
    a = p1[0] - p2[0]
    b = p1[1] - p2[1]
    return math.sqrt(a * a + b * b)

def point2lineDistance(p, n1, n2):
    l = distance(n1, n2)
    v1 = [n1[0] - p[0], n1[1] - p[1]]
    v2 = [n2[0] - p[0], n2[1] - p[1]]
    area = abs(v1[0] * v2[1] - v1[1] * v2[0])
    return area / l

def douglasPeucker(node_list, e=5):
    new_list = []
    if len(node_list) <= 2:
        return node_list
    best_i = 1
    best_d = 0
    for i in range(1, len(node_list) - 1):
        d = point2lineDistance(node_list[i], node_list[0], node_list[-1])
        if d > best_d:
            best_d = d
            best_i = i
    if best_d <= e:
        return [node_list[0], node_list[-1]]
    new_list = douglasPeucker(node_list[0:best_i + 1], e=e)
    new_list = new_list[:-1] + douglasPeucker(node_list[best_i:len(node_list)], e=e)
    return new_list

node_list = [
    [0.0, 0.0],
    [1.0, 0.5],
    [2.0, 0.1],
    [3.0, 2.0],
    [4.0, 1.9],
    [5.0, 5.0]
]

e = 0.5

ARGS = {
    "node_list": node_list,
    "e": e
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
neighbor_to_integer Ran
ran on a synthesized input
songtaohe/Sat2Graph/model/dataloader.py
code served (permissive licence) · get_code("6ae08c71ceab86ac")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# Analyze the function: neighbor_to_integer takes n_in which is a dict
# Keys are tuples that can be converted to (int, int)
# Values are lists of tuples that can be converted to (int, int)
# The function converts all keys and values to integer tuples and deduplicates

# Create a valid n_in argument
n_in = {
    ("0", "1"): [("2", "3"), ("4", "5"), ("2", "3")],  # Duplicate ("2", "3")
    ("1", "2"): [("5", "6"), ("7", "8")],
    ("3", "4"): [("1", "0"), ("1", "0")],  # Duplicate ("1", "0")
}

ARGS = {
    "n_in": n_in
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
neighbor_transpos Ran
ran on a synthesized input
songtaohe/Sat2Graph/model/dataloader.py
code served (permissive licence) · get_code("354adc10fe3e30a6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function expects n_in to be a dict where:
# - Keys are tuples of two elements (k[0], k[1])
# - Values are lists of tuples, where each tuple has two elements (_v[0], _v[1])
# The function transposes both the keys and the values

n_in = {
    (0, 1): [(2, 3), (4, 5)],
    (6, 7): [(8, 9), (10, 11)],
    (12, 13): [(14, 15)]
}

ARGS = {
    "n_in": n_in
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
neighbors_cos Ran
ran on a synthesized input
songtaohe/Sat2Graph/model/common.py
code served (permissive licence) · get_code("2463483470e5df9a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math

# Analyzing the function neighbors_cos:
# - neighbors: parameter is passed to neighbors_norm, which is called but neighbors itself isn't used
# - k1: tuple/coordinate accessed as k1[0], k1[1]
# - k2: tuple/coordinate accessed as k2[0], k2[1]
# - k3: tuple/coordinate accessed as k3[0], k3[1]

# The function computes cosine similarity between two vectors formed by points
# k1, k2, k3 (treated as 2D coordinates)

ARGS = {
    "neighbors": None,  # not actually used in the function body
    "k1": (1.0, 2.0),   # 2D point
    "k2": (3.0, 4.0),   # 2D point
    "k3": (5.0, 6.0),   # 2D point
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
neighbors_dist Ran
ran on a synthesized input
songtaohe/Sat2Graph/model/common.py
code served (permissive licence) · get_code("3f429d04fd4a29a9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math

def neighbors_dist(neighbors, k1, k2):
    a = k1[0] - k2[0]
    b = k1[1] - k2[1]
    return math.sqrt(a * a + b * b)

# k1 and k2 are indexed with [0] and [1], so they need at least 2 elements
# neighbors is passed but never used in the function body
# k1 and k2 appear to be coordinate pairs (x, y)

ARGS = {
    "neighbors": [],
    "k1": [1.5, 2.5],
    "k2": [4.0, 6.0]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
neighbors_norm Ran
ran on a synthesized input
songtaohe/Sat2Graph/model/common.py
code served (permissive licence) · get_code("cf9b0cfd9e2fd33d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math

torch_manual_seed = 0

# Analyzing the function neighbors_norm:
# - Takes parameters: neighbors, k1, k2
# - k1 and k2 are used with indexing [0] and [1], so they are tuples/lists with at least 2 elements
# - neighbors is passed to neighbors_dist but never used in its body
# - k1 and k2 are 2D coordinate pairs

neighbors = None  # Not used in the function body

k1 = (3.0, 4.0)  # First coordinate pair (x, y)

k2 = (0.0, 0.0)  # Second coordinate pair (x, y)

ARGS = {
    "neighbors": neighbors,
    "k1": k1,
    "k2": k2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
point2lineDistance Ran
ran on a synthesized input
songtaohe/Sat2Graph/model/douglasPeucker.py
code served (permissive licence) · get_code("0ba1f1355e58a03a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math

def distance(p1, p2):
    a = p1[0] - p2[0]
    b = p1[1] - p2[1]
    return math.sqrt(a * a + b * b)

def point2lineDistance(p, n1, n2):
    l = distance(n1, n2)
    v1 = [n1[0] - p[0], n1[1] - p[1]]
    v2 = [n2[0] - p[0], n2[1] - p[1]]
    area = abs(v1[0] * v2[1] - v1[1] * v2[0])
    return area / l

ARGS = {
    "p": [1.0, 2.0],
    "n1": [0.0, 0.0],
    "n2": [3.0, 4.0]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
rotate Ran
ran on a synthesized input
songtaohe/Sat2Graph/model/dataloader.py
code served (permissive licence) · get_code("8497355b5a261d12")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import math

# Create a small satellite image (2048x2048 as used in the function)
sat_img = np.random.randint(0, 256, (2048, 2048, 3), dtype=np.uint8)

# Create a ground truth segmentation map
gt_seg = np.random.randint(0, 2, (2048, 2048), dtype=np.uint8)

# Create neighbors dictionary with sample points
# Keys are tuples representing positions, values are lists of neighbor positions
neighbors = {
    (500, 500): [(510, 500), (500, 510), (490, 500)],
    (1000, 1000): [(1010, 1000), (1000, 1010)],
    (1500, 1500): [(1510, 1500), (1500, 1510), (1490, 1500), (1500, 1490)]
}

# Create samplepoints dictionary
# Keys are identifiers, values are lists of point coordinates
samplepoints = {
    'region_1': [(600, 600), (650, 650), (700, 700)],
    'region_2': [(1100, 1100), (1150, 1150)],
    'region_3': [(1600, 1600), (1650, 1650), (1700, 1700)]
}

ARGS = {
    'sat_img': sat_img,
    'gt_seg': gt_seg,
    'neighbors': neighbors,
    'samplepoints': samplepoints,
    'angle': 45,
    'size': 2048
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
anglediff Not yet run
unverified (harvested, no recorded run)
songtaohe/Sat2Graph/model/decoder.py
code served (permissive licence) · get_code("6ca6a8b9a21ab584")
How it ran

no invocation recorded.

glorot Not yet run
unverified (harvested, no recorded run)
songtaohe/Sat2Graph/model/tf_common_layer.py
code served (permissive licence) · get_code("db1a1fef3f66db9e")
How it ran

no invocation recorded.

graph_refine Not yet run
unverified (harvested, no recorded run)
songtaohe/Sat2Graph/model/decoder.py
code served (permissive licence) · get_code("5a6bb7d302f3d329")
How it ran

no invocation recorded.

uniform Not yet run
unverified (harvested, no recorded run)
songtaohe/Sat2Graph/model/tf_common_layer.py
code served (permissive licence) · get_code("412439874d75a376")
How it ran

no invocation recorded.

vNorm Not yet run
unverified (harvested, no recorded run)
songtaohe/Sat2Graph/model/decoder.py
code served (permissive licence) · get_code("4527457b7f49194a")
How it ran

no invocation recorded.

zeros Not yet run
unverified (harvested, no recorded run)
songtaohe/Sat2Graph/model/tf_common_layer.py
code served (permissive licence) · get_code("b1cae89b7ac10150")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 15 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Inferring road graphs from satellite imagery is a challenging computer vision task. Prior solutions fall into two categories: (1) pixel-wise segmentation-based approaches, which predict whether each pixel is on a road, and (2) graph-based approaches, which predict the road graph iteratively. We find that these two approaches have complementary strengths while suffering from their own inherent limitations. In this paper, we propose a new method, Sat2Graph, which combines the advantages of the two prior categories into a unified framework. The key idea in Sat2Graph is a novel encoding scheme, graph-tensor encoding (GTE), which encodes the road graph into a tensor representation. GTE makes it possible to train a simple, non-recurrent, supervised model to predict a rich set of features that capture the graph structure directly from an image. We evaluate Sat2Graph using two large datasets. We find that Sat2Graph surpasses prior methods on two widely used metrics, TOPO and APLS. Furthermore, whereas prior work only infers planar road graphs, our approach is capable of inferring stacked roads (e.g., overpasses), and does so robustly.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2007.09547")
get_code_for_paper("2007.09547")
have("2007.09547")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2007.09547.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2007.09547.svg)](https://syntology.ai/paper/2007.09547)

Connect an agent — have() is free.