Coder Social home page Coder Social logo

pgrouting-contrib's Introduction

pgRouting - Routing on PostgreSQL

Join the chat at https://gitter.im/pgRouting/pgrouting Join discourse

Branches

  • The main branch has the development of the next micro release
  • The develop branch has the development of the next minor/major release

For the complete list of releases go to: https://github.com/pgRouting/pgrouting/releases

For the release notes go to: https://docs.pgrouting.org/latest/en/release_notes.html

LINKS

STATUS

Status of the project can be found here

INTRODUCTION

pgRouting extends the PostGIS/PostgreSQL geospatial database to provide geospatial routing and other network analysis functionality.

This library contains the following features:

  • All Pairs Shortest Path Algorithms
  • A-star algorithm
  • Bi-directional algorithms
  • A variety of applications of Dijkstra algorithms
    • Cost functions
    • With points
  • Driving Distance
    • With points
  • Yen's algorithm
  • Traveling Sales Person (TSP)

and many more.

The latest documentation: https://docs.pgrouting.org/latest

REQUIREMENTS

Building requirements

  • perl
  • C and C++ compilers
    • Compiling with Boost 1.56 up to Boost 1.74 requires C++ Compiler with C++03 or C++11 standard support
    • Compiling with Boost 1.75 requires C++ Compiler with C++14 standard support
  • Postgresql = Supported version by PostgreSQL
  • The Boost Graph Library (BGL) >= 1.56
  • CMake >= 3.2
  • 7.0 > Sphinx >= 4.0.0

User's requirements

  • PostGIS

COMPILATION

For MinGW on Windows

mkdir build
cd build
cmake -G"MSYS Makefiles" ..
make
make install

Also pre-built Windows binaries can be downloaded from https://postgis.net/windows_downloads

For Linux

mkdir build
cd build
cmake  ..
make
sudo make install

Build with documentation (requires Sphinx)

cmake -DWITH_DOC=ON ..

Postgresql

createdb mydatabase
psql mydatabase -c "CREATE EXTENSION pgrouting CASCADE"

USAGE

See online documentation: http://docs.pgrouting.org/latest/en/index.html

LICENSE

  • Most features are available under GPL-2.0-or-later
  • Some Boost extensions are available under Boost license (see LICENSE_1_0.txt)
  • Some code contributed by iMaptools.com is available under MIT-X license.

pgrouting-contrib's People

Contributors

dkastl avatar fredj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pgrouting-contrib's Issues

Missing second argument in geometryfromtext results in SRID "-1"

I have found what appears to be a problem in one of the routing_core_smart functions.

In the function locate_point_as_geometry there are two lines which call the function geometryfromtext.

These functions are called when line_substring returns a point.

In the geometryfromtext function calls, there is no second argument for the srid. This produces a geometry with a “-1” for the srid.

When I use shootingstar_smart in my script, MapServer fails on trying to work with two geometries with different srids.

Adding the second argument to the geometryfromtext function fixed this problem. The only geometry with the “-1” srid was the one created by these function calls.

Reference: http://lists.osgeo.org/pipermail/pgrouting-users/2011-December/000879.html

PL/pgSQL error inshootingstar_sp_smart

hello

Im using the shootingstar_sp_smart in a project but I noticed my Postgres log are getting cluttered by such kind of error messages:

ERROR: cannot EXECUTE a null querystring
CONTEXT: PL/pgSQL function "shootingstar_sp_smart" line 102 at FOR over EXECUTE statement
PL/pgSQL function "shootingstar_sp_smart" line 5 at FOR over EXECUTE statement

the problem occur when the start or end point is away from any arcs of the network, so I would expect a null or zero sized result instead of the PL/pgSQL error.

I have prepared a simplified set of data to demonstrate the problem, as postgres dump and as shapefile:
http://dev.camptocamp.com/files/shootingstar_sp_smart/
The postgres dump was done on a Postgres 8.3 with the -F c option.

here are two sql queries, one work as expected (one path found), the other crash (no path found):

path ok:

SELECT astext(ST_Collect(ST_LineMerge(the_geom))) AS geom FROM
shootingstar_sp_smart('arcs', 659823.0, 165715.0,
659843.0, 164255.0, 200.0, E'ST_SetSRID(''''''''BOX3D(651383.0 154535.0, 679523.0 170415.0)''''''''::box3d, 21781)',
E'length * (CASE WHEN wander_n THEN 0.01 WHEN wander_r THEN 0.01 WHEN wander_l THEN 0.01 WHEN ww THEN 0.01 WHEN klass_1 THEN 1.0 WHEN klass_2 THEN 1.0 ELSE 1.0 END)', FALSE, FALSE);

result:

