Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
Thanks a lot for your help :) I use the function ST_ExteriorRing and it works –  raphael May 8 '12 at 12:52
    
@raphael happy you found a solution. please use the voting mechanism to reward helpful answers. –  underdark May 8 '12 at 13:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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