[GRASS-dev] Re: [GRASS-CVS] markus: grass6/lib/vector/Vlib field.c, 1.38, 1.39

Markus Neteler neteler at itc.it
Wed Jun 14 02:51:32 EDT 2006


Huidae Cho wrote on 06/14/2006 06:41 AM:

>On Wed, Jun 14, 2006 at 12:52:10AM +0200, grass at intevation.de wrote:
>  
>
>>Author: markus
>>
>>Update of /grassrepository/grass6/lib/vector/Vlib
>>In directory doto:/tmp/cvs-serv19408
>>
>>Modified Files:
>>	field.c 
>>Log Message:
>>GID search added; auto-search of FID fixed (still non-functional due to apparent OGR_L_GetFIDColumn() failure; auto-search disabled
>>
>>    
>>
>
>Markus,
>
>The FID auto-search works well with PostgreSQL:
>  
>

Cool! If so, then we can change line 386 in lib/vect/Vlib/field.c

>GRASS 6.1.cvs (Bryan):~/tmp > v.external dsn="PG:host=localhost dbname=mydb user=me" layer=tmp output=tmp
>D0/0: Using FID column <ogc_fid> in OGR DB
>  
>
I have now fixed the debug output.

>Building topology ...
>WARNING: Random read is not supported by OGR for this layer, cannot build
>         support.
>
>It looks like not all the OGR formats support FID column
>(http://ogr.maptools.org/classOGRLayer.html#a26).  For example, shape files
>have no FID columns.
>  
>
but does the new autodetection work for SHAPE?

I get open-on-level-2 error with v.info. Does v.info work on your PG map?

>FYI, find attached the patch for gdal-1.3.2.
>
>Huidae Cho
>  
>
>------------------------------------------------------------------------
>
>--- ogr/ogrsf_frmts/pg/ogrpgtablelayer.cpp.orig	Tue Jun 13 22:46:05 2006
>+++ ogr/ogrsf_frmts/pg/ogrpgtablelayer.cpp	Tue Jun 13 22:49:05 2006
>@@ -830,7 +830,7 @@
> 
>         if( pszBytea != NULL )
>         {
>-            osCommand += osCommand + "'" + pszBytea + "'";
>+            osCommand = osCommand + "'" + pszBytea + "'";
>             CPLFree( pszBytea );
>         }
>         else
>  
>

Ah, was this needed to get it working? Please submit to the GDAL bug
tracker (Frank is traveling,
so it won't get lost).

I am curious if the FID autodetector also works for Oracle now.

Markus




More information about the grass-dev mailing list