Skip to main content
Ctrl+K

openplaces

  • Overview
  • Get started
  • Examples
  • Reference
  • Contribute
  • Overview
  • Get started
  • Examples
  • Reference
  • Contribute

Section Navigation

  • openplaces
    • api
    • config
    • diagnostics
    • flow
      • dag
      • run_stage
      • scripts
      • submit
    • geo
      • address
      • ids
      • link
      • overlay
      • polygon
    • io
      • admin
      • aggregate
      • avenu_adapter
      • avenu_selectors
      • cleanup
      • curator
        • diagnostics
        • evidence
        • filters
        • formatters
        • imputers
        • indicators
        • inferers
        • occupancy
        • provenance
        • reconcilers
      • enricher
        • attributes
        • detectors
        • models
      • harmonizer
        • apportion
        • attributes
        • discover
        • filter
        • links
        • spine
      • ingester
        • cloud_geoparquet_ingester
        • image_ingester
        • raster_ingester
        • registry_ingester
        • table_ingester
      • parcel
      • readers
      • scrapers
        • US-WI_transaction-widor-2026_scraper
        • google_satellite
        • google_streetview
        • types
      • transform
    • path
    • recipe
    • timing
    • utils
    • viz
      • axes
      • colors
      • maps
      • tabulation
  • Recipe catalog
    • Global
    • Colombia
      • Antioquia
    • United States
      • Connecticut
      • Florida
      • Massachusetts
      • North Carolina
        • New Hanover
      • Texas
      • Vermont
      • Virginia
      • Wisconsin
  • Reference
  • openplaces
  • geo
  • link

link#

link.py

Entity linking: create ID linkages between two spatial entity datasets.

Functions#

get_entity_link_path(recipe_id_a, recipe_id_b[, admin_id])

Canonical on-disk path of the entity link between two recipes.

create_entity_link(entity1_recipe_id, entity2_recipe_id)

Create ID linkage (n-to-m) between two entities and save

Module Contents#

openplaces.geo.link.get_entity_link_path(recipe_id_a, recipe_id_b, admin_id=None)#

Canonical on-disk path of the entity link between two recipes.

The link is stored beside the finer entity’s output (ENTITY_LINK_ORDER, coarse to fine) as <finer_stem>_<coarser_recipe_id>.parquet, so the footprint-parcel link IS the parcel-footprint link: both argument orders resolve to the same path. Entity types outside the ordering and identical entity types fall back to lexicographic recipe-ID order.

Parameters:
  • recipe_id_a (str) – Recipe IDs of the two linked entities, in any order.

  • recipe_id_b (str) – Recipe IDs of the two linked entities, in any order.

  • admin_id (str or AdminId, optional) – Admin unit of the link. Truncated to the owning recipe’s save level to locate its output file, so a county-level admin_id works against a state- or country-level recipe.

openplaces.geo.link.create_entity_link(entity1_recipe_id, entity2_recipe_id, save=True, **kwargs)#

Create ID linkage (n-to-m) between two entities and save

Parameters:
  • entity1_recipe_id (str) – Recipe ID of first entity

  • entity2_recipe_id (str) – Recipe ID of second entity

  • save (bool) – If True, save output at the canonical link path resolved by get_entity_link_path (beside the finer entity’s output, regardless of argument order).

  • kwargs (dict) – Are passed to overlay_polygons or overlay_polygons_with_duckdb. When how='intersection' (default), iou=False (default), and geom=False (default), the DuckDB implementation is used because it is faster for Path inputs in that configuration; otherwise geopandas is used.

previous

ids

next

overlay

On this page
  • Functions
  • Module Contents
    • get_entity_link_path()
    • create_entity_link()

© Copyright 2025, Christoph Nolte.

Created using Sphinx 9.1.0.

Built with the PyData Sphinx Theme 0.20.0.