1

I'm trying to use pgrouting in order to create a graphe and I have two questions :

Is it possible to use the function assign_vertex_id() with a POLYGON geometry type? I always have the following error when I try to use this fonction :

psql (9.0.3)
Type "help" for help.

bpi=# SELECT assign_vertex_id('rangee', 0.00001, 'geometrie', 'id');
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 14 at EXECUTE statement

ERROR:  query string argument of EXECUTE is null
CONTEXT:  PL/pgSQL function "assign_vertex_id" line 31 at EXECUTE statement

the table rangee is :

bpi=# \d rangee

          Table "public.rangee"

    Column    |         Type          | Modifiers
 -------------+-----------------------+-----------
  id          | integer               | not null
  zone_id     | integer               |
  geometrie   | geometry              |
  description | character varying(50) |
  source      | integer               |
  target      | integer               |

Indexes:
 "rangee_pkey" PRIMARY KEY, btree (id)
 "rangee_spatial" gist (geometrie)

Triggers:

rangee_geom_srid BEFORE INSERT OR UPDATE ON rangee FOR EACH ROW EXECUTE PROCEDURE geometrie_srid()

I don't understand this mistake. Could you help me please?

My second question is about pgrouting. Is it possible to create a dual graph with this tool?

Thanks a lot and I'm sorry for my english.

1 Answer 1

1

Is it possible to use the function assign_vertex_id() with a POLYGON geometry type?

Short answer: No.

Looking at the code at https://github.com/pgRouting/pgrouting/blob/master/core/sql/routing_topology.sql, the function uses e.g. ST_StartPoint() which only works for LINESTRINGS.

Is it possible to create a dual graph with this tool?

Not as far as I know.

2
  • Thanks a lot for your help :) I use the function ST_ExteriorRing and it works
    – raphael
    May 8, 2012 at 12:52
  • @raphael happy you found a solution. please use the voting mechanism to reward helpful answers.
    – underdark
    May 8, 2012 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.