# spaghetti.PointPattern

class spaghetti.PointPattern(in_data=None, idvariable=None, attribute=False)

  A stub point pattern class used to store a point pattern.

  Note from the original author of `pysal.network`: 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{`python:str`, `python:list`, `python:tuple`, `libpysal.cg.Point`, `geopandas.GeoDataFrame`}

      The input geographic data. Either (1) a path to a shapefile (str); (2) an iterable containing `libpysal.cg.Point` objects; (3) a single `libpysal.cg.Point`; or (4) a `geopandas.GeoDataFrame`.

    idvariable `python:str`

      Field in the shapefile to use as an ID variable.

    attribute bool

      A flag to indicate whether all attributes are tagged to this class (`True`) or excluded (`False`). Default is `False`.

  Attributes:
    points `python:dict`

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

    npoints `python:int`

      The number of points.

    obs_to_arc `python:dict`

      Keys are arc IDs (tuple). Values are snapped point information (`dict`). Within the snapped point information (`dict`) keys are observation IDs (`int`), and values are snapped coordinates.

    obs_to_vertex `python:list`

      List of incident network vertices to snapped observation points converted from a `default_dict`. Originally in the form of paired left/right nearest network vertices {netvtx1: obs_id1, netvtx2: obs_id1, netvtx1: obs_id2… netvtx1: obs_idn}, then simplified to a list in the form [netvtx1, netvtx2, netvtx1, netvtx2, …].

    dist_to_vertex `python:dict`

      Keys are observations IDs (`int`). Values are distance lookup (`dict`). Within distance lookup (`dict`) keys are the two incident vertices of the arc and values are distance to each of those arcs.

    snapped_coordinates `python:dict`

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

    snap_dist bool

      Flag as `True` to 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)

  Methods

  `__init__`([in_data, idvariable, attribute]) |