Date support

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Date support

Peter Hopfgartner-7
Dear Shapelib developers.

I've ported date support from the current PostGIS trunk.

Would it make sense to include this into shapelib? The inclusion would
greatly help in upgrading PostGIS to the current shapelib.

Regards,

Peter


--
 
Dott. Peter Hopfgartner
 
R3 GIS Srl - GmbH
Via Johann Kravogl-Str. 2
I-39012 Meran/Merano (BZ)
Email: [hidden email]
Tel. : +39 0473 494949
Fax  : +39 0473 069902
www  : http://www.r3-gis.com

XING : http://www.xing.com/go/invita/8917535 


Index: dbfopen.c
===================================================================
RCS file: /cvs/maptools/cvsroot/shapelib/dbfopen.c,v
retrieving revision 1.84
diff -c -r1.84 dbfopen.c
*** dbfopen.c 29 Oct 2009 19:59:48 -0000 1.84
--- dbfopen.c 25 Mar 2010 16:50:36 -0000
***************
*** 771,776 ****
--- 771,778 ----
          chNativeType = 'L';
      else if( eType == FTString )
          chNativeType = 'C';
+     else if (eType == FTDate)
+         chNativeType = 'D';
      else
          chNativeType = 'N';
 
***************
*** 1194,1199 ****
--- 1196,1204 ----
      if ( psDBF->pachFieldType[iField] == 'L' )
  return( FTLogical);
 
+     else if (psDBF->pachFieldType[iField] == 'D')
+         return ( FTDate );
+
      else if( psDBF->pachFieldType[iField] == 'N'
               || psDBF->pachFieldType[iField] == 'F' )
      {

Index: shapefil.h
===================================================================
RCS file: /cvs/maptools/cvsroot/shapelib/shapefil.h,v
retrieving revision 1.47
diff -c -r1.47 shapefil.h
*** shapefil.h 28 Jan 2010 11:34:34 -0000 1.47
--- shapefil.h 25 Mar 2010 16:50:21 -0000
***************
*** 514,520 ****
    FTInteger,
    FTDouble,
    FTLogical,
!   FTInvalid
  } DBFFieldType;
 
  #define XBASE_FLDHDR_SZ       32
--- 514,521 ----
    FTInteger,
    FTDouble,
    FTLogical,
!   FTInvalid,
!   FTDate
  } DBFFieldType;
 
  #define XBASE_FLDHDR_SZ       32

_______________________________________________
Shapelib mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/shapelib
Loading...