You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PROCESSING:
pgr_createVerticesTable('network.ways','the_geom','source','target','true')
Performing checks, please wait .....
Got cannot truncate a table referenced in a foreign key constraint
ERROR: Initializing vertex table
select count(*) from network.ways WHERE (the_geom IS NULL or source is null or target is null)=true AND (true)
Platform/versions
PostgreSQL 13.7 (Ubuntu 13.7-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit
to drop the vertices table imported with osm2pgroutingDROP TABLE IF EXISTS vertices_table; I need to drop constrains:
ALTER TABLE edge_table DROP CONSTRAINT ways_target_fkey;
ALTER TABLE edge_table DROP CONSTRAINT ways_target_osm_fkey;
ALTER TABLE edge_table DROP CONSTRAINT ways_source_fkey;
ALTER TABLE edge_table DROP CONSTRAINT ways_source_osm_fkey;
--Create the vertices table seems to works not correctly: Updated Rows 34701 (not selected !!)
In fact
SELECT * FROM pgr_extractVertices(
'SELECT gid, the_geom AS geom FROM edge_table',
dryrun => true);
extract 0 row
and
select * from vertices_table;
the result is the following:
in_edges and out_edges are null
Finally
WITH
out_going AS (
SELECT id AS vid, unnest(out_edges) AS eid, x, y
FROM vertices_table
)
UPDATE edge_table
SET source = vid, x1 = x, y1 = y
FROM out_going WHERE gid = eid;
I import my OSM data using osm2pgrouting and then I try to create topology with pgrouting topology functions:
1)pgr_createTopology works correctly
Here the error:
Platform/versions
PostgreSQL 13.7 (Ubuntu 13.7-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit
POSTGIS="3.2.1 5fae8e5" [EXTENSION] PGSQL="130" GEOS="3.8.0-CAPI-1.13.1 " PROJ="6.3.1" LIBXML="2.9.10" LIBJSON="0.13.1" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)"
PgRouting Version 3.3.0
The text was updated successfully, but these errors were encountered: