98 m_Name = Projection.m_Name;
99 m_Type = Projection.m_Type;
100 m_Unit = Projection.m_Unit;
102 m_WKT2 = Projection.m_WKT2;
103 m_PROJ = Projection.m_PROJ;
104 m_Authority = Projection.m_Authority;
105 m_Code = Projection.m_Code;
118 if( Definition && *Definition)
136 if( Definition && *Definition )
162 m_Name =
WKT.Get_Property(
"NAME");
if( m_Name.
is_Empty() ) { m_Name =
"unnamed"; }
164 if( !
WKT(
"ID") || !
WKT[
"ID"].Get_Content(
"VAL1", m_Code) || !
WKT[
"ID"].Get_Property(
"NAME", m_Authority) )
168 if( Tokens.
Get_Count() == 2 && !Tokens[0].is_Empty() && Tokens[1].asInt(m_Code) )
170 m_Authority = Tokens[0]; m_Authority.
Make_Upper();
174 m_Authority.
Clear(); m_Code = -1;
203 m_Name =
_TL(
"undefined");
204 m_Type = ESG_CRS_Type ::Undefined;
205 m_Unit = ESG_Projection_Unit::Undefined;
209 m_Authority .
Clear();
223 return(
Load(Stream) );
233 return(
Save(Stream, Format) );
267 case ESG_CRS_Format::WKT1: Definition =
Get_WKT1();
break;
268 case ESG_CRS_Format::WKT2: Definition =
Get_WKT2();
break;
269 case ESG_CRS_Format::PROJ: Definition =
Get_PROJ();
break;
270 case ESG_CRS_Format::JSON: Definition =
Get_JSON();
break;
271 case ESG_CRS_Format::ESRI: Definition =
Get_ESRI();
break;
272 case ESG_CRS_Format::CODE:
if( !m_Authority.
is_Empty() && m_Code > 0 ) { Definition.
Printf(
"%s:%d", m_Authority.
c_str(), m_Code); }
break;
284 if( Projection(
"WKT2") &&
Create(Projection[
"WKT2"].Get_Content()) ) {
return(
true ); }
285 if( Projection(
"WKT1") &&
Create(Projection[
"WKT1"].Get_Content()) ) {
return(
true ); }
286 if( Projection(
"PROJ") &&
Create(Projection[
"PROJ"].Get_Content()) ) {
return(
true ); }
291 if( Projection(
"OGC_WKT") &&
Create(Projection[
"OGC_WKT"].Get_Content()) ) {
return(
true ); }
292 if( Projection(
"PROJ4" ) &&
Create(Projection[
"PROJ4" ].Get_Content()) ) {
return(
true ); }
338 return( CSG_Projections::_WKT2_to_MetaData(m_WKT2,
false).asText(1) );
351 return(
_TL(
"Unknown Spatial Reference") );
367 if( m_Code > 0 && !m_Authority.
is_Empty() )
376 #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()); }
377 #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()); }
378 #define ADD_CONT(name, entry) if( entry ) { ADD_INFO(name, entry->Get_Content() ); }
379 #define ADD_PROP(name, entry, prop) if( entry && entry->Get_Property(prop) ) { ADD_INFO(name, entry->Get_Property(prop)); }
390 ADD_PROP(
_TL(
"Projection" ), PRJ(
"CONVERSION.METHOD"),
"NAME");
392 if( m_Code > 0 && !m_Authority.
is_Empty() )
398 ADD_PROP(
_TL(
"Linear Unit" ), PRJ(
"UNIT"),
"NAME");
400 if( PRJ(
"CONVERSION") )
406 if( Parameter.
Cmp_Name(
"PARAMETER") && Parameter(
"VAL1") )
415 pGCS = PRJ(
"BASEGEODCRS");
419 pGCS =
WKT .Cmp_Name(
"GEOGCRS") ||
WKT .Cmp_Name(
"GEODCRS") ? &
WKT
420 :
WKT[0].Cmp_Name(
"GEOGCRS") ||
WKT[0].Cmp_Name(
"GEODCRS") ? &
WKT[0] : &
WKT[0][0];
430 ADD_PROP(
_TL(
"Prime Meridian" ), GCS(
"PRIMEM" ),
"NAME");
431 ADD_PROP(
_TL(
"Angular Unit" ), GCS(
"PRIMEM.LENGTHUNIT"),
"NAME");
433 ADD_PROP(
_TL(
"Spheroid" ), GCS(
"DATUM.ELLIPSOID" ),
"NAME");
434 ADD_CONT(
_TL(
"Semimajor Axis" ), GCS(
"DATUM.ELLIPSOID.VAL1"));
435 ADD_CONT(
_TL(
"Inverse Flattening" ), GCS(
"DATUM.ELLIPSOID.VAL2"));
436 ADD_CONT(
_TL(
"Extension" ), GCS(
"DATUM.EXTENSION" ));
438 if(
WKT(
"ABRIDGEDTRANSFORMATION") )
448 if( Parameter.
Cmp_Name(
"PARAMETER") && Parameter(
"VAL1") )
481 if( !m_Authority.
is_Empty() && !m_Authority.
CmpNoCase(Projection.m_Authority) && m_Code == Projection.m_Code )
486 if( !m_PROJ.
CmpNoCase(Projection.m_PROJ) )
494 #define CMP_CONTENT(a, b ) (a && b && a->Cmp_Content(b->Get_Content()))
495 #define CMP_PROPERTY(a, b, p) (a && b && a->Get_Property(p) && b->Cmp_Property(p, a->Get_Property(p), true))
496 #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())))
499 CSG_Projections::_WKT1_to_MetaData(
Get_WKT1()),
500 CSG_Projections::_WKT1_to_MetaData(Projection.
Get_WKT1())
501 }, *pGCS[2] = { NULL, NULL };
506 if( !
CMP_CONTENT (
WKT[0](
"PROJECTION"),
WKT[1](
"PROJECTION") ) ) {
return(
false ); }
509 for(
int i=0; i<
WKT[0].Get_Children_Count() && i<
WKT[1].Get_Children_Count(); i++)
514 pGCS[0] =
WKT[0](
"GEOGCS");
515 pGCS[1] =
WKT[1](
"GEOGCS");
523 if( !pGCS[0] || !pGCS[1] )
528 if( !
CMP_CONTENT((*pGCS[0])(
"PRIMEM" ), (*pGCS[1])(
"PRIMEM" )) ) {
return(
false ); }
529 if( !
CMP_CONTENT((*pGCS[0])(
"UNIT" ), (*pGCS[1])(
"UNIT" )) ) {
return(
false ); }
530 if( !
CMP_CONTENT((*pGCS[0])(
"DATUM.SPHEROID.a" ), (*pGCS[1])(
"DATUM.SPHEROID.a" )) ) {
return(
false ); }
531 if( !
CMP_CONTENT((*pGCS[0])(
"DATUM.SPHEROID.rf"), (*pGCS[1])(
"DATUM.SPHEROID.rf")) ) {
return(
false ); }
533 if( (*pGCS[0])(
"DATUM.TOWGS84") || (*pGCS[1])(
"DATUM.TOWGS84") )
535 #define CMP_TOWGS84(id) (\
536 ((*pGCS[0])("DATUM.TOWGS84." id) ? (*pGCS[0])["DATUM.TOWGS84." id].Get_Content().asDouble() : 0.)\
537 == ((*pGCS[1])("DATUM.TOWGS84." id) ? (*pGCS[1])["DATUM.TOWGS84." id].Get_Content().asDouble() : 0.) )
548 if( (*pGCS[0])(
"DATUM.EXTENSION") || (*pGCS[1])(
"DATUM.EXTENSION") )
550 if( !
CMP_CONTENT((*pGCS[0])(
"DATUM.EXTENSION"), (*pGCS[1])(
"DATUM.EXTENSION")) ) {
return(
false ); }
622 return( Projection );
628 if( Zone < 1 || Zone > 60 )
633 int EPSG_ID = (bSouth ? 32700 : 32600) + Zone;
642 "PROJCRS[\"WGS 84 / UTM zone %d%c\","
643 " BASEGEODCRS[\"WGS 84\","
644 " DATUM[\"World Geodetic System 1984\","
645 " ELLIPSOID[\"WGS 84\",6378137,298.257223563,"
646 " LENGTHUNIT[\"metre\",1]]],"
647 " PRIMEM[\"Greenwich\",0,"
648 " ANGLEUNIT[\"degree\",0.0174532925199433]]],"
649 " CONVERSION[\"UTM zone 32N\","
650 " METHOD[\"Transverse Mercator\","
651 " ID[\"EPSG\",9807]],"
652 " PARAMETER[\"Latitude of natural origin\",0,"
653 " ANGLEUNIT[\"degree\",0.0174532925199433],"
654 " ID[\"EPSG\",8801]],"
655 " PARAMETER[\"Longitude of natural origin\",%d,"
656 " ANGLEUNIT[\"degree\",0.0174532925199433],"
657 " ID[\"EPSG\",8802]],"
658 " PARAMETER[\"Scale factor at natural origin\",0.9996,"
659 " SCALEUNIT[\"unity\",1],"
660 " ID[\"EPSG\",8805]],"
661 " PARAMETER[\"False easting\",500000,"
662 " LENGTHUNIT[\"metre\",1],"
663 " ID[\"EPSG\",8806]],"
664 " PARAMETER[\"False northing\",%d,"
665 " LENGTHUNIT[\"metre\",1],"
666 " ID[\"EPSG\",8807]]],"
668 " AXIS[\"(E)\",east,"
670 " LENGTHUNIT[\"metre\",1]],"
671 " AXIS[\"(N)\",north,"
673 " LENGTHUNIT[\"metre\",1]],"
674 " ID[\"EPSG\",32632]]",
675 Zone, bSouth ?
'S' :
'N', 6 * (Zone - 1) - 177, bSouth ? 10000000 : 0, EPSG_ID
723 #if defined(__WXMAC__)
728 Path_Shared = SHARE_PATH;
731 #elif defined(_SAGA_LINUX)
733 Path_Shared = SHARE_PATH;
744 if( _Load(m_pPreferences,
SG_File_Make_Path(Path_Shared,
"saga_preferences",
"srs")) )
753 void CSG_Projections::_On_Construction(
void)
763 m_pPreferences =
new CSG_Table(m_pProjections);
773 delete(m_pProjections);
774 delete(m_pPreferences);
780 if( m_pProjections ) { m_pProjections->
Del_Records(); }
781 if( m_pPreferences ) { m_pPreferences->
Del_Records(); }
829 if( Projection.m_WKT2.
Find(
"GEOGCS") == 0
830 || Projection.m_WKT2.
Find(
"GEOCCS") == 0
831 || Projection.m_WKT2.
Find(
"GEODCS") == 0
832 || Projection.m_WKT2.
Find(
"PROJCS") == 0 )
834 Projection.m_WKT2 =
Parse(Projection.m_WKT2, ESG_CRS_Format::WKT2);
840 Projection.m_Name =
WKT.Get_Property(
"name");
842 Projection.m_Unit =
WKT(
"UNIT") &&
WKT[
"UNIT"].Get_Property(
"name") ?
846 return( Projection );
852 return( _Get_Projection(m_pProjections->
Get_Record(Index)) );
858 CSG_String Authority(_Authority && *_Authority ? _Authority :
SG_T(
"EPSG"));
876 CSG_String Authority(_Authority && *_Authority ? _Authority :
SG_T(
"EPSG"));
884 Projection = _Get_Projection(pProjection);
886 return( Projection.
is_Okay() );
899 bool CSG_Projections::_Add_Preferences(
void)
901 if( !m_pProjections || !m_pPreferences || m_pPreferences->
Get_Count() < 1 )
909 for(
sLong iPreference=0, iProjection=0; iPreference<m_pPreferences->
Get_Count() && iProjection<m_pProjections->
Get_Count(); )
918 if( Comparison < 0 ) { iProjection++; }
else if( Comparison > 0 ) { iPreference++; }
else
922 if( Comparison < 0 ) { iProjection++; }
else if( Comparison > 0 ) { iPreference++; }
else
927 m_pPreferences->
Select(pPreference,
true);
929 iProjection++; iPreference++;
939 for(
sLong iPreference=0; iPreference<m_pPreferences->
Get_Count(); iPreference++)
964 Projection = _Get_Projection(pProjection);
966 return( Projection.
is_Okay() );
976 int i = Authority_Code.
Find(
':');
978 if( i > 1 && i < Authority_Code.
Length() - 2 )
1035 return( _Load(m_pProjections, File, bAppend) );
1041 return( m_pProjections->
Save(File) );
1116 if( Definition.
Find(
"+proj") == 0 )
1122 if( WKT1 ) { *WKT1 =
WKT ; }
1123 if( PROJ ) { *PROJ = Definition; }
1136 if(
WKT.Get_Property(
"authority_name", Authority) &&
WKT.Get_Property(
"authority_code", Code)
1139 if( WKT1 ) { *WKT1 = Projection.
Get_WKT1(); }
1140 if( WKT2 ) { *WKT2 = Projection.
Get_WKT2(); }
1141 if( PROJ ) { *PROJ = Projection.
Get_PROJ(); }
1142 if( ESRI ) { *ESRI = Projection.
Get_ESRI(); }
1152 if( WKT1 ) { *WKT1 = Definition; }
1153 if( PROJ ) { *PROJ = Proj4 ; }
1164 if( WKT1 ) { *WKT1 = Projection.
Get_WKT1(); }
1165 if( WKT2 ) { *WKT2 = Projection.
Get_WKT2(); }
1166 if( PROJ ) { *PROJ = Projection.
Get_PROJ(); }
1167 if( ESRI ) { *ESRI = Projection.
Get_ESRI(); }
1192 for(
int i=0; i<m_pProjections->
Get_Count(); i++)
1198 if(
WKT.Length() == 0 )
1207 WKT =
WKT.AfterFirst(
'[');
1216 Projection.
Set_Value(0,
WKT.AfterFirst(
'\"').BeforeFirst(
'\"'));
1232 for(
int i=0; i<Projections.
Get_Count(); i++)
1237 Projections[i].asString(1),
1238 Projections[i].asInt (2),
1239 Projections[i].asString(3),
1240 Projections[i].asString(0)
1246 Projections[i].asString(1),
1247 Projections[i].asInt (2),
1248 Projections[i].asString(0)
1264 if(
WKT.is_Empty() )
1269 int Colon = -1, Bracket = -1;
1271 for(
int i=0, bracket=0, quota=0; Colon<0 && i<
WKT.Length(); i++)
1276 bracket++;
if( bracket == 1 ) { Bracket = i; }
1280 bracket--;
if( bracket < 0 ) {
return(
false ); }
1286 quota = quota ? 0 : 1;
1291 if( bracket == 0 && quota == 0 )
1305 if( Value.
Find(
'\"') == 0 )
1322 _WKT2_to_MetaData(*MetaData.
Add_Child(Key), Content);
1327 _WKT2_to_MetaData(MetaData,
WKT.Right(
WKT.Length() - Colon - 1));
1354 return( *pMetaData );
1365 return( _WKT2_to_MetaData(
WKT,
false).asText(1) );
1378 for(
int i=0, l=-1; l!=0 && i<(int)
WKT.Length(); i++)
1384 default : Key +=
WKT[i];
break;
1386 case '[':
case '(': l = 1 ;
break;
1387 case ')':
case ']':
return(
false );
1396 default : bAdd =
true;
break;
1397 case '\"' : bAdd =
false;
break;
1398 case '[' :
case '(': bAdd = ++l > 1;
break;
1399 case ']' :
case ')': bAdd = l-- > 1;
break;
1400 case ',' :
if( !(bAdd = l > 1) ) Content.
Add(
"");
break;
1410 if( Key.
is_Empty() || Content[0].is_Empty() )
1416 if( !Key.
Cmp(
"AUTHORITY") && Content.
Get_Count() == 2 )
1437 || (!Key.
Cmp(
"PARAMETER" ) && Content.
Get_Count() >= 2) )
1444 if( (!Key.
Cmp(
"SPHEROID" ) && Content.
Get_Count() >= 3) )
1451 if( (!Key.
Cmp(
"TOWGS84" ) && Content.
Get_Count() >= 7) )
1462 if( (!Key.
Cmp(
"EXTENSION" ) && Content.
Get_Count() >= 2) )
1468 if( (!Key.
Cmp(
"PROJECTION") && Content.
Get_Count() >= 1) )
1474 for(
int i=0; i<Content.
Get_Count(); i++)
1476 _WKT1_to_MetaData(*pKey, Content[i]);
1487 _WKT1_to_MetaData(MetaData,
WKT);
1512 if(
WKT.Cmp_Property(
"name",
"WGS84") )
1514 Proj4 +=
" +datum=WGS84";
1521 if( !
WKT(
"SPHEROID") ||
WKT[
"SPHEROID"].Get_Children_Count() != 2
1522 || !
WKT[
"SPHEROID"][0].Get_Content().asDouble(a) || a <= 0.
1523 || !
WKT[
"SPHEROID"][1].Get_Content().asDouble(b) || b < 0. )
1528 b = b > 0. ? a - a / b : a;
1533 if(
WKT(
"TOWGS84") &&
WKT[
"TOWGS84"].Get_Children_Count() == 7 )
1535 Proj4 +=
" +towgs84=";
1537 for(
int i=0; i<7; i++)
1544 Proj4 +=
WKT[
"TOWGS84"][i].Get_Content();
1564 int Authority_Code;
CSG_String Authority_Name;
1593 if( !m(
"DATUM") || !_WKT1_to_Proj4_Set_Datum(Proj4, m[
"DATUM"]) )
1598 if( m(
"PRIMEM") && m[
"PRIMEM"].Get_Content().asDouble(d) && d != 0. )
1617 Proj4 =
"+proj=longlat";
1619 if( !m(
"DATUM") || !_WKT1_to_Proj4_Set_Datum(Proj4, m[
"DATUM"]) )
1624 if( m(
"PRIMEM") && m[
"PRIMEM"].Get_Content().asDouble(d) && d != 0. )
1642 if( m.
Cmp_Name(
"PROJCS") && m(
"GEOGCS") && m(
"PROJECTION") && m_WKT1_to_Proj4.
Get_Translation(m[
"PROJECTION"].Get_Content(), Proj4) )
1644 if( m[
"PROJECTION"].Cmp_Content(
"Transverse_Mercator") )
1646 double Scale = -1., Easting = -1., Northing = -1., Meridian = -1., Latitude = -1.;
1650 if( m[i].Cmp_Name(
"PARAMETER") )
1654 if( m[i].Cmp_Property(
"name",
"central_meridian" ,
true) && m[i].Get_Content().asDouble(v) ) Meridian = v;
1655 if( m[i].Cmp_Property(
"name",
"latitude_of_origin",
true) && m[i].Get_Content().asDouble(v) ) Latitude = v;
1656 if( m[i].Cmp_Property(
"name",
"scale_factor" ,
true) && m[i].Get_Content().asDouble(v) ) Scale = v;
1657 if( m[i].Cmp_Property(
"name",
"false_easting" ,
true) && m[i].Get_Content().asDouble(v) ) Easting = v;
1658 if( m[i].Cmp_Property(
"name",
"false_northing" ,
true) && m[i].Get_Content().asDouble(v) ) Northing = v;
1662 if( Latitude == 0. && Scale == 0.9996 && Easting == 500000. && (Northing == 0. || Northing == 10000000.) )
1664 Proj4 =
"+proj=utm";
1666 if( !m[
"GEOGCS"](
"DATUM") || !_WKT1_to_Proj4_Set_Datum(Proj4, m[
"GEOGCS"][
"DATUM"]) )
1673 if( Northing == 10000000. )
1685 Proj4 =
"+proj=" + Proj4;
1687 if( !m[
"GEOGCS"](
"DATUM") || !_WKT1_to_Proj4_Set_Datum(Proj4, m[
"GEOGCS"][
"DATUM"]) )
1692 if( m(
"PRIMEM") && m[
"PRIMEM"].Get_Content().asDouble(d) && d != 0. )
1699 if( m[i].Cmp_Name(
"PARAMETER") )
1703 if( m_WKT1_to_Proj4.
Get_Translation(m[i].Get_Property(
"name"), Parameter) )
1705 Proj4 +=
" +" + Parameter +
"=" + m[i].
Get_Content();
1714 if( m(
"UNIT") && m[
"UNIT"].Get_Content().asDouble(d) && d != 0. && d != 1. )
1736 return( Proj4.
Find(
"+" + Key) >= 0 );
1744 int l, i = Proj4.
Find(
"+" + Key +
"=");
1748 for(++i, l=0; l<2 && i<(int)Proj4.
Length(); i++)
1752 case '=': l++;
break;
1753 case '+': l=2;
break;
1754 case ' ': l=2;
break;
1764 return( Value.
Length() > 0 );
1770 const char ellipsoid[42][2][32] =
1772 {
"MERIT" ,
"6378137.0,298.257" },
1773 {
"SGS85" ,
"6378136.0,298.257" },
1774 {
"GRS80" ,
"6378137.0,298.2572221" },
1775 {
"IAU76" ,
"6378140.0,298.257" },
1776 {
"airy" ,
"6377563.396,299.3249753" },
1777 {
"APL4.9" ,
"6378137.0,298.25" },
1778 {
"NWL9D" ,
"6378145.0,298.25" },
1779 {
"mod_airy" ,
"6377340.189,299.3249374" },
1780 {
"andrae" ,
"6377104.43,300" },
1781 {
"aust_SA" ,
"6378160.0,298.25" },
1782 {
"GRS67" ,
"6378160.0,298.2471674" },
1783 {
"bessel" ,
"6377397.155,299.1528128" },
1784 {
"bess_nam" ,
"6377483.865,299.1528128" },
1785 {
"clrk66" ,
"6378206.4,294.9786982" },
1786 {
"clrk80" ,
"6378249.145,293.4663" },
1787 {
"CPM" ,
"6375738.7,334.29" },
1788 {
"delmbr" ,
"6376428.0,311.5" },
1789 {
"engelis" ,
"6378136.05,298.2566" },
1790 {
"evrst30" ,
"6377276.345,300.8017" },
1791 {
"evrst48" ,
"6377304.063,300.8017" },
1792 {
"evrst56" ,
"6377301.243,300.8017" },
1793 {
"evrst69" ,
"6377295.664,300.8017" },
1794 {
"evrstSS" ,
"6377298.556,300.8017" },
1795 {
"fschr60" ,
"6378166.0,298.3" },
1796 {
"fschr60m" ,
"6378155.0,298.3" },
1797 {
"fschr68" ,
"6378150.0,298.3" },
1798 {
"helmert" ,
"6378200.0,298.3" },
1799 {
"hough" ,
"6378270.0,297" },
1800 {
"intl" ,
"6378388.0,297" },
1801 {
"krass" ,
"6378245.0,298.3" },
1802 {
"kaula" ,
"6378163.0,298.24" },
1803 {
"lerch" ,
"6378139.0,298.257" },
1804 {
"mprts" ,
"6397300.0,191" },
1805 {
"new_intl" ,
"6378157.5,298.2496154" },
1806 {
"plessis" ,
"6376523.0,308.6409971" },
1807 {
"SEasia" ,
"6378155.0,298.3000002" },
1808 {
"walbeck" ,
"6376896.0,302.7800002" },
1809 {
"WGS60" ,
"6378165.0,298.3" },
1810 {
"WGS66" ,
"6378145.0,298.25" },
1811 {
"WGS72" ,
"6378135.0,298.26" },
1812 {
"WGS84" ,
"6378137.0,298.2572236" },
1813 {
"sphere" ,
"6370997.0,-1" }
1817 if( _Proj4_Read_Parameter(Value, Proj4,
"ellps") )
1819 for(
int i=0; i<42; i++)
1831 double a = _Proj4_Read_Parameter(Value, Proj4,
"a" ) && Value.
asDouble(a) ? a : 6378137.;
1833 double b = _Proj4_Read_Parameter(Value, Proj4,
"b" ) && Value.
asDouble(b) ? a / (a - b)
1834 : _Proj4_Read_Parameter(Value, Proj4,
"rf") && Value.
asDouble(b) ? b
1835 : _Proj4_Read_Parameter(Value, Proj4,
"f" ) && Value.
asDouble(b) ? 1. / b
1836 : _Proj4_Read_Parameter(Value, Proj4,
"e" ) && Value.
asDouble(b) ? a / (a - sqrt(b*b - a*a))
1837 : _Proj4_Read_Parameter(Value, Proj4,
"es") && Value.
asDouble(b) ? a / (a - sqrt( b - a*a))
1848 const char datum[9][3][64] =
1850 {
"WGS84" ,
"WGS84" ,
"0,0,0,0,0,0,0" },
1851 {
"GGRS87" ,
"GRS80" ,
"-199.87,74.79,246.62,0,0,0,0" },
1852 {
"NAD83" ,
"GRS80" ,
"0,0,0,0,0,0,0" },
1854 {
"potsdam" ,
"bessel" ,
"606.0,23.0,413.0,0,0,0,0" },
1855 {
"carthage" ,
"clark80" ,
"-263.0,6.0,431.0,0,0,0,0" },
1856 {
"hermannskogel" ,
"bessel" ,
"653.0,-212.0,449.0,0,0,0,0" },
1857 {
"ire65" ,
"mod_airy" ,
"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15" },
1858 {
"nzgd49" ,
"intl" ,
"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993" },
1859 {
"OSGB36" ,
"airy" ,
"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894" }
1865 if( _Proj4_Read_Parameter(Value, Proj4,
"datum") )
1867 for(
int i=0; i<9; i++)
1879 if( _Proj4_Get_Ellipsoid(Spheroid, Proj4) )
1881 Value =
"DATUM[\"Datum\","+ Spheroid;
1883 if( _Proj4_Read_Parameter(ToWGS84, Proj4,
"towgs84") )
1889 ToWGS84 +=
",0,0,0,0";
1892 Value +=
",TOWGS84[" + ToWGS84 +
"]";
1896 Value +=
",TOWGS84[0,0,0,0,0,0,0]";
1905 Value =
"DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563],TOWGS84[0,0,0,0,0,0,0]]";
1913 const char meridian[12][2][16] =
1915 {
"lisbon" ,
"-9.131906111" },
1916 {
"paris" ,
"2.337229167" },
1917 {
"bogota" ,
"74.08091667" },
1918 {
"madrid" ,
"-3.687911111" },
1919 {
"rome" ,
"12.45233333" },
1920 {
"bern" ,
"7.439583333" },
1921 {
"jakarta" ,
"106.8077194" },
1922 {
"ferro" ,
"-17.66666667" },
1923 {
"brussels" ,
"4.367975" },
1924 {
"stockholm" ,
"18.05827778" },
1925 {
"athens" ,
"23.7163375" },
1926 {
"oslo" ,
"10.72291667" }
1930 if( _Proj4_Read_Parameter(Value, Proj4,
"pm") )
1932 for(
int i=0; i<12; i++)
1946 Value.
Printf(
"PRIMEM[\"Prime_Meridian\",%f]", d);
1953 Value =
"PRIMEM[\"Greenwich\",0]";
1963 if( Unit != ESG_Projection_Unit::Undefined )
1973 if( _Proj4_Read_Parameter(Value, Proj4,
"to_meter") && Value.
asDouble(d) && d > 0. && d != 1. )
1975 Value.
Printf(
"UNIT[\"Unit\",%f]", d);
1981 Value =
"UNIT[\"metre\",1]";
1993 if( !_Proj4_Read_Parameter(ProjCS, Proj4,
"proj") )
2014 WKT =
"GEOGCS[\"GCS\"";
2016 if( _Proj4_Get_Datum (Value, Proj4) ) {
WKT +=
"," + Value; }
2017 if( _Proj4_Get_Prime_Meridian(Value, Proj4) ) {
WKT +=
"," + Value; }
2018 if( _Proj4_Get_Unit (Value, Proj4) ) {
WKT +=
"," + Value; }
2039 if( _Proj4_Get_Datum (Value, Proj4) ) { GeogCS +=
"," + Value; }
2040 if( _Proj4_Get_Prime_Meridian(Value, Proj4) ) { GeogCS +=
"," + Value; }
2041 if( _Proj4_Get_Unit (Value, Proj4) ) { GeogCS +=
"," + Value; }
else { GeogCS +=
"UNIT[\"degree\",0.01745329251994328]"; }
2077 if( !_Proj4_Read_Parameter(Value, Proj4,
"zone") || !Value.
asDouble(Zone) )
2084 bool South = _Proj4_Find_Parameter(Proj4,
"south");
2086 WKT =
CSG_String::Format(
"PROJCS[\"UTM zone %d%c\",%s,PROJECTION[Transverse_Mercator]", (
int)Zone, South ?
'S' :
'N', GeogCS.
c_str());
2093 WKT +=
",UNIT[\"metre\",1]]";
2105 while( ProjCS.
Find(
'+') >= 0 )
2116 if( Value.
Find(
'+') >= 0 )
2121 WKT +=
",PARAMETER[\"" + Key +
"\"," + Value +
"]";
2128 if( _Proj4_Get_Unit(Value, Proj4) ) {
WKT +=
"," + Value; }
2146 if( !Identifier.
CmpNoCase(
"PROJCS") || !Identifier.
CmpNoCase(
"PROJCRS") ) {
return( ESG_CRS_Type::Projection ); }
2147 if( !Identifier.
CmpNoCase(
"GEOGCS") || !Identifier.
CmpNoCase(
"GEOGCRS") ) {
return( ESG_CRS_Type::Geographic ); }
2148 if( !Identifier.
CmpNoCase(
"GEOCCS") || !Identifier.
CmpNoCase(
"GEOCCRS") ) {
return( ESG_CRS_Type::Geocentric ); }
2149 if( !Identifier.
CmpNoCase(
"GEODCS") || !Identifier.
CmpNoCase(
"GEODCRS") ) {
return( ESG_CRS_Type::Geographic ); }
2160 case ESG_CRS_Type::Projection:
return(
"PROJCRS" );
2161 case ESG_CRS_Type::Geographic:
return(
"GEOGCRS" );
2162 case ESG_CRS_Type::Geocentric:
return(
"GEOCCRS" );
2163 case ESG_CRS_Type::Geodetic :
return(
"GEODCRS" );
2164 default :
return(
"UNDEFINED" );
2173 case ESG_CRS_Type::Projection:
return(
_TL(
"Projected Coordinate System" ) );
2174 case ESG_CRS_Type::Geographic:
return(
_TL(
"Geographic Coordinate System") );
2175 case ESG_CRS_Type::Geocentric:
return(
_TL(
"Geocentric Coordinate System") );
2176 case ESG_CRS_Type::Geodetic :
return(
_TL(
"Geodetic Coordinate System" ) );
2177 default :
return(
_TL(
"Undefined Coordinate System" ) );
2184 for(
int i=0; i<(int)ESG_Projection_Unit::Undefined; i++)
2195 return( !Identifier.
CmpNoCase(
"metre") ? ESG_Projection_Unit::Meter : ESG_Projection_Unit::Undefined );
2203 case ESG_Projection_Unit::Kilometer :
return(
"km" );
2204 case ESG_Projection_Unit::Meter :
return(
"m" );
2205 case ESG_Projection_Unit::Decimeter :
return(
"dm" );
2206 case ESG_Projection_Unit::Centimeter :
return(
"cm" );
2207 case ESG_Projection_Unit::Millimeter :
return(
"mm" );
2208 case ESG_Projection_Unit::Int_Nautical_Mile:
return(
"kmi" );
2209 case ESG_Projection_Unit::Int_Inch :
return(
"in" );
2210 case ESG_Projection_Unit::Int_Foot :
return(
"ft" );
2211 case ESG_Projection_Unit::Int_Yard :
return(
"yd" );
2212 case ESG_Projection_Unit::Int_Statute_Mile :
return(
"mi" );
2213 case ESG_Projection_Unit::Int_Fathom :
return(
"fath" );
2214 case ESG_Projection_Unit::Int_Chain :
return(
"ch" );
2215 case ESG_Projection_Unit::Int_Link :
return(
"link" );
2216 case ESG_Projection_Unit::US_Inch :
return(
"us-in" );
2217 case ESG_Projection_Unit::US_Foot :
return(
"us-ft" );
2218 case ESG_Projection_Unit::US_Yard :
return(
"us-yd" );
2219 case ESG_Projection_Unit::US_Chain :
return(
"us-ch" );
2220 case ESG_Projection_Unit::US_Statute_Mile :
return(
"us-mi" );
2221 case ESG_Projection_Unit::Indian_Yard :
return(
"ind-yd" );
2222 case ESG_Projection_Unit::Indian_Foot :
return(
"ind-ft" );
2223 case ESG_Projection_Unit::Indian_Chain :
return(
"ind-ch" );
2224 default:
return(
"" );
2233 case ESG_Projection_Unit::Kilometer :
return( bSimple ?
"Kilometers" :
"Kilometer" );
2234 case ESG_Projection_Unit::Meter :
return( bSimple ?
"Meters" :
"Meter" );
2235 case ESG_Projection_Unit::Decimeter :
return( bSimple ?
"Decimeters" :
"Decimeter" );
2236 case ESG_Projection_Unit::Centimeter :
return( bSimple ?
"Centimeters" :
"Centimeter" );
2237 case ESG_Projection_Unit::Millimeter :
return( bSimple ?
"Millimeters" :
"Millimeter" );
2238 case ESG_Projection_Unit::Int_Nautical_Mile:
return( bSimple ?
"Miles" :
"International Nautical Mile" );
2239 case ESG_Projection_Unit::Int_Inch :
return( bSimple ?
"Inches" :
"International Inch" );
2240 case ESG_Projection_Unit::Int_Foot :
return( bSimple ?
"Feet" :
"International Foot" );
2241 case ESG_Projection_Unit::Int_Yard :
return( bSimple ?
"Yards" :
"International Yard" );
2242 case ESG_Projection_Unit::Int_Statute_Mile :
return( bSimple ?
"Miles" :
"International Statute Mile" );
2243 case ESG_Projection_Unit::Int_Fathom :
return( bSimple ?
"Fathoms" :
"International Fathom" );
2244 case ESG_Projection_Unit::Int_Chain :
return( bSimple ?
"Chains" :
"International Chain" );
2245 case ESG_Projection_Unit::Int_Link :
return( bSimple ?
"Links" :
"International Link" );
2246 case ESG_Projection_Unit::US_Inch :
return( bSimple ?
"Inches" :
"U.S. Surveyor's Inch" );
2247 case ESG_Projection_Unit::US_Foot :
return( bSimple ?
"Feet" :
"U.S. Surveyor's Foot" );
2248 case ESG_Projection_Unit::US_Yard :
return( bSimple ?
"Yards" :
"U.S. Surveyor's Yard" );
2249 case ESG_Projection_Unit::US_Chain :
return( bSimple ?
"Chains" :
"U.S. Surveyor's Chain" );
2250 case ESG_Projection_Unit::US_Statute_Mile :
return( bSimple ?
"Miles" :
"U.S. Surveyor's Statute Mile" );
2251 case ESG_Projection_Unit::Indian_Yard :
return( bSimple ?
"Yards" :
"Indian Yard" );
2252 case ESG_Projection_Unit::Indian_Foot :
return( bSimple ?
"Feet" :
"Indian Foot" );
2253 case ESG_Projection_Unit::Indian_Chain :
return( bSimple ?
"Chains" :
"Indian Chain" );
2254 default:
return(
"" );
2263 case ESG_Projection_Unit::Kilometer :
return( 1000. );
2264 case ESG_Projection_Unit::Meter :
return( 1. );
2265 case ESG_Projection_Unit::Decimeter :
return( 0.1 );
2266 case ESG_Projection_Unit::Centimeter :
return( 0.01 );
2267 case ESG_Projection_Unit::Millimeter :
return( 0.001 );
2268 case ESG_Projection_Unit::Int_Nautical_Mile:
return( 1852. );
2269 case ESG_Projection_Unit::Int_Inch :
return( 0.0254 );
2270 case ESG_Projection_Unit::Int_Foot :
return( 0.3048 );
2271 case ESG_Projection_Unit::Int_Yard :
return( 0.9144 );
2272 case ESG_Projection_Unit::Int_Statute_Mile :
return( 1609.344 );
2273 case ESG_Projection_Unit::Int_Fathom :
return( 1.8288 );
2274 case ESG_Projection_Unit::Int_Chain :
return( 20.1168 );
2275 case ESG_Projection_Unit::Int_Link :
return( 0.201168 );
2276 case ESG_Projection_Unit::US_Inch :
return( 1. / 39.37 );
2277 case ESG_Projection_Unit::US_Foot :
return( 0.304800609601219 );
2278 case ESG_Projection_Unit::US_Yard :
return( 0.914401828803658 );
2279 case ESG_Projection_Unit::US_Chain :
return( 20.11684023368047 );
2280 case ESG_Projection_Unit::US_Statute_Mile :
return( 1609.347218694437 );
2281 case ESG_Projection_Unit::Indian_Yard :
return( 0.91439523 );
2282 case ESG_Projection_Unit::Indian_Foot :
return( 0.30479841 );
2283 case ESG_Projection_Unit::Indian_Chain :
return( 20.11669506 );
2284 default :
return( 1. );
2296 bool CSG_Projections::_Set_Dictionary(
CSG_Table &Dictionary,
int Direction)
2298 const char Translation[][4][128] = {
2302 {
"aea" ,
" ",
"Albers_Conic_Equal_Area" ,
"Albers Equal Area" },
2303 {
"aea" ,
"<",
"Albers" ,
"[ESRI] Albers Equal Area" },
2304 {
"aeqd" ,
" ",
"Azimuthal_Equidistant" ,
"Azimuthal Equidistant" },
2305 {
"airy" ,
" ",
"Airy 1830" ,
"Airy 1830" },
2306 {
"aitoff" ,
" ",
"Sphere_Aitoff" ,
"Aitoff" },
2307 {
"alsk" ,
" ",
"Mod_Stererographics_of_Alaska" ,
"*) Mod. Stererographics of Alaska" },
2308 {
"Amersfoort" ,
"<",
"D_Amersfoort" ,
"[ESRI] datum RD_NEW" },
2309 {
"Amersfoort" ,
"<",
"GCS_Amersfoort" ,
"[ESRI] GCS RD_NEW" },
2310 {
"Amersfoort / RD New",
"<",
"Amersfoort_RD_New" ,
"[ESRI] RD_NEW" },
2311 {
"apian" ,
" ",
"Apian_Globular_I" ,
"*) Apian Globular I" },
2312 {
"august" ,
" ",
"August_Epicycloidal" ,
"*) August Epicycloidal" },
2313 {
"bacon" ,
" ",
"Bacon_Globular" ,
"*) Bacon Globular" },
2314 {
"bipc" ,
" ",
"Bipolar_conic_of_western_hemisphere" ,
"*) Bipolar conic of western hemisphere" },
2315 {
"boggs" ,
" ",
"Boggs_Eumorphic" ,
"*) Boggs Eumorphic" },
2316 {
"bonne" ,
" ",
"Bonne" ,
"Bonne (Werner lat_1=90)" },
2317 {
"cass" ,
" ",
"Cassini_Soldner" ,
"Cassini" },
2318 {
"cass" ,
"<",
"Cassini" ,
"[ESRI] Cassini" },
2319 {
"cc" ,
" ",
"Central_Cylindrical" ,
"*) Central Cylindrical" },
2320 {
"cea" ,
" ",
"Cylindrical_Equal_Area" ,
"Equal Area Cylindrical, alias: Lambert Cyl.Eq.A., Normal Authalic Cyl. (FME), Behrmann (SP=30), Gall Orthogr. (SP=45)" },
2321 {
"cea" ,
"<",
"Behrmann" ,
"[ESRI] Behrmann (standard parallel = 30)" },
2322 {
"chamb" ,
" ",
"Chamberlin_Trimetric" ,
"*) Chamberlin Trimetric" },
2323 {
"collg" ,
" ",
"Collignon" ,
"*) Collignon" },
2324 {
"crast" ,
" ",
"Craster_Parabolic" ,
"[ESRI] Craster Parabolic (Putnins P4)" },
2325 {
"denoy" ,
" ",
"Denoyer_Semi_Elliptical" ,
"*) Denoyer Semi-Elliptical" },
2326 {
"eck1" ,
" ",
"Eckert_I" ,
"*) Eckert I" },
2327 {
"eck2" ,
" ",
"Eckert_II" ,
"*) Eckert II" },
2328 {
"eck3" ,
" ",
"Eckert_III" ,
"*) Eckert III" },
2329 {
"eck4" ,
" ",
"Eckert_IV" ,
"Eckert IV" },
2330 {
"eck5" ,
" ",
"Eckert_V" ,
"*) Eckert V" },
2331 {
"eck6" ,
" ",
"Eckert_VI" ,
"Eckert VI" },
2332 {
"eqearth" ,
" ",
"Equal_Earth" ,
"*) Equal Earth" },
2333 {
"eqc" ,
" ",
"Equirectangular" ,
"Equidistant Cylindrical (Plate Caree)" },
2334 {
"eqc" ,
"<",
"Equidistant_Cylindrical" ,
"[ESRI] Equidistant Cylindrical (Plate Caree)" },
2335 {
"eqc" ,
"<",
"Plate_Carree" ,
"[ESRI] Equidistant Cylindrical (Plate Caree)" },
2336 {
"eqdc" ,
" ",
"Equidistant_Conic" ,
"*) Equidistant Conic" },
2337 {
"euler" ,
" ",
"Euler" ,
"*) Euler" },
2338 {
"etmerc" ,
" ",
"Extended_Transverse_Mercator" ,
"*) Extended Transverse Mercator" },
2339 {
"fahey" ,
" ",
"Fahey" ,
"*) Fahey" },
2340 {
"fouc" ,
" ",
"Foucault" ,
"*) Foucaut" },
2341 {
"fouc_s" ,
" ",
"Foucault_Sinusoidal" ,
"*) Foucaut Sinusoidal" },
2342 {
"gall" ,
" ",
"Gall_Stereographic" ,
"Gall (Gall Stereographic)" },
2343 {
"geocent" ,
" ",
"Geocentric" ,
"*) Geocentric" },
2344 {
"geos" ,
" ",
"GEOS" ,
"Geostationary Satellite View" },
2345 {
"gins8" ,
" ",
"Ginsburg_VIII" ,
"*) Ginsburg VIII (TsNIIGAiK)" },
2346 {
"gn_sinu" ,
" ",
"General_Sinusoidal_Series" ,
"*) General Sinusoidal Series" },
2347 {
"gnom" ,
" ",
"Gnomonic" ,
"Gnomonic" },
2348 {
"goode" ,
" ",
"Goode_Homolosine" ,
"*) Goode Homolosine" },
2349 {
"gs48" ,
" ",
"Mod_Stererographics_48" ,
"*) Mod. Stererographics of 48 U.S." },
2350 {
"gs50" ,
" ",
"Mod_Stererographics_50" ,
"*) Mod. Stererographics of 50 U.S." },
2351 {
"hammer" ,
" ",
"Hammer_Eckert_Greifendorff" ,
"*) Hammer & Eckert-Greifendorff" },
2352 {
"hatano" ,
" ",
"Hatano_Asymmetrical_Equal_Area" ,
"*) Hatano Asymmetrical Equal Area" },
2353 {
"igh" ,
" ",
"Interrupted_Goodes_Homolosine" ,
"*) Interrupted Goode's Homolosine" },
2354 {
"igh_o" ,
" ",
"Interrupted_Goodes_Homolosine_Ocean" ,
"*) Interrupted Goode's Homolosine (Ocean)" },
2355 {
"imw_p" ,
" ",
"International_Map_of_the_World_Polyconic" ,
"*) International Map of the World Polyconic" },
2356 {
"kav5" ,
" ",
"Kavraisky_V" ,
"*) Kavraisky V" },
2357 {
"kav7" ,
" ",
"Kavraisky_VII" ,
"*) Kavraisky VII" },
2358 {
"krovak" ,
" ",
"Krovak" ,
"Krovak" },
2359 {
"labrd" ,
" ",
"Laborde_Oblique_Mercator" ,
"*) Laborde" },
2360 {
"laea" ,
" ",
"Lambert_Azimuthal_Equal_Area" ,
"Lambert Azimuthal Equal Area" },
2361 {
"lagrng" ,
" ",
"Lagrange" ,
"*) Lagrange" },
2362 {
"larr" ,
" ",
"Larrivee" ,
"*) Larrivee" },
2363 {
"lask" ,
" ",
"Laskowski" ,
"*) Laskowski" },
2364 {
"lcc" ,
"<",
"Lambert_Conformal_Conic_1SP" ,
"Lambert Conformal Conic (1 standard parallel)" },
2365 {
"lcc" ,
"<",
"Lambert_Conformal_Conic_2SP" ,
"Lambert Conformal Conic (2 standard parallels)" },
2366 {
"lcc" ,
" ",
"Lambert_Conformal_Conic" ,
"Lambert Conformal Conic" },
2367 {
"lcca" ,
" ",
"Lambert_Conformal_Conic_Alternative" ,
"*) Lambert Conformal Conic Alternative" },
2368 {
"leac" ,
" ",
"Lambert_Equal_Area_Conic" ,
"*) Lambert Equal Area Conic" },
2369 {
"lee_os" ,
" ",
"Lee_Oblated_Stereographic" ,
"*) Lee Oblated Stereographic" },
2370 {
"loxim" ,
" ",
"Loximuthal" ,
"[ESRI] Loximuthal" },
2371 {
"lsat" ,
" ",
"Space_oblique_for_LANDSAT" ,
"*) Space oblique for LANDSAT" },
2372 {
"mbt_s" ,
" ",
"McBryde_Thomas_Flat_Polar_Sine" ,
"*) McBryde-Thomas Flat-Polar Sine" },
2373 {
"mbt_fps" ,
" ",
"McBryde_Thomas_Flat_Polar_Sine_2" ,
"*) McBryde-Thomas Flat-Pole Sine (No. 2)" },
2374 {
"mbtfpp" ,
" ",
"McBryde_Thomas_Flat_Polar_Parabolic" ,
"*) McBride-Thomas Flat-Polar Parabolic" },
2375 {
"mbtfpq" ,
" ",
"Flat_Polar_Quartic" ,
"[ESRI] McBryde-Thomas Flat-Polar Quartic" },
2376 {
"mbtfps" ,
" ",
"McBryde_Thomas_Flat_Polar_Sinusoidal" ,
"*) McBryde-Thomas Flat-Polar Sinusoidal" },
2377 {
"merc" ,
" ",
"Mercator" ,
"[ESRI] Mercator" },
2378 {
"merc" ,
"<",
"Mercator_1SP" ,
"Mercator (1 standard parallel)" },
2379 {
"merc" ,
"<",
"Mercator_2SP" ,
"Mercator (2 standard parallels)" },
2380 {
"mil_os" ,
" ",
"Miller_Oblated_Stereographic" ,
"*) Miller Oblated Stereographic" },
2381 {
"mill" ,
" ",
"Miller_Cylindrical" ,
"Miller Cylindrical" },
2382 {
"moll" ,
" ",
"Mollweide" ,
"Mollweide" },
2383 {
"murd1" ,
" ",
"Murdoch_I" ,
"*) Murdoch I" },
2384 {
"murd2" ,
" ",
"Murdoch_II" ,
"*) Murdoch II" },
2385 {
"murd3" ,
" ",
"Murdoch_III" ,
"*) Murdoch III" },
2386 {
"nell" ,
" ",
"Nell" ,
"*) Nell" },
2387 {
"nell_h" ,
" ",
"Nell_Hammer" ,
"*) Nell-Hammer" },
2388 {
"nicol" ,
" ",
"Nicolosi_Globular" ,
"*) Nicolosi Globular" },
2389 {
"nsper" ,
" ",
"Near_sided_perspective" ,
"*) Near-sided perspective" },
2390 {
"nzmg" ,
" ",
"New_Zealand_Map_Grid" ,
"New Zealand Map Grid" },
2391 {
"ob_tran" ,
" ",
"General_Oblique_Transformation" ,
"*) General Oblique Transformation" },
2392 {
"ocea" ,
" ",
"Oblique_Cylindrical_Equal_Area" ,
"*) Oblique Cylindrical Equal Area" },
2393 {
"oea" ,
" ",
"Oblated_Equal_Area" ,
"*) Oblated Equal Area" },
2394 {
"omerc" ,
" ",
"Hotine_Oblique_Mercator" ,
"Oblique Mercator" },
2395 {
"omerc" ,
"<",
"Oblique_Mercator" ,
"Oblique Mercator" },
2396 {
"ortel" ,
" ",
"Ortelius_Oval" ,
"*) Ortelius Oval" },
2397 {
"ortho" ,
" ",
"Orthographic" ,
"Orthographic (ESRI: World from Space)" },
2398 {
"pconic" ,
" ",
"Perspective_Conic" ,
"*) Perspective Conic" },
2399 {
"poly" ,
" ",
"Polyconic" ,
"*) Polyconic (American)" },
2400 {
"putp1" ,
" ",
"Putnins_P1" ,
"*) Putnins P1" },
2401 {
"putp2" ,
" ",
"Putnins_P2" ,
"*) Putnins P2" },
2402 {
"putp3" ,
" ",
"Putnins_P3" ,
"*) Putnins P3" },
2403 {
"putp3p" ,
" ",
"Putnins_P3'" ,
"*) Putnins P3'" },
2404 {
"putp4p" ,
" ",
"Putnins_P4'" ,
"*) Putnins P4'" },
2405 {
"putp5" ,
" ",
"Putnins_P5" ,
"*) Putnins P5" },
2406 {
"putp5p" ,
" ",
"Putnins_P5'" ,
"*) Putnins P5'" },
2407 {
"putp6" ,
" ",
"Putnins_P6" ,
"*) Putnins P6" },
2408 {
"putp6p" ,
" ",
"Putnins_P6'" ,
"*) Putnins P6'" },
2409 {
"qua_aut" ,
" ",
"Quartic_Authalic" ,
"[ESRI] Quart c Authalic" },
2410 {
"robin" ,
" ",
"Robinson" ,
"Robinson" },
2411 {
"rouss" ,
" ",
"Roussilhe_Stereographic" ,
"*) Roussilhe Stereographic" },
2412 {
"rpoly" ,
" ",
"Rectangular_Polyconic" ,
"*) Rectangular Polyconic" },
2413 {
"sinu" ,
" ",
"Sinusoidal" ,
"Sinusoidal (Sanson-Flamsteed)" },
2414 {
"somerc" ,
" ",
"Hotine_Oblique_Mercator" ,
"Swiss Oblique Mercator" },
2415 {
"somerc" ,
"<",
"Swiss_Oblique_Cylindrical" ,
"Swiss Oblique Cylindrical" },
2416 {
"somerc" ,
"<",
"Hotine_Oblique_Mercator_Azimuth_Center" ,
"[ESRI] Swiss Oblique Mercator/Cylindrical" },
2417 {
"stere" ,
"<",
"Polar_Stereographic" ,
"Stereographic" },
2418 {
"stere" ,
" ",
"Stereographic" ,
"[ESRI] Stereographic" },
2419 {
"sterea" ,
" ",
"Oblique_Stereographic" ,
"Oblique Stereographic Alternative" },
2420 {
"sterea" ,
"<",
"Double_Stereographic" ,
"[ESRI]" },
2421 {
"gstmerc" ,
" ",
"Gauss_Schreiber_Transverse_Mercator" ,
"*) Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion)" },
2422 {
"tcc" ,
" ",
"Transverse_Central_Cylindrical" ,
"*) Transverse Central Cylindrical" },
2423 {
"tcea" ,
" ",
"Transverse_Cylindrical_Equal_Area" ,
"*) Transverse Cylindrical Equal Area" },
2424 {
"tissot" ,
" ",
"Tissot_Conic" ,
"*) Tissot Conic" },
2425 {
"tmerc" ,
" ",
"Transverse_Mercator" ,
"*) Transverse Mercator" },
2426 {
"tmerc" ,
"<",
"Gauss_Kruger" ,
"[ESRI] DHDN" },
2427 {
"tpeqd" ,
" ",
"Two_Point_Equidistant" ,
"*) Two Point Equidistant" },
2428 {
"tpers" ,
" ",
"Tilted_perspective" ,
"*) Tilted perspective" },
2429 {
"ups" ,
" ",
"Universal_Polar_Stereographic" ,
"*) Universal Polar Stereographic" },
2430 {
"urm5" ,
" ",
"Urmaev_V" ,
"*) Urmaev V" },
2431 {
"urmfps" ,
" ",
"Urmaev_Flat_Polar_Sinusoidal" ,
"*) Urmaev Flat-Polar Sinusoidal" },
2432 {
"utm" ,
">",
"Transverse_Mercator" ,
"*) Universal Transverse Mercator (UTM)" },
2433 {
"vandg" ,
"<",
"Van_Der_Grinten_I" ,
"[ESRI] van der Grinten (I)" },
2434 {
"vandg" ,
" ",
"VanDerGrinten" ,
"van der Grinten (I)" },
2435 {
"vandg2" ,
" ",
"VanDerGrinten_II" ,
"*) van der Grinten II" },
2436 {
"vandg3" ,
" ",
"VanDerGrinten_III" ,
"*) van der Grinten III" },
2437 {
"vandg4" ,
" ",
"VanDerGrinten_IV" ,
"*) van der Grinten IV" },
2438 {
"vitk1" ,
" ",
"Vitkovsky_I" ,
"*) Vitkovsky I" },
2439 {
"wag1" ,
" ",
"Wagner_I" ,
"*) Wagner I (Kavraisky VI)" },
2440 {
"wag2" ,
" ",
"Wagner_II" ,
"*) Wagner II" },
2441 {
"wag3" ,
" ",
"Wagner_III" ,
"*) Wagner III" },
2442 {
"wag4" ,
" ",
"Wagner_IV" ,
"*) Wagner IV" },
2443 {
"wag5" ,
" ",
"Wagner_V" ,
"*) Wagner V" },
2444 {
"wag6" ,
" ",
"Wagner_VI" ,
"*) Wagner VI" },
2445 {
"wag7" ,
" ",
"Wagner_VII" ,
"*) Wagner VII" },
2446 {
"webmerc" ,
" ",
"Mercator_1SP" ,
"Web Mercator" },
2447 {
"webmerc" ,
"<",
"Mercator_Auxiliary_Sphere" ,
"[ESRI] Web Mercator" },
2448 {
"weren" ,
" ",
"Werenskiold_I" ,
"*) Werenskiold I" },
2449 {
"wink1" ,
" ",
"Winkel_I" ,
"[ESRI] Winkel I" },
2450 {
"wink2" ,
" ",
"Winkel_II" ,
"[ESRI] Winkel II" },
2451 {
"wintri" ,
" ",
"Winkel_Tripel" ,
"[ESRI] Winkel Tripel" },
2454 {
"alpha" ,
" ",
"azimuth" ,
"? Used with Oblique Mercator and possibly a few others" },
2455 {
"k" ,
">",
"scale_factor" ,
"Scaling factor (old name)" },
2456 {
"K" ,
">",
"scale_factor" ,
"? Scaling factor (old name)" },
2457 {
"k_0" ,
" ",
"scale_factor" ,
"Scaling factor (new name)" },
2458 {
"lat_0" ,
" ",
"latitude_of_origin" ,
"Latitude of origin" },
2459 {
"lat_0" ,
"<",
"latitude_of_center" ,
"Latitude of center" },
2460 {
"lat_0" ,
"<",
"central_parallel" ,
"[ESRI] Latitude of center" },
2461 {
"lat_1" ,
" ",
"standard_parallel_1" ,
"Latitude of first standard parallel" },
2462 {
"lat_2" ,
" ",
"standard_parallel_2" ,
"Latitude of second standard parallel" },
2463 {
"lat_ts" ,
">",
"latitude_of_origin" ,
"Latitude of true scale" },
2464 {
"lon_0" ,
" ",
"central_meridian" ,
"Central meridian" },
2465 {
"lon_0" ,
"<",
"longitude_of_center" ,
"Longitude of center" },
2466 {
"lonc" ,
">",
"longitude_of_center" ,
"? Longitude used with Oblique Mercator and possibly a few others" },
2467 {
"x_0" ,
" ",
"false_easting" ,
"False easting" },
2468 {
"y_0" ,
" ",
"false_northing" ,
"False northing" },
2478 {
"h" ,
" ",
"satellite_height",
"Satellite height (geos - Geostationary Satellite View)" },
2550 Dictionary.
Set_Name(
"Proj.4-WKT Dictionary");
2552 if( Direction == 0 )
2559 for(
int i=0; *Translation[i][0]; i++)
2569 else if( Direction > 0 )
2574 for(
int i=0; *Translation[i][0]; i++)
2576 if( Translation[i][1][0] !=
'<' )
2585 else if( Direction < 0 )
2590 for(
int i=0; *Translation[i][0]; i++)
2592 if( Translation[i][1][0] !=
'>' )
2606 bool CSG_Projections::_Set_Dictionary(
void)
2610 return( _Set_Dictionary(Table, 1) && m_Proj4_to_WKT1.
Create(&Table, 0, 1,
true)
2611 && _Set_Dictionary(Table, -1) && m_WKT1_to_Proj4.
Create(&Table, 0, 1,
true)
2629 return( pTarget ? pTarget->
Create(*pSource) :
true );
2634 pTarget->
Create(*pSource); pSource = pTarget;
2650 bool bResult = pTool->
Execute();
2653 Data.
Delete(pSource,
true);
2666 if( Source == Target )
2685 bool bResult = pTool->
Execute();
2706 if( Source == Target )
2741 bool bResult =
false;