aequilibrae.project.network.Nodes#

class aequilibrae.project.network.Nodes(net)[source]#

Access to the API resources to manipulate the nodes table in the network

>>> project = create_example(project_path)

>>> all_nodes = project.network.nodes

# We can just get one link in specific
>>> node = all_nodes.get(21)

# We can save changes for all nodes we have edited so far
>>> all_nodes.save()
__init__(net)[source]#

Methods

__init__(net)

extent()

Queries the extent of the layer included in the model

get(node_id)

Get a node from the network by its node_id

new_centroid(node_id)

Creates a new centroid with a given ID

refresh()

Refreshes all the nodes in memory

refresh_fields()

After adding a field one needs to refresh all the fields recognized by the software

save()

Attributes

data

Returns all nodes data as a Pandas DataFrame

fields

Returns a FieldEditor class instance to edit the zones table fields and their metadata

lonlat

Returns all nodes lon/lat coords as a Pandas DataFrame

sql

Query sql for retrieving nodes

extent() Polygon#

Queries the extent of the layer included in the model

Returns:

model extent (Polygon): Shapely polygon with the bounding box of the layer.

get(node_id: int) Node[source]#

Get a node from the network by its node_id

It raises an error if node_id does not exist

Arguments:

node_id (int): ID of a node to retrieve

Returns:

node (Node): Node object for requested node_id

new_centroid(node_id: int) Node[source]#

Creates a new centroid with a given ID

Arguments:

node_id (int): ID of the centroid to be created

refresh()[source]#

Refreshes all the nodes in memory

refresh_fields() None[source]#

After adding a field one needs to refresh all the fields recognized by the software

save()[source]#
property data: GeoDataFrame#

Returns all nodes data as a Pandas DataFrame

Returns:

table (GeoDataFrame): GeoPandas GeoDataFrame with all the nodes

property fields: FieldEditor#

Returns a FieldEditor class instance to edit the zones table fields and their metadata

property lonlat: DataFrame#

Returns all nodes lon/lat coords as a Pandas DataFrame

Returns:

table (DataFrame): Pandas DataFrame with all the nodes, with geometry as lon/lat

sql = ''#

Query sql for retrieving nodes