]> git.mxchange.org Git - flightgear.git/blob - Polygon/names.cxx
Version 0.6.0
[flightgear.git] / Polygon / names.cxx
1 // names.cxx -- process shapefiles names
2 //
3 // Written by Curtis Olson, started February 1999.
4 //
5 // Copyright (C) 1999  Curtis L. Olson  - curt@flightgear.org
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22 // (Log is kept at end of this file)
23  
24 #include <Include/compiler.h>
25
26 #include STL_STRING
27
28 #include "names.hxx"
29
30
31 // return area type from text name
32 AreaType get_area_type( string area ) {
33     if ( area == "Default" ) {
34         return DefaultArea;
35     } else if ( area == "AirportKeep" ) {
36         return AirportKeepArea;
37     } else if ( area == "AirportIgnore" ) {
38         return AirportIgnoreArea;
39     } else if ( (area == "Swamp or Marsh")
40                 || (area == "Marsh") ) {
41         return MarshArea;
42     } else if ( (area == "Bay  Estuary or Ocean")
43                 || (area == "Ocean") ) {
44         return OceanArea;
45     } else if ( area == "Lake" ) {
46         return LakeArea;
47     } else if ( (area == "Lake   Dry")
48                 || (area == "DryLake") ) {
49         return DryLakeArea;
50     } else if ( (area == "Lake   Intermittent")
51                 || (area == "IntermittentLake") ) {
52         return IntLakeArea;
53     } else if ( area == "Reservoir" ) {
54         return ReservoirArea;
55     } else if ( (area == "Reservoir   Intermittent")
56                 || (area == "IntermittentReservoir") ) {
57         return IntReservoirArea;
58     } else if ( area == "Stream" ) {
59         return StreamArea;
60     } else if ( area == "Canal" ) {
61         return CanalArea;
62     } else if ( area == "Glacier" ) {
63         return GlacierArea;
64     } else if ( area == "Void Area" ) {
65         return VoidArea;
66     } else if ( area == "Null" ) {
67         return NullArea;
68     } else {
69         cout << "unknown area = '" << area << "'" << endl;
70         // cout << "area = " << area << endl;
71         // for ( int i = 0; i < area.length(); i++ ) {
72         //  cout << i << ") " << (int)area[i] << endl;
73         // }
74         return UnknownArea;
75     }
76 }
77
78
79 // return text from of area name
80 string get_area_name( AreaType area ) {
81     if ( area == DefaultArea ) {
82         return "Default";
83     } else if ( area == AirportKeepArea ) {
84         return "AirportKeep";
85     } else if ( area == AirportIgnoreArea ) {
86         return "AirportIgnore";
87     } else if ( area == MarshArea ) {
88         return "Marsh";
89     } else if ( area == OceanArea ) {
90         return "Ocean";
91     } else if ( area == LakeArea ) {
92         return "Lake";
93     } else if ( area == DryLakeArea ) {
94         return "DryLake";
95     } else if ( area == IntLakeArea ) {
96         return "IntermittentLake";
97     } else if ( area == ReservoirArea ) {
98         return "Reservoir";
99     } else if ( area == IntReservoirArea ) {
100         return "IntermittentReservoir";
101     } else if ( area == StreamArea ) {
102         return "Stream";
103     } else if ( area == CanalArea ) {
104         return "Canal";
105     } else if ( area == GlacierArea ) {
106         return "Glacier";
107     } else if ( area == VoidArea ) {
108         return "VoidArea";
109     } else if ( area == NullArea ) {
110         return "Null";
111     } else {
112         cout << "unknown area code = " << (int)area << endl;
113         return "Unknown";
114     }
115 }
116
117
118 // $Log$
119 // Revision 1.7  1999/04/01 13:52:13  curt
120 // Version 0.6.0
121 // Shape name tweak.
122 // Removing tool: FixNode
123 //
124 // Revision 1.6  1999/03/27 05:31:24  curt
125 // Make 0 the default area type since this corresponds well with the conventions
126 //   used by the triangulator.
127 //
128 // Revision 1.5  1999/03/22 23:49:29  curt
129 // Moved AreaType get_shapefile_type(GDBFile *dbf, int rec) to where it
130 // belongs in ShapeFile/
131 //
132 // Revision 1.4  1999/03/13 18:47:04  curt
133 // Removed an unused variable.
134 //
135 // Revision 1.3  1999/03/02 01:03:58  curt
136 // Added more reverse lookup support.
137 //
138 // Revision 1.2  1999/03/01 15:35:52  curt
139 // Generalized the routines a bit to make them more useful.
140 //
141 // Revision 1.1  1999/02/25 21:30:24  curt
142 // Initial revision.
143 //
144 // Revision 1.1  1999/02/23 01:29:05  curt
145 // Additional progress.
146 //