pysal.explore.spaghetti.PointPattern

class pysal.explore.spaghetti.PointPattern(in_data=None, idvariable=None, attribute=False)[source]

A stub point pattern class used to store a point pattern. This class is monkey patched with network specific attributes when the points are snapped to a network. In the future this class may be replaced with a generic point pattern class.

Parameters:
in_data : geopandas.GeoDataFrame or str

The input geographic data. Either (1) a path to a shapefile (str); or (2) a geopandas.GeoDataFrame.

idvariable : str

Field in the shapefile to use as an id variable.

attribute : bool

{False, True} A flag to indicate whether all attributes are tagged to this class.

Attributes:
points : dict

Keys are the point ids (int). Values are the x,y coordinates (tuple).

npoints : int

The number of points.

obs_to_edge : dict

Keys are edge ids (tuple). Values are snapped point information (dict). Withing the snapped point information (dict) keys are observation id (int), and values are snapped coordinates.

obs_to_node : list

list of incident network nodes to snapped observation points converted from default_dict. Originally in the form of paired left/right nearest network nodes - {netnode1: obs_id1, netnode2: obs_id1, netnode1: obs_id2… netnode1: obs_idn}, then simplified to a list in the form - [netnode1, netnode2, netnode1, netnode2, …].

dist_to_node : dict

Keys are observations ids (int). Values are distance lookup (dict). Within distance lookup (dict) keys are the two incident nodes of the edge and values are distance to each of those edges.

snapped_coordinates : dict

Keys are the point ids (int). Values are the snapped x,y coordinates (tuple).

snap_dist : bool

include the distance from the original location to the snapped location along the network. Default is False.

__init__(in_data=None, idvariable=None, attribute=False)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__([in_data, idvariable, attribute]) Initialize self.