[GRASS5] Problems with v.external

Luigi Pirelli l.pirelli at acsys.it
Wed Sep 1 10:00:36 EDT 2004


Hi at all,

I've some problem with v.external command.

*** I've PostGIS DB table "comuni"

riade=# \d comuni
              Table "public.comuni"
    Column   |         Type          | Modifiers
------------+-----------------------+-----------
  gid        | integer               | not null
  nome_com   | character varying(70) |
  area       | double precision      |
  perimeter  | double precision      |
  cod_amm    | character varying(9)  |
  cod_reg    | character varying(2)  |
  cod_pro    | character varying(3)  |
  cod_com    | character varying(3)  |
  cod_procom | character varying(6)  |
  grado_mont | character varying(14) |
  zonaalt    | integer               |
  ripartizio | integer               |
  qtmedia    | integer               |
  qtminima   | integer               |
  qtmassima  | integer               |
  regione    | character varying(21) |
  provincia  | character varying(20) |
  the_geom   | geometry              |
Indexes:
     "comuni_pkey" primary key, btree (gid)
Check constraints:
     "$2" CHECK (geometrytype(the_geom) = 'POLYGON'::text OR the_geom IS NULL)
     "$1" CHECK (srid(the_geom) = 23032)


*** imported in GRASS using command:

v.external dsn="PG:host=localhost user=postgres dbname=riade" layer=comuni 
output=comuni
Building topology ...
Feature: 8102
Topology was built.
Number of nodes     :   15678
Number of primitives:   16211
Number of points    :   0
Number of lines     :   0
Number of boundaries:   8109
Number of centroids :   8102
Number of areas     :   8109
Number of isles     :   8109
Number of areas without centroid :   7

*** DB Connection status is:

v.db.connect -p map=comuni
Vector map <comuni> is connected by:
field <1> table <comuni> in database <PG:host=localhost user=postgres 
dbname=riade> through driver <ogr> with key <FID>

*** But showing this data with d.vect I've this error:

D3/4: rtree_read_branch()
D2/4: Vect_cidx_open(): name = comuni mapset= riade_query_prova3
D2/4: dig_cidx_init()
D3/4: dig_read_cidx()
D2/4: dig_cidx_init()
D3/4: Cidx header: file version 5.0 , supported from GRASS version 5.0
D3/4:   byte order 0
D3/4:   header size 9
D3/4: V2_open_old_ogr()
D3/4:   header size 9
D3/4: 16218 records read from fidx
D2/4: V1_open_old_ogr(): dsn = PG:host=localhost user=postgres dbname=riade 
layer = comuni
D2/4: 15 layers found in data source
D2/4: OGR layer 14 opened
D1/4: Vect_open_old(): vector opened on level 2
D1/4: Vect_read_dblinks(): map = comuni, mapset = riade_query_prova3
D3/4: Vect_check_dblink: field 1
D1/4: Vect_Rewind(): name = comuni
D2/4: V2_rewind_ogr(): name = comuni
D3/4: G_str_to_color(): str = 'red'
D3/4: G_str_to_color(): str = 'none'
D3/4: G_str_to_color(): str = 'none'
D1/4: overlap = 1.000000

D1/4: display areas:
D2/4: n_areas = 8109
D3/4: area = 1
D3/4: display area 1
D3/4: Vect_get_area_points(): area = 1
D3/4:   n_lines = 1
D3/4:   append line(0) = 1
D3/4: Vect_read_line()
D4/4: V2_read_line_ogr() line = 1
D4/4:   FID = 0
D4/4: Read feature (FID = 0) to cache.
ERROR: Cannot read feature, FID = 0  <<<<--------------******

*** gid (first field) in table conuni has gid=[0-8101] so 0 exist as Feature ID 
(FID?)

*** Differently Table Comuni could be shown suing DB link in qgis.

step missing?

Thanks for your help.

Luigi Pirelli
www.riade.net
www.acsys.it




More information about the grass-dev mailing list