Details Ticket 3623


Comment | Reply | Take | Resolve


Serial Number 3623
Subject v.in.ogr fails when input contains a column 'CAT'
Area grass6
Queue grass
Requestors tutey@o2.pl
Owner none
Status open
Last User Contact Thu Sep 15 22:25:49 2005 (3 yr ago)
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Wed Jul 26 14:59:50 2006 (2 yr ago)
Created Mon Sep 12 11:58:18 2005 (3 yr ago)

Transaction History Ticket 3623


Mon, Sep 12 2005 11:58:18    Request created by guest  
Subject: v.in.ogr fails when input contains a column 'CAT'

Platform: GNU/Linux/i386
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: cvs 23.08.05

details:

GRASS 6.1.cvs (caves_utm33):~ > v.in.ogr dsn=/home/trawiarz/poz_fault_patch_cut_pt_extr/poz_fault_pa
tch_cut_pt_extr.shp
output=poz_fault_patch_cut_pt_extr_re layer=poz_fault_patch_cut_pt_extr min_area=0.0001
snap=-1 
A datum name wgs84 (WGS_1984) was specified without transformation parameters.
Note that the GRASS default for wgs84 is towgs84=0.000,0.000,0.000.
Projection of input dataset and current location appear to match.
Proceeding with import...
Layer: poz_fault_patch_cut_pt_extr
DBMI-DBF driver error:
Column 'CAT' already exists (duplicate name)
Cannot create table.
Error in db_execute_immediate()


GRASS_INFO_ERROR(9053,1): Cannot create table: create table poz_fault_patch_cut_pt_extr_re
(cat integer, CAT double precision, WYS double precision, SM double precision,
WYS_MULT double precision)



Here's the problematic file:
http://www.biol.uni.wroc.pl/sieczka/udostepnione/vinogr/poz_fault_patch_cut_pt_extr.tar.bz2
It was created in Grass, edited in OO.org and exported with v.out.ogr.

