Skip to main content
Ctrl+K

AequilibraE

    • Main menu
    • The AequilibraE Project
    • Run module
    • Network manipulation
    • Distribution Procedures
    • Path Computation
    • Traffic Assignment
    • Public Transport
    • Route choice
    • Other Applications
  • Python
  • QGIS
  • GitHub
    • Main menu
    • The AequilibraE Project
    • Run module
    • Network manipulation
    • Distribution Procedures
    • Path Computation
    • Traffic Assignment
    • Public Transport
    • Route choice
    • Other Applications
  • Python
  • QGIS
  • GitHub

Section Navigation

  • aequilibrae
    • aequilibrae.context
    • aequilibrae.distribution
    • aequilibrae.log
    • aequilibrae.matrix
    • aequilibrae.parameters
    • aequilibrae.paths
    • aequilibrae.project
      • aequilibrae.project.about
      • aequilibrae.project.basic_table
      • aequilibrae.project.data
      • aequilibrae.project.data_loader
      • aequilibrae.project.database_connection
      • aequilibrae.project.field_editor
      • aequilibrae.project.network
        • aequilibrae.project.network.connector_creation
        • aequilibrae.project.network.gmns_builder
        • aequilibrae.project.network.gmns_exporter
        • aequilibrae.project.network.haversine
        • aequilibrae.project.network.link
        • aequilibrae.project.network.link_type
        • aequilibrae.project.network.link_types
        • aequilibrae.project.network.links
        • aequilibrae.project.network.mode
        • aequilibrae.project.network.modes
        • aequilibrae.project.network.network
        • aequilibrae.project.network.node
        • aequilibrae.project.network.nodes
        • aequilibrae.project.network.osm
        • aequilibrae.project.network.period
        • aequilibrae.project.network.periods
        • aequilibrae.project.network.safe_class
      • aequilibrae.project.project
      • aequilibrae.project.project_cleaning
      • aequilibrae.project.project_creation
      • aequilibrae.project.scenario
      • aequilibrae.project.table_loader
      • aequilibrae.project.tools
      • aequilibrae.project.zone
      • aequilibrae.project.zoning
    • aequilibrae.reference_files
    • aequilibrae.transit
    • aequilibrae.utils
  • aequilibrae.project.network.link

aequilibrae.project.network.link#

Classes

Link(dataset, project)

A Link object represents a single record in the links table

class aequilibrae.project.network.link.Link(dataset, project)[source]#

A Link object represents a single record in the links table

>>> project = create_example(project_path)

>>> all_links = project.network.links

# Let's get a mode to work with
>>> modes = project.network.modes
>>> car_mode = modes.get('c')

# We can just get one link in specific
>>> link1 = all_links.get(3)
>>> link2 = all_links.get(17)

# We can find out which fields exist for the links
>>> which_fields_do_we_have = link1.data_fields()

# And edit each one like this
>>> link1.lanes_ab = 3
>>> link1.lanes_ba = 2

# we can drop a mode from the link
>>> link1.drop_mode(car_mode)  # or link1.drop_mode('c')

# we can add a mode to the link
>>> link2.add_mode(car_mode)  # or link2.add_mode('c')

# Or set all modes at once
>>> link2.set_modes('cbtw')

# We can just save the link
>>> link1.save()
>>> link2.save()

>>> project.close()
add_mode(mode: str | Mode)[source]#

Adds a new mode to this link

Raises a warning if mode is already allowed on the link, and fails if mode does not exist

Arguments:

mode_id (str or Mode): Mode_id of the mode or mode object to be added to the link

data_fields() → list[source]#

lists all data fields for the link, as available in the database

Returns:

data fields (list): list of all fields available for editing

delete()[source]#

Deletes link from database

drop_mode(mode: str | Mode)[source]#

Removes a mode from this link

Raises a warning if mode is already NOT allowed on the link, and fails if mode does not exist

Arguments:

mode_id (str or Mode): Mode_id of the mode or mode object to be removed from the link

save(conn=None)[source]#

Saves link to database

set_modes(modes: str)[source]#

Sets the modes acceptable for this link

Arguments:

modes (str): string with all mode_ids to be assigned to this link

On this page
  • Link
    • Link.add_mode()
    • Link.data_fields()
    • Link.delete()
    • Link.drop_mode()
    • Link.save()
    • Link.set_modes()

This Page

  • Show Source

© Copyright 2025-09-09, AequilibraE developers.

Created using Sphinx 8.1.3.

Built with the PyData Sphinx Theme 0.16.1.