[pgrouting-users] Converting a shape file to a network

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[pgrouting-users] Converting a shape file to a network

davep
Hi,

I am trying to convert a shapefile of linestrings into a suitable form for pgroute.  The type of issue that I am getting is that from a casual look its looks fine, but if you drill down in to the map, you find there are some line segments should connect, but they don't due to the way that the data was entered.

Q. Has anybody attempt this type of thing before and what if any solutions did they find ?
Dave. 

_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users
Reply | Threaded
Open this post in threaded view
|

Re: [pgrouting-users] Converting a shape file to a network

Vicky Vergara-2
Hi Dave,

Have you tried:


Its has some issues, but does a reasonable work for pgRouting purposes.
Fixing the geometry would be using postGIS



On Thu, May 17, 2018 at 2:47 PM, Dave Potts <[hidden email]> wrote:
Hi,

I am trying to convert a shapefile of linestrings into a suitable form for pgroute.  The type of issue that I am getting is that from a casual look its looks fine, but if you drill down in to the map, you find there are some line segments should connect, but they don't due to the way that the data was entered.

Q. Has anybody attempt this type of thing before and what if any solutions did they find ?
Dave. 

_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users



--
Georepublic UG (haftungsbeschränkt)
Salzmannstraße 44, 
81739 München, Germany

Vicky Vergara
Operations Research

eMail: vicky@georepublic.de
Web: https://georepublic.info

Tel: +49 (089) 4161 7698-1
Fax: +49 (089) 4161 7698-9

Commercial register: Amtsgericht München, HRB 181428
CEO: Daniel Kastl


_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users
Reply | Threaded
Open this post in threaded view
|

Re: [pgrouting-users] Converting a shape file to a network

davep
I tried this and got an error message to the effect missing column

med_proj=# \d tmp;
                                     Table "public.tmp"
  Column  |          Type           | Collation | Nullable |             Default             
----------+-------------------------+-----------+----------+---------------------------------
 id       | integer                 |           | not null | nextval('tmp_id_seq'::regclass)
 the_geom | geometry(Geometry,3857) |           |          | 

med_proj=# \d tmp_noded;
                                     Table "public.tmp_noded"
  Column  |          Type           | Collation | Nullable |                Default                
----------+-------------------------+-----------+----------+---------------------------------------
 id       | integer                 |           | not null | nextval('tmp_noded_id_seq'::regclass)
 old_id   | bigint                  |           |          | 
 sub_id   | bigint                  |           |          | 
 source   | bigint                  |           |          | 
 target   | bigint                  |           |          | 
 the_geom | geometry(Geometry,3857) |           |          | 

Invoking this, should put the results in tmp_noded, which according to the above and the manual at https://docs.pgrouting.org/2.6/en/pgr_nodeNetwork.html has all the right column

Doing this
med_proj=# select pgr_createTopology('tmp',1);

Given an error,  I don't  think there is anything wrong with the functions, it most be my table layout, but according to the documents,everything is correct.  
NOTICE:  PROCESSING:
NOTICE:  pgr_createTopology('tmp', 1, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := f)
NOTICE:  Performing checks, please wait .....
NOTICE:  ----> PGR ERROR in pgr_createTopology: Column source not found
HINT:    ----> Check your column name
NOTICE:  Unexpected error raise_exception
 pgr_createtopology 
--------------------
 FAIL

any ideas what I am doing wrong ?

Dave.




On 17 May 2018 at 21:35, Vicky Vergara <[hidden email]> wrote:
Hi Dave,

Have you tried:


Its has some issues, but does a reasonable work for pgRouting purposes.
Fixing the geometry would be using postGIS



On Thu, May 17, 2018 at 2:47 PM, Dave Potts <[hidden email]> wrote:
Hi,

I am trying to convert a shapefile of linestrings into a suitable form for pgroute.  The type of issue that I am getting is that from a casual look its looks fine, but if you drill down in to the map, you find there are some line segments should connect, but they don't due to the way that the data was entered.