MULTILINESTRING((659823 165715,659813.652377407 165728.155068868),(659813.652377407 165728.155068868,659826.1 165737,659860.9 165727.7,659903.4 165746.5,659917.4 165744.5,659900.6 165728,659923.1 165735.5,659935.6 165727.5,659892.9 165699,659890.6 165690.2,659968.6 165696.1),(659836.362033598 164255.445833564,659836.5 164257.5,659889.3 164344.4,659890.2 164375.5,659865.5 164388.2,659860.7 164405.7,659871.2 164425.7,659863.2 164456.5,659899.7 164511.5,659881.7 164543.5,659893.5 164645.5,659961.5 164723.7,660003.5 164790.5,660024.7 164802,660048 164828.7,660074.7 164882.5,660143 164941.7,660178 164979.2,660190.5 165006.2,660206.2 165008.7,660243.5 165063.5,660269.2 165082.2,660280.7 165123.2,660261.7 165190.7,660209 165217.7,660211.2 165239.2,660199 165257.2,660199 165275.5,660177.2 165287,660198.7 165305,660174.7 165331.2,660182.2 165340.2,660202.7 165344,660205.2 165355,660195 165370.5,660194.2 165395.5,660171 165397.2,660184 165414.5,660178.3 165419.6,660182 165433.7,660163 165441.2,660132.2 165434.7,660098.2 165451,660049.2 165439,660023.6 165440.8,659989.5 165500.5,659985.7 165537.5,659997.2 165586,659923 165598.7,659928.9 165642.9,659967.7 165678,659968.6 165696.1),(659836.362033598 164255.445833564,659843 164255))

no path:

SELECT astext(ST_Collect(ST_LineMerge(the_geom))) AS geom FROM
shootingstar_sp_smart('arcs', 659863.0, 164295.0,
660583.0, 163095.0, 200.0, E'ST_SetSRID(''''''''BOX3D(651383.0 154535.0, 679523.0 170415.0)''''''''::box3d, 21781)',
E'length * (CASE WHEN wander_n THEN 0.01 WHEN wander_r THEN 0.01 WHEN wander_l THEN 0.01 WHEN ww THEN 0.01 WHEN klass_1 THEN 1.0 WHEN klass_2 THEN 1.0 ELSE 1.0 END)', FALSE, FALSE);

result:

LOG: statement: SELECT astext(ST_Collect(ST_LineMerge(the_geom))) AS geom FROM
shootingstar_sp_smart('arcs', 659863.0, 164295.0,
660583.0, 163095.0, 200.0, E'ST_SetSRID(''''''''BOX3D(651383.0 154535.0, 679523.0 170415.0)''''''''::box3d, 21781)',
E'length * (CASE WHEN wander_n THEN 0.01 WHEN wander_r THEN 0.01 WHEN wander_l THEN 0.01 WHEN ww THEN 0.01 WHEN klass_1 THEN 1.0 WHEN klass_2 THEN 1.0 ELSE 1.0 END)', FALSE, FALSE);
ERROR: cannot EXECUTE a null querystring
CONTEXT: PL/pgSQL function "shootingstar_sp_smart" line 102 at FOR over EXECUTE statement
PL/pgSQL function "shootingstar_sp_smart" line 5 at FOR over EXECUTE statement

please let me know if I can give more information to solve this problem.

best regards
Oliver

sp_smart_directed error

Hey guys i'm new in pgrouting and i just found the wrapper that i thought it will help me a lot to accomplish my point to point routing. when i started to load the https://github.com/pgRouting/pgrouting-contrib/blob/master/functions-v1.x/routing_core_smart.sql in my postgres, it brought me a lot of error and most of them are the function which not recognized by postgis. But the solution is easy, just add "st_" infront of the function (e.g: distance -> st_distance)
my question is when i finished fix that errors and start to do some routing, it gave me an error like

ERROR: query string argument of EXECUTE is null
SQL state: 22004
Context: PL/pgSQL function sp_smart_directed(character varying,boolean,double precision,double precision,double precision,double precision,double precision,character varying,character varying,boolean,boolean) line 309 at FOR over EXECUTE statement

it happened when i choose point in different way or vertex or its long way to route, but if its just in the same way it gave me a result that i want like

id;gid;the_geom
0;459198;"0102000020E6100000020000001DA3510658B45A403E95006A90C318C0BB73ED0D58B45A40A0FDD42D9FC318C0"
1;459194;"0105000020E6100000010000000102000000030000007201674648B45A40F4FEACE7ADC318C0EE5F596952B45A4066DD3F16A2C318C0B773ED0D58B45A40A2FDD42D9FC318C0"
2;459199;"0102000020E6100000020000007101674648B45A40F8FEACE7ADC318C0F0A2513448B45A40B0B801659EC318C0"

please help me to solve this problem, i'm dying for a couple days to find out this things done
before that, i'm sorry for my bad english and my noob

regards,
Hanif

osm2po parser skipping edges

Using osm2po for parsing osm data and importing to postgresql is too easy but when i look at database and draw all the edges i find out some of the edges are missed so that the roads are not smooth, i don't know why this is happening, if anyone here can help me please do so i am in big trouble

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.