1 : /******************************************************************************
2 : * $Id: tigerzipplus4.cpp 22961 2011-08-20 17:09:59Z rouault $
3 : *
4 : * Project: TIGER/Line Translator
5 : * Purpose: Implements TigerZipPlus4, providing access to .RTZ files.
6 : * Author: Frank Warmerdam, warmerdam@pobox.com
7 : *
8 : ******************************************************************************
9 : * Copyright (c) 1999, Frank Warmerdam
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: tigerzipplus4.cpp 22961 2011-08-20 17:09:59Z rouault $");
34 :
35 : #define FILE_CODE "Z"
36 :
37 : static const TigerFieldInfo rtZ_fields[] = {
38 : // fieldname fmt type OFTType beg end len bDefine bSet bWrite
39 : { "MODULE", ' ', ' ', OFTString, 0, 0, 8, 1, 0, 0 },
40 : { "TLID", 'R', 'N', OFTInteger, 6, 15, 10, 1, 1, 1 },
41 : { "RTSQ", 'R', 'N', OFTInteger, 16, 18, 3, 1, 1, 1 },
42 : { "ZIP4L", 'L', 'N', OFTInteger, 19, 22, 4, 1, 1, 1 },
43 : { "ZIP4R", 'L', 'N', OFTInteger, 23, 26, 4, 1, 1, 1 }
44 : };
45 : static const TigerRecordInfo rtZ_info =
46 : {
47 : rtZ_fields,
48 : sizeof(rtZ_fields) / sizeof(TigerFieldInfo),
49 : 26
50 : };
51 :
52 : /************************************************************************/
53 : /* TigerZipPlus4() */
54 : /************************************************************************/
55 :
56 7 : TigerZipPlus4::TigerZipPlus4( OGRTigerDataSource * poDSIn,
57 7 : const char * pszPrototypeModule ) : TigerFileBase(&rtZ_info, FILE_CODE)
58 :
59 : {
60 7 : poDS = poDSIn;
61 7 : poFeatureDefn = new OGRFeatureDefn( "ZipPlus4" );
62 7 : poFeatureDefn->Reference();
63 7 : poFeatureDefn->SetGeomType( wkbNone );
64 :
65 : /* -------------------------------------------------------------------- */
66 : /* Fields from type Z record. */
67 : /* -------------------------------------------------------------------- */
68 :
69 7 : AddFieldDefns( psRTInfo, poFeatureDefn );
70 :
71 7 : }
|