Thank you for these answers,
* Running legacy.sql did help : the "ways" table is now filled.
psql -d routing -f /usr/share/postgresql/9.1/contrib/postgis-2.0/legacy.sql
* For assign_vertex_id(), I thought that it was already run by
osm2pgrouting as it writes :
[...]
create topology
NOTICE: CREATE TABLE will create implicit sequence
"vertices_tmp_id_seq" for serial column "vertices_tmp.id"
CONTEXT: SQL statement "CREATE TABLE vertices_tmp (id serial)"
PL/pgSQL function "assign_vertex_id" line 15 at EXECUTE statement
#########################
size of streets: 41
size of splitted ways : 469
finished
In the osm2pgrouting source :
https://github.com/pgRouting/osm2pgrouting/blob/master/src/Export2DB.cpp#L372
But the vertices_tmp table remains empty. When running manually SELECT
assign_vertex_id('ways', 0.00001, 'the_geom', 'gid'); I get this :
NOTICE: CREATE TABLE will create implicit sequence
"vertices_tmp_id_seq" for serial column "vertices_tmp.id"
CONTEXT: SQL statement "CREATE TABLE vertices_tmp (id serial)"
PL/pgSQL function "assign_vertex_id" line 15 at EXECUTE statement
ERROR: query string argument of EXECUTE is null
CONTEXT: PL/pgSQL function "assign_vertex_id" line 33 at EXECUTE statement
My "ways" table is in MultiLineString geometry type. Could the problem
come from that ?
Frédéric Bonifas
2013/3/18 Stephen Woodbridge <woodbri@swoodbridge.com>:
On 3/18/2013 10:48 AM, Frédéric Bonifas wrote:
Hi,
I have built PgRouting from the sew-devel-2_0 branch. I am using
Postgis 2.0 and PostgreSql 9.1.8
I have created a database "routing" and created the postgis and
pgrouting extensions on it :
createdb routing
createlang plpgsql routing
You can use "CREATE EXTENSION plpgsql" but I'm not sure it is even needed.
psql -d routing -c "CREATE EXTENSION postgis;"
psql -d routing -c "CREATE EXTENSION pgrouting;"
I did not run the following lines because I assume that "CREATE
EXTENSION pgrouting;" does that but I may be wrong. Anyway, the
/usr/share/postlbs/ directory is empty.
psql -d routing -f /usr/share/postlbs/routing_core.sql
psql -d routing -f /usr/share/postlbs/routing_core_wrappers.sql
psql -d routing -f /usr/share/postlbs/routing_topology.sql
Right when you install an extension it loads all the files as part of the
extension. And I do not install files in /usr/share/postlbs The extension
installs share/postgresql/extension/pgrouting--1.0.7.sql which contains all
the SQL concatenated into one file.
One problem with the current setup is that tsp and dd are optional and as a
result probably need to be broken out into separate extensions, but that
should not be a problem for now.
Then I run osm2pgrouting, from the georepublic ppa.
osm2pgrouting -file "data.osm" -conf
"/usr/share/osm2pgrouting/mapconfig.xml" -host localhost -dbname
routing -user postgres -clean
osm2pgrouting seems the end coorectly as I got :
size of streets: 41
size of splitted ways : 469
finished
But while the "nodes" table is correctly filled, the "ways" and
"vertices_tmp" tables remain empty. I suspect this might be related to
routing_core.sql, routing_core_wrappers.sql and routing_topology.sql
that I did not run.
Does someone know what I am doing wrong ?
A couple of thoughts here:
1. you have to run the topology command assign_vertex_id(), which I have
never used as I wrote my own a long time ago.
2. You might (most likely) will need to load legacy.sql from postgis until I
have had a chance to review, update and test all the sql code for
compatibility with postgis 2.x
Thank you for stepping on on the bleed edge and testing this. I look forward
to here about your success and failures. Hopefully more success than
failures ![:slight_smile: :slight_smile:](/images/emoji/twitter/slight_smile.png?v=12)
-Steve
Thanks in advance
_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users
--
Frédéric Bonifas
+33672652807 skype:fredericbonifas