Hot answers tagged

3

Use this guide to set up indexes for a spatial database. Here is the gist of it: 1. create indexes on ID, source and target columns. 2. create index using GIST on geom column. 3. vacuum 4. cluster on geom column 5. analyze for my _4pgr and _vertex tables, only the source and target columns had indexes after the import (osm2po-core-5.1.0).


2

When you make a pgRouting query like this one SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_dijkstra(' SELECT gid AS id, source::integer, target::integer, length::double precision AS cost FROM ways', 30, 60, false, ...


2

Replace ST_GeomFromText('POINT(715127 957625)',4326) with ST_Transform(ST_SetSRID(ST_GeomFromText('POINT(715127 957625)'),SRID_YOU_ARE_USING),4326) 4326 is the SRID of WGS84, which is used by GPS, and is the commonly used lat-lng system you're looking for.


2

You can do your own function in PostgreSQL like this (Example taken from the docs) : CREATE TABLE foo (fooid INT, foosubid INT, fooname TEXT); INSERT INTO foo VALUES (1, 2, 'three'); INSERT INTO foo VALUES (4, 5, 'six'); CREATE OR REPLACE FUNCTION get_all_foo() RETURNS SETOF foo AS $BODY$ DECLARE r foo%rowtype; BEGIN FOR r IN SELECT * FROM ...


1

You should use ST_DWithin as a filter on your location as below SELECT pubs.name FROM pubs WHERE ST_DWithin([Your Location in units of projection], pubs.the_geom, [Distance in units of the projection used]); the_geom is the geometry column of your pubs table. If your location data is in GeoJSON format (You could maybe clarify this in your question) you ...


1

There was a Google Summer of Code project to support Multi-Modal routing and import the data from GTFS format, but it was not developed further and currently isn't integrated into a release. You can find the source code in a branch of the pgRouting repository, but it will need some work to make it work with the current version of pgRouting. More information ...


1

No it is not true, although it depends on how you define multi-modal routing and how realistic a model you need. It's not exactly straightforward, but it is possible. My masters thesis used pgRouting to model public transportation accessibility, including walking, buses, trains, and a funicular. The most difficult aspects are modelling waiting for transport, ...


1

sudo apt-add-repository -y ppa:ubuntugis/ppa sudo apt-add-repository -y ppa:georepublic/pgrouting sudo apt-get update sudo apt-get install postgresql-9.3-pgrouting Now you should be able to add the extension to the database: pgAdmin >> Databases >> "my database" >> Extensions >> New Extension... >> pgrouting See this excellent tutorial for more details: ...



Only top voted, non community-wiki answers of a minimum length are eligible