/src/gdal/ogr/ogrsf_frmts/tiger/tigerzerocellid.cpp
Line | Count | Source |
1 | | /****************************************************************************** |
2 | | * |
3 | | * Project: TIGER/Line Translator |
4 | | * Purpose: Implements TigerZeroCellID, providing access to .RTT files. |
5 | | * Author: Mark Phillips, mbp@geomtech.com |
6 | | * |
7 | | ****************************************************************************** |
8 | | * Copyright (c) 2002, Frank Warmerdam, Mark Phillips |
9 | | * |
10 | | * SPDX-License-Identifier: MIT |
11 | | ****************************************************************************/ |
12 | | |
13 | | #include "ogr_tiger.h" |
14 | | #include "cpl_conv.h" |
15 | | |
16 | | static const char T_FILE_CODE[] = "T"; |
17 | | |
18 | | static const TigerFieldInfo rtT_fields[] = { |
19 | | // fieldname fmt type OFTType beg end len bDefine bSet |
20 | | {"MODULE", ' ', ' ', OFTString, 0, 0, 8, 1, 0}, |
21 | | {"FILE", 'L', 'N', OFTInteger, 6, 10, 5, 1, 1}, |
22 | | {"TZID", 'R', 'N', OFTInteger, 11, 20, 10, 1, 1}, |
23 | | {"SOURCE", 'L', 'A', OFTString, 21, 30, 10, 1, 1}, |
24 | | {"FTRP", 'L', 'A', OFTString, 31, 47, 17, 1, 1}}; |
25 | | static const TigerRecordInfo rtT_info = { |
26 | | rtT_fields, sizeof(rtT_fields) / sizeof(TigerFieldInfo), 47}; |
27 | | |
28 | | /************************************************************************/ |
29 | | /* TigerZeroCellID() */ |
30 | | /************************************************************************/ |
31 | | |
32 | | TigerZeroCellID::TigerZeroCellID(OGRTigerDataSource *poDSIn, |
33 | | CPL_UNUSED const char *pszPrototypeModule) |
34 | 205 | : TigerFileBase(&rtT_info, T_FILE_CODE) |
35 | 205 | { |
36 | 205 | poDS = poDSIn; |
37 | 205 | poFeatureDefn = new OGRFeatureDefn("ZeroCellID"); |
38 | 205 | poFeatureDefn->Reference(); |
39 | 205 | poFeatureDefn->SetGeomType(wkbNone); |
40 | | |
41 | | /* -------------------------------------------------------------------- */ |
42 | | /* Fields from type T record. */ |
43 | | /* -------------------------------------------------------------------- */ |
44 | | |
45 | 205 | AddFieldDefns(psRTInfo, poFeatureDefn); |
46 | 205 | } |
47 | | |
48 | 205 | TigerZeroCellID::~TigerZeroCellID() = default; |