Q. Has anybody attempt this type of thing before and what if any solutions did they find ?
Dave. 

_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users



--
Georepublic UG (haftungsbeschränkt)
Salzmannstraße 44, 
81739 München, Germany

Vicky Vergara
Operations Research

eMail: vicky@georepublic.de
Web: https://georepublic.info

Tel: +49 (089) 4161 7698-1
Fax: +49 (089) 4161 7698-9

Commercial register: Amtsgericht München, HRB 181428
CEO: Daniel Kastl


_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users


_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users
Reply | Threaded
Open this post in threaded view
|

Re: [pgrouting-users] Converting a shape file to a network

Vicky Vergara-2
Dave:
your table "tmp" does only has id and the_geom columns


On Sat, May 19, 2018 at 6:45 AM, Dave Potts <[hidden email]> wrote:
I tried this and got an error message to the effect missing column

med_proj=# \d tmp;
                                     Table "public.tmp"
  Column  |          Type           | Collation | Nullable |             Default             
----------+-------------------------+-----------+----------+---------------------------------
 id       | integer                 |           | not null | nextval('tmp_id_seq'::regclass)
 the_geom | geometry(Geometry,3857) |           |          | 

med_proj=# \d tmp_noded;
                                     Table "public.tmp_noded"
  Column  |          Type           | Collation | Nullable |                Default                
----------+-------------------------+-----------+----------+---------------------------------------
 id       | integer                 |           | not null | nextval('tmp_noded_id_seq'::regclass)
 old_id   | bigint                  |           |          | 
 sub_id   | bigint                  |           |          | 
 source   | bigint                  |           |          | 
 target   | bigint                  |           |          | 
 the_geom | geometry(Geometry,3857) |           |          | 

Invoking this, should put the results in tmp_noded, which according to the above and the manual at https://docs.pgrouting.org/2.6/en/pgr_nodeNetwork.html has all the right column

Doing this
med_proj=# select pgr_createTopology('tmp',1);

Given an error,  I don't  think there is anything wrong with the functions, it most be my table layout, but according to the documents,everything is correct.  
NOTICE:  PROCESSING:
NOTICE:  pgr_createTopology('tmp', 1, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := f)
NOTICE:  Performing checks, please wait .....
NOTICE:  ----> PGR ERROR in pgr_createTopology: Column source not found
HINT:    ----> Check your column name
NOTICE:  Unexpected error raise_exception
 pgr_createtopology 
--------------------
 FAIL

any ideas what I am doing wrong ?

Dave.




On 17 May 2018 at 21:35, Vicky Vergara <[hidden email]> wrote:
Hi Dave,

Have you tried:


Its has some issues, but does a reasonable work for pgRouting purposes.
Fixing the geometry would be using postGIS



On Thu, May 17, 2018 at 2:47 PM, Dave Potts <[hidden email]> wrote:
Hi,

I am trying to convert a shapefile of linestrings into a suitable form for pgroute.  The type of issue that I am getting is that from a casual look its looks fine, but if you drill down in to the map, you find there are some line segments should connect, but they don't due to the way that the data was entered.

Q. Has anybody attempt this type of thing before and what if any solutions did they find ?
Dave. 

_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users



--
Georepublic UG (haftungsbeschränkt)
Salzmannstraße 44, 
81739 München, Germany

Vicky Vergara
Operations Research

eMail: vicky@georepublic.de
Web: https://georepublic.info

Tel: +49 (089) 4161 7698-1
Fax: +49 (089) 4161 7698-9

Commercial register: Amtsgericht München, HRB 181428
CEO: Daniel Kastl


_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users


_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users



--
Georepublic UG (haftungsbeschränkt)
Salzmannstraße 44, 
81739 München, Germany

Vicky Vergara
Operations Research

