Fri, Jul 28 2006
15:11:28
|
|
Request created by guest
|
|
Subject: v.in.ogr should allow choice of cat column
Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: cvs_head_20060724
V.in.ogr creates a new cat column at import. It would be nice if one could tell
v.in.ogr which column in the attribute data it should use as cat. Currently,
I have to use v.reclass to create a new vector file with the desired category
values.
Moritz |
|
Mon, Jul 31 2006
13:33:47
|
|
Mail sent by mneteler
|
|
Moritz,
I am not sure if that could be implemented:
/* Import feature */
cat = 1;
nogeom = 0;
OGR_L_ResetReading ( Ogr_layer );
G_message(_("Importing map %d features..."), OGR_L_GetFeatureCount (
Ogr_layer, 1 ));
while( (Ogr_feature = OGR_L_GetNextFeature(Ogr_layer)) != NULL ) {
/* Geometry */
The program is looping over the vector objects in the order as
OGR sees them. Changing that would probably (not sure) damage
the associations to the attribute table.
Markus |
|
Mon, Jul 31 2006
15:21:00
|
|
Mail sent by mlennert@club.worldonline.be
|
|
Return-Path |
<mlennert@club.worldonline.be>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
Message-ID |
<44CE03BA.5020602@club.worldonline.be>
|
Date |
Mon, 31 Jul 2006 15:20:58 +0200
|
From |
Moritz Lennert <mlennert@club.worldonline.be>
|
User-Agent |
Thunderbird 1.5.0.4 (X11/20060713)
|
MIME-Version |
1.0
|
To |
Markus Neteler via RT <grass-bugs@intevation.de>
|
Subject |
Re: [bug #4916] (grass) v.in.ogr should allow choice of cat column
|
References |
<20060731113347.622AB1006D0@lists.intevation.de>
|
In-Reply-To |
<20060731113347.622AB1006D0@lists.intevation.de>
|
Content-Type |
text/plain; charset=ISO-8859-15; format=flowed
|
Content-Transfer-Encoding |
7bit
|
X-Virus-Scanned |
by amavisd-new at intevation.de
|
X-Spam-Status |
No, hits=-4.161 tagged_above=-999 required=3 tests=[AWL=0.839, BAYES_00=-5]
|
X-Spam-Level |
|
Markus Neteler via RT wrote:
> Moritz,
>
>
>
> I am not sure if that could be implemented:
>
>
>
> /* Import feature */
>
> cat = 1;
>
> nogeom = 0;
>
> OGR_L_ResetReading ( Ogr_layer );
>
> G_message(_("Importing map %d features..."), OGR_L_GetFeatureCount
(
>
> Ogr_layer, 1 ));
>
> while( (Ogr_feature = OGR_L_GetNextFeature(Ogr_layer)) != NULL ) {
>
> /* Geometry */
>
>
>
>
>
> The program is looping over the vector objects in the order as
>
> OGR sees them. Changing that would probably (not sure) damage
>
> the associations to the attribute table.
I guess this would also imply that the program has to check for
consistency in the desired cat colum...
hmmm, maybe once the file has been completely read, it could just do the
equivalent of v.reclass ?
Or we could go for a script which wraps around v.in.ogr and v.reclass...
Moritz
|
|