118 if( Definition && *Definition)
136 if( Definition && *Definition )
164 m_Name =
WKT.Get_Property(
"NAME");
if( m_Name.is_Empty() ) { m_Name =
"unnamed"; }
166 if( !
WKT(
"ID") || !
WKT[
"ID"].Get_Content(
"VAL1", m_Code) || !
WKT[
"ID"].Get_Property(
"NAME", m_Authority) )
170 if( Tokens.
Get_Count() == 2 && !Tokens[0].is_Empty() && Tokens[1].asInt(m_Code) )
172 m_Authority = Tokens[0]; m_Authority.Make_Upper();
176 m_Authority.Clear(); m_Code = -1;
213 if(
PROJ.is_Empty() )
224 m_Name =
WKT.Get_Property(
"NAME");
if( m_Name.is_Empty() ) { m_Name =
"unnamed"; }
226 if( !
WKT(
"ID") || !
WKT[
"ID"].Get_Content(
"VAL1", m_Code) || !
WKT[
"ID"].Get_Property(
"NAME", m_Authority) )
228 m_Authority.Clear(); m_Code = -1;
237 m_Name =
_TL(
"undefined");
238 m_Type = ESG_CRS_Type ::Undefined;
243 m_Authority .Clear();
257 return(
Load(Stream) );
267 return(
Save(Stream, Format) );
306 case ESG_CRS_Format::CODE:
if( !m_Authority.is_Empty() && m_Code > 0 ) { Definition.
Printf(
"%s:%d", m_Authority.c_str(), m_Code); }
break;
343 Projection.Add_Child(
"CODE", m_Code)->Add_Property(
"authority", m_Authority);
374 return( CSG_Projections::_WKT2_to_MetaData(m_WKT2,
false).asText(1) );
387 return(
_TL(
"Unknown Spatial Reference") );
394 if( !m_Name.is_Empty() && m_Name.CmpNoCase(
"<custom>") )
399 if( m_Code > 0 && !m_Authority.is_Empty() )
408 #define ADD_HEAD(name, value) { CSG_String n(name), v(value); n.Replace("_", " "); v.Replace("_", " "); s += CSG_String::Format("<tr><th>%s</th><th>%s</th></tr>", n.c_str(), v.c_str()); }
409 #define ADD_INFO(name, value) { CSG_String n(name), v(value); n.Replace("_", " "); v.Replace("_", " "); s += CSG_String::Format("<tr><td>%s</td><td>%s</td></tr>", n.c_str(), v.c_str()); }
410 #define ADD_CONT(name, entry) if( entry ) { ADD_INFO(name, entry->Get_Content() ); }
411 #define ADD_PROP(name, entry, prop) if( entry && entry->Get_Property(prop) ) { ADD_INFO(name, entry->Get_Property(prop)); }
422 ADD_PROP(
_TL(
"Projection" ), PRJ(
"CONVERSION.METHOD"),
"NAME");
424 if( m_Code > 0 && !m_Authority.is_Empty() )
430 ADD_PROP(
_TL(
"Linear Unit" ), PRJ(
"UNIT"),
"NAME");
432 if( PRJ(
"CONVERSION") )
438 if( Parameter.
Cmp_Name(
"PARAMETER") && Parameter(
"VAL1") )
447 pGCS = PRJ(
"BASEGEODCRS");
451 pGCS =
WKT .Cmp_Name(
"GEOGCRS") ||
WKT .Cmp_Name(
"GEODCRS") ? &
WKT
452 :
WKT[0].Cmp_Name(
"GEOGCRS") ||
WKT[0].Cmp_Name(
"GEODCRS") ? &
WKT[0] : &
WKT[0][0];
462 ADD_PROP(
_TL(
"Prime Meridian" ), GCS(
"PRIMEM" ),
"NAME");
463 ADD_PROP(
_TL(
"Angular Unit" ), GCS(
"PRIMEM.LENGTHUNIT"),
"NAME");
465 ADD_PROP(
_TL(
"Spheroid" ), GCS(
"DATUM.ELLIPSOID" ),
"NAME");
466 ADD_CONT(
_TL(
"Semimajor Axis" ), GCS(
"DATUM.ELLIPSOID.VAL1"));
467 ADD_CONT(
_TL(
"Inverse Flattening" ), GCS(
"DATUM.ELLIPSOID.VAL2"));
468 ADD_CONT(
_TL(
"Extension" ), GCS(
"DATUM.EXTENSION" ));
470 if(
WKT(
"ABRIDGEDTRANSFORMATION") )
480 if( Parameter.
Cmp_Name(
"PARAMETER") && Parameter(
"VAL1") )
513 if( !m_Authority.is_Empty() && !m_Authority.CmpNoCase(
Projection.m_Authority) && m_Code ==
Projection.m_Code )
523 for(
int i=0; i<2; i++)
528 if( !proj[0].CmpNoCase(proj[1]) )
536 #define CMP_CONTENT(a, b ) (a && b && a->Cmp_Content(b->Get_Content()))
537 #define CMP_PROPERTY(a, b, p) (a && b && a->Get_Property(p) && b->Cmp_Property(p, a->Get_Property(p), true))
538 #define CMP_PARAMETER(a, b ) (a && b && ((!a->Cmp_Name("PARAMETER") && !b->Cmp_Name("PARAMETER")) || (CMP_PROPERTY(a, b, "name") && a->Cmp_Content(b->Get_Content()))))
541 CSG_Projections::_WKT1_to_MetaData(
Get_WKT1()),
542 CSG_Projections::_WKT1_to_MetaData(
Projection.Get_WKT1())
543 }, *pGCS[2] = { NULL, NULL };
548 if( !
CMP_CONTENT (
WKT[0](
"PROJECTION"),
WKT[1](
"PROJECTION") ) ) {
return(
false ); }
551 for(
int i=0; i<
WKT[0].Get_Children_Count() && i<
WKT[1].Get_Children_Count(); i++)
556 pGCS[0] =
WKT[0](
"GEOGCS");
557 pGCS[1] =
WKT[1](
"GEOGCS");
565 if( !pGCS[0] || !pGCS[1] )
570 if( !
CMP_CONTENT((*pGCS[0])(
"PRIMEM" ), (*pGCS[1])(
"PRIMEM" )) ) {
return(
false ); }
571 if( !
CMP_CONTENT((*pGCS[0])(
"UNIT" ), (*pGCS[1])(
"UNIT" )) ) {
return(
false ); }
572 if( !
CMP_CONTENT((*pGCS[0])(
"DATUM.SPHEROID.a" ), (*pGCS[1])(
"DATUM.SPHEROID.a" )) ) {
return(
false ); }
573 if( !
CMP_CONTENT((*pGCS[0])(
"DATUM.SPHEROID.rf"), (*pGCS[1])(
"DATUM.SPHEROID.rf")) ) {
return(
false ); }
575 if( (*pGCS[0])(
"DATUM.TOWGS84") || (*pGCS[1])(
"DATUM.TOWGS84") )
577 #define CMP_TOWGS84(id) (\
578 ((*pGCS[0])("DATUM.TOWGS84." id) ? (*pGCS[0])["DATUM.TOWGS84." id].Get_Content().asDouble() : 0.)\
579 == ((*pGCS[1])("DATUM.TOWGS84." id) ? (*pGCS[1])["DATUM.TOWGS84." id].Get_Content().asDouble() : 0.) )
590 if( (*pGCS[0])(
"DATUM.EXTENSION") || (*pGCS[1])(
"DATUM.EXTENSION") )
592 if( !
CMP_CONTENT((*pGCS[0])(
"DATUM.EXTENSION"), (*pGCS[1])(
"DATUM.EXTENSION")) ) {
return(
false ); }
657 m_Authority =
"EPSG";
659 m_PROJ =
"+proj=longlat +datum=WGS84 +no_defs";
661 "GEODCRS[\"WGS 84\","
662 " DATUM[\"World Geodetic System 1984\","
663 " ELLIPSOID[\"WGS 84\",6378137,298.257223563]],"
664 " CS[ellipsoidal,2],"
665 " AXIS[\"geodetic latitude (Lat)\",north],"
666 " AXIS[\"geodetic longitude (Lon)\",east],"
667 " UNIT[\"degree\",0.0174532925199433],"
668 " SCOPE[\"Horizontal component of 3D system.\"],"
670 " BBOX[-90,-180,90,180],"
671 " ID[\"EPSG\",4326]]";
708 if( Zone < 1 || Zone > 60 )
713 int EPSG_ID = (bSouth ? 32700 : 32600) + Zone;
722 "PROJCRS[\"WGS 84 / UTM zone %d%c\","
723 " BASEGEODCRS[\"WGS 84\","
724 " DATUM[\"World Geodetic System 1984\","
725 " ELLIPSOID[\"WGS 84\",6378137,298.257223563,"
726 " LENGTHUNIT[\"metre\",1]]],"
727 " PRIMEM[\"Greenwich\",0,"
728 " ANGLEUNIT[\"degree\",0.0174532925199433]]],"
729 " CONVERSION[\"UTM zone 32N\","
730 " METHOD[\"Transverse Mercator\","
731 " ID[\"EPSG\",9807]],"
732 " PARAMETER[\"Latitude of natural origin\",0,"
733 " ANGLEUNIT[\"degree\",0.0174532925199433],"
734 " ID[\"EPSG\",8801]],"
735 " PARAMETER[\"Longitude of natural origin\",%d,"
736 " ANGLEUNIT[\"degree\",0.0174532925199433],"
737 " ID[\"EPSG\",8802]],"
738 " PARAMETER[\"Scale factor at natural origin\",0.9996,"
739 " SCALEUNIT[\"unity\",1],"
740 " ID[\"EPSG\",8805]],"
741 " PARAMETER[\"False easting\",500000,"
742 " LENGTHUNIT[\"metre\",1],"
743 " ID[\"EPSG\",8806]],"
744 " PARAMETER[\"False northing\",%d,"
745 " LENGTHUNIT[\"metre\",1],"
746 " ID[\"EPSG\",8807]]],"
748 " AXIS[\"(E)\",east,"
750 " LENGTHUNIT[\"metre\",1]],"
751 " AXIS[\"(N)\",north,"
753 " LENGTHUNIT[\"metre\",1]],"
754 " ID[\"EPSG\",32632]]",
755 Zone, bSouth ?
'S' :
'N', 6 * (Zone - 1) - 177, bSouth ? 10000000 : 0, EPSG_ID
803 #if defined(__WXMAC__)
808 Path_Shared = SHARE_PATH;
811 #elif defined(_SAGA_LINUX)
813 Path_Shared = SHARE_PATH;
824 if( _Load(m_pPreferences,
SG_File_Make_Path(Path_Shared,
"saga_preferences",
"srs")) )
833void CSG_Projections::_On_Construction(
void)
843 m_pPreferences =
new CSG_Table(m_pProjections);
853 delete(m_pProjections);
854 delete(m_pPreferences);
860 if( m_pProjections ) { m_pProjections->Del_Records(); }
861 if( m_pPreferences ) { m_pPreferences->Del_Records(); }
872 return( m_pProjections->Get_Count() );
932 return( _Get_Projection(m_pProjections->Get_Record(Index)) );
938 CSG_String Authority(_Authority && *_Authority ? _Authority :
SG_T(
"EPSG"));
940 for(
sLong i=0; i<m_pProjections->Get_Count(); i++)
956 CSG_String Authority(_Authority && *_Authority ? _Authority :
SG_T(
"EPSG"));
958 for(
sLong i=0; i<m_pProjections->Get_Count(); i++)
979bool CSG_Projections::_Add_Preferences(
void)
981 if( !m_pProjections || !m_pPreferences || m_pPreferences->
Get_Count() < 1 )
989 for(
sLong iPreference=0, iProjection=0; iPreference<m_pPreferences->Get_Count() && iProjection<m_pProjections->
Get_Count(); )
991 CSG_Table_Record *pPreference = m_pPreferences->Get_Record_byIndex(iPreference);
992 CSG_Table_Record *pProjection = m_pProjections->Get_Record_byIndex(iProjection);
998 if( Comparison < 0 ) { iProjection++; }
else if( Comparison > 0 ) { iPreference++; }
else
1002 if( Comparison < 0 ) { iProjection++; }
else if( Comparison > 0 ) { iPreference++; }
else
1007 m_pPreferences->Select(pPreference,
true);
1009 iProjection++; iPreference++;
1014 m_pProjections->Del_Index();
1015 m_pPreferences->Del_Index();
1017 if( m_pPreferences->Get_Selection_Count() < m_pPreferences->Get_Count() )
1019 for(
sLong iPreference=0; iPreference<m_pPreferences->Get_Count(); iPreference++)
1021 CSG_Table_Record *pPreference = m_pPreferences->Get_Record(iPreference);
1025 m_pProjections->Add_Record(pPreference);
1030 m_pPreferences->Select();
1038 for(
sLong i=0; i<m_pPreferences->Get_Count(); i++)
1050 if( m_bUseInternalDB )
1052 for(
sLong i=0; i<m_pProjections->Get_Count(); i++)
1071 int i = Authority_Code.
Find(
':');
1073 if( i > 1 && i < (
int)Authority_Code.
Length() - 2 )
1130 return( _Load(m_pProjections, File, bAppend) );
1136 return( m_pProjections->Save(File) );
1252 WKT.Get_Property(
"authority_name", Authority);
1253 WKT.Get_Property(
"authority_code", Code);
1256 if( !Authority.
is_Empty() && Code > 0 )
1313 for(
int i=0; i<m_pProjections->Get_Count(); i++)
1319 if(
WKT.Length() == 0 )
1328 WKT =
WKT.AfterFirst(
'[');
1337 Projection.Set_Value(0,
WKT.AfterFirst(
'\"').BeforeFirst(
'\"'));
1353 for(
int i=0; i<Projections.
Get_Count(); i++)
1358 Projections[i].asString(1),
1359 Projections[i].asInt (2),
1360 Projections[i].asString(3),
1361 Projections[i].asString(0)
1367 Projections[i].asString(1),
1368 Projections[i].asInt (2),
1369 Projections[i].asString(0)
1385 if(
WKT.is_Empty() )
1390 int Colon = -1, Bracket = -1;
1392 for(
int i=0, bracket=0, quota=0; Colon<0 && i<(int)
WKT.Length(); i++)
1397 bracket++;
if( bracket == 1 ) { Bracket = i; }
1401 bracket--;
if( bracket < 0 ) {
return(
false ); }
1407 quota = quota ? 0 : 1;
1412 if( bracket == 0 && quota == 0 )
1420 CSG_String Value = Colon < 0 ?
WKT :
WKT.Left(Colon);
1426 if( Value.
Find(
'\"') == 0 )
1439 CSG_String Key(Value.
Left(Bracket)); Key.Trim_Both();
1441 CSG_String Content(Value.
AfterFirst(
'[').
BeforeLast(
']')); Content.Trim_Both(); Content.Replace(
"\n",
"");
1443 _WKT2_to_MetaData(*MetaData.
Add_Child(Key), Content);
1448 _WKT2_to_MetaData(MetaData,
WKT.Right(
WKT.Length() - Colon - 1));
1457 CSG_MetaData MetaData; _WKT2_to_MetaData(MetaData,
WKT);
1461 CSG_MetaData *pMetaData = MetaData.
Get_Child(0);
1475 return( *pMetaData );
1488 if( !
WKT.is_Empty() )
1490 XML = _WKT2_to_MetaData(
WKT,
false).asText(1);
1506 for(
int i=0, l=-1; l!=0 && i<(int)
WKT.Length(); i++)
1512 default : Key +=
WKT[i];
break;
1514 case '[':
case '(': l = 1 ;
break;
1515 case ')':
case ']':
return(
false );
1524 default : bAdd =
true;
break;
1525 case '\"' : bAdd =
false;
break;
1526 case '[' :
case '(': bAdd = ++l > 1;
break;
1527 case ']' :
case ')': bAdd = l-- > 1;
break;
1528 case ',' :
if( !(bAdd = l > 1) ) Content.
Add(
"");
break;
1538 if( Key.
is_Empty() || Content[0].is_Empty() )
1544 if( !Key.
Cmp(
"AUTHORITY") && Content.
Get_Count() == 2 )
1552 CSG_MetaData *pKey = MetaData.
Add_Child(Key);
1565 || (!Key.
Cmp(
"PARAMETER" ) && Content.
Get_Count() >= 2) )
1572 if( (!Key.
Cmp(
"SPHEROID" ) && Content.
Get_Count() >= 3) )
1579 if( (!Key.
Cmp(
"TOWGS84" ) && Content.
Get_Count() >= 7) )
1590 if( (!Key.
Cmp(
"EXTENSION" ) && Content.
Get_Count() >= 2) )
1596 if( (!Key.
Cmp(
"PROJECTION") && Content.
Get_Count() >= 1) )
1602 for(
int i=0; i<Content.
Get_Count(); i++)
1604 _WKT1_to_MetaData(*pKey, Content[i]);
1613 CSG_MetaData MetaData;
1615 _WKT1_to_MetaData(MetaData,
WKT);
1640 if(
WKT.Cmp_Property(
"name",
"WGS84") )
1642 Proj4 +=
" +datum=WGS84";
1649 if( !
WKT(
"SPHEROID") ||
WKT[
"SPHEROID"].Get_Children_Count() != 2
1650 || !
WKT[
"SPHEROID"][0].Get_Content().asDouble(a) || a <= 0.
1651 || !
WKT[
"SPHEROID"][1].Get_Content().asDouble(b) || b < 0. )
1656 b = b > 0. ? a - a / b : a;
1661 if(
WKT(
"TOWGS84") &&
WKT[
"TOWGS84"].Get_Children_Count() == 7 )
1663 Proj4 +=
" +towgs84=";
1665 for(
int i=0; i<7; i++)
1672 Proj4 +=
WKT[
"TOWGS84"][i].Get_Content();
1684 CSG_MetaData m = _WKT1_to_MetaData(
WKT);
1692 int Authority_Code; CSG_String Authority_Name;
1721 if( !m(
"DATUM") || !_WKT1_to_Proj4_Set_Datum(Proj4, m[
"DATUM"]) )
1726 if( m(
"PRIMEM") && m[
"PRIMEM"].Get_Content().asDouble(d) && d != 0. )
1745 Proj4 =
"+proj=longlat";
1747 if( !m(
"DATUM") || !_WKT1_to_Proj4_Set_Datum(Proj4, m[
"DATUM"]) )
1752 if( m(
"PRIMEM") && m[
"PRIMEM"].Get_Content().asDouble(d) && d != 0. )
1770 if( m.
Cmp_Name(
"PROJCS") && m(
"GEOGCS") && m(
"PROJECTION") && m_WKT1_to_Proj4.Get_Translation(m[
"PROJECTION"].Get_Content(), Proj4) )
1772 if( m[
"PROJECTION"].Cmp_Content(
"Transverse_Mercator") )
1774 double Scale = -1., Easting = -1., Northing = -1., Meridian = -1., Latitude = -1.;
1778 if( m[i].Cmp_Name(
"PARAMETER") )
1782 if( m[i].Cmp_Property(
"name",
"central_meridian" ,
true) && m[i].Get_Content().asDouble(v) ) Meridian = v;
1783 if( m[i].Cmp_Property(
"name",
"latitude_of_origin",
true) && m[i].Get_Content().asDouble(v) ) Latitude = v;
1784 if( m[i].Cmp_Property(
"name",
"scale_factor" ,
true) && m[i].Get_Content().asDouble(v) ) Scale = v;
1785 if( m[i].Cmp_Property(
"name",
"false_easting" ,
true) && m[i].Get_Content().asDouble(v) ) Easting = v;
1786 if( m[i].Cmp_Property(
"name",
"false_northing" ,
true) && m[i].Get_Content().asDouble(v) ) Northing = v;
1790 if( Latitude == 0. && Scale == 0.9996 && Easting == 500000. && (Northing == 0. || Northing == 10000000.) )
1792 Proj4 =
"+proj=utm";
1794 if( !m[
"GEOGCS"](
"DATUM") || !_WKT1_to_Proj4_Set_Datum(Proj4, m[
"GEOGCS"][
"DATUM"]) )
1801 if( Northing == 10000000. )
1813 Proj4 =
"+proj=" + Proj4;
1815 if( !m[
"GEOGCS"](
"DATUM") || !_WKT1_to_Proj4_Set_Datum(Proj4, m[
"GEOGCS"][
"DATUM"]) )
1820 if( m(
"PRIMEM") && m[
"PRIMEM"].Get_Content().asDouble(d) && d != 0. )
1827 if( m[i].Cmp_Name(
"PARAMETER") )
1829 CSG_String Parameter;
1831 if( m_WKT1_to_Proj4.Get_Translation(m[i].Get_Property(
"name"), Parameter) )
1833 Proj4 +=
" +" + Parameter +
"=" + m[i].
Get_Content();
1842 if( m(
"UNIT") && m[
"UNIT"].Get_Content().asDouble(d) && d != 0. && d != 1. )
1864 return( Proj4.
Find(
"+" + Key) >= 0 );
1872 int l, i = Proj4.
Find(
"+" + Key +
"=");
1876 for(++i, l=0; l<2 && i<(int)Proj4.
Length(); i++)
1880 case '=': l++;
break;
1881 case '+': l=2;
break;
1882 case ' ': l=2;
break;
1892 return( Value.
Length() > 0 );
1898 const char ellipsoid[42][2][32] =
1900 {
"MERIT" ,
"6378137.0,298.257" },
1901 {
"SGS85" ,
"6378136.0,298.257" },
1902 {
"GRS80" ,
"6378137.0,298.2572221" },
1903 {
"IAU76" ,
"6378140.0,298.257" },
1904 {
"airy" ,
"6377563.396,299.3249753" },
1905 {
"APL4.9" ,
"6378137.0,298.25" },
1906 {
"NWL9D" ,
"6378145.0,298.25" },
1907 {
"mod_airy" ,
"6377340.189,299.3249374" },
1908 {
"andrae" ,
"6377104.43,300" },
1909 {
"aust_SA" ,
"6378160.0,298.25" },
1910 {
"GRS67" ,
"6378160.0,298.2471674" },
1911 {
"bessel" ,
"6377397.155,299.1528128" },
1912 {
"bess_nam" ,
"6377483.865,299.1528128" },
1913 {
"clrk66" ,
"6378206.4,294.9786982" },
1914 {
"clrk80" ,
"6378249.145,293.4663" },
1915 {
"CPM" ,
"6375738.7,334.29" },
1916 {
"delmbr" ,
"6376428.0,311.5" },
1917 {
"engelis" ,
"6378136.05,298.2566" },
1918 {
"evrst30" ,
"6377276.345,300.8017" },
1919 {
"evrst48" ,
"6377304.063,300.8017" },
1920 {
"evrst56" ,
"6377301.243,300.8017" },
1921 {
"evrst69" ,
"6377295.664,300.8017" },
1922 {
"evrstSS" ,
"6377298.556,300.8017" },
1923 {
"fschr60" ,
"6378166.0,298.3" },
1924 {
"fschr60m" ,
"6378155.0,298.3" },
1925 {
"fschr68" ,
"6378150.0,298.3" },
1926 {
"helmert" ,
"6378200.0,298.3" },
1927 {
"hough" ,
"6378270.0,297" },
1928 {
"intl" ,
"6378388.0,297" },
1929 {
"krass" ,
"6378245.0,298.3" },
1930 {
"kaula" ,
"6378163.0,298.24" },
1931 {
"lerch" ,
"6378139.0,298.257" },
1932 {
"mprts" ,
"6397300.0,191" },
1933 {
"new_intl" ,
"6378157.5,298.2496154" },
1934 {
"plessis" ,
"6376523.0,308.6409971" },
1935 {
"SEasia" ,
"6378155.0,298.3000002" },
1936 {
"walbeck" ,
"6376896.0,302.7800002" },
1937 {
"WGS60" ,
"6378165.0,298.3" },
1938 {
"WGS66" ,
"6378145.0,298.25" },
1939 {
"WGS72" ,
"6378135.0,298.26" },
1940 {
"WGS84" ,
"6378137.0,298.2572236" },
1941 {
"sphere" ,
"6370997.0,-1" }
1945 if( _Proj4_Read_Parameter(Value, Proj4,
"ellps") )
1947 for(
int i=0; i<42; i++)
1959 double a = _Proj4_Read_Parameter(Value, Proj4,
"a" ) && Value.
asDouble(a) ? a : 6378137.;
1961 double b = _Proj4_Read_Parameter(Value, Proj4,
"b" ) && Value.
asDouble(b) ? a / (a - b)
1962 : _Proj4_Read_Parameter(Value, Proj4,
"rf") && Value.asDouble(b) ? b
1963 : _Proj4_Read_Parameter(Value, Proj4,
"f" ) && Value.asDouble(b) ? 1. / b
1964 : _Proj4_Read_Parameter(Value, Proj4,
"e" ) && Value.asDouble(b) ? a / (a - sqrt(b*b - a*a))
1965 : _Proj4_Read_Parameter(Value, Proj4,
"es") && Value.asDouble(b) ? a / (a - sqrt( b - a*a))
1976 const char datum[9][3][64] =
1978 {
"WGS84" ,
"WGS84" ,
"0,0,0,0,0,0,0" },
1979 {
"GGRS87" ,
"GRS80" ,
"-199.87,74.79,246.62,0,0,0,0" },
1980 {
"NAD83" ,
"GRS80" ,
"0,0,0,0,0,0,0" },
1982 {
"potsdam" ,
"bessel" ,
"606.0,23.0,413.0,0,0,0,0" },
1983 {
"carthage" ,
"clark80" ,
"-263.0,6.0,431.0,0,0,0,0" },
1984 {
"hermannskogel" ,
"bessel" ,
"653.0,-212.0,449.0,0,0,0,0" },
1985 {
"ire65" ,
"mod_airy" ,
"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15" },
1986 {
"nzgd49" ,
"intl" ,
"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993" },
1987 {
"OSGB36" ,
"airy" ,
"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894" }
1990 CSG_String Spheroid, ToWGS84;
1993 if( _Proj4_Read_Parameter(Value, Proj4,
"datum") )
1995 for(
int i=0; i<9; i++)
2007 if( _Proj4_Get_Ellipsoid(Spheroid, Proj4) )
2009 Value =
"DATUM[\"Datum\","+ Spheroid;
2011 if( _Proj4_Read_Parameter(ToWGS84, Proj4,
"towgs84") )
2017 ToWGS84 +=
",0,0,0,0";
2020 Value +=
",TOWGS84[" + ToWGS84 +
"]";
2024 Value +=
",TOWGS84[0,0,0,0,0,0,0]";
2033 Value =
"DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563],TOWGS84[0,0,0,0,0,0,0]]";
2041 const char meridian[12][2][16] =
2043 {
"lisbon" ,
"-9.131906111" },
2044 {
"paris" ,
"2.337229167" },
2045 {
"bogota" ,
"74.08091667" },
2046 {
"madrid" ,
"-3.687911111" },
2047 {
"rome" ,
"12.45233333" },
2048 {
"bern" ,
"7.439583333" },
2049 {
"jakarta" ,
"106.8077194" },
2050 {
"ferro" ,
"-17.66666667" },
2051 {
"brussels" ,
"4.367975" },
2052 {
"stockholm" ,
"18.05827778" },
2053 {
"athens" ,
"23.7163375" },
2054 {
"oslo" ,
"10.72291667" }
2058 if( _Proj4_Read_Parameter(Value, Proj4,
"pm") )
2060 for(
int i=0; i<12; i++)
2074 Value.
Printf(
"PRIMEM[\"Prime_Meridian\",%f]", d);
2081 Value =
"PRIMEM[\"Greenwich\",0]";
2101 if( _Proj4_Read_Parameter(Value, Proj4,
"to_meter") && Value.
asDouble(d) && d > 0. && d != 1. )
2103 Value.
Printf(
"UNIT[\"Unit\",%f]", d);
2109 Value =
"UNIT[\"metre\",1]";
2118 CSG_String Value, ProjCS;
2121 if( !_Proj4_Read_Parameter(ProjCS, Proj4,
"proj") )
2142 WKT =
"GEOGCS[\"GCS\"";
2144 if( _Proj4_Get_Datum (Value, Proj4) ) {
WKT +=
"," + Value; }
2145 if( _Proj4_Get_Prime_Meridian(Value, Proj4) ) {
WKT +=
"," + Value; }
2146 if( _Proj4_Get_Unit (Value, Proj4) ) {
WKT +=
"," + Value; }
2165 CSG_String GeogCS =
"GEOGCS[\"GCS\"";
2167 if( _Proj4_Get_Datum (Value, Proj4) ) { GeogCS +=
"," + Value; }
2168 if( _Proj4_Get_Prime_Meridian(Value, Proj4) ) { GeogCS +=
"," + Value; }
2169 if( _Proj4_Get_Unit (Value, Proj4) ) { GeogCS +=
"," + Value; }
else { GeogCS +=
"UNIT[\"degree\",0.01745329251994328]"; }
2191 if( !m_Proj4_to_WKT1.Get_Translation(ProjCS, Value) )
2205 if( !_Proj4_Read_Parameter(Value, Proj4,
"zone") || !Value.
asDouble(Zone) )
2212 bool South = _Proj4_Find_Parameter(Proj4,
"south");
2214 WKT =
CSG_String::Format(
"PROJCS[\"UTM zone %d%c\",%s,PROJECTION[Transverse_Mercator]", (
int)Zone, South ?
'S' :
'N', GeogCS.
c_str());
2221 WKT +=
",UNIT[\"metre\",1]]";
2233 while( ProjCS.
Find(
'+') >= 0 )
2240 if( m_Proj4_to_WKT1.Get_Translation(Value, Key) )
2244 if( Value.
Find(
'+') >= 0 )
2249 WKT +=
",PARAMETER[\"" + Key +
"\"," + Value +
"]";
2256 if( _Proj4_Get_Unit(Value, Proj4) ) {
WKT +=
"," + Value; }
2291 default :
return(
"UNDEFINED" );
2304 default :
return(
_TL(
"Unknown Coordinate System" ) );
2351 default:
return(
"" );
2381 default:
return(
"" );
2411 default :
return( 1. );
2423bool CSG_Projections::_Set_Dictionary(
CSG_Table &Dictionary,
int Direction)
2425 const char Translation[][4][128] = {
2429 {
"aea" ,
" ",
"Albers_Conic_Equal_Area" ,
"Albers Equal Area" },
2430 {
"aea" ,
"<",
"Albers" ,
"[ESRI] Albers Equal Area" },
2431 {
"aeqd" ,
" ",
"Azimuthal_Equidistant" ,
"Azimuthal Equidistant" },
2432 {
"airy" ,
" ",
"Airy 1830" ,
"Airy 1830" },
2433 {
"aitoff" ,
" ",
"Sphere_Aitoff" ,
"Aitoff" },
2434 {
"alsk" ,
" ",
"Mod_Stererographics_of_Alaska" ,
"*) Mod. Stererographics of Alaska" },
2435 {
"Amersfoort" ,
"<",
"D_Amersfoort" ,
"[ESRI] datum RD_NEW" },
2436 {
"Amersfoort" ,
"<",
"GCS_Amersfoort" ,
"[ESRI] GCS RD_NEW" },
2437 {
"Amersfoort / RD New",
"<",
"Amersfoort_RD_New" ,
"[ESRI] RD_NEW" },
2438 {
"apian" ,
" ",
"Apian_Globular_I" ,
"*) Apian Globular I" },
2439 {
"august" ,
" ",
"August_Epicycloidal" ,
"*) August Epicycloidal" },
2440 {
"bacon" ,
" ",
"Bacon_Globular" ,
"*) Bacon Globular" },
2441 {
"bipc" ,
" ",
"Bipolar_conic_of_western_hemisphere" ,
"*) Bipolar conic of western hemisphere" },
2442 {
"boggs" ,
" ",
"Boggs_Eumorphic" ,
"*) Boggs Eumorphic" },
2443 {
"bonne" ,
" ",
"Bonne" ,
"Bonne (Werner lat_1=90)" },
2444 {
"cass" ,
" ",
"Cassini_Soldner" ,
"Cassini" },
2445 {
"cass" ,
"<",
"Cassini" ,
"[ESRI] Cassini" },
2446 {
"cc" ,
" ",
"Central_Cylindrical" ,
"*) Central Cylindrical" },
2447 {
"cea" ,
" ",
"Cylindrical_Equal_Area" ,
"Equal Area Cylindrical, alias: Lambert Cyl.Eq.A., Normal Authalic Cyl. (FME), Behrmann (SP=30), Gall Orthogr. (SP=45)" },
2448 {
"cea" ,
"<",
"Behrmann" ,
"[ESRI] Behrmann (standard parallel = 30)" },
2449 {
"chamb" ,
" ",
"Chamberlin_Trimetric" ,
"*) Chamberlin Trimetric" },
2450 {
"collg" ,
" ",
"Collignon" ,
"*) Collignon" },
2451 {
"crast" ,
" ",
"Craster_Parabolic" ,
"[ESRI] Craster Parabolic (Putnins P4)" },
2452 {
"denoy" ,
" ",
"Denoyer_Semi_Elliptical" ,
"*) Denoyer Semi-Elliptical" },
2453 {
"eck1" ,
" ",
"Eckert_I" ,
"*) Eckert I" },
2454 {
"eck2" ,
" ",
"Eckert_II" ,
"*) Eckert II" },
2455 {
"eck3" ,
" ",
"Eckert_III" ,
"*) Eckert III" },
2456 {
"eck4" ,
" ",
"Eckert_IV" ,
"Eckert IV" },
2457 {
"eck5" ,
" ",
"Eckert_V" ,
"*) Eckert V" },
2458 {
"eck6" ,
" ",
"Eckert_VI" ,
"Eckert VI" },
2459 {
"eqearth" ,
" ",
"Equal_Earth" ,
"*) Equal Earth" },
2460 {
"eqc" ,
" ",
"Equirectangular" ,
"Equidistant Cylindrical (Plate Caree)" },
2461 {
"eqc" ,
"<",
"Equidistant_Cylindrical" ,
"[ESRI] Equidistant Cylindrical (Plate Caree)" },
2462 {
"eqc" ,
"<",
"Plate_Carree" ,
"[ESRI] Equidistant Cylindrical (Plate Caree)" },
2463 {
"eqdc" ,
" ",
"Equidistant_Conic" ,
"*) Equidistant Conic" },
2464 {
"euler" ,
" ",
"Euler" ,
"*) Euler" },
2465 {
"etmerc" ,
" ",
"Extended_Transverse_Mercator" ,
"*) Extended Transverse Mercator" },
2466 {
"fahey" ,
" ",
"Fahey" ,
"*) Fahey" },
2467 {
"fouc" ,
" ",
"Foucault" ,
"*) Foucaut" },
2468 {
"fouc_s" ,
" ",
"Foucault_Sinusoidal" ,
"*) Foucaut Sinusoidal" },
2469 {
"gall" ,
" ",
"Gall_Stereographic" ,
"Gall (Gall Stereographic)" },
2470 {
"geocent" ,
" ",
"Geocentric" ,
"*) Geocentric" },
2471 {
"geos" ,
" ",
"GEOS" ,
"Geostationary Satellite View" },
2472 {
"gins8" ,
" ",
"Ginsburg_VIII" ,
"*) Ginsburg VIII (TsNIIGAiK)" },
2473 {
"gn_sinu" ,
" ",
"General_Sinusoidal_Series" ,
"*) General Sinusoidal Series" },
2474 {
"gnom" ,
" ",
"Gnomonic" ,
"Gnomonic" },
2475 {
"goode" ,
" ",
"Goode_Homolosine" ,
"*) Goode Homolosine" },
2476 {
"gs48" ,
" ",
"Mod_Stererographics_48" ,
"*) Mod. Stererographics of 48 U.S." },
2477 {
"gs50" ,
" ",
"Mod_Stererographics_50" ,
"*) Mod. Stererographics of 50 U.S." },
2478 {
"hammer" ,
" ",
"Hammer_Eckert_Greifendorff" ,
"*) Hammer & Eckert-Greifendorff" },
2479 {
"hatano" ,
" ",
"Hatano_Asymmetrical_Equal_Area" ,
"*) Hatano Asymmetrical Equal Area" },
2480 {
"igh" ,
" ",
"Interrupted_Goodes_Homolosine" ,
"*) Interrupted Goode's Homolosine" },
2481 {
"igh_o" ,
" ",
"Interrupted_Goodes_Homolosine_Ocean" ,
"*) Interrupted Goode's Homolosine (Ocean)" },
2482 {
"imw_p" ,
" ",
"International_Map_of_the_World_Polyconic" ,
"*) International Map of the World Polyconic" },
2483 {
"kav5" ,
" ",
"Kavraisky_V" ,
"*) Kavraisky V" },
2484 {
"kav7" ,
" ",
"Kavraisky_VII" ,
"*) Kavraisky VII" },
2485 {
"krovak" ,
" ",
"Krovak" ,
"Krovak" },
2486 {
"labrd" ,
" ",
"Laborde_Oblique_Mercator" ,
"*) Laborde" },
2487 {
"laea" ,
" ",
"Lambert_Azimuthal_Equal_Area" ,
"Lambert Azimuthal Equal Area" },
2488 {
"lagrng" ,
" ",
"Lagrange" ,
"*) Lagrange" },
2489 {
"larr" ,
" ",
"Larrivee" ,
"*) Larrivee" },
2490 {
"lask" ,
" ",
"Laskowski" ,
"*) Laskowski" },
2491 {
"lcc" ,
"<",
"Lambert_Conformal_Conic_1SP" ,
"Lambert Conformal Conic (1 standard parallel)" },
2492 {
"lcc" ,
"<",
"Lambert_Conformal_Conic_2SP" ,
"Lambert Conformal Conic (2 standard parallels)" },
2493 {
"lcc" ,
" ",
"Lambert_Conformal_Conic" ,
"Lambert Conformal Conic" },
2494 {
"lcca" ,
" ",
"Lambert_Conformal_Conic_Alternative" ,
"*) Lambert Conformal Conic Alternative" },
2495 {
"leac" ,
" ",
"Lambert_Equal_Area_Conic" ,
"*) Lambert Equal Area Conic" },
2496 {
"lee_os" ,
" ",
"Lee_Oblated_Stereographic" ,
"*) Lee Oblated Stereographic" },
2497 {
"loxim" ,
" ",
"Loximuthal" ,
"[ESRI] Loximuthal" },
2498 {
"lsat" ,
" ",
"Space_oblique_for_LANDSAT" ,
"*) Space oblique for LANDSAT" },
2499 {
"mbt_s" ,
" ",
"McBryde_Thomas_Flat_Polar_Sine" ,
"*) McBryde-Thomas Flat-Polar Sine" },
2500 {
"mbt_fps" ,
" ",
"McBryde_Thomas_Flat_Polar_Sine_2" ,
"*) McBryde-Thomas Flat-Pole Sine (No. 2)" },
2501 {
"mbtfpp" ,
" ",
"McBryde_Thomas_Flat_Polar_Parabolic" ,
"*) McBride-Thomas Flat-Polar Parabolic" },
2502 {
"mbtfpq" ,
" ",
"Flat_Polar_Quartic" ,
"[ESRI] McBryde-Thomas Flat-Polar Quartic" },
2503 {
"mbtfps" ,
" ",
"McBryde_Thomas_Flat_Polar_Sinusoidal" ,
"*) McBryde-Thomas Flat-Polar Sinusoidal" },
2504 {
"merc" ,
" ",
"Mercator" ,
"[ESRI] Mercator" },
2505 {
"merc" ,
"<",
"Mercator_1SP" ,
"Mercator (1 standard parallel)" },
2506 {
"merc" ,
"<",
"Mercator_2SP" ,
"Mercator (2 standard parallels)" },
2507 {
"mil_os" ,
" ",
"Miller_Oblated_Stereographic" ,
"*) Miller Oblated Stereographic" },
2508 {
"mill" ,
" ",
"Miller_Cylindrical" ,
"Miller Cylindrical" },
2509 {
"moll" ,
" ",
"Mollweide" ,
"Mollweide" },
2510 {
"murd1" ,
" ",
"Murdoch_I" ,
"*) Murdoch I" },
2511 {
"murd2" ,
" ",
"Murdoch_II" ,
"*) Murdoch II" },
2512 {
"murd3" ,
" ",
"Murdoch_III" ,
"*) Murdoch III" },
2513 {
"nell" ,
" ",
"Nell" ,
"*) Nell" },
2514 {
"nell_h" ,
" ",
"Nell_Hammer" ,
"*) Nell-Hammer" },
2515 {
"nicol" ,
" ",
"Nicolosi_Globular" ,
"*) Nicolosi Globular" },
2516 {
"nsper" ,
" ",
"Near_sided_perspective" ,
"*) Near-sided perspective" },
2517 {
"nzmg" ,
" ",
"New_Zealand_Map_Grid" ,
"New Zealand Map Grid" },
2518 {
"ob_tran" ,
" ",
"General_Oblique_Transformation" ,
"*) General Oblique Transformation" },
2519 {
"ocea" ,
" ",
"Oblique_Cylindrical_Equal_Area" ,
"*) Oblique Cylindrical Equal Area" },
2520 {
"oea" ,
" ",
"Oblated_Equal_Area" ,
"*) Oblated Equal Area" },
2521 {
"omerc" ,
" ",
"Hotine_Oblique_Mercator" ,
"Oblique Mercator" },
2522 {
"omerc" ,
"<",
"Oblique_Mercator" ,
"Oblique Mercator" },
2523 {
"ortel" ,
" ",
"Ortelius_Oval" ,
"*) Ortelius Oval" },
2524 {
"ortho" ,
" ",
"Orthographic" ,
"Orthographic (ESRI: World from Space)" },
2525 {
"pconic" ,
" ",
"Perspective_Conic" ,
"*) Perspective Conic" },
2526 {
"poly" ,
" ",
"Polyconic" ,
"*) Polyconic (American)" },
2527 {
"putp1" ,
" ",
"Putnins_P1" ,
"*) Putnins P1" },
2528 {
"putp2" ,
" ",
"Putnins_P2" ,
"*) Putnins P2" },
2529 {
"putp3" ,
" ",
"Putnins_P3" ,
"*) Putnins P3" },
2530 {
"putp3p" ,
" ",
"Putnins_P3'" ,
"*) Putnins P3'" },
2531 {
"putp4p" ,
" ",
"Putnins_P4'" ,
"*) Putnins P4'" },
2532 {
"putp5" ,
" ",
"Putnins_P5" ,
"*) Putnins P5" },
2533 {
"putp5p" ,
" ",
"Putnins_P5'" ,
"*) Putnins P5'" },
2534 {
"putp6" ,
" ",
"Putnins_P6" ,
"*) Putnins P6" },
2535 {
"putp6p" ,
" ",
"Putnins_P6'" ,
"*) Putnins P6'" },
2536 {
"qua_aut" ,
" ",
"Quartic_Authalic" ,
"[ESRI] Quart c Authalic" },
2537 {
"robin" ,
" ",
"Robinson" ,
"Robinson" },
2538 {
"rouss" ,
" ",
"Roussilhe_Stereographic" ,
"*) Roussilhe Stereographic" },
2539 {
"rpoly" ,
" ",
"Rectangular_Polyconic" ,
"*) Rectangular Polyconic" },
2540 {
"sinu" ,
" ",
"Sinusoidal" ,
"Sinusoidal (Sanson-Flamsteed)" },
2541 {
"somerc" ,
" ",
"Hotine_Oblique_Mercator" ,
"Swiss Oblique Mercator" },
2542 {
"somerc" ,
"<",
"Swiss_Oblique_Cylindrical" ,
"Swiss Oblique Cylindrical" },
2543 {
"somerc" ,
"<",
"Hotine_Oblique_Mercator_Azimuth_Center" ,
"[ESRI] Swiss Oblique Mercator/Cylindrical" },
2544 {
"stere" ,
"<",
"Polar_Stereographic" ,
"Stereographic" },
2545 {
"stere" ,
" ",
"Stereographic" ,
"[ESRI] Stereographic" },
2546 {
"sterea" ,
" ",
"Oblique_Stereographic" ,
"Oblique Stereographic Alternative" },
2547 {
"sterea" ,
"<",
"Double_Stereographic" ,
"[ESRI]" },
2548 {
"gstmerc" ,
" ",
"Gauss_Schreiber_Transverse_Mercator" ,
"*) Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion)" },
2549 {
"tcc" ,
" ",
"Transverse_Central_Cylindrical" ,
"*) Transverse Central Cylindrical" },
2550 {
"tcea" ,
" ",
"Transverse_Cylindrical_Equal_Area" ,
"*) Transverse Cylindrical Equal Area" },
2551 {
"tissot" ,
" ",
"Tissot_Conic" ,
"*) Tissot Conic" },
2552 {
"tmerc" ,
" ",
"Transverse_Mercator" ,
"*) Transverse Mercator" },
2553 {
"tmerc" ,
"<",
"Gauss_Kruger" ,
"[ESRI] DHDN" },
2554 {
"tpeqd" ,
" ",
"Two_Point_Equidistant" ,
"*) Two Point Equidistant" },
2555 {
"tpers" ,
" ",
"Tilted_perspective" ,
"*) Tilted perspective" },
2556 {
"ups" ,
" ",
"Universal_Polar_Stereographic" ,
"*) Universal Polar Stereographic" },
2557 {
"urm5" ,
" ",
"Urmaev_V" ,
"*) Urmaev V" },
2558 {
"urmfps" ,
" ",
"Urmaev_Flat_Polar_Sinusoidal" ,
"*) Urmaev Flat-Polar Sinusoidal" },
2559 {
"utm" ,
">",
"Transverse_Mercator" ,
"*) Universal Transverse Mercator (UTM)" },
2560 {
"vandg" ,
"<",
"Van_Der_Grinten_I" ,
"[ESRI] van der Grinten (I)" },
2561 {
"vandg" ,
" ",
"VanDerGrinten" ,
"van der Grinten (I)" },
2562 {
"vandg2" ,
" ",
"VanDerGrinten_II" ,
"*) van der Grinten II" },
2563 {
"vandg3" ,
" ",
"VanDerGrinten_III" ,
"*) van der Grinten III" },
2564 {
"vandg4" ,
" ",
"VanDerGrinten_IV" ,
"*) van der Grinten IV" },
2565 {
"vitk1" ,
" ",
"Vitkovsky_I" ,
"*) Vitkovsky I" },
2566 {
"wag1" ,
" ",
"Wagner_I" ,
"*) Wagner I (Kavraisky VI)" },
2567 {
"wag2" ,
" ",
"Wagner_II" ,
"*) Wagner II" },
2568 {
"wag3" ,
" ",
"Wagner_III" ,
"*) Wagner III" },
2569 {
"wag4" ,
" ",
"Wagner_IV" ,
"*) Wagner IV" },
2570 {
"wag5" ,
" ",
"Wagner_V" ,
"*) Wagner V" },
2571 {
"wag6" ,
" ",
"Wagner_VI" ,
"*) Wagner VI" },
2572 {
"wag7" ,
" ",
"Wagner_VII" ,
"*) Wagner VII" },
2573 {
"webmerc" ,
" ",
"Mercator_1SP" ,
"Web Mercator" },
2574 {
"webmerc" ,
"<",
"Mercator_Auxiliary_Sphere" ,
"[ESRI] Web Mercator" },
2575 {
"weren" ,
" ",
"Werenskiold_I" ,
"*) Werenskiold I" },
2576 {
"wink1" ,
" ",
"Winkel_I" ,
"[ESRI] Winkel I" },
2577 {
"wink2" ,
" ",
"Winkel_II" ,
"[ESRI] Winkel II" },
2578 {
"wintri" ,
" ",
"Winkel_Tripel" ,
"[ESRI] Winkel Tripel" },
2581 {
"alpha" ,
" ",
"azimuth" ,
"? Used with Oblique Mercator and possibly a few others" },
2582 {
"k" ,
">",
"scale_factor" ,
"Scaling factor (old name)" },
2583 {
"K" ,
">",
"scale_factor" ,
"? Scaling factor (old name)" },
2584 {
"k_0" ,
" ",
"scale_factor" ,
"Scaling factor (new name)" },
2585 {
"lat_0" ,
" ",
"latitude_of_origin" ,
"Latitude of origin" },
2586 {
"lat_0" ,
"<",
"latitude_of_center" ,
"Latitude of center" },
2587 {
"lat_0" ,
"<",
"central_parallel" ,
"[ESRI] Latitude of center" },
2588 {
"lat_1" ,
" ",
"standard_parallel_1" ,
"Latitude of first standard parallel" },
2589 {
"lat_2" ,
" ",
"standard_parallel_2" ,
"Latitude of second standard parallel" },
2590 {
"lat_ts" ,
">",
"latitude_of_origin" ,
"Latitude of true scale" },
2591 {
"lon_0" ,
" ",
"central_meridian" ,
"Central meridian" },
2592 {
"lon_0" ,
"<",
"longitude_of_center" ,
"Longitude of center" },
2593 {
"lonc" ,
">",
"longitude_of_center" ,
"? Longitude used with Oblique Mercator and possibly a few others" },
2594 {
"x_0" ,
" ",
"false_easting" ,
"False easting" },
2595 {
"y_0" ,
" ",
"false_northing" ,
"False northing" },
2605 {
"h" ,
" ",
"satellite_height",
"Satellite height (geos - Geostationary Satellite View)" },
2677 Dictionary.
Set_Name(
"Proj.4-WKT Dictionary");
2679 if( Direction == 0 )
2686 for(
int i=0; *Translation[i][0]; i++)
2688 CSG_Table_Record &Entry = *Dictionary.
Add_Record();
2696 else if( Direction > 0 )
2701 for(
int i=0; *Translation[i][0]; i++)
2703 if( Translation[i][1][0] !=
'<' )
2705 CSG_Table_Record &Entry = *Dictionary.
Add_Record();
2712 else if( Direction < 0 )
2717 for(
int i=0; *Translation[i][0]; i++)
2719 if( Translation[i][1][0] !=
'>' )
2721 CSG_Table_Record &Entry = *Dictionary.
Add_Record();
2733bool CSG_Projections::_Set_Dictionary(
void)
2737 return( _Set_Dictionary(Table, 1) && m_Proj4_to_WKT1.Create(&Table, 0, 1,
true)
2738 && _Set_Dictionary(Table, -1) && m_WKT1_to_Proj4.Create(&Table, 0, 1,
true)
2756 return( pTarget ? pTarget->
Create(*pSource) :
true );
2761 pTarget->
Create(*pSource); pSource = pTarget;
2778 bool bResult = pTool->
Execute();
2781 Data.
Delete(pSource,
true);
2794 if( Source == Target )
2815 bool bResult = pTool->
Execute();
2836 if( Source == Target )
2871 bool bResult =
false;
void SG_UI_Msg_Add_Error(const char *Message)
int SG_UI_Msg_Lock(bool bOn)
void SG_UI_ProgressAndMsg_Lock(bool bOn)
CSG_String SG_UI_Get_Application_Path(bool bPathOnly)
CSG_String SG_UI_Get_API_Path(void)
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
SAGA_API_DLL_EXPORT CSG_Strings SG_String_Tokenize(const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT)
SAGA_API_DLL_EXPORT CSG_String SG_Get_String(double Value, int Precision=-99)
CSG_Data_Object * Add(CSG_Data_Object *pObject)
bool Delete(CSG_Data_Object *pObject, bool bDetach=false)
void Set_Name(const CSG_String &Name)
CSG_Projection & Get_Projection(void)
size_t Write(void *Buffer, size_t Size, size_t Count=1) const
size_t Read(void *Buffer, size_t Size, size_t Count=1) const
bool is_Writing(void) const
bool is_Reading(void) const
virtual bool is_Valid(void) const
bool Create(const CSG_Grid &Grid)
const CSG_Grid_System & Get_System(void) const
double asDouble(void) const
const SG_Char * asString(void) const
virtual ~CSG_Projection(void)
CSG_String Get_Type_Identifier(void) const
bool is_Geographic(void) const
static const CSG_Projection & Get_GCS_WGS84(void)
CSG_String Get_Unit_Name(void) const
CSG_String Get_JSON(void) const
static CSG_Projection Get_UTM_WGS84(int Zone, bool bSouth=false)
bool is_Projection(void) const
const CSG_String & Get_PROJ(void) const
ESG_CRS_Type Get_Type(void) const
CSG_String Get_ESRI(void) const
const CSG_String & Get_WKT2(void) const
bool is_Equal(const CSG_Projection &Projection) const
bool Set_UTM_WGS84(int Zone, bool bSouth=false)
CSG_String Get_XML(void) const
bool Save(const CSG_String &File, ESG_CRS_Format Format=ESG_CRS_Format::WKT) const
CSG_String Get_Description(bool bDetails=false) const
CSG_String Get_Unit_Identifier(void) const
bool Create(const CSG_Projection &Projection)
CSG_String Get_Type_Name(void) const
double Get_Unit_To_Meter(void) const
bool Load(const CSG_String &File)
CSG_String Get_WKT1(void) const
static ESG_Projection_Unit Get_Unit(const CSG_String &Identifier)
CSG_String Get_Names_List(ESG_CRS_Type Type=ESG_CRS_Type::Undefined, bool bAddSelect=true) const
bool Create(bool LoadCodeList=true)
bool Save(const CSG_String &File)
CSG_Projection Get_Projection(sLong Index) const
static bool Parse(const CSG_String &Definition, CSG_String *PROJ=NULL, CSG_String *WKT2=NULL, CSG_String *WKT1=NULL, CSG_String *JSON=NULL, CSG_String *ESRI=NULL)
virtual ~CSG_Projections(void)
static CSG_String Get_CRS_Type_Identifier(ESG_CRS_Type Type)
static const CSG_String Get_Unit_Name(ESG_Projection_Unit Unit, bool bSimple=true)
static const CSG_String Get_Unit_Identifier(ESG_Projection_Unit Unit)
static CSG_String Convert_WKT2_to_XML(const CSG_String &WKT)
sLong Get_Count(void) const
static ESG_CRS_Type Get_CRS_Type(const CSG_String &Identifier)
bool Add(const CSG_Projection &Projection)
bool Load(const CSG_String &File, bool bAppend=false)
bool Get_Preference(CSG_Projection &Projection, int Code, const CSG_String &Authority) const
static CSG_String Get_CRS_Type_Name(ESG_CRS_Type Type)
static double Get_Unit_To_Meter(ESG_Projection_Unit Unit)
friend class CSG_Projection
virtual int Add_Point(double x, double y, int iPart=0)=0
virtual bool is_Valid(void) const
virtual CSG_Shape * Add_Shape(CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY)
virtual const CSG_Rect & Get_Extent(void)
bool Create(const CSG_Shapes &Shapes)
size_t Length(void) const
CSG_String AfterFirst(char Character) const
bool asInt(int &Value) const
int CmpNoCase(const CSG_String &String) const
int Cmp(const CSG_String &String) const
CSG_String BeforeFirst(char Character) const
size_t Replace(const CSG_String &Old, const CSG_String &New, bool bReplaceAll=true)
CSG_String BeforeLast(char Character) const
static CSG_String Format(const char *Format,...)
int Find(char Character, bool fromEnd=false) const
bool asDouble(double &Value) const
const SG_Char * c_str(void) const
CSG_String & Make_Lower(void)
int Printf(const char *Format,...)
bool is_Empty(void) const
CSG_String Left(size_t count) const
bool Add(const CSG_Strings &Strings)
int Get_Count(void) const
bool Set_Value(int Field, const CSG_String &Value)
int asInt(int Field) const
bool is_Selected(void) const
const SG_Char * asString(int Field, int Decimals=-99) const
sLong Get_Count(void) const
virtual bool Destroy(void)
virtual bool Del_Records(void)
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
bool Set_Index(CSG_Index &Index, int Field, bool bAscending=true) const
virtual CSG_Table_Record * Get_Record(sLong Index) const
int Get_Field_Count(void) const
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
CSG_Table_Record * Get_Record_byIndex(sLong Index) const
CSG_Projections gSG_Projections
bool SG_Get_Projected(CSG_Shapes *pSource, CSG_Shapes *pTarget, const CSG_Projection &Target)
#define CMP_PARAMETER(a, b)
#define CMP_PROPERTY(a, b, p)
bool SG_Grid_Get_Geographic_Coordinates(CSG_Grid *pGrid, CSG_Grid *pLon, CSG_Grid *pLat)
#define ADD_INFO(name, value)
#define ADD_HEAD(name, value)
#define ADD_PROP(name, entry, prop)
#define ADD_CONT(name, entry)
#define CMP_CONTENT(a, b)
CSG_Projections & SG_Get_Projections(void)