Line data Source code
1 : /******************************************************************************
2 : *
3 : * Project: TIGER/Line Translator
4 : * Purpose: Implements TigerIDHistory, providing access to .RTH files.
5 : * Author: Frank Warmerdam, warmerdam@pobox.com
6 : *
7 : ******************************************************************************
8 : * Copyright (c) 1999, Frank Warmerdam
9 : *
10 : * SPDX-License-Identifier: MIT
11 : ****************************************************************************/
12 :
13 : #include "ogr_tiger.h"
14 : #include "cpl_conv.h"
15 :
16 : static const char FILE_CODE[] = "H";
17 :
18 : static const TigerFieldInfo rtH_fields[] = {
19 : // fieldname fmt type OFTType beg end len bDefine bSet
20 : {"MODULE", ' ', ' ', OFTString, 0, 0, 8, 1, 0},
21 : {"FILE", 'L', 'N', OFTString, 6, 10, 5, 1, 1},
22 : {"STATE", 'L', 'N', OFTInteger, 6, 7, 2, 1, 1},
23 : {"COUNTY", 'L', 'N', OFTInteger, 8, 10, 3, 1, 1},
24 : {"TLID", 'R', 'N', OFTInteger, 11, 20, 10, 1, 1},
25 : {"HIST", 'L', 'A', OFTString, 21, 21, 1, 1, 1},
26 : {"SOURCE", 'L', 'A', OFTString, 22, 22, 1, 1, 1},
27 : {"TLIDFR1", 'R', 'N', OFTInteger, 23, 32, 10, 1, 1},
28 : {"TLIDFR2", 'R', 'N', OFTInteger, 33, 42, 10, 1, 1},
29 : {"TLIDTO1", 'R', 'N', OFTInteger, 43, 52, 10, 1, 1},
30 : {"TLIDTO2", 'R', 'N', OFTInteger, 53, 62, 10, 1, 1}};
31 : static const TigerRecordInfo rtH_info = {
32 : rtH_fields, sizeof(rtH_fields) / sizeof(TigerFieldInfo), 62};
33 :
34 : /************************************************************************/
35 : /* TigerIDHistory() */
36 : /************************************************************************/
37 :
38 0 : TigerIDHistory::TigerIDHistory(OGRTigerDataSource *poDSIn,
39 0 : CPL_UNUSED const char *pszPrototypeModule)
40 0 : : TigerFileBase(&rtH_info, FILE_CODE)
41 : {
42 0 : poDS = poDSIn;
43 0 : poFeatureDefn = new OGRFeatureDefn("IDHistory");
44 0 : poFeatureDefn->Reference();
45 0 : poFeatureDefn->SetGeomType(wkbNone);
46 :
47 : /* -------------------------------------------------------------------- */
48 : /* Fields from record type H */
49 : /* -------------------------------------------------------------------- */
50 :
51 0 : AddFieldDefns(psRTInfo, poFeatureDefn);
52 0 : }
|