[pgrouting-users] PgRouting sew-devel-2_0 : topology problem

Daniel Kastl daniel at georepublic.de
Mon Mar 18 18:15:50 PDT 2013


Oh, then I already changed it there, but didn't build new packages.

On the user mailing list osm2pgroyting was mention yesterday, too.
And another issue seems to be that OSM data has increased that ID's had to
change to bigint:

alter table relation_ways alter column relation_id type bigint;
alter table relation_ways alter column way_id type bigint;
alter table nodes alter column id type bigint;

Daniel



On Tue, Mar 19, 2013 at 8:10 AM, Frédéric Bonifas <fredericbonifas at gmail.com
> wrote:

> I just built osm2pgrouting from the source and it works now. It seems
> like the geom type is already LINESTRING there :
>
> https://github.com/pgRouting/osm2pgrouting/blob/master/src/Export2DB.cpp#L84
>
> Thanks again for all the advices
>
> Frédéric Bonifas
>
> 2013/3/18 Daniel Kastl <daniel at georepublic.de>:
> >
> >> 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 ?
> >
> >
> > Yes, osm2pgrouting creates geometries as "MULTILINESTRING" which is not
> > working anymore with functions like "ST_StartPoint" and ST_EndPoint" in
> > PostGIS 2.0.
> > 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
> > more.
> >
> > Daniel
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >>
> >>
> >> 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
> >> > 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 :)
> >> >
> >> > -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
> >> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
> >
> >
> >
> >
> > --
> > Georepublic UG & Georepublic Japan
> > eMail: daniel.kastl at georepublic.de
> > Web: http://georepublic.de
> > _______________________________________________
> > 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
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>



-- 
Georepublic UG & Georepublic Japan
eMail: daniel.kastl at georepublic.de
Web: http://georepublic.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20130319/da1c4f95/attachment.html>


More information about the Pgrouting-users mailing list