fetch_sfm_cluster

fetch_sfm_cluster#

rapidtools.processing.street_structures.fetch_sfm_cluster(cluster_id: str, url: str, cache_dir: str | Path | None = None, timeout: float = 120.0) → PointCloud | None[source]#

Download (or read from cache_dir) one point-cloud cluster.

Clusters are a few megabytes and cover about a hundred meters of driving. The parsed arrays are cached as <cluster_id>.npz, so a second run over the same streets downloads nothing.

Parameters:
  • cluster_id – Mapillary cluster identifier (cache key).

  • url – Signed download address from an image’s sfm_cluster field.

  • cache_dir – Folder for the cache; nothing is cached when None.

  • timeout – Download timeout in seconds.

Returns:

PointCloud | None – The cluster, or None when it could not be downloaded or parsed.

Example

>>> cloud = fetch_sfm_cluster('10937891', url, 'cache')
>>> len(cloud.points)
75208