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 )
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;
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;
239 m_Unit = ESG_Projection_Unit::Undefined;
243 m_Authority .
Clear();
257 return(
Load(Stream) );
267 return(
Save(Stream, Format) );
301 case ESG_CRS_Format::WKT1: Definition =
Get_WKT1();
break;
302 case ESG_CRS_Format::WKT2: Definition =
Get_WKT2();
break;
303 case ESG_CRS_Format::PROJ: Definition =
Get_PROJ();
break;
304 case ESG_CRS_Format::JSON: Definition =
Get_JSON();
break;
305 case ESG_CRS_Format::ESRI: Definition =
Get_ESRI();
break;
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;
318 if( Projection(
"WKT2") && Projection(
"PROJ") &&
Create(Projection[
"WKT2"].Get_Content(), Projection[
"PROJ"].Get_Content()) ) {
return(
true ); }
320 if( Projection(
"WKT2") &&
Create(Projection[
"WKT2"].Get_Content()) ) {
return(
true ); }
321 if( Projection(
"PROJ") &&
Create(Projection[
"PROJ"].Get_Content()) ) {
return(
true ); }
326 if( Projection(
"WKT1" ) &&
Create(Projection[
"WKT1" ].Get_Content()) ) {
return(
true ); }
327 if( Projection(
"OGC_WKT") &&
Create(Projection[
"OGC_WKT"].Get_Content()) ) {
return(
true ); }
328 if( Projection(
"PROJ4" ) &&
Create(Projection[
"PROJ4" ].Get_Content()) ) {
return(
true ); }
374 return( CSG_Projections::_WKT2_to_MetaData(m_WKT2,
false).asText(1) );
387 return(
_TL(
"Unknown Spatial Reference") );
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 )
518 if( !m_PROJ.
CmpNoCase(Projection.m_PROJ) )
526 #define CMP_CONTENT(a, b ) (a && b && a->Cmp_Content(b->Get_Content()))
527 #define CMP_PROPERTY(a, b, p) (a && b && a->Get_Property(p) && b->Cmp_Property(p, a->Get_Property(p), true))
528 #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()))))
531 CSG_Projections::_WKT1_to_MetaData(
Get_WKT1()),
532 CSG_Projections::_WKT1_to_MetaData(Projection.
Get_WKT1())
533 }, *pGCS[2] = { NULL, NULL };
538 if( !
CMP_CONTENT (
WKT[0](
"PROJECTION"),
WKT[1](
"PROJECTION") ) ) {
return(
false ); }
541 for(
int i=0; i<
WKT[0].Get_Children_Count() && i<
WKT[1].Get_Children_Count(); i++)
546 pGCS[0] =
WKT[0](
"GEOGCS");
547 pGCS[1] =
WKT[1](
"GEOGCS");
555 if( !pGCS[0] || !pGCS[1] )
560 if( !
CMP_CONTENT((*pGCS[0])(
"PRIMEM" ), (*pGCS[1])(
"PRIMEM" )) ) {
return(
false ); }
561 if( !
CMP_CONTENT((*pGCS[0])(
"UNIT" ), (*pGCS[1])(
"UNIT" )) ) {
return(
false ); }
562 if( !
CMP_CONTENT((*pGCS[0])(
"DATUM.SPHEROID.a" ), (*pGCS[1])(
"DATUM.SPHEROID.a" )) ) {
return(
false ); }
563 if( !
CMP_CONTENT((*pGCS[0])(
"DATUM.SPHEROID.rf"), (*pGCS[1])(
"DATUM.SPHEROID.rf")) ) {
return(
false ); }
565 if( (*pGCS[0])(
"DATUM.TOWGS84") || (*pGCS[1])(
"DATUM.TOWGS84") )
567 #define CMP_TOWGS84(id) (\
568 ((*pGCS[0])("DATUM.TOWGS84." id) ? (*pGCS[0])["DATUM.TOWGS84." id].Get_Content().asDouble() : 0.)\
569 == ((*pGCS[1])("DATUM.TOWGS84." id) ? (*pGCS[1])["DATUM.TOWGS84." id].Get_Content().asDouble() : 0.) )
580 if( (*pGCS[0])(
"DATUM.EXTENSION") || (*pGCS[1])(
"DATUM.EXTENSION") )
582 if( !
CMP_CONTENT((*pGCS[0])(
"DATUM.EXTENSION"), (*pGCS[1])(
"DATUM.EXTENSION")) ) {
return(
false ); }
645 m_Type = ESG_CRS_Type::Geographic;
646 m_Unit = ESG_Projection_Unit::Undefined;
647 m_Authority =
"EPSG";
649 m_PROJ =
"+proj=longlat +datum=WGS84 +no_defs";
651 "GEODCRS[\"WGS 84\","
652 " DATUM[\"World Geodetic System 1984\","
653 " ELLIPSOID[\"WGS 84\",6378137,298.257223563]],"
654 " CS[ellipsoidal,2],"
655 " AXIS[\"geodetic latitude (Lat)\",north],"
656 " AXIS[\"geodetic longitude (Lon)\",east],"
657 " UNIT[\"degree\",0.0174532925199433],"
658 " SCOPE[\"Horizontal component of 3D system.\"],"
660 " BBOX[-90,-180,90,180],"
661 " ID[\"EPSG\",4326]]";
692 return( Projection );
698 if( Zone < 1 || Zone > 60 )
703 int EPSG_ID = (bSouth ? 32700 : 32600) + Zone;
712 "PROJCRS[\"WGS 84 / UTM zone %d%c\","
713 " BASEGEODCRS[\"WGS 84\","
714 " DATUM[\"World Geodetic System 1984\","
715 " ELLIPSOID[\"WGS 84\",6378137,298.257223563,"
716 " LENGTHUNIT[\"metre\",1]]],"
717 " PRIMEM[\"Greenwich\",0,"
718 " ANGLEUNIT[\"degree\",0.0174532925199433]]],"
719 " CONVERSION[\"UTM zone 32N\","
720 " METHOD[\"Transverse Mercator\","
721 " ID[\"EPSG\",9807]],"
722 " PARAMETER[\"Latitude of natural origin\",0,"
723 " ANGLEUNIT[\"degree\",0.0174532925199433],"
724 " ID[\"EPSG\",8801]],"
725 " PARAMETER[\"Longitude of natural origin\",%d,"
726 " ANGLEUNIT[\"degree\",0.0174532925199433],"
727 " ID[\"EPSG\",8802]],"
728 " PARAMETER[\"Scale factor at natural origin\",0.9996,"
729 " SCALEUNIT[\"unity\",1],"
730 " ID[\"EPSG\",8805]],"
731 " PARAMETER[\"False easting\",500000,"
732 " LENGTHUNIT[\"metre\",1],"
733 " ID[\"EPSG\",8806]],"
734 " PARAMETER[\"False northing\",%d,"
735 " LENGTHUNIT[\"metre\",1],"
736 " ID[\"EPSG\",8807]]],"
738 " AXIS[\"(E)\",east,"
740 " LENGTHUNIT[\"metre\",1]],"
741 " AXIS[\"(N)\",north,"
743 " LENGTHUNIT[\"metre\",1]],"
744 " ID[\"EPSG\",32632]]",
745 Zone, bSouth ?
'S' :
'N', 6 * (Zone - 1) - 177, bSouth ? 10000000 : 0, EPSG_ID
793 #if defined(__WXMAC__)
798 Path_Shared = SHARE_PATH;
801 #elif defined(_SAGA_LINUX)
803 Path_Shared = SHARE_PATH;
814 if( _Load(m_pPreferences,
SG_File_Make_Path(Path_Shared,
"saga_preferences",
"srs")) )
823 void CSG_Projections::_On_Construction(
void)
833 m_pPreferences =
new CSG_Table(m_pProjections);
843 delete(m_pProjections);
844 delete(m_pPreferences);
850 if( m_pProjections ) { m_pProjections->
Del_Records(); }
851 if( m_pPreferences ) { m_pPreferences->
Del_Records(); }
899 if( Projection.m_WKT2.
Find(
"GEOGCS") == 0
900 || Projection.m_WKT2.
Find(
"GEOCCS") == 0
901 || Projection.m_WKT2.
Find(
"GEODCS") == 0
902 || Projection.m_WKT2.
Find(
"PROJCS") == 0 )
904 Projection.m_WKT2 =
Parse(Projection.m_WKT2, ESG_CRS_Format::WKT2);
910 Projection.m_Name =
WKT.Get_Property(
"name");
912 Projection.m_Unit =
WKT(
"UNIT") &&
WKT[
"UNIT"].Get_Property(
"name") ?
916 return( Projection );
922 return( _Get_Projection(m_pProjections->
Get_Record(Index)) );
928 CSG_String Authority(_Authority && *_Authority ? _Authority :
SG_T(
"EPSG"));
946 CSG_String Authority(_Authority && *_Authority ? _Authority :
SG_T(
"EPSG"));
954 Projection = _Get_Projection(pProjection);
956 return( Projection.
is_Okay() );
969 bool CSG_Projections::_Add_Preferences(
void)
971 if( !m_pProjections || !m_pPreferences || m_pPreferences->
Get_Count() < 1 )
979 for(
sLong iPreference=0, iProjection=0; iPreference<m_pPreferences->
Get_Count() && iProjection<m_pProjections->
Get_Count(); )
988 if( Comparison < 0 ) { iProjection++; }
else if( Comparison > 0 ) { iPreference++; }
else
992 if( Comparison < 0 ) { iProjection++; }
else if( Comparison > 0 ) { iPreference++; }
else
997 m_pPreferences->
Select(pPreference,
true);
999 iProjection++; iPreference++;
1009 for(
sLong iPreference=0; iPreference<m_pPreferences->
Get_Count(); iPreference++)
1020 m_pPreferences->
Select();
1034 Projection = _Get_Projection(pProjection);
1036 return( Projection.
is_Okay() );
1046 int i = Authority_Code.
Find(
':');
1048 if( i > 1 && i < (
int)Authority_Code.
Length() - 2 )
1067 bool CSG_Projections::_Load(
CSG_Table *pTable,
const CSG_String &File,
bool bAppend)
const
1105 return( _Load(m_pProjections, File, bAppend) );
1111 return( m_pProjections->
Save(File) );
1168 pTool->
Set_Parameter(
"FORMAT" , WKT1 || ESRI || JSON ? 5 : 6);
1196 WKT.Get_Property(
"authority_name", Authority);
1197 WKT.Get_Property(
"authority_code", Code);
1200 if( !Authority.
is_Empty() && Code > 0 )
1206 if( WKT1 ) { *WKT1 = Projection.
Get_WKT1(); }
1207 if( WKT2 ) { *WKT2 = Projection.
Get_WKT2(); }
1208 if( PROJ ) { *PROJ = Projection.
Get_PROJ(); }
1209 if( ESRI ) { *ESRI = Projection.
Get_ESRI(); }
1220 if( WKT1 ) { *WKT1 = Definition; }
1221 if( PROJ ) { *PROJ = Proj4 ; }
1223 return( !WKT2 || !ESRI );
1231 if( WKT1 ) { *WKT1 =
WKT ; }
1232 if( PROJ ) { *PROJ = Definition; }
1234 return( !WKT2 || !ESRI );
1257 for(
int i=0; i<m_pProjections->
Get_Count(); i++)
1263 if(
WKT.Length() == 0 )
1272 WKT =
WKT.AfterFirst(
'[');
1281 Projection.
Set_Value(0,
WKT.AfterFirst(
'\"').BeforeFirst(
'\"'));
1297 for(
int i=0; i<Projections.
Get_Count(); i++)
1302 Projections[i].asString(1),
1303 Projections[i].asInt (2),
1304 Projections[i].asString(3),
1305 Projections[i].asString(0)
1311 Projections[i].asString(1),
1312 Projections[i].asInt (2),
1313 Projections[i].asString(0)
1329 if(
WKT.is_Empty() )
1334 int Colon = -1, Bracket = -1;
1336 for(
int i=0, bracket=0, quota=0; Colon<0 && i<(int)
WKT.Length(); i++)
1341 bracket++;
if( bracket == 1 ) { Bracket = i; }
1345 bracket--;
if( bracket < 0 ) {
return(
false ); }
1351 quota = quota ? 0 : 1;
1356 if( bracket == 0 && quota == 0 )
1370 if( Value.
Find(
'\"') == 0 )
1387 _WKT2_to_MetaData(*MetaData.
Add_Child(Key), Content);
1392 _WKT2_to_MetaData(MetaData,
WKT.Right(
WKT.Length() - Colon - 1));
1419 return( *pMetaData );
1432 if( !
WKT.is_Empty() )
1434 XML = _WKT2_to_MetaData(
WKT,
false).
asText(1);
1450 for(
int i=0, l=-1; l!=0 && i<(int)
WKT.Length(); i++)
1456 default : Key +=
WKT[i];
break;
1458 case '[':
case '(': l = 1 ;
break;
1459 case ')':
case ']':
return(
false );
1468 default : bAdd =
true;
break;
1469 case '\"' : bAdd =
false;
break;
1470 case '[' :
case '(': bAdd = ++l > 1;
break;
1471 case ']' :
case ')': bAdd = l-- > 1;
break;
1472 case ',' :
if( !(bAdd = l > 1) ) Content.
Add(
"");
break;
1482 if( Key.
is_Empty() || Content[0].is_Empty() )
1488 if( !Key.
Cmp(
"AUTHORITY") && Content.
Get_Count() == 2 )
1509 || (!Key.
Cmp(
"PARAMETER" ) && Content.
Get_Count() >= 2) )
1516 if( (!Key.
Cmp(
"SPHEROID" ) && Content.
Get_Count() >= 3) )
1523 if( (!Key.
Cmp(
"TOWGS84" ) && Content.
Get_Count() >= 7) )
1534 if( (!Key.
Cmp(
"EXTENSION" ) && Content.
Get_Count() >= 2) )
1540 if( (!Key.
Cmp(
"PROJECTION") && Content.
Get_Count() >= 1) )
1546 for(
int i=0; i<Content.
Get_Count(); i++)
1548 _WKT1_to_MetaData(*pKey, Content[i]);
1559 _WKT1_to_MetaData(MetaData,
WKT);
1584 if(
WKT.Cmp_Property(
"name",
"WGS84") )
1586 Proj4 +=
" +datum=WGS84";
1593 if( !
WKT(
"SPHEROID") ||
WKT[
"SPHEROID"].Get_Children_Count() != 2
1594 || !
WKT[
"SPHEROID"][0].Get_Content().asDouble(a) || a <= 0.
1595 || !
WKT[
"SPHEROID"][1].Get_Content().asDouble(b) || b < 0. )
1600 b = b > 0. ? a - a / b : a;
1605 if(
WKT(
"TOWGS84") &&
WKT[
"TOWGS84"].Get_Children_Count() == 7 )
1607 Proj4 +=
" +towgs84=";
1609 for(
int i=0; i<7; i++)
1616 Proj4 +=
WKT[
"TOWGS84"][i].Get_Content();
1636 int Authority_Code;
CSG_String Authority_Name;
1665 if( !m(
"DATUM") || !_WKT1_to_Proj4_Set_Datum(Proj4, m[
"DATUM"]) )
1670 if( m(
"PRIMEM") && m[
"PRIMEM"].Get_Content().asDouble(d) && d != 0. )
1689 Proj4 =
"+proj=longlat";
1691 if( !m(
"DATUM") || !_WKT1_to_Proj4_Set_Datum(Proj4, m[
"DATUM"]) )
1696 if( m(
"PRIMEM") && m[
"PRIMEM"].Get_Content().asDouble(d) && d != 0. )
1714 if( m.
Cmp_Name(
"PROJCS") && m(
"GEOGCS") && m(
"PROJECTION") && m_WKT1_to_Proj4.
Get_Translation(m[
"PROJECTION"].Get_Content(), Proj4) )
1716 if( m[
"PROJECTION"].Cmp_Content(
"Transverse_Mercator") )
1718 double Scale = -1., Easting = -1., Northing = -1., Meridian = -1., Latitude = -1.;
1722 if( m[i].Cmp_Name(
"PARAMETER") )
1726 if( m[i].Cmp_Property(
"name",
"central_meridian" ,
true) && m[i].Get_Content().asDouble(v) ) Meridian = v;
1727 if( m[i].Cmp_Property(
"name",
"latitude_of_origin",
true) && m[i].Get_Content().asDouble(v) ) Latitude = v;
1728 if( m[i].Cmp_Property(
"name",
"scale_factor" ,
true) && m[i].Get_Content().asDouble(v) ) Scale = v;
1729 if( m[i].Cmp_Property(
"name",
"false_easting" ,
true) && m[i].Get_Content().asDouble(v) ) Easting = v;
1730 if( m[i].Cmp_Property(
"name",
"false_northing" ,
true) && m[i].Get_Content().asDouble(v) ) Northing = v;
1734 if( Latitude == 0. && Scale == 0.9996 && Easting == 500000. && (Northing == 0. || Northing == 10000000.) )
1736 Proj4 =
"+proj=utm";
1738 if( !m[
"GEOGCS"](
"DATUM") || !_WKT1_to_Proj4_Set_Datum(Proj4, m[
"GEOGCS"][
"DATUM"]) )
1745 if( Northing == 10000000. )
1757 Proj4 =
"+proj=" + Proj4;
1759 if( !m[
"GEOGCS"](
"DATUM") || !_WKT1_to_Proj4_Set_Datum(Proj4, m[
"GEOGCS"][
"DATUM"]) )
1764 if( m(
"PRIMEM") && m[
"PRIMEM"].Get_Content().asDouble(d) && d != 0. )
1771 if( m[i].Cmp_Name(
"PARAMETER") )
1775 if( m_WKT1_to_Proj4.
Get_Translation(m[i].Get_Property(
"name"), Parameter) )
1777 Proj4 +=
" +" + Parameter +
"=" + m[i].
Get_Content();
1786 if( m(
"UNIT") && m[
"UNIT"].Get_Content().asDouble(d) && d != 0. && d != 1. )
1808 return( Proj4.
Find(
"+" + Key) >= 0 );
1816 int l, i = Proj4.
Find(
"+" + Key +
"=");
1820 for(++i, l=0; l<2 && i<(int)Proj4.
Length(); i++)
1824 case '=': l++;
break;
1825 case '+': l=2;
break;
1826 case ' ': l=2;
break;
1836 return( Value.
Length() > 0 );
1842 const char ellipsoid[42][2][32] =
1844 {
"MERIT" ,
"6378137.0,298.257" },
1845 {
"SGS85" ,
"6378136.0,298.257" },
1846 {
"GRS80" ,
"6378137.0,298.2572221" },
1847 {
"IAU76" ,
"6378140.0,298.257" },
1848 {
"airy" ,
"6377563.396,299.3249753" },
1849 {
"APL4.9" ,
"6378137.0,298.25" },
1850 {
"NWL9D" ,
"6378145.0,298.25" },
1851 {
"mod_airy" ,
"6377340.189,299.3249374" },
1852 {
"andrae" ,
"6377104.43,300" },
1853 {
"aust_SA" ,
"6378160.0,298.25" },
1854 {
"GRS67" ,
"6378160.0,298.2471674" },
1855 {
"bessel" ,
"6377397.155,299.1528128" },
1856 {
"bess_nam" ,
"6377483.865,299.1528128" },
1857 {
"clrk66" ,
"6378206.4,294.9786982" },
1858 {
"clrk80" ,
"6378249.145,293.4663" },
1859 {
"CPM" ,
"6375738.7,334.29" },
1860 {
"delmbr" ,
"6376428.0,311.5" },
1861 {
"engelis" ,
"6378136.05,298.2566" },
1862 {
"evrst30" ,
"6377276.345,300.8017" },
1863 {
"evrst48" ,
"6377304.063,300.8017" },
1864 {
"evrst56" ,
"6377301.243,300.8017" },
1865 {
"evrst69" ,
"6377295.664,300.8017" },
1866 {
"evrstSS" ,
"6377298.556,300.8017" },
1867 {
"fschr60" ,
"6378166.0,298.3" },
1868 {
"fschr60m" ,
"6378155.0,298.3" },
1869 {
"fschr68" ,
"6378150.0,298.3" },
1870 {
"helmert" ,
"6378200.0,298.3" },
1871 {
"hough" ,
"6378270.0,297" },
1872 {
"intl" ,
"6378388.0,297" },
1873 {
"krass" ,
"6378245.0,298.3" },
1874 {
"kaula" ,
"6378163.0,298.24" },
1875 {
"lerch" ,
"6378139.0,298.257" },
1876 {
"mprts" ,
"6397300.0,191" },
1877 {
"new_intl" ,
"6378157.5,298.2496154" },
1878 {
"plessis" ,
"6376523.0,308.6409971" },
1879 {
"SEasia" ,
"6378155.0,298.3000002" },
1880 {
"walbeck" ,
"6376896.0,302.7800002" },
1881 {
"WGS60" ,
"6378165.0,298.3" },
1882 {
"WGS66" ,
"6378145.0,298.25" },
1883 {
"WGS72" ,
"6378135.0,298.26" },
1884 {
"WGS84" ,
"6378137.0,298.2572236" },
1885 {
"sphere" ,
"6370997.0,-1" }
1889 if( _Proj4_Read_Parameter(Value, Proj4,
"ellps") )
1891 for(
int i=0; i<42; i++)
1903 double a = _Proj4_Read_Parameter(Value, Proj4,
"a" ) && Value.
asDouble(a) ? a : 6378137.;
1905 double b = _Proj4_Read_Parameter(Value, Proj4,
"b" ) && Value.
asDouble(b) ? a / (a - b)
1906 : _Proj4_Read_Parameter(Value, Proj4,
"rf") && Value.
asDouble(b) ? b
1907 : _Proj4_Read_Parameter(Value, Proj4,
"f" ) && Value.
asDouble(b) ? 1. / b
1908 : _Proj4_Read_Parameter(Value, Proj4,
"e" ) && Value.
asDouble(b) ? a / (a - sqrt(b*b - a*a))
1909 : _Proj4_Read_Parameter(Value, Proj4,
"es") && Value.
asDouble(b) ? a / (a - sqrt( b - a*a))
1920 const char datum[9][3][64] =
1922 {
"WGS84" ,
"WGS84" ,
"0,0,0,0,0,0,0" },
1923 {
"GGRS87" ,
"GRS80" ,
"-199.87,74.79,246.62,0,0,0,0" },
1924 {
"NAD83" ,
"GRS80" ,
"0,0,0,0,0,0,0" },
1926 {
"potsdam" ,
"bessel" ,
"606.0,23.0,413.0,0,0,0,0" },
1927 {
"carthage" ,
"clark80" ,
"-263.0,6.0,431.0,0,0,0,0" },
1928 {
"hermannskogel" ,
"bessel" ,
"653.0,-212.0,449.0,0,0,0,0" },
1929 {
"ire65" ,
"mod_airy" ,
"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15" },
1930 {
"nzgd49" ,
"intl" ,
"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993" },
1931 {
"OSGB36" ,
"airy" ,
"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894" }
1937 if( _Proj4_Read_Parameter(Value, Proj4,
"datum") )
1939 for(
int i=0; i<9; i++)
1951 if( _Proj4_Get_Ellipsoid(Spheroid, Proj4) )
1953 Value =
"DATUM[\"Datum\","+ Spheroid;
1955 if( _Proj4_Read_Parameter(ToWGS84, Proj4,
"towgs84") )
1961 ToWGS84 +=
",0,0,0,0";
1964 Value +=
",TOWGS84[" + ToWGS84 +
"]";
1968 Value +=
",TOWGS84[0,0,0,0,0,0,0]";
1977 Value =
"DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563],TOWGS84[0,0,0,0,0,0,0]]";
1985 const char meridian[12][2][16] =
1987 {
"lisbon" ,
"-9.131906111" },
1988 {
"paris" ,
"2.337229167" },
1989 {
"bogota" ,
"74.08091667" },
1990 {
"madrid" ,
"-3.687911111" },
1991 {
"rome" ,
"12.45233333" },
1992 {
"bern" ,
"7.439583333" },
1993 {
"jakarta" ,
"106.8077194" },
1994 {
"ferro" ,
"-17.66666667" },
1995 {
"brussels" ,
"4.367975" },
1996 {
"stockholm" ,
"18.05827778" },
1997 {
"athens" ,
"23.7163375" },
1998 {
"oslo" ,
"10.72291667" }
2002 if( _Proj4_Read_Parameter(Value, Proj4,
"pm") )
2004 for(
int i=0; i<12; i++)
2018 Value.
Printf(
"PRIMEM[\"Prime_Meridian\",%f]", d);
2025 Value =
"PRIMEM[\"Greenwich\",0]";
2035 if( Unit != ESG_Projection_Unit::Undefined )
2045 if( _Proj4_Read_Parameter(Value, Proj4,
"to_meter") && Value.
asDouble(d) && d > 0. && d != 1. )
2047 Value.
Printf(
"UNIT[\"Unit\",%f]", d);
2053 Value =
"UNIT[\"metre\",1]";
2065 if( !_Proj4_Read_Parameter(ProjCS, Proj4,
"proj") )
2086 WKT =
"GEOGCS[\"GCS\"";
2088 if( _Proj4_Get_Datum (Value, Proj4) ) {
WKT +=
"," + Value; }
2089 if( _Proj4_Get_Prime_Meridian(Value, Proj4) ) {
WKT +=
"," + Value; }
2090 if( _Proj4_Get_Unit (Value, Proj4) ) {
WKT +=
"," + Value; }
2111 if( _Proj4_Get_Datum (Value, Proj4) ) { GeogCS +=
"," + Value; }
2112 if( _Proj4_Get_Prime_Meridian(Value, Proj4) ) { GeogCS +=
"," + Value; }
2113 if( _Proj4_Get_Unit (Value, Proj4) ) { GeogCS +=
"," + Value; }
else { GeogCS +=
"UNIT[\"degree\",0.01745329251994328]"; }
2149 if( !_Proj4_Read_Parameter(Value, Proj4,
"zone") || !Value.
asDouble(Zone) )
2156 bool South = _Proj4_Find_Parameter(Proj4,
"south");
2158 WKT =
CSG_String::Format(
"PROJCS[\"UTM zone %d%c\",%s,PROJECTION[Transverse_Mercator]", (
int)Zone, South ?
'S' :
'N', GeogCS.
c_str());
2165 WKT +=
",UNIT[\"metre\",1]]";
2177 while( ProjCS.
Find(
'+') >= 0 )
2188 if( Value.
Find(
'+') >= 0 )
2193 WKT +=
",PARAMETER[\"" + Key +
"\"," + Value +
"]";
2200 if( _Proj4_Get_Unit(Value, Proj4) ) {
WKT +=
"," + Value; }
2218 if( !Identifier.
CmpNoCase(
"PROJCS") || !Identifier.
CmpNoCase(
"PROJCRS") ) {
return( ESG_CRS_Type::Projection ); }
2219 if( !Identifier.
CmpNoCase(
"GEOGCS") || !Identifier.
CmpNoCase(
"GEOGCRS") ) {
return( ESG_CRS_Type::Geographic ); }
2220 if( !Identifier.
CmpNoCase(
"GEOCCS") || !Identifier.
CmpNoCase(
"GEOCCRS") ) {
return( ESG_CRS_Type::Geocentric ); }
2221 if( !Identifier.
CmpNoCase(
"GEODCS") || !Identifier.
CmpNoCase(
"GEODCRS") ) {
return( ESG_CRS_Type::Geodetic ); }
2231 case ESG_CRS_Type::Projection:
return(
"PROJCRS" );
2232 case ESG_CRS_Type::Geographic:
return(
"GEOGCRS" );
2233 case ESG_CRS_Type::Geocentric:
return(
"GEOCCRS" );
2234 case ESG_CRS_Type::Geodetic :
return(
"GEODCRS" );
2235 default :
return(
"UNDEFINED" );
2244 case ESG_CRS_Type::Projection:
return(
_TL(
"Projected Coordinate System" ) );
2245 case ESG_CRS_Type::Geographic:
return(
_TL(
"Geographic Coordinate System") );
2246 case ESG_CRS_Type::Geocentric:
return(
_TL(
"Geocentric Coordinate System") );
2247 case ESG_CRS_Type::Geodetic :
return(
_TL(
"Geodetic Coordinate System" ) );
2248 default :
return(
_TL(
"Unknown Coordinate System" ) );
2255 for(
int i=0; i<(int)ESG_Projection_Unit::Undefined; i++)
2266 return( !Identifier.
CmpNoCase(
"metre") ? ESG_Projection_Unit::Meter : ESG_Projection_Unit::Undefined );
2274 case ESG_Projection_Unit::Kilometer :
return(
"km" );
2275 case ESG_Projection_Unit::Meter :
return(
"m" );
2276 case ESG_Projection_Unit::Decimeter :
return(
"dm" );
2277 case ESG_Projection_Unit::Centimeter :
return(
"cm" );
2278 case ESG_Projection_Unit::Millimeter :
return(
"mm" );
2279 case ESG_Projection_Unit::Int_Nautical_Mile:
return(
"kmi" );
2280 case ESG_Projection_Unit::Int_Inch :
return(
"in" );
2281 case ESG_Projection_Unit::Int_Foot :
return(
"ft" );
2282 case ESG_Projection_Unit::Int_Yard :
return(
"yd" );
2283 case ESG_Projection_Unit::Int_Statute_Mile :
return(
"mi" );
2284 case ESG_Projection_Unit::Int_Fathom :
return(
"fath" );
2285 case ESG_Projection_Unit::Int_Chain :
return(
"ch" );
2286 case ESG_Projection_Unit::Int_Link :
return(
"link" );
2287 case ESG_Projection_Unit::US_Inch :
return(
"us-in" );
2288 case ESG_Projection_Unit::US_Foot :
return(
"us-ft" );
2289 case ESG_Projection_Unit::US_Yard :
return(
"us-yd" );
2290 case ESG_Projection_Unit::US_Chain :
return(
"us-ch" );
2291 case ESG_Projection_Unit::US_Statute_Mile :
return(
"us-mi" );
2292 case ESG_Projection_Unit::Indian_Yard :
return(
"ind-yd" );
2293 case ESG_Projection_Unit::Indian_Foot :
return(
"ind-ft" );
2294 case ESG_Projection_Unit::Indian_Chain :
return(
"ind-ch" );
2295 default:
return(
"" );
2304 case ESG_Projection_Unit::Kilometer :
return( bSimple ?
"Kilometers" :
"Kilometer" );
2305 case ESG_Projection_Unit::Meter :
return( bSimple ?
"Meters" :
"Meter" );
2306 case ESG_Projection_Unit::Decimeter :
return( bSimple ?
"Decimeters" :
"Decimeter" );
2307 case ESG_Projection_Unit::Centimeter :
return( bSimple ?
"Centimeters" :
"Centimeter" );
2308 case ESG_Projection_Unit::Millimeter :
return( bSimple ?
"Millimeters" :
"Millimeter" );
2309 case ESG_Projection_Unit::Int_Nautical_Mile:
return( bSimple ?
"Miles" :
"International Nautical Mile" );
2310 case ESG_Projection_Unit::Int_Inch :
return( bSimple ?
"Inches" :
"International Inch" );
2311 case ESG_Projection_Unit::Int_Foot :
return( bSimple ?
"Feet" :
"International Foot" );
2312 case ESG_Projection_Unit::Int_Yard :
return( bSimple ?
"Yards" :
"International Yard" );
2313 case ESG_Projection_Unit::Int_Statute_Mile :
return( bSimple ?
"Miles" :
"International Statute Mile" );
2314 case ESG_Projection_Unit::Int_Fathom :
return( bSimple ?
"Fathoms" :
"International Fathom" );
2315 case ESG_Projection_Unit::Int_Chain :
return( bSimple ?
"Chains" :
"International Chain" );
2316 case ESG_Projection_Unit::Int_Link :
return( bSimple ?
"Links" :
"International Link" );
2317 case ESG_Projection_Unit::US_Inch :
return( bSimple ?
"Inches" :
"U.S. Surveyor's Inch" );
2318 case ESG_Projection_Unit::US_Foot :
return( bSimple ?
"Feet" :
"U.S. Surveyor's Foot" );
2319 case ESG_Projection_Unit::US_Yard :
return( bSimple ?
"Yards" :
"U.S. Surveyor's Yard" );
2320 case ESG_Projection_Unit::US_Chain :
return( bSimple ?
"Chains" :
"U.S. Surveyor's Chain" );
2321 case ESG_Projection_Unit::US_Statute_Mile :
return( bSimple ?
"Miles" :
"U.S. Surveyor's Statute Mile" );
2322 case ESG_Projection_Unit::Indian_Yard :
return( bSimple ?
"Yards" :
"Indian Yard" );
2323 case ESG_Projection_Unit::Indian_Foot :
return( bSimple ?
"Feet" :
"Indian Foot" );
2324 case ESG_Projection_Unit::Indian_Chain :
return( bSimple ?
"Chains" :
"Indian Chain" );
2325 default:
return(
"" );
2334 case ESG_Projection_Unit::Kilometer :
return( 1000. );
2335 case ESG_Projection_Unit::Meter :
return( 1. );
2336 case ESG_Projection_Unit::Decimeter :
return( 0.1 );
2337 case ESG_Projection_Unit::Centimeter :
return( 0.01 );
2338 case ESG_Projection_Unit::Millimeter :
return( 0.001 );
2339 case ESG_Projection_Unit::Int_Nautical_Mile:
return( 1852. );
2340 case ESG_Projection_Unit::Int_Inch :
return( 0.0254 );
2341 case ESG_Projection_Unit::Int_Foot :
return( 0.3048 );
2342 case ESG_Projection_Unit::Int_Yard :
return( 0.9144 );
2343 case ESG_Projection_Unit::Int_Statute_Mile :
return( 1609.344 );
2344 case ESG_Projection_Unit::Int_Fathom :
return( 1.8288 );
2345 case ESG_Projection_Unit::Int_Chain :
return( 20.1168 );
2346 case ESG_Projection_Unit::Int_Link :
return( 0.201168 );
2347 case ESG_Projection_Unit::US_Inch :
return( 1. / 39.37 );
2348 case ESG_Projection_Unit::US_Foot :
return( 0.304800609601219 );
2349 case ESG_Projection_Unit::US_Yard :
return( 0.914401828803658 );
2350 case ESG_Projection_Unit::US_Chain :
return( 20.11684023368047 );
2351 case ESG_Projection_Unit::US_Statute_Mile :
return( 1609.347218694437 );
2352 case ESG_Projection_Unit::Indian_Yard :
return( 0.91439523 );
2353 case ESG_Projection_Unit::Indian_Foot :
return( 0.30479841 );
2354 case ESG_Projection_Unit::Indian_Chain :
return( 20.11669506 );
2355 default :
return( 1. );
2367 bool CSG_Projections::_Set_Dictionary(
CSG_Table &Dictionary,
int Direction)
2369 const char Translation[][4][128] = {
2373 {
"aea" ,
" ",
"Albers_Conic_Equal_Area" ,
"Albers Equal Area" },
2374 {
"aea" ,
"<",
"Albers" ,
"[ESRI] Albers Equal Area" },
2375 {
"aeqd" ,
" ",
"Azimuthal_Equidistant" ,
"Azimuthal Equidistant" },
2376 {
"airy" ,
" ",
"Airy 1830" ,
"Airy 1830" },
2377 {
"aitoff" ,
" ",
"Sphere_Aitoff" ,
"Aitoff" },
2378 {
"alsk" ,
" ",
"Mod_Stererographics_of_Alaska" ,
"*) Mod. Stererographics of Alaska" },
2379 {
"Amersfoort" ,
"<",
"D_Amersfoort" ,
"[ESRI] datum RD_NEW" },
2380 {
"Amersfoort" ,
"<",
"GCS_Amersfoort" ,
"[ESRI] GCS RD_NEW" },
2381 {
"Amersfoort / RD New",
"<",
"Amersfoort_RD_New" ,
"[ESRI] RD_NEW" },
2382 {
"apian" ,
" ",
"Apian_Globular_I" ,
"*) Apian Globular I" },
2383 {
"august" ,
" ",
"August_Epicycloidal" ,
"*) August Epicycloidal" },
2384 {
"bacon" ,
" ",
"Bacon_Globular" ,
"*) Bacon Globular" },
2385 {
"bipc" ,
" ",
"Bipolar_conic_of_western_hemisphere" ,
"*) Bipolar conic of western hemisphere" },
2386 {
"boggs" ,
" ",
"Boggs_Eumorphic" ,
"*) Boggs Eumorphic" },
2387 {
"bonne" ,
" ",
"Bonne" ,
"Bonne (Werner lat_1=90)" },
2388 {
"cass" ,
" ",
"Cassini_Soldner" ,
"Cassini" },
2389 {
"cass" ,
"<",
"Cassini" ,
"[ESRI] Cassini" },
2390 {
"cc" ,
" ",
"Central_Cylindrical" ,
"*) Central Cylindrical" },
2391 {
"cea" ,
" ",
"Cylindrical_Equal_Area" ,
"Equal Area Cylindrical, alias: Lambert Cyl.Eq.A., Normal Authalic Cyl. (FME), Behrmann (SP=30), Gall Orthogr. (SP=45)" },
2392 {
"cea" ,
"<",
"Behrmann" ,
"[ESRI] Behrmann (standard parallel = 30)" },
2393 {
"chamb" ,
" ",
"Chamberlin_Trimetric" ,
"*) Chamberlin Trimetric" },
2394 {
"collg" ,
" ",
"Collignon" ,
"*) Collignon" },
2395 {
"crast" ,
" ",
"Craster_Parabolic" ,
"[ESRI] Craster Parabolic (Putnins P4)" },
2396 {
"denoy" ,
" ",
"Denoyer_Semi_Elliptical" ,
"*) Denoyer Semi-Elliptical" },
2397 {
"eck1" ,
" ",
"Eckert_I" ,
"*) Eckert I" },
2398 {
"eck2" ,
" ",
"Eckert_II" ,
"*) Eckert II" },
2399 {
"eck3" ,
" ",
"Eckert_III" ,
"*) Eckert III" },
2400 {
"eck4" ,
" ",
"Eckert_IV" ,
"Eckert IV" },
2401 {
"eck5" ,
" ",
"Eckert_V" ,
"*) Eckert V" },
2402 {
"eck6" ,
" ",
"Eckert_VI" ,
"Eckert VI" },
2403 {
"eqearth" ,
" ",
"Equal_Earth" ,
"*) Equal Earth" },
2404 {
"eqc" ,
" ",
"Equirectangular" ,
"Equidistant Cylindrical (Plate Caree)" },
2405 {
"eqc" ,
"<",
"Equidistant_Cylindrical" ,
"[ESRI] Equidistant Cylindrical (Plate Caree)" },
2406 {
"eqc" ,
"<",
"Plate_Carree" ,
"[ESRI] Equidistant Cylindrical (Plate Caree)" },
2407 {
"eqdc" ,
" ",
"Equidistant_Conic" ,
"*) Equidistant Conic" },
2408 {
"euler" ,
" ",
"Euler" ,
"*) Euler" },
2409 {
"etmerc" ,
" ",
"Extended_Transverse_Mercator" ,
"*) Extended Transverse Mercator" },
2410 {
"fahey" ,
" ",
"Fahey" ,
"*) Fahey" },
2411 {
"fouc" ,
" ",
"Foucault" ,
"*) Foucaut" },
2412 {
"fouc_s" ,
" ",
"Foucault_Sinusoidal" ,
"*) Foucaut Sinusoidal" },
2413 {
"gall" ,
" ",
"Gall_Stereographic" ,
"Gall (Gall Stereographic)" },
2414 {
"geocent" ,
" ",
"Geocentric" ,
"*) Geocentric" },
2415 {
"geos" ,
" ",
"GEOS" ,
"Geostationary Satellite View" },
2416 {
"gins8" ,
" ",
"Ginsburg_VIII" ,
"*) Ginsburg VIII (TsNIIGAiK)" },
2417 {
"gn_sinu" ,
" ",
"General_Sinusoidal_Series" ,
"*) General Sinusoidal Series" },
2418 {
"gnom" ,
" ",
"Gnomonic" ,
"Gnomonic" },
2419 {
"goode" ,
" ",
"Goode_Homolosine" ,
"*) Goode Homolosine" },
2420 {
"gs48" ,
" ",
"Mod_Stererographics_48" ,
"*) Mod. Stererographics of 48 U.S." },
2421 {
"gs50" ,
" ",
"Mod_Stererographics_50" ,
"*) Mod. Stererographics of 50 U.S." },
2422 {
"hammer" ,
" ",
"Hammer_Eckert_Greifendorff" ,
"*) Hammer & Eckert-Greifendorff" },
2423 {
"hatano" ,
" ",
"Hatano_Asymmetrical_Equal_Area" ,
"*) Hatano Asymmetrical Equal Area" },
2424 {
"igh" ,
" ",
"Interrupted_Goodes_Homolosine" ,
"*) Interrupted Goode's Homolosine" },
2425 {
"igh_o" ,
" ",
"Interrupted_Goodes_Homolosine_Ocean" ,
"*) Interrupted Goode's Homolosine (Ocean)" },
2426 {
"imw_p" ,
" ",
"International_Map_of_the_World_Polyconic" ,
"*) International Map of the World Polyconic" },
2427 {
"kav5" ,
" ",
"Kavraisky_V" ,
"*) Kavraisky V" },
2428 {
"kav7" ,
" ",
"Kavraisky_VII" ,
"*) Kavraisky VII" },
2429 {
"krovak" ,
" ",
"Krovak" ,
"Krovak" },
2430 {
"labrd" ,
" ",
"Laborde_Oblique_Mercator" ,
"*) Laborde" },
2431 {
"laea" ,
" ",
"Lambert_Azimuthal_Equal_Area" ,
"Lambert Azimuthal Equal Area" },
2432 {
"lagrng" ,
" ",
"Lagrange" ,
"*) Lagrange" },
2433 {
"larr" ,
" ",
"Larrivee" ,
"*) Larrivee" },
2434 {
"lask" ,
" ",
"Laskowski" ,
"*) Laskowski" },
2435 {
"lcc" ,
"<",
"Lambert_Conformal_Conic_1SP" ,
"Lambert Conformal Conic (1 standard parallel)" },
2436 {
"lcc" ,
"<",
"Lambert_Conformal_Conic_2SP" ,
"Lambert Conformal Conic (2 standard parallels)" },
2437 {
"lcc" ,
" ",
"Lambert_Conformal_Conic" ,
"Lambert Conformal Conic" },
2438 {
"lcca" ,
" ",
"Lambert_Conformal_Conic_Alternative" ,
"*) Lambert Conformal Conic Alternative" },
2439 {
"leac" ,
" ",
"Lambert_Equal_Area_Conic" ,
"*) Lambert Equal Area Conic" },
2440 {
"lee_os" ,
" ",
"Lee_Oblated_Stereographic" ,
"*) Lee Oblated Stereographic" },
2441 {
"loxim" ,
" ",
"Loximuthal" ,
"[ESRI] Loximuthal" },
2442 {
"lsat" ,
" ",
"Space_oblique_for_LANDSAT" ,
"*) Space oblique for LANDSAT" },
2443 {
"mbt_s" ,
" ",
"McBryde_Thomas_Flat_Polar_Sine" ,
"*) McBryde-Thomas Flat-Polar Sine" },
2444 {
"mbt_fps" ,
" ",
"McBryde_Thomas_Flat_Polar_Sine_2" ,
"*) McBryde-Thomas Flat-Pole Sine (No. 2)" },
2445 {
"mbtfpp" ,
" ",
"McBryde_Thomas_Flat_Polar_Parabolic" ,
"*) McBride-Thomas Flat-Polar Parabolic" },
2446 {
"mbtfpq" ,
" ",
"Flat_Polar_Quartic" ,
"[ESRI] McBryde-Thomas Flat-Polar Quartic" },
2447 {
"mbtfps" ,
" ",
"McBryde_Thomas_Flat_Polar_Sinusoidal" ,
"*) McBryde-Thomas Flat-Polar Sinusoidal" },
2448 {
"merc" ,
" ",
"Mercator" ,
"[ESRI] Mercator" },
2449 {
"merc" ,
"<",
"Mercator_1SP" ,
"Mercator (1 standard parallel)" },
2450 {
"merc" ,
"<",
"Mercator_2SP" ,
"Mercator (2 standard parallels)" },
2451 {
"mil_os" ,
" ",
"Miller_Oblated_Stereographic" ,
"*) Miller Oblated Stereographic" },
2452 {
"mill" ,
" ",
"Miller_Cylindrical" ,
"Miller Cylindrical" },
2453 {
"moll" ,
" ",
"Mollweide" ,
"Mollweide" },
2454 {
"murd1" ,
" ",
"Murdoch_I" ,
"*) Murdoch I" },
2455 {
"murd2" ,
" ",
"Murdoch_II" ,
"*) Murdoch II" },
2456 {
"murd3" ,
" ",
"Murdoch_III" ,
"*) Murdoch III" },
2457 {
"nell" ,
" ",
"Nell" ,
"*) Nell" },
2458 {
"nell_h" ,
" ",
"Nell_Hammer" ,
"*) Nell-Hammer" },
2459 {
"nicol" ,
" ",
"Nicolosi_Globular" ,
"*) Nicolosi Globular" },
2460 {
"nsper" ,
" ",
"Near_sided_perspective" ,
"*) Near-sided perspective" },
2461 {
"nzmg" ,
" ",
"New_Zealand_Map_Grid" ,
"New Zealand Map Grid" },
2462 {
"ob_tran" ,
" ",
"General_Oblique_Transformation" ,
"*) General Oblique Transformation" },
2463 {
"ocea" ,
" ",
"Oblique_Cylindrical_Equal_Area" ,
"*) Oblique Cylindrical Equal Area" },
2464 {
"oea" ,
" ",
"Oblated_Equal_Area" ,
"*) Oblated Equal Area" },
2465 {
"omerc" ,
" ",
"Hotine_Oblique_Mercator" ,
"Oblique Mercator" },
2466 {
"omerc" ,
"<",
"Oblique_Mercator" ,
"Oblique Mercator" },
2467 {
"ortel" ,
" ",
"Ortelius_Oval" ,
"*) Ortelius Oval" },
2468 {
"ortho" ,
" ",
"Orthographic" ,
"Orthographic (ESRI: World from Space)" },
2469 {
"pconic" ,
" ",
"Perspective_Conic" ,
"*) Perspective Conic" },
2470 {
"poly" ,
" ",
"Polyconic" ,
"*) Polyconic (American)" },
2471 {
"putp1" ,
" ",
"Putnins_P1" ,
"*) Putnins P1" },
2472 {
"putp2" ,
" ",
"Putnins_P2" ,
"*) Putnins P2" },
2473 {
"putp3" ,
" ",
"Putnins_P3" ,
"*) Putnins P3" },
2474 {
"putp3p" ,
" ",
"Putnins_P3'" ,
"*) Putnins P3'" },
2475 {
"putp4p" ,
" ",
"Putnins_P4'" ,
"*) Putnins P4'" },
2476 {
"putp5" ,
" ",
"Putnins_P5" ,
"*) Putnins P5" },
2477 {
"putp5p" ,
" ",
"Putnins_P5'" ,
"*) Putnins P5'" },
2478 {
"putp6" ,
" ",
"Putnins_P6" ,
"*) Putnins P6" },
2479 {
"putp6p" ,
" ",
"Putnins_P6'" ,
"*) Putnins P6'" },
2480 {
"qua_aut" ,
" ",
"Quartic_Authalic" ,
"[ESRI] Quart c Authalic" },
2481 {
"robin" ,
" ",
"Robinson" ,
"Robinson" },
2482 {
"rouss" ,
" ",
"Roussilhe_Stereographic" ,
"*) Roussilhe Stereographic" },
2483 {
"rpoly" ,
" ",
"Rectangular_Polyconic" ,
"*) Rectangular Polyconic" },
2484 {
"sinu" ,
" ",
"Sinusoidal" ,
"Sinusoidal (Sanson-Flamsteed)" },
2485 {
"somerc" ,
" ",
"Hotine_Oblique_Mercator" ,
"Swiss Oblique Mercator" },
2486 {
"somerc" ,
"<",
"Swiss_Oblique_Cylindrical" ,
"Swiss Oblique Cylindrical" },
2487 {
"somerc" ,
"<",
"Hotine_Oblique_Mercator_Azimuth_Center" ,
"[ESRI] Swiss Oblique Mercator/Cylindrical" },
2488 {
"stere" ,
"<",
"Polar_Stereographic" ,
"Stereographic" },
2489 {
"stere" ,
" ",
"Stereographic" ,
"[ESRI] Stereographic" },
2490 {
"sterea" ,
" ",
"Oblique_Stereographic" ,
"Oblique Stereographic Alternative" },
2491 {
"sterea" ,
"<",
"Double_Stereographic" ,
"[ESRI]" },
2492 {
"gstmerc" ,
" ",
"Gauss_Schreiber_Transverse_Mercator" ,
"*) Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion)" },
2493 {
"tcc" ,
" ",
"Transverse_Central_Cylindrical" ,
"*) Transverse Central Cylindrical" },
2494 {
"tcea" ,
" ",
"Transverse_Cylindrical_Equal_Area" ,
"*) Transverse Cylindrical Equal Area" },
2495 {
"tissot" ,
" ",
"Tissot_Conic" ,
"*) Tissot Conic" },
2496 {
"tmerc" ,
" ",
"Transverse_Mercator" ,
"*) Transverse Mercator" },
2497 {
"tmerc" ,
"<",
"Gauss_Kruger" ,
"[ESRI] DHDN" },
2498 {
"tpeqd" ,
" ",
"Two_Point_Equidistant" ,
"*) Two Point Equidistant" },
2499 {
"tpers" ,
" ",
"Tilted_perspective" ,
"*) Tilted perspective" },
2500 {
"ups" ,
" ",
"Universal_Polar_Stereographic" ,
"*) Universal Polar Stereographic" },
2501 {
"urm5" ,
" ",
"Urmaev_V" ,
"*) Urmaev V" },
2502 {
"urmfps" ,
" ",
"Urmaev_Flat_Polar_Sinusoidal" ,
"*) Urmaev Flat-Polar Sinusoidal" },
2503 {
"utm" ,
">",
"Transverse_Mercator" ,
"*) Universal Transverse Mercator (UTM)" },
2504 {
"vandg" ,
"<",
"Van_Der_Grinten_I" ,
"[ESRI] van der Grinten (I)" },
2505 {
"vandg" ,
" ",
"VanDerGrinten" ,
"van der Grinten (I)" },
2506 {
"vandg2" ,
" ",
"VanDerGrinten_II" ,
"*) van der Grinten II" },
2507 {
"vandg3" ,
" ",
"VanDerGrinten_III" ,
"*) van der Grinten III" },
2508 {
"vandg4" ,
" ",
"VanDerGrinten_IV" ,
"*) van der Grinten IV" },
2509 {
"vitk1" ,
" ",
"Vitkovsky_I" ,
"*) Vitkovsky I" },
2510 {
"wag1" ,
" ",
"Wagner_I" ,
"*) Wagner I (Kavraisky VI)" },
2511 {
"wag2" ,
" ",
"Wagner_II" ,
"*) Wagner II" },
2512 {
"wag3" ,
" ",
"Wagner_III" ,
"*) Wagner III" },
2513 {
"wag4" ,
" ",
"Wagner_IV" ,
"*) Wagner IV" },
2514 {
"wag5" ,
" ",
"Wagner_V" ,
"*) Wagner V" },
2515 {
"wag6" ,
" ",
"Wagner_VI" ,
"*) Wagner VI" },
2516 {
"wag7" ,
" ",
"Wagner_VII" ,
"*) Wagner VII" },
2517 {
"webmerc" ,
" ",
"Mercator_1SP" ,
"Web Mercator" },
2518 {
"webmerc" ,
"<",
"Mercator_Auxiliary_Sphere" ,
"[ESRI] Web Mercator" },
2519 {
"weren" ,
" ",
"Werenskiold_I" ,
"*) Werenskiold I" },
2520 {
"wink1" ,
" ",
"Winkel_I" ,
"[ESRI] Winkel I" },
2521 {
"wink2" ,
" ",
"Winkel_II" ,
"[ESRI] Winkel II" },
2522 {
"wintri" ,
" ",
"Winkel_Tripel" ,
"[ESRI] Winkel Tripel" },
2525 {
"alpha" ,
" ",
"azimuth" ,
"? Used with Oblique Mercator and possibly a few others" },
2526 {
"k" ,
">",
"scale_factor" ,
"Scaling factor (old name)" },
2527 {
"K" ,
">",
"scale_factor" ,
"? Scaling factor (old name)" },
2528 {
"k_0" ,
" ",
"scale_factor" ,
"Scaling factor (new name)" },
2529 {
"lat_0" ,
" ",
"latitude_of_origin" ,
"Latitude of origin" },
2530 {
"lat_0" ,
"<",
"latitude_of_center" ,
"Latitude of center" },
2531 {
"lat_0" ,
"<",
"central_parallel" ,
"[ESRI] Latitude of center" },
2532 {
"lat_1" ,
" ",
"standard_parallel_1" ,
"Latitude of first standard parallel" },
2533 {
"lat_2" ,
" ",
"standard_parallel_2" ,
"Latitude of second standard parallel" },
2534 {
"lat_ts" ,
">",
"latitude_of_origin" ,
"Latitude of true scale" },
2535 {
"lon_0" ,
" ",
"central_meridian" ,
"Central meridian" },
2536 {
"lon_0" ,
"<",
"longitude_of_center" ,
"Longitude of center" },
2537 {
"lonc" ,
">",
"longitude_of_center" ,
"? Longitude used with Oblique Mercator and possibly a few others" },
2538 {
"x_0" ,
" ",
"false_easting" ,
"False easting" },
2539 {
"y_0" ,
" ",
"false_northing" ,
"False northing" },
2549 {
"h" ,
" ",
"satellite_height",
"Satellite height (geos - Geostationary Satellite View)" },
2621 Dictionary.
Set_Name(
"Proj.4-WKT Dictionary");
2623 if( Direction == 0 )
2630 for(
int i=0; *Translation[i][0]; i++)
2640 else if( Direction > 0 )
2645 for(
int i=0; *Translation[i][0]; i++)
2647 if( Translation[i][1][0] !=
'<' )
2656 else if( Direction < 0 )
2661 for(
int i=0; *Translation[i][0]; i++)
2663 if( Translation[i][1][0] !=
'>' )
2677 bool CSG_Projections::_Set_Dictionary(
void)
2681 return( _Set_Dictionary(Table, 1) && m_Proj4_to_WKT1.
Create(&Table, 0, 1,
true)
2682 && _Set_Dictionary(Table, -1) && m_WKT1_to_Proj4.
Create(&Table, 0, 1,
true)
2700 return( pTarget ? pTarget->
Create(*pSource) :
true );
2705 pTarget->
Create(*pSource); pSource = pTarget;
2722 bool bResult = pTool->
Execute();
2725 Data.
Delete(pSource,
true);
2738 if( Source == Target )
2757 bool bResult = pTool->
Execute();
2778 if( Source == Target )
2813 bool bResult =
false;