Opened 10 years ago
Closed 8 years ago
#2460 closed defect (fixed)
v.out.postgis doesn't export attribute table
Reported by: | martin | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.2.1 |
Component: | Default | Version: | svn-trunk |
Keywords: | v.out.postgis | Cc: | |
CPU: | x86-64 | Platform: | Linux |
Description
Attribute table has one column.
"v.out.ogr" creates a proper column in PostGIS accordingly, "v.out.postgis" doesn't.
GRASS 7.1.svn > v.out.postgis input=newcs_errorW_full type=area olayer=newcs_full_pg \ dsn="PG:host=${PGHOST} dbname=${PGDATABASE} user=${PGUSER}" \ options="FID=ogc_fid, GEOMETRY_NAME=wkb_geometry, SPATIAL_INDEX=YES, PRIMARY_KEY=YES, SRID=4326" \ --verbose --overwrite WARNING: PostGIS layer <public.newcs_full_pg> already exists and will be overwritten Using PostGIS format Building spatial index on <wkb_geometry>... Copying features (polygon)... 100% Exporting areas... 100% Building topology for vector map <newcs_full_pg@nlcd2011error>... Using external data format 'PostgreSQL' (feature type 'polygon') Building pseudo-topology over simple features... Registering primitives... 26401 primitives registered 4296855 vertices registered Topology was built Number of nodes: 11427 Number of primitives: 26401 Number of points: 0 Number of lines: 0 Number of boundaries: 14330 Number of centroids: 12071 Number of areas: 14330 Number of isles: 14330 v.out.postgis complete. 12071 features (polygon type) written to <newcs_full_pg>.
landcover=> \d newcs_full_pg Table "public.newcs_full_pg" Column | Type | Modifiers --------------+------------------------+----------------------------------------------------------------- ogc_fid | integer | not null default nextval('newcs_full_pg_ogc_fid_seq'::regclass) cat | integer | wkb_geometry | geometry(Polygon,4326) | Indexes: "newcs_full_pg_pkey" PRIMARY KEY, btree (ogc_fid) "newcs_full_pg_cat_idx" btree (cat) "newcs_full_pg_wkb_geometry_idx" gist (wkb_geometry)
GRASS 7.1.svn > v.out.ogr input=newcs_errorW_full type=area olayer=newcs_full_ogr format=PostgreSQL \ dsn="PG:host=${PGHOST} dbname=${PGDATABASE} user=${PGUSER}" \ --verbose --overwrite Warning 1: Multi-column primary key in 'fgs_overrides' detected but not supported. WARNING: OGR layer <newcs_full_ogr> already exists and will be overwritten Exporting 12071 areas (may take some time)... 100% v.out.ogr complete. 12071 features (Polygon type) written to <newcs_full_ogr> (PostgreSQL format).
landcover=> \d newcs_full_ogr Table "public.newcs_full_ogr" Column | Type | Modifiers --------------+-------------------------+------------------------------------------------------------------ ogc_fid | integer | not null default nextval('newcs_full_ogr_ogc_fid_seq'::regclass) wkb_geometry | geometry(Polygon,4326) | cat | integer | pglayer | character varying(1000) | Indexes: "newcs_full_ogr_pk" PRIMARY KEY, btree (ogc_fid) "newcs_full_ogr_geom_idx" gist (wkb_geometry)
Change History (15)
comment:1 by , 10 years ago
follow-up: 9 comment:3 by , 10 years ago
This seems to be linked to the handling of feature types:
v.out.postgis in=censusblk_swwake output='PG:dbname=nc_grass' --o
gives me the full attribute table, while
v.out.postgis in=censusblk_swwake type=area output='PG:dbname=nc_grass' --o
only gives me fid, cat and geom columns.
BTW, when I try
v.out.postgis in=censusblk_swwake type=centroid output='PG:dbname=nc_grass' --o
I get
ATTENTION: Unsupported geometry type (8) ATTENTION: Unable to write feature in vector map <censusblk_swwake> ERREUR :Feature type 8 is not supported Erreur de segmentation
follow-up: 8 comment:5 by , 10 years ago
The following patch apparently "solves" the problem for me, but I don't know what consequences this might have, nor why it works as I don't get a fatal error anyhow...
Index: main.c =================================================================== --- main.c (révision 64605) +++ main.c (copie de travail) @@ -135,11 +135,12 @@ olayer); G_add_error_handler(output_handler, &Out); - /* check output type */ - if (otype > 0) { /* type is not 'auto' */ + /* check output type + if (otype > 0) { type is not 'auto' if (Vect_write_line(&Out, otype, NULL, NULL) < 0) G_fatal_error(_("Feature type %d is not supported"), otype); } + */ /* copy attributes */ field = Vect_get_field_number(&In, params.layer->answer);
comment:8 by , 8 years ago
follow-up: 13 comment:9 by , 8 years ago
Replying to mlennert:
BTW, when I try
v.out.postgis in=censusblk_swwake type=centroid output='PG:dbname=nc_grass' --oI get
ATTENTION: Unsupported geometry type (8) ATTENTION: Unable to write feature in vector map <censusblk_swwake> ERREUR :Feature type 8 is not supported Erreur de segmentation
Right, it's still issue and must be solved before closing this ticket.
comment:10 by , 8 years ago
Milestone: | 7.2.0 → 7.2.1 |
---|
comment:13 by , 8 years ago
Replying to martinl:
Right, it's still issue and must be solved before closing this ticket.
Should be fixed in r70505.
v.out.postgis in=censusblk_swwake output='PG:dbname=nc_grass' --o type=point -> nothing is exported v.out.postgis in=censusblk_swwake output='PG:dbname=nc_grass' --o type=line -> nothing is exported v.out.postgis in=censusblk_swwake output='PG:dbname=nc_grass' --o type=centroid -> centroids exported as points v.out.postgis in=censusblk_swwake output='PG:dbname=nc_grass' --o type=boundary -> boundaries exported as linestrings v.out.postgis in=censusblk_swwake output='PG:dbname=nc_grass' --o type=area -> areas exported as polygons
Testing welcome.
Ping