[GRASS-CVS] markus: grass6/vector/v.in.ogr main.c, 1.68.4.3,
1.68.4.4
grass at intevation.de
grass at intevation.de
Sat Nov 24 08:32:41 EST 2007
- Previous message: [GRASS-CVS] markus: grass6/db/drivers/postgres Makefile, 1.18.4.2,
1.18.4.3 README, 1.4, 1.4.4.1 db.c, 1.22, 1.22.4.1 describe.c,
1.16, 1.16.4.1 execute.c, 1.9, 1.9.4.1 globals.h, 1.14,
1.14.4.1 grass-pg.html, 1.1.2.2, 1.1.2.3 listtab.c, 1.6, 1.6.4.1
- Next message: [GRASS-CVS] martinl: grass6/vector/v.in.ascii points.c,1.24,1.25
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: markus
Update of /grassrepository/grass6/vector/v.in.ogr
In directory doto:/tmp/cvs-serv17931
Modified Files:
Tag: releasebranch_6_2
main.c
Log Message:
OFTDate, OFTTime and OFTDateTime backported
Index: main.c
===================================================================
RCS file: /grassrepository/grass6/vector/v.in.ogr/main.c,v
retrieving revision 1.68.4.3
retrieving revision 1.68.4.4
diff -u -d -r1.68.4.3 -r1.68.4.4
--- main.c 2 Dec 2006 06:21:51 -0000 1.68.4.3
+++ main.c 24 Nov 2007 13:32:39 -0000 1.68.4.4
@@ -624,6 +624,10 @@
/** Double byte string (unsupported) OFTWideString = 6 **/
/** List of wide strings (unsupported) OFTWideStringList = 7 **/
/** Raw Binary data (unsupported) OFTBinary = 8 **/
+ /** OFTDate = 9 **/
+ /** OFTTime = 10 **/
+ /** OFTDateTime = 11 **/
+
if( Ogr_ftype == OFTInteger ) {
sprintf (buf, ", %s integer", Ogr_fieldname );
@@ -636,21 +640,25 @@
#if GDAL_VERSION_NUM >= 1320
} else if( Ogr_ftype == OFTDate ) {
sprintf (buf, ", %s date", Ogr_fieldname );
+ } else if( Ogr_ftype == OFTTime ) {
+ sprintf (buf, ", %s time", Ogr_fieldname );
+ } else if( Ogr_ftype == OFTDateTime ) {
+ sprintf (buf, ", %s datetime", Ogr_fieldname );
#endif
} else if( Ogr_ftype == OFTString ) {
int fwidth;
fwidth = OGR_Fld_GetWidth(Ogr_field);
/* TODO: read all records first and find the longest string length */
if ( fwidth == 0) {
- G_warning (_("Width for column '%s' set to 255 (was not specified by OGR), "
- "some strings may be truncated!"), Ogr_fieldname );
+ G_warning (_("Width for column %s set to 255 (was not specified by OGR), "
+ "some strings may be truncated!"), Ogr_fieldname );
fwidth = 255;
}
sprintf (buf, ", %s varchar ( %d )", Ogr_fieldname, fwidth );
} else if( Ogr_ftype == OFTStringList ) {
/* hack: treat as string */
sprintf (buf, ", %s varchar ( %d )", Ogr_fieldname, OFTIntegerListlength );
- G_warning (_("Writing column <%s> with fixed length %d chars (may be truncated)"), Ogr_fieldname, OFTIntegerListlength);
+ G_warning (_("Writing column %s with fixed length %d chars (may be truncated)"), Ogr_fieldname, OFTIntegerListlength);
} else {
G_warning (_("Column type not supported (%s)"), Ogr_fieldname );
buf[0] = 0;
@@ -711,10 +719,16 @@
if( Ogr_ftype == OFTInteger || Ogr_ftype == OFTReal ) {
sprintf (buf, ", %s", OGR_F_GetFieldAsString( Ogr_feature, i) );
#if GDAL_VERSION_NUM >= 1320
- } else if( Ogr_ftype == OFTString || Ogr_ftype == OFTIntegerList || Ogr_ftype == OFTDate ) {
-#else
- } else if( Ogr_ftype == OFTString || Ogr_ftype == OFTIntegerList ) {
+ /* should we use OGR_F_GetFieldAsDateTime() here ? */
+ } else if( Ogr_ftype == OFTDate || Ogr_ftype == OFTTime || Ogr_ftype == OFTDateTime ) {
+ char *newbuf;
+ db_set_string ( &strval, (char *) OGR_F_GetFieldAsString( Ogr_feature, i) );
+ db_double_quote_string (&strval);
+ sprintf (buf, ", '%s'", db_get_string(&strval) );
+ newbuf = G_str_replace(buf, "/", "-"); /* fix 2001/10/21 to 2001-10-21 */
+ sprintf (buf, "%s", newbuf);
#endif
+ } else if( Ogr_ftype == OFTString || Ogr_ftype == OFTIntegerList ) {
db_set_string ( &strval, (char *) OGR_F_GetFieldAsString( Ogr_feature, i) );
db_double_quote_string (&strval);
sprintf (buf, ", '%s'", db_get_string(&strval) );
- Previous message: [GRASS-CVS] markus: grass6/db/drivers/postgres Makefile, 1.18.4.2,
1.18.4.3 README, 1.4, 1.4.4.1 db.c, 1.22, 1.22.4.1 describe.c,
1.16, 1.16.4.1 execute.c, 1.9, 1.9.4.1 globals.h, 1.14,
1.14.4.1 grass-pg.html, 1.1.2.2, 1.1.2.3 listtab.c, 1.6, 1.6.4.1
- Next message: [GRASS-CVS] martinl: grass6/vector/v.in.ascii points.c,1.24,1.25
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the grass-commit
mailing list