1999-02-25 21:30:24 +00:00
|
|
|
// names.cxx -- process shapefiles names
|
|
|
|
//
|
|
|
|
// Written by Curtis Olson, started February 1999.
|
|
|
|
//
|
|
|
|
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
#include <Include/compiler.h>
|
|
|
|
|
|
|
|
#include STL_STRING
|
|
|
|
|
|
|
|
#include "names.hxx"
|
|
|
|
|
|
|
|
|
1999-03-01 15:35:52 +00:00
|
|
|
// return area type from text name
|
|
|
|
AreaType get_area_type( string area ) {
|
1999-05-13 02:37:56 +00:00
|
|
|
if ( area == "SomeSort" ) {
|
|
|
|
return SomeSortOfArea;
|
1999-03-27 05:31:24 +00:00
|
|
|
} else if ( area == "AirportKeep" ) {
|
1999-02-25 21:30:24 +00:00
|
|
|
return AirportKeepArea;
|
|
|
|
} else if ( area == "AirportIgnore" ) {
|
|
|
|
return AirportIgnoreArea;
|
1999-03-01 15:35:52 +00:00
|
|
|
} else if ( (area == "Swamp or Marsh")
|
|
|
|
|| (area == "Marsh") ) {
|
1999-02-25 21:30:24 +00:00
|
|
|
return MarshArea;
|
1999-03-02 01:03:58 +00:00
|
|
|
} else if ( (area == "Bay Estuary or Ocean")
|
|
|
|
|| (area == "Ocean") ) {
|
1999-02-25 21:30:24 +00:00
|
|
|
return OceanArea;
|
|
|
|
} else if ( area == "Lake" ) {
|
|
|
|
return LakeArea;
|
1999-03-27 05:31:24 +00:00
|
|
|
} else if ( (area == "Lake Dry")
|
|
|
|
|| (area == "DryLake") ) {
|
1999-02-25 21:30:24 +00:00
|
|
|
return DryLakeArea;
|
1999-03-01 15:35:52 +00:00
|
|
|
} else if ( (area == "Lake Intermittent")
|
|
|
|
|| (area == "IntermittentLake") ) {
|
1999-02-25 21:30:24 +00:00
|
|
|
return IntLakeArea;
|
|
|
|
} else if ( area == "Reservoir" ) {
|
|
|
|
return ReservoirArea;
|
1999-04-01 13:52:11 +00:00
|
|
|
} else if ( (area == "Reservoir Intermittent")
|
|
|
|
|| (area == "IntermittentReservoir") ) {
|
1999-02-25 21:30:24 +00:00
|
|
|
return IntReservoirArea;
|
|
|
|
} else if ( area == "Stream" ) {
|
|
|
|
return StreamArea;
|
|
|
|
} else if ( area == "Canal" ) {
|
|
|
|
return CanalArea;
|
|
|
|
} else if ( area == "Glacier" ) {
|
|
|
|
return GlacierArea;
|
1999-05-13 02:37:56 +00:00
|
|
|
} else if ( area == "Default" ) {
|
|
|
|
return DefaultArea;
|
1999-02-25 21:30:24 +00:00
|
|
|
} else if ( area == "Void Area" ) {
|
|
|
|
return VoidArea;
|
|
|
|
} else if ( area == "Null" ) {
|
|
|
|
return NullArea;
|
|
|
|
} else {
|
|
|
|
cout << "unknown area = '" << area << "'" << endl;
|
|
|
|
// cout << "area = " << area << endl;
|
1999-03-01 15:35:52 +00:00
|
|
|
// for ( int i = 0; i < area.length(); i++ ) {
|
|
|
|
// cout << i << ") " << (int)area[i] << endl;
|
|
|
|
// }
|
1999-02-25 21:30:24 +00:00
|
|
|
return UnknownArea;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-03-01 15:35:52 +00:00
|
|
|
// return text from of area name
|
1999-02-25 21:30:24 +00:00
|
|
|
string get_area_name( AreaType area ) {
|
1999-03-27 05:31:24 +00:00
|
|
|
if ( area == DefaultArea ) {
|
|
|
|
return "Default";
|
|
|
|
} else if ( area == AirportKeepArea ) {
|
1999-02-25 21:30:24 +00:00
|
|
|
return "AirportKeep";
|
|
|
|
} else if ( area == AirportIgnoreArea ) {
|
|
|
|
return "AirportIgnore";
|
|
|
|
} else if ( area == MarshArea ) {
|
|
|
|
return "Marsh";
|
|
|
|
} else if ( area == OceanArea ) {
|
|
|
|
return "Ocean";
|
|
|
|
} else if ( area == LakeArea ) {
|
|
|
|
return "Lake";
|
|
|
|
} else if ( area == DryLakeArea ) {
|
|
|
|
return "DryLake";
|
|
|
|
} else if ( area == IntLakeArea ) {
|
|
|
|
return "IntermittentLake";
|
|
|
|
} else if ( area == ReservoirArea ) {
|
|
|
|
return "Reservoir";
|
|
|
|
} else if ( area == IntReservoirArea ) {
|
|
|
|
return "IntermittentReservoir";
|
|
|
|
} else if ( area == StreamArea ) {
|
|
|
|
return "Stream";
|
|
|
|
} else if ( area == CanalArea ) {
|
|
|
|
return "Canal";
|
|
|
|
} else if ( area == GlacierArea ) {
|
|
|
|
return "Glacier";
|
|
|
|
} else if ( area == VoidArea ) {
|
|
|
|
return "VoidArea";
|
|
|
|
} else if ( area == NullArea ) {
|
|
|
|
return "Null";
|
|
|
|
} else {
|
|
|
|
cout << "unknown area code = " << (int)area << endl;
|
|
|
|
return "Unknown";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|