[pgrouting-users] Newbee-question, I hope it is OK.

I’ve just discovered pgRouting and it does look quite interesting.

I’m currently running our Open Data portal at our municipality. It’s based upon CKAN.org, but are running PostgreSQL 9.3 and PostGIS 2.1.

This allows the API for CKAN to receive queries with PostGIS functionality in, and return advanced results.

I’ve installed pgRouting and added the pgrouting extension to my database, which serves the API with data.

I’ve got a dataset containing GeoJSON-data with our streets in the city.

Is it possible to use this dataset with pgRouting and calculate a simple shortest path from point X1 and Y1 (long and lat) to another point X2 and Y2 (long and lat) via a SQL query?

I hope such a question is OK, otherwise I apologize. I’ve tried to look at the tutorials/workshops around pgRouting, but cannot find any information on using GeoJSON (or similar format) as input etc…

Hi Henrik,

For pgRouting you need to be able to make a query, which selects “id, source, target and cost” coulmn from a PostgreSQL table: http://docs.pgrouting.org/2.0/en/src/dijkstra/doc/index.html#pgr-dijkstra

So if you can turn your data into the right format and if it contains a routing topology (source and target information for each road segment), then it should work.

I think looking at the workshop is a good place to start. It makes use of OSM data, but with small modifications any other road network data is OK: http://workshop.pgrouting.org/

Daniel

···

On Mon, Jun 23, 2014 at 11:26 AM, Henrik Aagaard Sørensen <BU1G@tmf.kk.dk> wrote:

I’ve just discovered pgRouting and it does look quite interesting.

I’m currently running our Open Data portal at our municipality. It’s based upon CKAN.org, but are running PostgreSQL 9.3 and PostGIS 2.1.

This allows the API for CKAN to receive queries with PostGIS functionality in, and return advanced results.

I’ve installed pgRouting and added the pgrouting extension to my database, which serves the API with data.

I’ve got a dataset containing GeoJSON-data with our streets in the city.

Is it possible to use this dataset with pgRouting and calculate a simple shortest path from point X1 and Y1 (long and lat) to another point X2 and Y2 (long and lat) via a SQL query?

I hope such a question is OK, otherwise I apologize. I’ve tried to look at the tutorials/workshops around pgRouting, but cannot find any information on using GeoJSON (or similar format) as input etc…


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.info

Hi Daniel,

Thank you for your answer.

I will look more into the workshop.

Currently, this is our “beta”-dataset with streets in Copenhagen (as CSV with GeoJSON column):

http://data.kk.dk/dataset/veje/resource/19a2ba4c-3798-42e2-bfa4-548d493111a4

It’s showed here: http://data.kk.dk/dataset/veje/resource/639d444e-b4c4-4dbf-b7bf-bf655ee69ff1

The API for CKAN allows to make SQL-queries directly onto the CSV-table and thereby select the GeoJSON column and use it with PostgreSQL/PostGIS/pgRouting functions etc.

Fra: pgrouting-users-bounces@lists.osgeo.org [mailto:pgrouting-users-bounces@lists.osgeo.org] På vegne af Daniel Kastl
Sendt: 23. juni 2014 11:38
Til: pgRouting users mailing list
Emne: Re: [pgrouting-users] Newbee-question, I hope it is OK.

Hi Henrik,

For pgRouting you need to be able to make a query, which selects “id, source, target and cost” coulmn from a PostgreSQL table: http://docs.pgrouting.org/2.0/en/src/dijkstra/doc/index.html#pgr-dijkstra

So if you can turn your data into the right format and if it contains a routing topology (source and target information for each road segment), then it should work.

I think looking at the workshop is a good place to start. It makes use of OSM data, but with small modifications any other road network data is OK: http://workshop.pgrouting.org/

Daniel

On Mon, Jun 23, 2014 at 11:26 AM, Henrik Aagaard Sørensen <BU1G@tmf.kk.dk> wrote:

I’ve just discovered pgRouting and it does look quite interesting.

I’m currently running our Open Data portal at our municipality. It’s based upon CKAN.org, but are running PostgreSQL 9.3 and PostGIS 2.1.

This allows the API for CKAN to receive queries with PostGIS functionality in, and return advanced results.

I’ve installed pgRouting and added the pgrouting extension to my database, which serves the API with data.

I’ve got a dataset containing GeoJSON-data with our streets in the city.

Is it possible to use this dataset with pgRouting and calculate a simple shortest path from point X1 and Y1 (long and lat) to another point X2 and Y2 (long and lat) via a SQL query?

I hope such a question is OK, otherwise I apologize. I’ve tried to look at the tutorials/workshops around pgRouting, but cannot find any information on using GeoJSON (or similar format) as input etc…


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.info