Maciek
Wed, Sep 14 2005 04:10:31    Mail sent by hamish_nospam@yahoo.com  
Return-Path <hamish_nospam@yahoo.com>
Delivered-To grass-bugs@lists.intevation.de
Date Wed, 14 Sep 2005 14:10:06 +1200
From Hamish <hamish_nospam@yahoo.com>
To Request Tracker <grass-bugs@intevation.de>
Cc grass5@grass.itc.it
Subject Re: [GRASS5] [bug #3623] (grass) v.in.ogr fails when input contains a column 'CAT'
Message-Id <20050914141006.1978d582.hamish_nospam@yahoo.com>
In-Reply-To <20050912095818.D35731006DC@lists.intevation.de>
References <20050912095818.D35731006DC@lists.intevation.de>
X-Mailer Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
X-Face M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=T|rbBL'e1/CQ9;/1g\BU3&!=y8ria$2Uk!HT&BB 8i?|X_+7~1jsy}F~g$2va%3fV`*=L(*cem[@3\yg,G,@rg6/QMJ
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Spam-Status No, hits=-4.0 tagged_above=-999.0 required=3.0 tests=BAYES_00, FORGED_YAHOO_RCVD
X-Spam-Level
> this bug's URL: http://intevation.de/rt/webrt?serial_num=3623
> ---------------------------------------------------------------------
> 
> Subject: v.in.ogr fails when input contains a column 'CAT'

> GRASS Version: cvs 23.08.05
> 
> details:
> 
> GRASS 6.1.cvs (caves_utm33):~ > v.in.ogr
> dsn=/home/trawiarz/poz_fault_patch_cut_pt_extr/poz_fault_patch_cut_pt
> _extr.shp output=poz_fault_patch_cut_pt_extr_re
> layer=poz_fault_patch_cut_pt_extr min_area=0.0001 snap=-1
> A datum name wgs84 (WGS_1984) was specified without transformation
>  parameters.
> Note that the GRASS default for wgs84 is towgs84=0.000,0.000,0.000.
> Projection of input dataset and current location appear to match.
> Proceeding with import... Layer: poz_fault_patch_cut_pt_extr
> DBMI-DBF driver error:
> Column 'CAT' already exists (duplicate name)
> Cannot create table.
> Error in db_execute_immediate()
> 
> 
> GRASS_INFO_ERROR(9053,1): Cannot create table: create table
> poz_fault_patch_cut_pt_extr_re (cat integer, CAT double precision, WYS
> double precision, SM double precision, WYS_MULT double precision)

use the cnames= option to rename the column to something non-reserved,
or make CAT column of type integer if it is in fact a category column?

v.in.ogr:
    cnames   List of column names to be used instead of original names,
first is used for category column

or v.in.db depending on format of file.


Hamish


Wed, Sep 14 2005 19:41:14    Mail sent by werchowyna@epf.pl  
Return-Path <werchowyna@epf.pl>
Delivered-To grass-bugs@lists.intevation.de
Message-ID <004801c5b953$4f0ec7c0$b8e41d3e@eustahiush>
From "Maciek Sieczka" <werchowyna@epf.pl>
To "Hamish" <hamish_nospam@yahoo.com>, "Request Tracker" <grass-bugs@intevation.de>
Cc "grass devel" <grass5@grass.itc.it>
References <20050912095818.D35731006DC@lists.intevation.de> <20050914141006.1978d582.hamish_nospam@yahoo.com>
Subject Re: [GRASS5] [bug #3623] (grass) v.in.ogr fails when input contains a column 'CAT'
Date Wed, 14 Sep 2005 19:37:50 +0200
MIME-Version 1.0
Content-Type text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original
Content-Transfer-Encoding 7bit
X-Priority 3
X-MSMail-Priority Normal
X-Mailer Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE Produced By Microsoft MimeOLE V6.00.2900.2180
X-Antivirus avast! (VPS 0528-4, 2005-07-14), Outbound message
X-Antivirus-Status Clean
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
From: "Hamish" <hamish_nospam@yahoo.com>

> use the cnames= option to rename the column to something non-reserved,

You are right in general.

But there is something more to it. If my input shapefile contains 'cat'
column (*lowercase*), it is imported without the error message as 'cat_'.
The error pops up only when the column name is 'CAT' - uppercase.

Neither behaviour is a good solution I think. Forcing 'cat_' is no good
because it may always happen that you want to export your vector file again
to shapefile for external processing and the import it back to Grass. Then
you end up with a message:

DBMI-DBF driver error:
Column 'cat_' already exists (duplicate name)
Cannot create table.
Error in db_execute_immediate()

No good.

My idea is that any time 'CAT' or 'cat' is present in the input, a warning
and instruction should be issued like:

"A column named 'CAT' or 'cat' is present in your input data. This column is
RESERVED for Grass to store "categories". Read more here:  (a link to where
the user he can read more about what "categories" in Grass are; but is there
such a place?). Please rename your 'CAT' or 'cat' using the cnames option in
v.in.ogr to override conflicting column name."

What do you think?

The other, automated, solution could be to rename 'cat' to, say, 'cat1'. And
if 'cat1' is present to 'cat2' etc. Same with 'CAT'. Any good?

Maciek

P.S.
I mean this solutions mainly to help Grass newbies. I imagine that could be 
quite a surprise for a newbie to read "Column 'CAT' already exists 
(duplicate name)" with no guiding why so and what to do with it to able to 
import his shapefile anyway. But maybe I'm just exagerating here. You 
decide. I'll complain ;). 


Thu, Sep 15 2005 22:25:49    Mail sent by michael.barton@asu.edu  
Return-Path <Michael.Barton@asu.edu>
Delivered-To grass-bugs@lists.intevation.de
Date Thu, 15 Sep 2005 13:24:58 -0700
From Michael Barton <michael.barton@asu.edu>
Subject Re: [GRASS5] [bug #3623] (grass) v.in.ogr fails when input contains a column 'CAT'
In-reply-to <004801c5b953$4f0ec7c0$b8e41d3e@eustahiush>
To Maciek Sieczka <werchowyna@epf.pl>, Hamish <hamish_nospam@yahoo.com>, Paolo Cavallini via RT <grass-bugs@intevation.de>
Cc grass devel <grass5@grass.itc.it>
Message-id <BF4F26AA.1A6F6%michael.barton@asu.edu>
MIME-version 1.0
Content-type text/plain; charset=US-ASCII
Content-transfer-encoding 7bit
User-Agent Microsoft-Entourage/11.1.0.040913
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
AND if the existing table contains a column named cat_, it will OGR will
fail. 

In other words, if you append 2 tables together using OGR, it will rename
the old column cat_ and provide a new column--with a single integer
series--called CAT. If you try and append THAT table to another one, it will
fail because it tries to make a duplicate cat_ column.

Ideally, it should just continue to append existing cat numbers to existing
cat_ column, and continue with the existing series in CAT.

Michael
______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ  85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


> From: Maciek Sieczka <werchowyna@epf.pl>
> Date: Wed, 14 Sep 2005 19:37:50 +0200
> To: Hamish <hamish_nospam@yahoo.com>, Request Tracker
> <grass-bugs@intevation.de>
> Cc: grass devel <grass5@grass.itc.it>
> Subject: Re: [GRASS5] [bug #3623] (grass) v.in.ogr fails when input contains
a
> column 'CAT'
> 
> From: "Hamish" <hamish_nospam@yahoo.com>
> 
>> use the cnames= option to rename the column to something non-reserved,
> 
> You are right in general.
> 
> But there is something more to it. If my input shapefile contains 'cat'
> column (*lowercase*), it is imported without the error message as 'cat_'.
> The error pops up only when the column name is 'CAT' - uppercase.
> 
> Neither behaviour is a good solution I think. Forcing 'cat_' is no good
> because it may always happen that you want to export your vector file again
> to shapefile for external processing and the import it back to Grass. Then
> you end up with a message:
> 
> DBMI-DBF driver error:
> Column 'cat_' already exists (duplicate name)
> Cannot create table.
> Error in db_execute_immediate()
> 
> No good.
> 
> My idea is that any time 'CAT' or 'cat' is present in the input, a warning
> and instruction should be issued like:
> 
> "A column named 'CAT' or 'cat' is present in your input data. This column is
> RESERVED for Grass to store "categories". Read more here:  (a link to where
> the user he can read more about what "categories" in Grass are; but is there
> such a place?). Please rename your 'CAT' or 'cat' using the cnames option in
> v.in.ogr to override conflicting column name."
> 
> What do you think?
> 
> The other, automated, solution could be to rename 'cat' to, say, 'cat1'. And
> if 'cat1' is present to 'cat2' etc. Same with 'CAT'. Any good?
> 
> Maciek
> 
> P.S.
> I mean this solutions mainly to help Grass newbies. I imagine that could be
> quite a surprise for a newbie to read "Column 'CAT' already exists
> (duplicate name)" with no guiding why so and what to do with it to able to
> import his shapefile anyway. But maybe I'm just exagerating here. You
> decide. I'll complain ;).
> 


Wed, Jul 26 2006 14:59:50    User changed to tutey@o2.pl by msieczka  
Comment | Reply | Take | Resolve

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request