]> git.mxchange.org Git - flightgear.git/blob - Polygon/names.cxx
Moved AreaType get_shapefile_type(GDBFile *dbf, int rec) to where it
[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 == "AirportKeep" ) {
34         return AirportKeepArea;
35     } else if ( area == "AirportIgnore" ) {
36         return AirportIgnoreArea;
37     } else if ( (area == "Swamp or Marsh")
38                 || (area == "Marsh") ) {
39         return MarshArea;
40     } else if ( (area == "Bay  Estuary or Ocean")
41                 || (area == "Ocean") ) {
42         return OceanArea;
43     } else if ( area == "Lake" ) {
44         return LakeArea;
45     } else if ( area == "Lake   Dry" ) {
46         return DryLakeArea;
47     } else if ( (area == "Lake   Intermittent")
48                 || (area == "IntermittentLake") ) {
49         return IntLakeArea;
50     } else if ( area == "Reservoir" ) {
51         return ReservoirArea;
52     } else if ( area == "Reservoir   Intermittent" ) {
53         return IntReservoirArea;
54     } else if ( area == "Stream" ) {
55         return StreamArea;
56     } else if ( area == "Canal" ) {
57         return CanalArea;
58     } else if ( area == "Glacier" ) {
59         return GlacierArea;
60     } else if ( area == "Void Area" ) {
61         return VoidArea;
62     } else if ( area == "Null" ) {
63         return NullArea;
64     } else {
65         cout << "unknown area = '" << area << "'" << endl;
66         // cout << "area = " << area << endl;
67         // for ( int i = 0; i < area.length(); i++ ) {
68         //  cout << i << ") " << (int)area[i] << endl;
69         // }
70         return UnknownArea;
71     }
72 }
73
74
75 // return text from of area name
76 string get_area_name( AreaType area ) {
77     if ( area == AirportKeepArea ) {
78         return "AirportKeep";
79     } else if ( area == AirportIgnoreArea ) {
80         return "AirportIgnore";
81     } else if ( area == MarshArea ) {
82         return "Marsh";
83     } else if ( area == OceanArea ) {
84         return "Ocean";
85     } else if ( area == LakeArea ) {
86         return "Lake";
87     } else if ( area == DryLakeArea ) {
88         return "DryLake";
89     } else if ( area == IntLakeArea ) {
90         return "IntermittentLake";
91     } else if ( area == ReservoirArea ) {
92         return "Reservoir";
93     } else if ( area == IntReservoirArea ) {
94         return "IntermittentReservoir";
95     } else if ( area == StreamArea ) {
96         return "Stream";
97     } else if ( area == CanalArea ) {
98         return "Canal";
99     } else if ( area == GlacierArea ) {
100         return "Glacier";
101     } else if ( area == VoidArea ) {
102         return "VoidArea";
103     } else if ( area == NullArea ) {
104         return "Null";
105     } else {
106         cout << "unknown area code = " << (int)area << endl;
107         return "Unknown";
108     }
109 }
110
111
112 // $Log$
113 // Revision 1.5  1999/03/22 23:49:29  curt
114 // Moved AreaType get_shapefile_type(GDBFile *dbf, int rec) to where it
115 // belongs in ShapeFile/
116 //
117 // Revision 1.4  1999/03/13 18:47:04  curt
118 // Removed an unused variable.
119 //
120 // Revision 1.3  1999/03/02 01:03:58  curt
121 // Added more reverse lookup support.
122 //
123 // Revision 1.2  1999/03/01 15:35:52  curt
124 // Generalized the routines a bit to make them more useful.
125 //
126 // Revision 1.1  1999/02/25 21:30:24  curt
127 // Initial revision.
128 //
129 // Revision 1.1  1999/02/23 01:29:05  curt
130 // Additional progress.
131 //