{"repo":"herrkaefer/psycopgr","free":true,"listed":false,"github":"https://github.com/herrkaefer/psycopgr","clone":"git clone https://github.com/herrkaefer/psycopgr.git","description":"A Python wrapper of pgRouting for routing from nodes to nodes on real map.","language":"Python","stars":29,"topics":["routing","postgresql","postgis","pgrouting","python-wrapper","openstreetmap","dijkstra","astar"],"license":"MIT","category":"databases-storage","readme_excerpt":"/ \\/ / / / / / \\/ \\/ / / / / / ( ) / / / / / / / / / / / / / / / / . / /\\ , /\\ /\\ / . /\\ , / / / / / / / / / / psycopgr is a Python wrapper of pgRouting with one purpose: Computing routes on real map for humans. Tested with - Python 3.6.5 - PostgreSQL 11.2 - PostGIS 2.5.2 - pgRouting 2.6.2 - osm2pgrouting 2.3.6 Preparation - Install PostgreSQL , PostGIS , and pgRouting - Create database to store map data - Import OpenStreet map data into database A step by step note can be found here. Installation or Routing with Python! First, create an PGRouting instance with database connection. Arguments are same as that psycopg2.connect() takes. Adjust meta datas of tables including the edge table properies if they are different from the default (only the different properties needs to be set), e.g.: This is the default meta data: Nodes are points on map which are represented by PgrNode namedtuple with geographic coordinates (longitude and latitude) rather than vague vertex id (vid) in the tables. PgrNodes is defined as: in which id could be None or self-defined value, and lon and lat are double precision values. For example: Now we can do routings! This is really straightforward: - end speed : speed from node to nearest vertices on ways in unit km/h. - gpx file : set it to output paths to a gpx file. The returned is a dict of dict: {(start node, end node): {'path': [PgrNode], 'cost': cost} By default, cost is traveling time along the path in unit second. It depends on the means of column","default_branch":null,"files":null,"tree":[],"storefront":"/r/herrkaefer","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/herrkaefer/psycopgr/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}