Changes between Initial Version and Version 1 of rfc31_ogr_64


Ignore:
Timestamp:
Sep 10, 2010, 1:46:53 AM (14 years ago)
Author:
warmerdam
Comment:

preliminary draft.

Legend:

Unmodified
Added
Removed
Modified
  • rfc31_ogr_64

    v1 v1  
     1= RFC 31: OGR 64bit Integer Fields and FIDs =
     2
     3Authors: Frank Warmerdam [[BR]]
     4Contact: warmerdam@pobox.com[[BR]]
     5Status: Development
     6
     7== Summary ==
     8
     9This RFC addresses steps to upgrade OGR to support 64bit integer fields and feature ids.  Many feature data formats support wide integers, and the inability to transform these through OGR causes increasing numbers of problems.   
     10
     11== 64bit FID ==
     12
     13It is planned that feature id's will be handled as type "GIntBig" instead of "long" internally.
     14This will include the nFID field of the OGRFeature.  The existing GetFID() and SetFID() methods on the OGRFeature use type long.  It is difficult to change this without significant disruption to existing application code, so it is intended to introduce new methods:
     15
     16{{{
     17  GIntBig  OGRFeature::GetFID64();
     18  OGRErr   OGRFeature::SetFID64(GIntBig nFID );
     19}}}
     20
     21The old methods will be deprecated in favor of the new interfaces in documentation, etc.   Howevever the will continue to exist, and will just cast as needed.  Note that the old interfaces using "long" are already 64bit on 64bit operating systems so there is little harm to applications continuing to use these interfaces on 64bit operating systems.
     22
     23== 64bit Fields ==
     24
     25New field types will be introduced for 64bit integers:
     26
     27{{{
     28   OFTInteger64 = 12
     29   OFTIntegerList64 = 13
     30}}}
     31
     32The OGRField union will be extended to include:
     33
     34{{{
     35    GIntBig     Integer64;
     36    struct {
     37        int nCount;
     38        GIntBig *paList;
     39    } IntegerList64;
     40}}}
     41
     42The OGRFeature class will be extended with these new methods:
     43
     44{{{
     45    GIntBig             GetFieldAsInteger64( int i );
     46    GIntBig             GetFieldAsInteger64( const char *pszFName );
     47    const int          *GetFieldAsIntegerList64( const char *pszFName,
     48                                               int *pnCount );
     49    const int          *GetFieldAsIntegerList64( int i, int *pnCount );
     50
     51    void                SetField( int i, GIntBig nValue );
     52    void                SetField( int i, int nCount, GIntBig * panValues );
     53    void                SetField( const char *pszFName, GIntBig nValue )
     54    void                SetField( const char *pszFName, int nCount,
     55                                  GIntBig * panValues )
     56}}}
     57
     58Furthermore, the new interfaces will internally support setting/getting integer fields, and the integer field methods will support getting/setting 64bit integer fields so that one case can be used for both field types where convenient.
     59
     60== Python / Java / C# / perl Changes ==
     61
     62No thoughts yet on the impact to the various SWIG derived interfaces.
     63
     64== Utilities ==
     65
     66ogr2ogr, ogrinfo and other utilities will be updated to support the new 64bit interfaces.
     67
     68== File Formats ==
     69
     70As appropriate, existing OGR drivers will be updated to support the new interfaces.  In particular an effort will be made to update the database driver interfaces to support 64bit integer columns for use as feature id, though I am not convinced we should create FID columns as 64bit by default when creating new layers as this may cause problems for other applications.
     71
     72== Test Suite ==
     73
     74... it is not yet clear how we would test this change in the test suite ...
     75