[pgrouting-users] Cleaning multilinestring vector network for routing via kDijkstra
Stephen Woodbridge
woodbri at swoodbridge.com
Mon Dec 15 10:44:45 PST 2014
Eyad,
There has recently been a bug reported against pgr_nodeNetwork and it
contains a patch to fix that problem. See:
https://github.com/pgRouting/pgrouting/issues/280
If you have multilinestrings then you might want to try something like:
st_geometryn(multiline, 1)
so you just select the first linestring in the multilinestring.
-Steve
On 12/15/2014 12:24 PM, AUS - Eyad wrote:
> Hi All,
>
> As I’m still struggling to make my network routable, I tried using
> pgr_nodeNetwork (instead of using v.clean), as follows:
>
> Select pgr_nodeNetwork ('schema.table', 0.0001, 'id', 'geom')
>
> But I got the following Error:
>
> line_locate_point: 1st arg isnt a line
>
> CONTEXT: SQL statement "create temp table inter_loc on commit drop as (
> select * from (
>
> (select l1id, l2id, st_linelocatepoint(line,source) as locus from intergeom)
>
> union
>
> (select l1id, l2id, st_linelocatepoint(line,target) as locus from
> intergeom)) as foo
>
> where locus<>0 and locus<>1)"
>
> PL/pgSQL function pgr_nodenetwork(text,double precision,text,text,text)
> line 184 at EXECUTE statement
>
> I removed line 184 from my table but still getting same Error!
>
> Afterward, I tried calculating the costs using pgr_kdijkstraCost, but
> unfortunately most of the results are “-1” which means that there is no
> connection!
>
> Important note: my network is somehow accurate (done on CAD), but I
> think this is a normal cleaning that every expert of you may take it for
> granted
>
> Please assist in resolving this issue (even by suggesting new
> tool/function) because my time is becoming tight and this is my first
> real/full application using pgRouting
>
> Regards,
>
> Eyad
>
> *From:*AUS - Eyad [mailto:b00038807 at aus.edu]
> *Sent:* Monday, December 15, 2014 12:44 AM
> *To:* 'pgRouting users mailing list'
> *Subject:* Cleaning multilinestring vector network for routing via kDijkstra
>
> Hi All,
>
> I’m facing a serious issue preparing my multilinestring vector network
> for routing.
>
> I imported my vector network from CAD file. Obviously, there are some
> areas where lines are intercrossing still not routable_through;
> although, they are connected to each others!
>
> I used V.Clean (advance) to clean the network before importing to the
> database. I tried (break, snap, bpol, etc) alternatively but still not
> sure which one is the proper tool. Also I’m finding it hard to set the
> parameters because my vector network is obviously imported in
> millimeters while the network is spread on a length reaching 700m from
> start to destination from some ends.
>
> I’m testing the results via shortest_path plugin before I import to
> DataBase. In few successful cases using shortest_path, afterwards the
> network gets to lose a lot of elements while importing to DB (i.e. 600
> features only written from 700).
>
> If there are other ways to make the network clean and routable, please
> suggest
>
> I'm using QGIS 2.4.0 and pgRouting pg93-binaries-2.4.0
>
> Regards..
>
> Eyad
>
>
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
More information about the Pgrouting-users
mailing list