[pgrouting-dev] pgr_nodenetwork issue
Stephen Woodbridge
woodbri at swoodbridge.com
Mon Nov 11 10:01:54 PST 2013
Hi Vicky,
I am building a test database and used pgr_nodenetwork() and in the
result I had about 20-25% of the edges that were 'LINESTRING EMPTY'.
I thought that these were originally filtered out of the results.
Any thoughts on this?
Obviously we can delete them, but it would be better to filter them out
before they get inserted into bigtable_noded.
Opened issue #214
https://github.com/pgRouting/pgrouting/issues/214
-Steve
Below is the process I'm using:
------------------------------------------------------------------------
drop table if exists bigtable cascade;
create table bigtable (
id bigserial PRIMARY KEY,
source integer,
target integer,
dir_travel character(1),
speed_cat character(1),
name text,
nameid integer,
roundabout character(1),
tunnel character(1),
bridge character(1)
);
SELECT AddGeometryColumn( 'bigtable', 'the_geom', 4326, 'LINESTRING',2);
insert into bigtable (dir_travel, speed_cat,
roundabout, tunnel, bridge, the_geom) (
select
(array['B','B','F','T'])[(random()*3+1)::integer]::character as
dir_travel,
(random()*7+1)::character,
'N'::char,
case when random()<0.1 then 'Y' else 'N' end::char,
case when random()>0.9 then 'Y' else 'N' end::char,
ST_MakeLine(
st_setsrid(ST_MakePoint(-77.0+random()*3, 42.0+random()*3),
4326),
st_setsrid(ST_MakePoint(-77.0+random()*3, 42.0+random()*3),
4326)
)
from (
SELECT *
FROM generate_series(1,3000) AS id
) AS x
);
-- select * from bigtable limit 500;
select pgr_nodenetwork('bigtable', 0.000001);
-- select * from bigtable_noded limit 50;
select count(*)
from bigtable_noded
where st_astext(the_geom) = 'LINESTRING EMPTY';
-- 1525212
More information about the pgrouting-dev
mailing list