Skip to main content
Ctrl+K
pyufunc - Home pyufunc - Home
  • Getting started
  • API reference
  • Development
  • Release notes
  • Acknowledgements
  • GitHub
  • LinkedIn
  • Getting started
  • API reference
  • Development
  • Release notes
  • Acknowledgements
  • GitHub
  • LinkedIn
  • util_magic
  • util_data_processing
  • util_datetime
  • util_pathio
  • util_test
  • util_geo
    • pyufunc.calc_distance_on_unit_sphere
    • pyufunc.calc_distance_on_unit_haversine
    • pyufunc.find_k_nearest_points
    • pyufunc.find_closest_point
    • pyufunc.get_coordinates_from_geom
    • pyufunc.proj_point_to_line
    • pyufunc.cvt_wgs84_to_baidu09
    • pyufunc.cvt_wgs84_to_gcj02
    • pyufunc.cvt_gcj02_to_wgs84
    • pyufunc.cvt_gcj02_to_baidu09
    • pyufunc.cvt_baidu09_to_wgs84
    • pyufunc.cvt_baidu09_to_gcj02
    • pyufunc.create_circle_at_point_with_radius
    • pyufunc.calc_area_from_wkt_geometry
    • pyufunc.download_elevation_tif_by
    • pyufunc.gmns_Node
    • pyufunc.gmns_Link
    • pyufunc.gmns_POI
    • pyufunc.gmns_Zone
    • pyufunc.gmns_Agent
    • pyufunc.gmns_read_node
    • pyufunc.gmns_read_link
    • pyufunc.gmns_read_poi
    • pyufunc.gmns_read_zone
    • pyufunc.get_osm_place
    • pyufunc.get_osm_place
    • pyufunc.get_osm_by_relation_id
    • pyufunc.get_osm_by_bbox
    • pyufunc.extract_bbox_coordinates
  • util_git_pypi
  • util_img
  • util_log
  • util_network
  • util_office
  • util_ai
  • util_algorithm
  • util_pkgs
  • Third-party licenses
  • pkg_utils
  • API reference
  • util_geo
  • pyufunc.gmns_read_link

pyufunc.gmns_read_link#

pyufunc.gmns_read_link(link_file='', cpu_cores=-1, verbose=False)#

Read link.csv file and return a dict of Links.

Parameters:
  • link_file (str) – The link.csv file path. default is “”.

  • cpu_cores (int, optional) – number of cpu cores for parallel processing. Defaults to -1.

  • verbose (bool, optional) – print processing information. Defaults to False.

Raises:
  • FileNotFoundError – File: {link_file} does not exist.

  • ValueError – cpu_cores should be integer, but got {type(cpu_cores)}

Returns:

A dict of Links.

Return type:

dict

Examples

>>> from pyufunc import gmns_read_link
>>> link_dict = gmns_read_link(link_file = r"../dataset/ASU/link.csv")
>>> link_dict[1]
Link(id=1, name='A', from_node_id=1, to_node_id=2, length=0.0, lanes=1, dir_flag=1, free_speed=0.0,
capacity=0.0, link_type=1, link_type_name='motorway', geometry='LINESTRING (0 0, 1 1)')

previous

pyufunc.gmns_read_node

next

pyufunc.gmns_read_poi

On this page
  • gmns_read_link()
Show Source

© Copyright 2023 - 2026 , Xiangyong Luo.

Created using Sphinx 9.1.0.