SAGA API  v9.2
projections.cpp File Reference
#include "geo_tools.h"
#include "table.h"
#include "shapes.h"
#include "tool_library.h"

Go to the source code of this file.

Macros

#define WKT_GCS_WGS84
 
#define PROJ4_GCS_WGS84   "+proj=longlat +datum=WGS84 +no_defs"
 
#define GET_DATUM(d, p)
 

Enumerations

enum  ESG_PROJ_FIELD_ID {
  PRJ_FIELD_SRID = 0, PRJ_FIELD_AUTH_NAME, PRJ_FIELD_AUTH_SRID, PRJ_FIELD_SRTEXT,
  PRJ_FIELD_PROJ4TEXT
}
 

Functions

CSG_ProjectionsSG_Get_Projections (void)
 
TSG_Projection_Type SG_Get_Projection_Type (const CSG_String &Identifier)
 
CSG_String SG_Get_Projection_Type_Identifier (TSG_Projection_Type Type)
 
CSG_String SG_Get_Projection_Type_Name (TSG_Projection_Type Type)
 
TSG_Projection_Unit SG_Get_Projection_Unit (const CSG_String &Identifier)
 
CSG_String SG_Get_Projection_Unit_Identifier (TSG_Projection_Unit Unit)
 
CSG_String SG_Get_Projection_Unit_Name (TSG_Projection_Unit Unit, bool bSimple)
 
double SG_Get_Projection_Unit_To_Meter (TSG_Projection_Unit Unit)
 
bool SG_Set_Projection_Unit (const CSG_MetaData &m, TSG_Projection_Unit &Unit, CSG_String &Name, double &To_Meter)
 
bool SG_Get_Projected (CSG_Shapes *pSource, CSG_Shapes *pTarget, const CSG_Projection &Target)
 
bool SG_Get_Projected (const CSG_Projection &Source, const CSG_Projection &Target, TSG_Point &Point)
 
bool SG_Get_Projected (const CSG_Projection &Source, const CSG_Projection &Target, TSG_Rect &Rectangle)
 
bool SG_Grid_Get_Geographic_Coordinates (CSG_Grid *pGrid, CSG_Grid *pLon, CSG_Grid *pLat)
 

Variables

CSG_Projections gSG_Projections
 
const char SG_Projection_Units [SG_PROJ_UNIT_Undefined+1][3][32]
 

Macro Definition Documentation

◆ GET_DATUM

#define GET_DATUM (   d,
 
)
Value:
{ CSG_String s; CSG_Projections::_Proj4_Get_Datum(s, p); d.Clear();\
for(int i=0, add=1; i<s.Length(); i++) {\
if( s[i] == '\"' ) { add = add ? 0 : 1; } else if( add ) { d += s[i]; }\
}\
}

◆ PROJ4_GCS_WGS84

#define PROJ4_GCS_WGS84   "+proj=longlat +datum=WGS84 +no_defs"

Definition at line 506 of file projections.cpp.

◆ WKT_GCS_WGS84

#define WKT_GCS_WGS84
Value:
"GEOGCS[\"WGS 84\",AUTHORITY[\"EPSG\",\"4326\"]],"\
"DATUM[\"WGS_1984\",AUTHORITY[\"EPSG\",\"6326\"]],"\
"SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],"\
"PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"\
"UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]]"

Definition at line 499 of file projections.cpp.

Enumeration Type Documentation

◆ ESG_PROJ_FIELD_ID

Enumerator
PRJ_FIELD_SRID 
PRJ_FIELD_AUTH_NAME 
PRJ_FIELD_AUTH_SRID 
PRJ_FIELD_SRTEXT 
PRJ_FIELD_PROJ4TEXT 

Definition at line 693 of file projections.cpp.

Function Documentation

◆ SG_Get_Projected() [1/3]

◆ SG_Get_Projected() [2/3]

◆ SG_Get_Projected() [3/3]

◆ SG_Get_Projection_Type()

◆ SG_Get_Projection_Type_Identifier()

CSG_String SG_Get_Projection_Type_Identifier ( TSG_Projection_Type  Type)

◆ SG_Get_Projection_Type_Name()

◆ SG_Get_Projection_Unit()

TSG_Projection_Unit SG_Get_Projection_Unit ( const CSG_String Identifier)

◆ SG_Get_Projection_Unit_Identifier()

CSG_String SG_Get_Projection_Unit_Identifier ( TSG_Projection_Unit  Unit)

Definition at line 160 of file projections.cpp.

References SG_PROJ_UNIT_Undefined, and SG_Projection_Units.

Referenced by CSG_Projection::Get_Unit_Identifier().

◆ SG_Get_Projection_Unit_Name()

CSG_String SG_Get_Projection_Unit_Name ( TSG_Projection_Unit  Unit,
bool  bSimple 
)

Definition at line 169 of file projections.cpp.

References SG_PROJ_UNIT_Undefined, and SG_Projection_Units.

Referenced by SG_Set_Projection_Unit().

◆ SG_Get_Projection_Unit_To_Meter()

◆ SG_Get_Projections()

CSG_Projections& SG_Get_Projections ( void  )

Definition at line 66 of file projections.cpp.

References gSG_Projections.

Referenced by SG_Initialize_Environment().

◆ SG_Grid_Get_Geographic_Coordinates()

bool SG_Grid_Get_Geographic_Coordinates ( CSG_Grid pGrid,
CSG_Grid pLon,
CSG_Grid pLat 
)

◆ SG_Set_Projection_Unit()

bool SG_Set_Projection_Unit ( const CSG_MetaData m,
TSG_Projection_Unit Unit,
CSG_String Name,
double &  To_Meter 
)

Variable Documentation

◆ gSG_Projections

CSG_Projections gSG_Projections

Definition at line 63 of file projections.cpp.

Referenced by CSG_Projection::Assign(), and SG_Get_Projections().

◆ SG_Projection_Units

const char SG_Projection_Units[SG_PROJ_UNIT_Undefined+1][3][32]
Initial value:
=
{
{ "km" , "Kilometers" , "Kilometer" },
{ "m" , "Meters" , "Meter" },
{ "dm" , "Decimeters" , "Decimeter" },
{ "cm" , "Centimeters", "Centimeter" },
{ "mm" , "Millimeters", "Millimeter" },
{ "kmi" , "Miles" , "International Nautical Mile" },
{ "in" , "Inches" , "International Inch" },
{ "ft" , "Feet" , "International Foot" },
{ "yd" , "Yards" , "International Yard" },
{ "mi" , "Miles" , "International Statute Mile" },
{ "fath" , "Fathoms" , "International Fathom" },
{ "ch" , "Chains" , "International Chain" },
{ "link" , "Links" , "International Link" },
{ "us-in" , "Inches" , "U.S. Surveyor's Inch" },
{ "us-ft" , "Feet" , "U.S. Surveyor's Foot" },
{ "us-yd" , "Yards" , "U.S. Surveyor's Yard" },
{ "us-ch" , "Chains" , "U.S. Surveyor's Chain" },
{ "us-mi" , "Miles" , "U.S. Surveyor's Statute Mile" },
{ "ind-yd", "Yards" , "Indian Yard" },
{ "ind-ft", "Feet" , "Indian Foot" },
{ "ind-ch", "Chains" , "Indian Chain" },
{ "" , "" , "" }
}

Definition at line 116 of file projections.cpp.

Referenced by SG_Get_Projection_Unit(), SG_Get_Projection_Unit_Identifier(), and SG_Get_Projection_Unit_Name().

CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_String
Definition: api_core.h:557