eMail: vicky@georepublic.de
Web: https://georepublic.info

Tel: +49 (089) 4161 7698-1
Fax: +49 (089) 4161 7698-9

Commercial register: Amtsgericht München, HRB 181428
CEO: Daniel Kastl


_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users
Reply | Threaded
Open this post in threaded view
|

Re: [pgrouting-users] Converting a shape file to a network

davep
Got it sorted, thanks for the help


On 19 May 2018 at 15:47, Vicky Vergara <[hidden email]> wrote:
Dave:
your table "tmp" does only has id and the_geom columns


On Sat, May 19, 2018 at 6:45 AM, Dave Potts <[hidden email]> wrote:
I tried this and got an error message to the effect missing column

med_proj=# \d tmp;
                                     Table "public.tmp"
  Column  |          Type           | Collation | Nullable |             Default             
----------+-------------------------+-----------+----------+---------------------------------
 id       | integer                 |           | not null | nextval('tmp_id_seq'::regclass)
 the_geom | geometry(Geometry,3857) |           |          | 

med_proj=# \d tmp_noded;
                                     Table "public.tmp_noded"
  Column  |          Type           | Collation | Nullable |                Default                
----------+-------------------------+-----------+----------+---------------------------------------
 id       | integer                 |           | not null | nextval('tmp_noded_id_seq'::regclass)
 old_id   | bigint                  |           |          | 
 sub_id   | bigint                  |           |          | 
 source   | bigint                  |           |          | 
 target   | bigint                  |           |          | 
 the_geom | geometry(Geometry,3857) |           |          | 

Invoking this, should put the results in tmp_noded, which according to the above and the manual at https://docs.pgrouting.org/2.6/en/pgr_nodeNetwork.html has all the right column

Doing this
med_proj=# select pgr_createTopology('tmp',1);

Given an error,  I don't  think there is anything wrong with the functions, it most be my table layout, but according to the documents,everything is correct.  
NOTICE:  PROCESSING:
NOTICE:  pgr_createTopology('tmp', 1, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := f)
NOTICE:  Performing checks, please wait .....
NOTICE:  ----> PGR ERROR in pgr_createTopology: Column source not found
HINT:    ----> Check your column name
NOTICE:  Unexpected error raise_exception
 pgr_createtopology 
--------------------
 FAIL

any ideas what I am doing wrong ?

Dave.




On 17 May 2018 at 21:35, Vicky Vergara <[hidden email]> wrote:
Hi Dave,

Have you tried:


Its has some issues, but does a reasonable work for pgRouting purposes.
Fixing the geometry would be using postGIS



On Thu, May 17, 2018 at 2:47 PM, Dave Potts <[hidden email]> wrote:
Hi,

I am trying to convert a shapefile of linestrings into a suitable form for pgroute.  The type of issue that I am getting is that from a casual look its looks fine, but if you drill down in to the map, you find there are some line segments should connect, but they don't due to the way that the data was entered.

Q. Has anybody attempt this type of thing before and what if any solutions did they find ?
Dave. 

_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users



--
Georepublic UG (haftungsbeschränkt)
Salzmannstraße 44, 
81739 München, Germany

Vicky Vergara
Operations Research

eMail: vicky@georepublic.de
Web: https://georepublic.info

Tel: +49 (089) 4161 7698-1
Fax: +49 (089) 4161 7698-9

Commercial register: Amtsgericht München, HRB 181428
CEO: Daniel Kastl


_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users


_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users



--
Georepublic UG (haftungsbeschränkt)
Salzmannstraße 44, 
81739 München, Germany

Vicky Vergara
Operations Research

eMail: vicky@georepublic.de
Web: https://georepublic.info

Tel: +49 (089) 4161 7698-1
Fax: +49 (089) 4161 7698-9

Commercial register: Amtsgericht München, HRB 181428
CEO: Daniel Kastl


_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users


_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users