| 370 | |
| 371 | |
| 372 | -- Test with '10037%' that corresponds to the Biscay coast of Spain: |
| 373 | -- Table of Basins |
| 374 | drop table if exists biscay_coast_cuenca; |
| 375 | create table biscay_coast_cuenca as select * from a_cuencas_rios_atl_norte where pfafrio like '10037%'; |
| 376 | |
| 377 | CREATE INDEX biscay_coast_cuenca_geom_idx |
| 378 | ON biscay_coast_cuenca |
| 379 | USING gist |
| 380 | (geom); |
| 381 | |
| 382 | -- Table of rivers |
| 383 | drop table if exists biscay_coast_a_rios_v2; |
| 384 | create table biscay_coast_a_rios_v2 as select * from a_rios_v2 where pfafrio like '10037%'; |
| 385 | |
| 386 | CREATE INDEX biscay_coast_a_rios_v2_geom_idx |
| 387 | ON biscay_coast_a_rios_v2 |
| 388 | USING gist |
| 389 | (geom); |
| 390 | |
374 | | [[Image(source:eda/data/Docs/trac/sudoang/test_biscay_coast.png,400px)]] |
| 394 | [[Image(source:eda/data/Docs/trac/sudoang/test_biscay_coast.png,400px)]] [[BR]] |
| 395 | |
| 396 | pgRouting, configuration on table and ltree |
| 397 | {{{#!sh |
| 398 | ALTER TABLE biscay_coast_a_rios_v2 DROP COLUMN if exists source; |
| 399 | ALTER TABLE biscay_coast_a_rios_v2 DROP COLUMN if exists target; |
| 400 | ALTER TABLE biscay_coast_a_rios_v2 ADD COLUMN source integer; |
| 401 | ALTER TABLE biscay_coast_a_rios_v2 ADD COLUMN target integer; |
| 402 | CREATE INDEX biscay_coast_a_rios_v2_source_idx ON biscay_coast_a_rios_v2 (source); |
| 403 | CREATE INDEX biscay_coast_a_rios_v2_target_idx ON biscay_coast_a_rios_v2 (target); |
| 404 | |
| 405 | --------------------------------------------------------------------- |
| 406 | -- createTopology also creates biscay_coast_a_rios_v2_vertices_pgr |
| 407 | ------------------------------------------------------------------ |
| 408 | SELECT pgr_createTopology('biscay_coast_a_rios_v2', 0.0001, 'geom', 'gid'); |
| 409 | }}} |
| 410 | |
| 411 | Get error creating topology |