# cityseer.structures

The `structures`

module defines data structures used by the lower-level `cityseer`

API.

The data structures defined in this modules are created and managed automatically by the user-facing API. It is therefore not necessary to create these structures directly unless interaction the lower-level API is intentional.

## NodeMap

`NodeMap`

structure representing the `x`

, `y`

, and `live`

information for the network.

Each attribute contains a `numpy`

array with indices corresponding to the graph’s node indices.

It is not necessary to invoke this class directly if using a `NetworkStructure`

class, which will generate the `NodeMap`

implicitly.

### Properties

### Methods

## NodeMap.__init__

Instance a `NodeMap`

.

### Parameters

The number of nodes to be contained by this `NodeMap`

instance.

## NodeMap.x_y

Return the `x`

and `y`

coordinates for a given node index.

### Parameters

The node index for which to return `x`

and `y`

coordinates.

### Returns

`x`

coordinate.

`y`

coordinate.

## NodeMap.validate

Validate this `NodeMap`

instance.

## EdgeMap

`EdgeMap`

structure containing edge (segment) information for the network.

Each attribute contains a `numpy`

array with indices corresponding to the graph’s edges.

It is not necessary to invoke this class directly if using a `NetworkStructure`

class, which will generate the `EdgeMap`

implicitly.

### Properties

### Methods

## EdgeMap.__init__

Create an `EdgeMap`

instance.

### Parameters

The number of edges to be contained by this `EdgeMap`

instance.

## EdgeMap.validate

Validate this Edgemap instance.

## NetworkStructure

`NetworkStructure`

instance consisting of `nodes`

, `edges`

and `node_edge_map`

attributes.

Each of these attributes will be created automatically when instancing this class.

### Properties

### Methods

## NetworkStructure.__init__

Instances a `NetworkStructure`

.

### Parameters

The number of nodes this `NetworkStructure`

will contain.

The number of edges this `NetworkStructure`

will contain.

## NetworkStructure.set_node

Add a node to the `NetworkStructure`

.

### Parameters

The index at which to add the node.

The `x`

coordinate for the added node.

The `y`

coordinate for the added node.

The `live`

node attribute identifies nodes falling within the areal boundary of interest as opposed to those that fall within the surrounding buffered area. See the edge-rolloff section in the guide.

## NetworkStructure.set_edge

Add an edge to the `NetworkStructure`

. Edges are directed, meaning that each bidirectionaly street is represented twice: once in each direction; start/end nodes and in/out bearings will differ accordingly.

### Parameters

Index for the starting node for the added edge.

Index for the ending node for the added edge.

The `length`

edge attribute should always correspond to the edge lengths in metres. This is used when calculating the distances traversed by the shortest-path algorithm so that the respective $d_{max}$ maximum distance thresholds can be enforced: these distance thresholds are based on the actual network-paths traversed by the algorithm as opposed to crow-flies distances.

The `angle_sum`

edge bearing should correspond to the total angular change along the length of the segment. This is used when calculating angular impedances for simplest-path measures. The `in_bearing`

and `out_bearing`

attributes respectively represent the starting and ending bearing of the segment. This is also used when calculating simplest-path measures when the algorithm steps from one edge to another.

The `imp_factor`

edge attribute represents an impedance multiplier for increasing or diminishing the impedance of an edge. This is ordinarily set to 1, therefor not impacting calculations. By setting this to greater or less than 1, the edge will have a correspondingly higher or lower impedance. This can be used to take considerations such as street gradients into account, but should be used with caution.

The edge’s inwards angular bearing.

The edge’s outwards angular bearing.

## NetworkStructure.validate

Validate Network Structure.

## DataMap

`NodeMap`

instance representing the `x`

, `y`

data coordinates and the nearest adjacent network node indices.

Each attribute contains a `numpy`

array with indices corresponding to the graph’s node indices.

### Properties

### Methods

## DataMap.__init__

Instance a `DataMap`

.

### Parameters

The number of data points to be contained by this `DataMap`

instance.

## DataMap.set_data_point

Add a data point.

### Parameters

The index for the added node.

The x coordinate for the added node.

The y coordinate for the added node.

An optional key for each datapoint. Used for deduplication.

## DataMap.x_y

Return the `x`

and `y`

coordinates for a given data point index.

### Parameters

The data point index for which to return `x`

and `y`

coordinates.

### Returns

`x`

coordinate.

`y`

coordinate.

## DataMap.validate

Validate this `DataMap`

instance.

### Parameters

Whether to check if data points have been assigned to a network.