1 : /******************************************************************************
2 : * $Id: tigerpolygoncorrections.cpp 22961 2011-08-20 17:09:59Z rouault $
3 : *
4 : * Project: TIGER/Line Translator
5 : * Purpose: Implements TigerPolygonCorrections, providing access to .RTB files.
6 : * Author: Mark Phillips, mbp@geomtech.com
7 : *
8 : ******************************************************************************
9 : * Copyright (c) 2002, Frank Warmerdam, Mark Phillips
10 : *
11 : * Permission is hereby granted, free of charge, to any person obtaining a
12 : * copy of this software and associated documentation files (the "Software"),
13 : * to deal in the Software without restriction, including without limitation
14 : * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15 : * and/or sell copies of the Software, and to permit persons to whom the
16 : * Software is furnished to do so, subject to the following conditions:
17 : *
18 : * The above copyright notice and this permission notice shall be included
19 : * in all copies or substantial portions of the Software.
20 : *
21 : * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 : * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 : * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24 : * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 : * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26 : * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27 : * DEALINGS IN THE SOFTWARE.
28 : ****************************************************************************/
29 :
30 : #include "ogr_tiger.h"
31 : #include "cpl_conv.h"
32 :
33 : CPL_CVSID("$Id: tigerpolygoncorrections.cpp 22961 2011-08-20 17:09:59Z rouault $");
34 :
35 : #define FILE_CODE "B"
36 :
37 : static const TigerFieldInfo rtB_fields[] = {
38 : // fieldname fmt type OFTType beg end len bDefine bSet bWrite
39 : { "MODULE", ' ', ' ', OFTString, 0, 0, 8, 1, 0, 0 },
40 : { "FILE", 'L', 'N', OFTInteger, 6, 10, 5, 1, 1, 1 },
41 : { "CENID", 'L', 'A', OFTString, 11, 15, 5, 1, 1, 1 },
42 : { "POLYID", 'R', 'N', OFTInteger, 16, 25, 10, 1, 1, 1 },
43 : { "STATECQ", 'L', 'N', OFTInteger, 26, 27, 2, 1, 1, 1 },
44 : { "COUNTYCQ", 'L', 'N', OFTInteger, 28, 30, 3, 1, 1, 1 },
45 : { "TRACTCQ", 'L', 'N', OFTInteger, 31, 36, 6, 1, 1, 1 },
46 : { "BLOCKCQ", 'L', 'A', OFTString, 37, 41, 5, 1, 1, 1 },
47 : { "AIANHHFPCQ", 'L', 'N', OFTInteger, 42, 46, 5, 1, 1, 1 },
48 : { "AIANHHCQ", 'L', 'N', OFTInteger, 47, 50, 4, 1, 1, 1 },
49 : { "AIHHTLICQ", 'L', 'A', OFTString, 51, 51, 1, 1, 1, 1 },
50 : { "AITSCECQ", 'L', 'N', OFTInteger, 52, 54, 3, 1, 1, 1 },
51 : { "AITSCQ", 'L', 'N', OFTInteger, 55, 59, 5, 1, 1, 1 },
52 : { "ANRCCQ", 'L', 'N', OFTInteger, 60, 64, 5, 1, 1, 1 },
53 : { "CONCITCQ", 'L', 'N', OFTInteger, 65, 69, 5, 1, 1, 1 },
54 : { "COUSUBCQ", 'L', 'N', OFTInteger, 70, 74, 5, 1, 1, 1 },
55 : { "SUBMCDCQ", 'L', 'N', OFTInteger, 75, 79, 5, 1, 1, 1 },
56 : { "PLACECQ", 'L', 'N', OFTInteger, 80, 84, 5, 1, 1, 1 },
57 : { "UACC", 'L', 'N', OFTInteger, 85, 89, 5, 1, 1, 1 },
58 : { "URCC", 'L', 'A', OFTString, 90, 90, 1, 1, 1, 1 },
59 : { "RS-B1", 'L', 'A', OFTString, 91, 98, 12, 1, 1, 1 },
60 : };
61 : static const TigerRecordInfo rtB_info =
62 : {
63 : rtB_fields,
64 : sizeof(rtB_fields) / sizeof(TigerFieldInfo),
65 : 98
66 : };
67 :
68 : /************************************************************************/
69 : /* TigerPolygonCorrections() */
70 : /************************************************************************/
71 :
72 7 : TigerPolygonCorrections::TigerPolygonCorrections( OGRTigerDataSource * poDSIn,
73 7 : const char * pszPrototypeModule ) : TigerFileBase(&rtB_info, FILE_CODE)
74 :
75 : {
76 7 : OGRFieldDefn oField("",OFTInteger);
77 :
78 7 : poDS = poDSIn;
79 7 : poFeatureDefn = new OGRFeatureDefn( "PolygonCorrections" );
80 7 : poFeatureDefn->Reference();
81 7 : poFeatureDefn->SetGeomType( wkbNone );
82 :
83 : /* -------------------------------------------------------------------- */
84 : /* Fields from type B record. */
85 : /* -------------------------------------------------------------------- */
86 :
87 7 : AddFieldDefns( psRTInfo, poFeatureDefn );
88 7 : }
|