[pgrouting-users] PgRouting sew-devel-2_0 : topology problem
daniel at georepublic.de
Mon Mar 18 10:10:47 PDT 2013
> In the osm2pgrouting source :
> 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 ?
Yes, osm2pgrouting creates geometries as "MULTILINESTRING" which is not
working anymore with functions like "ST_StartPoint" and ST_EndPoint" in
Legacy.sql doesn't seem to help here.
I found out that source and target column remain empty therefor. Best would
be to change osm2pgrouting and recompile.
In case you use the Ubuntu package and don't want to compile, you can alter
the geometry type to LINESTRING (I don't think there is any MULTILINESTRING
consisting of two lines created) and run assign_vertex_id manually once
> Frédéric Bonifas
> 2013/3/18 Stephen Woodbridge <woodbri at 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
> >> 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
> > 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
> > to here about your success and failures. Hopefully more success than
> > failures :)
> > -Steve
> >> Thanks in advance
> > _______________________________________________
> > Pgrouting-users mailing list
> > Pgrouting-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/pgrouting-users
> Frédéric Bonifas
> +33672652807 skype:fredericbonifas
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
Georepublic UG & Georepublic Japan
eMail: daniel.kastl at georepublic.de
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pgrouting-users