/// <summary> /// Creates a new instance of SouthAmerica /// </summary> public SouthAmerica() { Aratu = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); Bogota = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); BogotaBogota = new ProjectionInfo("+proj=longlat +ellps=intl +pm=-74.08091666666667 +no_defs "); CampoInchauspe = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); ChosMalal1914 = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); Chua = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); CorregoAlegre = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); GuyaneFrancaise = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); HitoXVIII1963 = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); LaCanoa = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); Lake = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); LomaQuintana = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); MountDillon = new ProjectionInfo("+proj=longlat +a=6378293.639 +b=6356617.98149216 +no_defs "); Naparima1955 = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); Naparima1972 = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); PampadelCastillo = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); POSGAR = new ProjectionInfo("+proj=longlat +ellps=GRS80 +no_defs "); POSGAR1998 = new ProjectionInfo("+proj=longlat +ellps=GRS80 +no_defs "); ProvisionalSouthAmer = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); REGVEN = new ProjectionInfo("+proj=longlat +ellps=GRS80 +no_defs "); SapperHill1943 = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); SIRGAS = new ProjectionInfo("+proj=longlat +ellps=GRS80 +no_defs "); SouthAmericanDatum1969 = new ProjectionInfo("+proj=longlat +ellps=aust_SA +no_defs "); Trinidad1903 = new ProjectionInfo("+proj=longlat +a=6378293.639 +b=6356617.98149216 +no_defs "); Yacare = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); Zanderij = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); }
/// <summary> /// Creates a new instance of NationalGridsSweden /// </summary> public NationalGridsSweden() { RT380gon = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=18.05827777777778 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs "); RT3825gonO = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=20.30827777777778 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs "); RT3825gonV = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs "); RT385gonO = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=22.55827777777778 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs "); RT385gonV = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=13.55827777777778 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs "); RT3875gonV = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=11.30827777777778 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs "); RT900gon = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=18.05827777777778 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs "); RT9025gonO = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=20.30827777777778 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs "); RT9025gonV = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs "); RT905gonO = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=22.55827777777778 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs "); RT905gonV = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=13.55827777777778 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs "); RT9075gonV = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=11.30827777777778 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs "); SWEREF991200 = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=12 +k=1.000000 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs "); SWEREF991330 = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=13.5 +k=1.000000 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs "); SWEREF991415 = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=14.25 +k=1.000000 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs "); SWEREF991500 = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=15 +k=1.000000 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs "); SWEREF991545 = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=15.75 +k=1.000000 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs "); SWEREF991630 = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=16.5 +k=1.000000 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs "); SWEREF991715 = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=17.25 +k=1.000000 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs "); SWEREF991800 = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=18 +k=1.000000 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs "); SWEREF991845 = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=18.75 +k=1.000000 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs "); SWEREF992015 = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=20.25 +k=1.000000 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs "); SWEREF992145 = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=21.75 +k=1.000000 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs "); SWEREF992315 = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=23.25 +k=1.000000 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs "); SWEREF99TM = new ProjectionInfo("+proj=utm +zone=33 +ellps=GRS80 +units=m +no_defs "); }
/// <summary> /// Creates a new instance of UtmNad1927 /// </summary> public UtmNad1927() { NAD1927UTMZone10N = new ProjectionInfo("+proj=utm +zone=10 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone11N = new ProjectionInfo("+proj=utm +zone=11 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone12N = new ProjectionInfo("+proj=utm +zone=12 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone13N = new ProjectionInfo("+proj=utm +zone=13 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone14N = new ProjectionInfo("+proj=utm +zone=14 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone15N = new ProjectionInfo("+proj=utm +zone=15 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone16N = new ProjectionInfo("+proj=utm +zone=16 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone17N = new ProjectionInfo("+proj=utm +zone=17 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone18N = new ProjectionInfo("+proj=utm +zone=18 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone19N = new ProjectionInfo("+proj=utm +zone=19 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone1N = new ProjectionInfo("+proj=utm +zone=1 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone20N = new ProjectionInfo("+proj=utm +zone=20 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone21N = new ProjectionInfo("+proj=utm +zone=21 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone22N = new ProjectionInfo("+proj=utm +zone=22 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone2N = new ProjectionInfo("+proj=utm +zone=2 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone3N = new ProjectionInfo("+proj=utm +zone=3 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone4N = new ProjectionInfo("+proj=utm +zone=4 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone59N = new ProjectionInfo("+proj=utm +zone=59 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone5N = new ProjectionInfo("+proj=utm +zone=5 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone60N = new ProjectionInfo("+proj=utm +zone=60 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone6N = new ProjectionInfo("+proj=utm +zone=6 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone7N = new ProjectionInfo("+proj=utm +zone=7 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone8N = new ProjectionInfo("+proj=utm +zone=8 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); NAD1927UTMZone9N = new ProjectionInfo("+proj=utm +zone=9 +ellps=clrk66 +datum=NAD27 +units=m +no_defs "); }
/// <summary> /// Creates a new instance of Asia /// </summary> public Asia() { AsiaLambertConformalConic = ProjectionInfo.FromProj4String("+proj=lcc +lat_1=30 +lat_2=62 +lat_0=0 +lon_0=105 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AsiaNorthAlbersEqualAreaConic = ProjectionInfo.FromProj4String("+proj=aea +lat_1=15 +lat_2=65 +lat_0=30 +lon_0=95 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AsiaNorthEquidistantConic = ProjectionInfo.FromProj4String("+proj=eqdc +lat_0=0 +lon_0=0 +lat_1=15 +lat_2=65 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AsiaNorthLambertConformalConic = ProjectionInfo.FromProj4String("+proj=lcc +lat_1=15 +lat_2=65 +lat_0=30 +lon_0=95 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AsiaSouthAlbersEqualAreaConic = ProjectionInfo.FromProj4String("+proj=aea +lat_1=7 +lat_2=-32 +lat_0=-15 +lon_0=125 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AsiaSouthEquidistantConic = ProjectionInfo.FromProj4String("+proj=eqdc +lat_0=0 +lon_0=0 +lat_1=7 +lat_2=-32 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AsiaSouthLambertConformalConic = ProjectionInfo.FromProj4String("+proj=lcc +lat_1=7 +lat_2=-32 +lat_0=-15 +lon_0=125 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AsiaLambertConformalConic.Name = "Asia_Lambert_Conformal_Conic"; AsiaNorthAlbersEqualAreaConic.Name = "Asia_North_Albers_Equal_Area_Conic"; AsiaNorthEquidistantConic.Name = "Asia_North_Equidistant_Conic"; AsiaNorthLambertConformalConic.Name = "Asia_North_Lambert_Conformal_Conic"; AsiaSouthAlbersEqualAreaConic.Name = "Asia_South_Albers_Equal_Area_Conic"; AsiaSouthEquidistantConic.Name = "Asia_South_Equidistant_Conic"; AsiaSouthLambertConformalConic.Name = "Asia_South_Lambert_Conformal_Conic"; AsiaLambertConformalConic.GeographicInfo.Name = "GCS_WGS_1984"; AsiaNorthAlbersEqualAreaConic.GeographicInfo.Name = "GCS_WGS_1984"; AsiaNorthEquidistantConic.GeographicInfo.Name = "GCS_WGS_1984"; AsiaNorthLambertConformalConic.GeographicInfo.Name = "GCS_WGS_1984"; AsiaSouthAlbersEqualAreaConic.GeographicInfo.Name = "GCS_WGS_1984"; AsiaSouthEquidistantConic.GeographicInfo.Name = "GCS_WGS_1984"; AsiaSouthLambertConformalConic.GeographicInfo.Name = "GCS_WGS_1984"; AsiaLambertConformalConic.GeographicInfo.Datum.Name = "D_WGS_1984"; AsiaNorthAlbersEqualAreaConic.GeographicInfo.Datum.Name = "D_WGS_1984"; AsiaNorthEquidistantConic.GeographicInfo.Datum.Name = "D_WGS_1984"; AsiaNorthLambertConformalConic.GeographicInfo.Datum.Name = "D_WGS_1984"; AsiaSouthAlbersEqualAreaConic.GeographicInfo.Datum.Name = "D_WGS_1984"; AsiaSouthEquidistantConic.GeographicInfo.Datum.Name = "D_WGS_1984"; AsiaSouthLambertConformalConic.GeographicInfo.Datum.Name = "D_WGS_1984"; }
/// <summary> /// Creates a new instance of WorldSpheroid /// </summary> public WorldSpheroid() { Aitoffsphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); Behrmannsphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); Bonnesphere = new ProjectionInfo("+proj=bonne +lon_0=0 +lat_1=60 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs "); CrasterParabolicsphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); CylindricalEqualAreasphere = new ProjectionInfo("+proj=cea +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs "); EckertIIIsphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); EckertIIsphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); EckertIsphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); EckertIVsphere = new ProjectionInfo("+proj=eck4 +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs "); EckertVIsphere = new ProjectionInfo("+proj=eck6 +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs "); EckertVsphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); EquidistantConicsphere = new ProjectionInfo("+proj=eqdc +lat_0=0 +lon_0=0 +lat_1=60 +lat_2=60 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs "); EquidistantCylindricalsphere = new ProjectionInfo("+proj=eqc +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs "); FlatPolarQuarticsphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); GallStereographicsphere = new ProjectionInfo("+proj=gall +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs "); HammerAitoffsphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); Loximuthalsphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); Mercatorsphere = new ProjectionInfo("+proj=merc +lat_ts=0 +lon_0=0 +k=1.000000 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs "); MillerCylindricalsphere = new ProjectionInfo("+proj=mill +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +R_A +a=6371000 +b=6371000 +units=m +no_defs "); Mollweidesphere = new ProjectionInfo("+proj=moll +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs "); PlateCarreesphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); Polyconicsphere = new ProjectionInfo("+proj=poly +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs "); QuarticAuthalicsphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); Robinsonsphere = new ProjectionInfo("+proj=robin +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs "); Sinusoidalsphere = new ProjectionInfo("+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs "); Timessphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); VanderGrintenIsphere = new ProjectionInfo("+proj=vandg +lon_0=0 +x_0=0 +y_0=0 +R_A +a=6371000 +b=6371000 +units=m +no_defs "); VerticalPerspectivesphere = new ProjectionInfo("+ellps=WGS84 +datum=WGS84 +units=m +no_defs "); WinkelIIsphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); WinkelIsphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); WinkelTripelNGSsphere = new ProjectionInfo("+a=6371000 +b=6371000 +units=m +no_defs "); }
/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { double pp; /* get control point locations */ double phi1 = projInfo.Phi1; double lam1 = projInfo.Lam1; double phi2 = projInfo.Phi2; double lam2 = projInfo.Lam2; if (phi1 == phi2 && lam1 == lam2) throw new ProjectionException(-25); Lam0 = Proj.Adjlon(0.5 * (lam1 + lam2)); _dlam2 = Proj.Adjlon(lam2 - lam1); _cp1 = Math.Cos(phi1); _cp2 = Math.Cos(phi2); _sp1 = Math.Sin(phi1); _sp2 = Math.Sin(phi2); _cs = _cp1 * _sp2; _sc = _sp1 * _cp2; _ccs = _cp1 * _cp2 * Math.Sin(_dlam2); _z02 = Proj.Aacos(_sp1 * _sp2 + _cp1 * _cp2 * Math.Cos(_dlam2)); _hz0 = .5 * _z02; double a12 = Math.Atan2(_cp2 * Math.Sin(_dlam2), _cp1 * _sp2 - _sp1 * _cp2 * Math.Cos(_dlam2)); _ca = Math.Cos(pp = Proj.Aasin(_cp1 * Math.Sin(a12))); _sa = Math.Sin(pp); _lp = Proj.Adjlon(Math.Atan2(_cp1 * Math.Cos(a12), _sp1) - _hz0); _dlam2 *= .5; _lamc = HALF_PI - Math.Atan2(Math.Sin(a12) * _sp1, Math.Cos(a12)) - _dlam2; _thz0 = Math.Tan(_hz0); _rhshz0 = .5 / Math.Sin(_hz0); _r2Z0 = 0.5 / _z02; _z02 *= _z02; }
/// <summary> /// Creates a new instance of Antarctica /// </summary> public Antarctica() { AustralianAntarctic1998 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); CampAreaAstro = ProjectionInfo.FromProj4String("+proj=longlat +ellps=intl +no_defs "); DeceptionIsland = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk80 +no_defs "); Petrels1972 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=intl +no_defs "); PointeGeologiePerroud1950 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=intl +no_defs "); AustralianAntarctic1998.IsLatLon = true; CampAreaAstro.IsLatLon = true; DeceptionIsland.IsLatLon = true; Petrels1972.IsLatLon = true; PointeGeologiePerroud1950.IsLatLon = true; AustralianAntarctic1998.GeographicInfo.Name = "GCS_Australian_Antarctic_1998"; CampAreaAstro.GeographicInfo.Name = "GCS_Camp_Area"; DeceptionIsland.GeographicInfo.Name = "GCS_Deception_Island"; Petrels1972.GeographicInfo.Name = "GCS_Petrels_1972"; PointeGeologiePerroud1950.GeographicInfo.Name = "GCS_Pointe_Geologie_Perroud_1950"; AustralianAntarctic1998.GeographicInfo.Datum.Name = "D_Australian_Antarctic_1998"; CampAreaAstro.GeographicInfo.Datum.Name = "D_Camp_Area"; DeceptionIsland.GeographicInfo.Datum.Name = "D_Deception_Island"; Petrels1972.GeographicInfo.Datum.Name = "D_Petrels_1972"; PointeGeologiePerroud1950.GeographicInfo.Datum.Name = "D_Pointe_Geologie_Perroud_1950"; }
/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { Y0 = projInfo.IsSouth ? 10000000 : 0; projInfo.FalseNorthing = Y0; X0 = 500000; projInfo.FalseEasting = X0; int zone; if (projInfo.Zone != null) { zone = projInfo.Zone.Value; if (zone <= 0 || zone > 60) throw new ProjectionException(35); zone--; } else { zone = (int)Math.Floor((Proj.Adjlon(Lam0) + Math.PI) * 30 / Math.PI); if (zone < 0) zone = 0; if (zone >= 60) zone = 59; } Lam0 = (zone + .5) * Math.PI / 30.00 - Math.PI; projInfo.Lam0 = Lam0; K0 = 0.9996; Phi0 = 0; base.OnInit(projInfo); }
/// <summary> /// Creates a new instance of NorthAmerica /// </summary> public NorthAmerica() { AlaskanIslands = new ProjectionInfo("+proj=longlat +ellps=clrk66 +no_defs "); AmericanSamoa1962 = new ProjectionInfo("+proj=longlat +ellps=clrk66 +no_defs "); Ammassalik1958 = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); ATS1977 = new ProjectionInfo("+proj=longlat +a=6378135 +b=6356750.304921594 +no_defs "); Barbados = new ProjectionInfo("+proj=longlat +ellps=clrk80 +no_defs "); Bermuda1957 = new ProjectionInfo("+proj=longlat +ellps=clrk66 +no_defs "); Bermuda2000 = new ProjectionInfo("+proj=longlat +ellps=WGS84 +no_defs "); CapeCanaveral = new ProjectionInfo("+proj=longlat +ellps=clrk66 +no_defs "); Guam1963 = new ProjectionInfo("+proj=longlat +ellps=clrk66 +no_defs "); Helle1954 = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); Jamaica1875 = new ProjectionInfo("+proj=longlat +a=6378249.138 +b=6356514.959419348 +no_defs "); Jamaica1969 = new ProjectionInfo("+proj=longlat +ellps=clrk66 +no_defs "); NAD1927CGQ77 = new ProjectionInfo("+proj=longlat +ellps=clrk66 +no_defs "); NAD1927Definition1976 = new ProjectionInfo("+proj=longlat +ellps=clrk66 +no_defs "); NADMichigan = new ProjectionInfo("+proj=longlat +a=6378450.047 +b=6356826.620025999 +no_defs "); NorthAmerican1983CSRS98 = new ProjectionInfo("+proj=longlat +ellps=GRS80 +no_defs "); NorthAmerican1983HARN = new ProjectionInfo("+proj=longlat +ellps=GRS80 +no_defs "); NorthAmericanDatum1927 = new ProjectionInfo("+proj=longlat +ellps=clrk66 +datum=NAD27 +no_defs "); NorthAmericanDatum1983 = new ProjectionInfo("+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs "); OldHawaiian = new ProjectionInfo("+proj=longlat +ellps=clrk66 +no_defs "); PuertoRico = new ProjectionInfo("+proj=longlat +ellps=clrk66 +no_defs "); Qornoq = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); Qornoq1927 = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); Scoresbysund1952 = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); StGeorgeIsland = new ProjectionInfo("+proj=longlat +ellps=clrk66 +no_defs "); StLawrenceIsland = new ProjectionInfo("+proj=longlat +ellps=clrk66 +no_defs "); StPaulIsland = new ProjectionInfo("+proj=longlat +ellps=clrk66 +no_defs "); }
/// <summary> /// Creates a new instance of SouthAmerica /// </summary> public SouthAmerica() { SouthAmericaAlbersEqualAreaConic = new ProjectionInfo("+proj=aea +lat_1=-5 +lat_2=-42 +lat_0=-32 +lon_0=-60 +x_0=0 +y_0=0 +ellps=aust_SA +units=m +no_defs "); SouthAmericaEquidistantConic = new ProjectionInfo("+proj=eqdc +lat_0=0 +lon_0=0 +lat_1=-5 +lat_2=-42 +x_0=0 +y_0=0 +ellps=aust_SA +units=m +no_defs "); SouthAmericaLambertConformalConic = new ProjectionInfo("+proj=lcc +lat_1=-5 +lat_2=-42 +lat_0=-32 +lon_0=-60 +x_0=0 +y_0=0 +ellps=aust_SA +units=m +no_defs "); }
/// <summary> /// Creates a new instance of Europe /// </summary> public Europe() { EMEP150KilometerGrid = new ProjectionInfo(); EMEP150KilometerGrid.ParseEsriString("PROJCS[\"EMEP_150_Kilometer_Grid\", GEOGCS[\"GCS_Sphere_EMEP\", DATUM[\"D_Sphere_EMEP\", SPHEROID[\"Sphere_EMEP\", 6370000.0, 0.0]], PRIMEM[\"Greenwich\", 0.0], UNIT[\"Degree\", 0.0174532925199433]], PROJECTION[\"Stereographic_North_Pole\"], PARAMETER[\"False_Easting\", 3.0], PARAMETER[\"False_Northing\", 37.0], PARAMETER[\"Central_Meridian\", -32.0], PARAMETER[\"Standard_Parallel_1\", 60.0], UNIT[\"150_Kilometers\", 150000.0]]"); EMEP50KilometerGrid = new ProjectionInfo(); EMEP50KilometerGrid.ParseEsriString("PROJCS[\"EMEP_50_Kilometer_Grid\", GEOGCS[\"GCS_Sphere_EMEP\", DATUM[\"D_Sphere_EMEP\", SPHEROID[\"Sphere_EMEP\", 6370000.0, 0.0]], PRIMEM[\"Greenwich\", 0.0], UNIT[\"Degree\", 0.0174532925199433]], PROJECTION[\"Stereographic_North_Pole\"], PARAMETER[\"False_Easting\", 8.0], PARAMETER[\"False_Northing\", 110.0], PARAMETER[\"Central_Meridian\", -32.0], PARAMETER[\"Standard_Parallel_1\", 60.0], UNIT[\"50_Kilometers\", 50000.0]]"); ETRS1989LAEA = ProjectionInfo.FromProj4String("+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs "); ETRS1989LCC = ProjectionInfo.FromProj4String("+proj=lcc +lat_1=35 +lat_2=65 +lat_0=52 +lon_0=10 +x_0=4000000 +y_0=2800000 +ellps=GRS80 +units=m +no_defs "); EuropeAlbersEqualAreaConic = ProjectionInfo.FromProj4String("+proj=aea +lat_1=43 +lat_2=62 +lat_0=30 +lon_0=10 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs "); EuropeEquidistantConic = ProjectionInfo.FromProj4String("+proj=eqdc +lat_0=0 +lon_0=0 +lat_1=43 +lat_2=62 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs "); EuropeLambertConformalConic = ProjectionInfo.FromProj4String("+proj=lcc +lat_1=43 +lat_2=62 +lat_0=30 +lon_0=10 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs "); EMEP50KilometerGrid.Name = "EMEP_50_Kilometer_Grid"; ETRS1989LAEA.Name = "ETRS_1989_LAEA"; ETRS1989LCC.Name = "ETRS_1989_LCC"; EuropeAlbersEqualAreaConic.Name = "Europe_Albers_Equal_Area_Conic"; EuropeEquidistantConic.Name = "Europe_Equidistant_Conic"; EuropeLambertConformalConic.Name = "Europe_Lambert_Conformal_Conic"; EMEP150KilometerGrid.GeographicInfo.Name = "GCS_Sphere_EMEP"; EMEP50KilometerGrid.GeographicInfo.Name = "GCS_Sphere_EMEP"; ETRS1989LAEA.GeographicInfo.Name = "GCS_ETRS_1989"; ETRS1989LCC.GeographicInfo.Name = "GCS_ETRS_1989"; EuropeAlbersEqualAreaConic.GeographicInfo.Name = "GCS_European_1950"; EuropeEquidistantConic.GeographicInfo.Name = "GCS_European_1950"; EuropeLambertConformalConic.GeographicInfo.Name = "GCS_European_1950"; EMEP150KilometerGrid.GeographicInfo.Datum.Name = "D_Sphere_EMEP"; EMEP50KilometerGrid.GeographicInfo.Datum.Name = "D_Sphere_EMEP"; ETRS1989LAEA.GeographicInfo.Datum.Name = "D_ETRS_1989"; ETRS1989LCC.GeographicInfo.Datum.Name = "D_ETRS_1989"; EuropeAlbersEqualAreaConic.GeographicInfo.Datum.Name = "D_European_1950"; EuropeEquidistantConic.GeographicInfo.Datum.Name = "D_European_1950"; EuropeLambertConformalConic.GeographicInfo.Datum.Name = "D_European_1950"; }
/// <summary> /// Creates a new instance of Australia /// </summary> public Australia() { AustralianGeodeticDatum1966 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=aust_SA +no_defs "); AustralianGeodeticDatum1984 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=aust_SA +no_defs "); ChathamIslands1979 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=intl +no_defs "); GeocentricDatumofAustralia1994 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); NewZealandGeodeticDatum1949 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=intl +no_defs "); NZGD2000 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); AustralianGeodeticDatum1966.IsLatLon = true; AustralianGeodeticDatum1984.IsLatLon = true; ChathamIslands1979.IsLatLon = true; GeocentricDatumofAustralia1994.IsLatLon = true; NewZealandGeodeticDatum1949.IsLatLon = true; NZGD2000.IsLatLon = true; AustralianGeodeticDatum1966.GeographicInfo.Name = "GCS_Australian_1966"; AustralianGeodeticDatum1984.GeographicInfo.Name = "GCS_Australian_1984"; ChathamIslands1979.GeographicInfo.Name = "GCS_Chatham_Islands_1979"; GeocentricDatumofAustralia1994.GeographicInfo.Name = "GCS_GDA_1994"; NewZealandGeodeticDatum1949.GeographicInfo.Name = "GCS_New_Zealand_1949"; NZGD2000.GeographicInfo.Name = "GCS_NZGD_2000"; AustralianGeodeticDatum1966.GeographicInfo.Datum.Name = "D_Australian_1966"; AustralianGeodeticDatum1984.GeographicInfo.Datum.Name = "D_Australian_1984"; ChathamIslands1979.GeographicInfo.Datum.Name = "D_Chatham_Islands_1979"; GeocentricDatumofAustralia1994.GeographicInfo.Datum.Name = "D_GDA_1994"; NewZealandGeodeticDatum1949.GeographicInfo.Datum.Name = "D_New_Zealand_1949"; NZGD2000.GeographicInfo.Datum.Name = "D_NZGD_2000"; }
/// <summary> /// Creates a new instance of IndianSubcontinent /// </summary> public NationalGridsIndia() { Kalianpur1880IndiaZone0 = new ProjectionInfo("+proj=lcc +lat_1=39.5 +lat_0=39.5 +lon_0=68 +k_0=0.99846154 +x_0=2153865.73916853 +y_0=2368292.194628102 +a=6377299.36 +b=6356098.35162804 +to_meter=0.9143985307444408 +no_defs "); Kalianpur1880IndiaZoneI = new ProjectionInfo("+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36 +b=6356098.35162804 +to_meter=0.9143985307444408 +no_defs "); Kalianpur1880IndiaZoneIIa = new ProjectionInfo("+proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36 +b=6356098.35162804 +to_meter=0.9143985307444408 +no_defs "); Kalianpur1880IndiaZoneIIb = new ProjectionInfo("+proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36 +b=6356098.35162804 +to_meter=0.9143985307444408 +no_defs "); Kalianpur1880IndiaZoneIII = new ProjectionInfo("+proj=lcc +lat_1=19 +lat_0=19 +lon_0=80 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36 +b=6356098.35162804 +to_meter=0.9143985307444408 +no_defs "); Kalianpur1880IndiaZoneIV = new ProjectionInfo("+proj=lcc +lat_1=12 +lat_0=12 +lon_0=80 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36 +b=6356098.35162804 +to_meter=0.9143985307444408 +no_defs "); Kalianpur1937IndiaZoneIIb = new ProjectionInfo("+proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377276.345 +b=6356075.41314024 +units=m +no_defs "); Kalianpur1937UTMZone45N = new ProjectionInfo("+proj=utm +zone=45 +a=6377276.345 +b=6356075.41314024 +units=m +no_defs "); Kalianpur1937UTMZone46N = new ProjectionInfo("+proj=utm +zone=46 +a=6377276.345 +b=6356075.41314024 +units=m +no_defs "); Kalianpur1962IndiaZoneI = new ProjectionInfo("+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878641 +x_0=2743196.4 +y_0=914398.8000000001 +a=6377301.243 +b=6356100.230165384 +units=m +no_defs "); Kalianpur1962IndiaZoneIIa = new ProjectionInfo("+proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 +x_0=2743196.4 +y_0=914398.8000000001 +a=6377301.243 +b=6356100.230165384 +units=m +no_defs "); Kalianpur1962UTMZone41N = new ProjectionInfo("+proj=utm +zone=41 +a=6377301.243 +b=6356100.230165384 +units=m +no_defs "); Kalianpur1962UTMZone42N = new ProjectionInfo("+proj=utm +zone=42 +a=6377301.243 +b=6356100.230165384 +units=m +no_defs "); Kalianpur1962UTMZone43N = new ProjectionInfo("+proj=utm +zone=43 +a=6377301.243 +b=6356100.230165384 +units=m +no_defs "); Kalianpur1975IndiaZoneI = new ProjectionInfo("+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878641 +x_0=2743185.69 +y_0=914395.23 +a=6377299.151 +b=6356098.145120132 +units=m +no_defs "); Kalianpur1975IndiaZoneIIa = new ProjectionInfo("+proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 +x_0=2743185.69 +y_0=914395.23 +a=6377299.151 +b=6356098.145120132 +units=m +no_defs "); Kalianpur1975IndiaZoneIIb = new ProjectionInfo("+proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 +x_0=2743185.69 +y_0=914395.23 +a=6377299.151 +b=6356098.145120132 +units=m +no_defs "); Kalianpur1975IndiaZoneIII = new ProjectionInfo("+proj=lcc +lat_1=19 +lat_0=19 +lon_0=80 +k_0=0.99878641 +x_0=2743185.69 +y_0=914395.23 +a=6377299.151 +b=6356098.145120132 +units=m +no_defs "); Kalianpur1975IndiaZoneIV = new ProjectionInfo("+proj=lcc +lat_1=12 +lat_0=12 +lon_0=80 +k_0=0.99878641 +x_0=2743185.69 +y_0=914395.23 +a=6377299.151 +b=6356098.145120132 +units=m +no_defs "); Kalianpur1975UTMZone42N = new ProjectionInfo("+proj=utm +zone=42 +a=6377299.151 +b=6356098.145120132 +units=m +no_defs "); Kalianpur1975UTMZone43N = new ProjectionInfo("+proj=utm +zone=43 +a=6377299.151 +b=6356098.145120132 +units=m +no_defs "); Kalianpur1975UTMZone44N = new ProjectionInfo("+proj=utm +zone=44 +a=6377299.151 +b=6356098.145120132 +units=m +no_defs "); Kalianpur1975UTMZone45N = new ProjectionInfo("+proj=utm +zone=45 +a=6377299.151 +b=6356098.145120132 +units=m +no_defs "); Kalianpur1975UTMZone46N = new ProjectionInfo("+proj=utm +zone=46 +a=6377299.151 +b=6356098.145120132 +units=m +no_defs "); Kalianpur1975UTMZone47N = new ProjectionInfo("+proj=utm +zone=47 +a=6377299.151 +b=6356098.145120132 +units=m +no_defs "); }
/// <inheritdoc /> protected override void OnInit(ProjectionInfo projInfo) { double phi = 0; if (projInfo.StandardParallel1 != null) phi = projInfo.StandardParallel1.Value * Math.PI / 180; _rc = Math.Cos(phi); if (_rc <= 0) throw new ProjectionException(24); }
/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { Ra = 1 / (A = 6378388.0); Lam0 = DEG_TO_RAD * 173; Phi0 = DEG_TO_RAD * -41; X0 = 2510000; Y0 = 6023150; }
public void ProjectionInfoConstructorTest2() { string proj4String = null; var actual = ProjectionInfo.FromProj4String(proj4String); var expected = new ProjectionInfo(); Assert.AreEqual(expected.ToProj4String(), actual.ToProj4String()); }
/// <summary> /// Creates a new instance of NorthAmerica /// </summary> public NorthAmerica() { AlaskanIslands = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk66 +no_defs "); AmericanSamoa1962 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk66 +no_defs "); Ammassalik1958 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=intl +no_defs "); ATS1977 = ProjectionInfo.FromProj4String("+proj=longlat +a=6378135 +b=6356750.304921594 +no_defs "); Barbados = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk80 +no_defs "); Bermuda1957 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk66 +no_defs "); Bermuda2000 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=WGS84 +no_defs "); CapeCanaveral = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk66 +no_defs "); Guam1963 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk66 +no_defs "); Helle1954 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=intl +no_defs "); Jamaica1875 = ProjectionInfo.FromProj4String("+proj=longlat +a=6378249.138 +b=6356514.959419348 +no_defs "); Jamaica1969 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk66 +no_defs "); NAD1927CGQ77 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk66 +no_defs "); NAD1927Definition1976 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk66 +no_defs "); NADMichigan = ProjectionInfo.FromProj4String("+proj=longlat +a=6378450.047 +b=6356826.620025999 +no_defs "); NorthAmerican1983CSRS98 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); NorthAmerican1983HARN = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); NorthAmericanDatum1927 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk66 +datum=NAD27 +no_defs "); NorthAmericanDatum1983 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs "); OldHawaiian = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk66 +no_defs "); PuertoRico = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk66 +no_defs "); Qornoq = ProjectionInfo.FromProj4String("+proj=longlat +ellps=intl +no_defs "); Qornoq1927 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=intl +no_defs "); Scoresbysund1952 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=intl +no_defs "); StGeorgeIsland = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk66 +no_defs "); StLawrenceIsland = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk66 +no_defs "); StPaulIsland = ProjectionInfo.FromProj4String("+proj=longlat +ellps=clrk66 +no_defs "); AlaskanIslands.GeographicInfo.Name = "GCS_Alaskan_Islands"; AmericanSamoa1962.GeographicInfo.Name = "GCS_American_Samoa_1962"; Ammassalik1958.GeographicInfo.Name = "GCS_Ammassalik_1958"; ATS1977.GeographicInfo.Name = "GCS_ATS_1977"; Barbados.GeographicInfo.Name = "GCS_Barbados"; Bermuda1957.GeographicInfo.Name = "GCS_Bermuda_1957"; Bermuda2000.GeographicInfo.Name = "GCS_Bermuda_2000"; CapeCanaveral.GeographicInfo.Name = "GCS_Cape_Canaveral"; Helle1954.GeographicInfo.Name = "GCS_Helle_1954"; Guam1963.GeographicInfo.Name = "GCS_Guam_1963"; Jamaica1875.GeographicInfo.Name = "GCS_Jamaica_1875"; Jamaica1969.GeographicInfo.Name = "GCS_Jamaica_1969"; NAD1927CGQ77.GeographicInfo.Name = "GCS_NAD_1927_CGQ77"; NAD1927Definition1976.GeographicInfo.Name = "GCS_NAD_1927_Definition_1976"; NADMichigan.GeographicInfo.Name = "GCS_North_American_Michigan"; NorthAmerican1983CSRS98.GeographicInfo.Name = "GCS_North_American_1983_CSRS98"; NorthAmerican1983HARN.GeographicInfo.Name = "GCS_North_American_1983_HARN"; NorthAmericanDatum1927.GeographicInfo.Name = "GCS_North_American_1927"; NorthAmericanDatum1983.GeographicInfo.Name = "GCS_North_American_1983"; OldHawaiian.GeographicInfo.Name = "GCS_Old_Hawaiian"; PuertoRico.GeographicInfo.Name = "GCS_Puerto_Rico"; Qornoq.GeographicInfo.Name = String.Empty; Qornoq1927.GeographicInfo.Name = "GCS_Qornoq_1927"; Scoresbysund1952.GeographicInfo.Name = "GCS_Scoresbysund_1952"; StGeorgeIsland.GeographicInfo.Name = "GCS_St_George_Island"; StLawrenceIsland.GeographicInfo.Name = "GCS_St_Lawrence_Island"; StPaulIsland.GeographicInfo.Name = "GCS_St_Paul_Island"; }
/// <summary> /// Creates a new instance of Africa /// </summary> public Africa() { AfricaAlbersEqualAreaConic = new ProjectionInfo("+proj=aea +lat_1=20 +lat_2=-23 +lat_0=0 +lon_0=25 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AfricaEquidistantConic = new ProjectionInfo("+proj=eqdc +lat_0=0 +lon_0=0 +lat_1=20 +lat_2=-23 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AfricaLambertConformalConic = new ProjectionInfo("+proj=lcc +lat_1=20 +lat_2=-23 +lat_0=0 +lon_0=25 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AfricaSinusoidal = new ProjectionInfo("+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); }
/// <summary> /// Creates a new instance of SpheroidBased /// </summary> public SpheroidBased() { Lambert2 = new ProjectionInfo(); Lambert2.ReadProj4String("+proj=lcc +lat_1=45.89893890000052 +lat_2=47.69601440000037 +lat_0=46.8 +lon_0=2.33722917 +x_0=600000 +y_0=200000 +ellps=clrk80 +units=m +no_defs"); Lambert2Wide = new ProjectionInfo(); Lambert2Wide.ReadProj4String("+proj = lcc + lat_1 = 45.89891889999931 + lat_2 = 47.69601440000037 + lat_0 = 46.8 + lon_0 = 2.33722917 + x_0 = 600000 + y_0 = 2200000 + a = 6378249.145 + b = 6356514.96582849 + units = m + no_defs"); }
/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { Phi0 = projInfo.IsSouth ? -HALF_PI : HALF_PI; if (Es == 0) throw new ProjectionException(34); K0 = .994; X0 = 2000000; Y0 = 2000000; Lam0 = 0; base.OnInit(projInfo); }
/// <summary> /// Creates a new instance of Antarctica /// </summary> public Antarctica() { AustralianAntarctic1998 = new ProjectionInfo("+proj=longlat +ellps=GRS80 +no_defs "); CampAreaAstro = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); DeceptionIsland = new ProjectionInfo("+proj=longlat +ellps=clrk80 +no_defs "); Petrels1972 = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); PointeGeologiePerroud1950 = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); }
/// <summary> /// Creates a new instance of Australia /// </summary> public Australia() { AustralianGeodeticDatum1966 = new ProjectionInfo("+proj=longlat +ellps=aust_SA +no_defs "); AustralianGeodeticDatum1984 = new ProjectionInfo("+proj=longlat +ellps=aust_SA +no_defs "); ChathamIslands1979 = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); GeocentricDatumofAustralia1994 = new ProjectionInfo("+proj=longlat +ellps=GRS80 +no_defs "); NewZealandGeodeticDatum1949 = new ProjectionInfo("+proj=longlat +ellps=intl +no_defs "); NZGD2000 = new ProjectionInfo("+proj=longlat +ellps=GRS80 +no_defs "); }
public void Test_Contains_NameProperty_NameBased() { ProjectionInfo info = new ProjectionInfo(); info.Name = "TestProjection"; info.Format = ProjectionFormat.Html; ProjectionStateCollection collection = new ProjectionStateCollection(); collection.Add(info); Assert.IsTrue(collection.Contains(info.Name), "Returned false when it have been true."); }
/// <summary> /// Creates a new instance of Asia /// </summary> public Asia() { AsiaLambertConformalConic = new ProjectionInfo("+proj=lcc +lat_1=30 +lat_2=62 +lat_0=0 +lon_0=105 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AsiaNorthAlbersEqualAreaConic = new ProjectionInfo("+proj=aea +lat_1=15 +lat_2=65 +lat_0=30 +lon_0=95 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AsiaNorthEquidistantConic = new ProjectionInfo("+proj=eqdc +lat_0=0 +lon_0=0 +lat_1=15 +lat_2=65 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AsiaNorthLambertConformalConic = new ProjectionInfo("+proj=lcc +lat_1=15 +lat_2=65 +lat_0=30 +lon_0=95 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AsiaSouthAlbersEqualAreaConic = new ProjectionInfo("+proj=aea +lat_1=7 +lat_2=-32 +lat_0=-15 +lon_0=125 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AsiaSouthEquidistantConic = new ProjectionInfo("+proj=eqdc +lat_0=0 +lon_0=0 +lat_1=7 +lat_2=-32 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); AsiaSouthLambertConformalConic = new ProjectionInfo("+proj=lcc +lat_1=7 +lat_2=-32 +lat_0=-15 +lon_0=125 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs "); }
public void Test_thisProperty_NameParameter() { ProjectionInfo info = new ProjectionInfo(); info.Name = "TestProjection"; info.Format = ProjectionFormat.Html; ProjectionStateCollection collection = new ProjectionStateCollection(); collection[info.Name, info.Format] = info; Assert.IsTrue(collection.Contains(info.Name), "Returned false when it have been true."); }
/// <summary> /// Creates a new instance of Europe /// </summary> public Europe() { EMEP150KilometerGrid = new ProjectionInfo("+a=6370000 +b=6370000 +to_meter=150000 +no_defs "); EMEP50KilometerGrid = new ProjectionInfo("+a=6370000 +b=6370000 +to_meter=50000 +no_defs "); ETRS1989LAEA = new ProjectionInfo("+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs "); ETRS1989LCC = new ProjectionInfo("+proj=lcc +lat_1=35 +lat_2=65 +lat_0=52 +lon_0=10 +x_0=4000000 +y_0=2800000 +ellps=GRS80 +units=m +no_defs "); EuropeAlbersEqualAreaConic = new ProjectionInfo("+proj=aea +lat_1=43 +lat_2=62 +lat_0=30 +lon_0=10 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs "); EuropeEquidistantConic = new ProjectionInfo("+proj=eqdc +lat_0=0 +lon_0=0 +lat_1=43 +lat_2=62 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs "); EuropeLambertConformalConic = new ProjectionInfo("+proj=lcc +lat_1=43 +lat_2=62 +lat_0=30 +lon_0=10 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs "); }
/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { if (IsElliptical) { _en = Proj.Enfn(Es); _ml0 = Proj.Mlfn(Phi0, Math.Sin(Phi0), Math.Cos(Phi0), _en); } else { _ml0 = -Phi0; } }
/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { if (projInfo.Parameters.ContainsKey("n") && projInfo.Parameters.ContainsKey("m")) { N = projInfo.ParamD("n"); M = projInfo.ParamD("m"); } else { throw new ProjectionException(99); } }
/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { if (projInfo.n.HasValue && projInfo.mGeneral.HasValue) { N = projInfo.n.Value; M = projInfo.mGeneral.Value; } else { throw new ProjectionException(99); } }
/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { if (projInfo.StandardParallel1 != null) { _cosphi1 = Math.Cos(projInfo.Phi1); if (_cosphi1 == 0) throw new ProjectionException(22); } else { /* 50d28' or acos(2/pi) */ _cosphi1 = 0.636619772367581343; } }
public void NAD1927StatePlaneConnecticutFIPS0600() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneConnecticutFIPS0600; Tester.TestProjection(pStart); }
private void BUT_shptopoly_Click(object sender, EventArgs e) { using (var fd = new OpenFileDialog()) { fd.Filter = "Shape file|*.shp"; var result = fd.ShowDialog(); var file = fd.FileName; var pStart = new ProjectionInfo(); var pESRIEnd = KnownCoordinateSystems.Geographic.World.WGS1984; var reproject = false; if (File.Exists(file)) { var prjfile = Path.GetDirectoryName(file) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(file) + ".prj"; if (File.Exists(prjfile)) { using ( var re = File.OpenText(Path.GetDirectoryName(file) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(file) + ".prj")) { pStart.ParseEsriString(re.ReadLine()); reproject = true; } } var fs = FeatureSet.Open(file); fs.FillAttributes(); var rows = fs.NumRows(); var dtOriginal = fs.DataTable; for (var row = 0; row < dtOriginal.Rows.Count; row++) { var original = dtOriginal.Rows[row].ItemArray; } foreach (DataColumn col in dtOriginal.Columns) { Console.WriteLine(col.ColumnName + " " + col.DataType); } var a = 1; var path = Path.GetDirectoryName(file); foreach (var feature in fs.Features) { var sb = new StringBuilder(); sb.Append("#Shap to Poly - Mission Planner\r\n"); foreach (var point in feature.Coordinates) { if (reproject) { double[] xyarray = { point.X, point.Y }; double[] zarray = { point.Z }; Reproject.ReprojectPoints(xyarray, zarray, pStart, pESRIEnd, 0, 1); point.X = xyarray[0]; point.Y = xyarray[1]; point.Z = zarray[0]; } sb.Append(point.Y.ToString(CultureInfo.InvariantCulture) + "\t" + point.X.ToString(CultureInfo.InvariantCulture) + "\r\n"); } log.Info("writting poly to " + path + Path.DirectorySeparatorChar + "poly-" + a + ".poly"); File.WriteAllText(path + Path.DirectorySeparatorChar + "poly-" + a + ".poly", sb.ToString()); a++; } } } }
/// <summary> /// given a data table, create an in-memory point feature set. /// The feature set must have the 'Latitude' and 'Longitude' numeric /// columns /// </summary> /// <param name="themeTable">The table of distinct series</param> /// <param name="projection">The projection of the theme feature set</param> /// <returns>A point FeatureSet in the WGS-84 coordinate system /// All columns of the data table will be converted to atrribute fields</returns> private IFeatureSet TableToFeatureSet(DataTable themeTable, ProjectionInfo projection = null) { //index of the Latitude column int latColIndex = -1; //index of the Longitude column int lonColIndex = -1; //get the latitude and longitude column indices for (int col = 0; col < themeTable.Columns.Count; col++) { string colName = themeTable.Columns[col].ColumnName.ToLower(); if (colName == "latitude") { latColIndex = col; } if (colName == "longitude") { lonColIndex = col; } } //check if the latitude column exists if (latColIndex == -1) { throw new ArgumentException("The table doesn't have a column 'Latitude'"); } //check if the longitude column exists if (lonColIndex == -1) { throw new ArgumentException("The table doesn't have a column 'Longitude'"); } //generate attribute table schema var fs = new FeatureSet(FeatureType.Point); var attributeTable = fs.DataTable; foreach (DataColumn column in themeTable.Columns) { attributeTable.Columns.Add(column.DataType == typeof(DateTime) ? new Field(column.ColumnName, 'C', 16, 0) : new DataColumn(column.ColumnName, column.DataType)); } //generate features foreach (DataRow row in themeTable.Rows) { double lat = Convert.ToDouble(row[latColIndex]); double lon = Convert.ToDouble(row[lonColIndex]); var coord = new Coordinate(lon, lat); var newFeature = new Feature(FeatureType.Point, new[] { coord }); fs.Features.Add(newFeature); var featureRow = newFeature.DataRow; for (int c = 0; c < attributeTable.Columns.Count; c++) { featureRow[c] = themeTable.Columns[c].DataType == typeof(DateTime) ? ConvertTime((DateTime)row[c]) : row[c]; } } //to save the feature set to a file with unique name string uniqueID = DateTime.Now.ToString("yyyyMMdd_hhmmss"); var rnd = new Random(); uniqueID += rnd.Next(100).ToString("000"); var filename = Path.Combine(Settings.Instance.CurrentProjectDirectory, "theme_" + uniqueID + ".shp"); fs.Filename = filename; fs.Projection = _wgs84Projection; fs.Save(); fs.Dispose(); var fs2 = FeatureSet.OpenFile(filename); //to reproject the feature set if (projection != null) { fs2.Reproject(projection); } return(fs2); }
/// <summary> /// Creates a new instance of World /// </summary> public World() { GRS1980 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); GRS1980.GeographicInfo.Name = "GCS_GRS_1980"; GRS1980.GeographicInfo.Datum.Name = "D_GRS_1980"; ITRF1988 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); ITRF1988.GeographicInfo.Name = "GCS_ITRF_1988"; ITRF1988.GeographicInfo.Datum.Name = "D_ITRF_1988"; ITRF1989 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); ITRF1989.GeographicInfo.Name = "GCS_ITRF_1989"; ITRF1989.GeographicInfo.Datum.Name = "D_ITRF_1989"; ITRF1990 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); ITRF1990.GeographicInfo.Name = "GCS_ITRF_1990"; ITRF1990.GeographicInfo.Datum.Name = "D_ITRF_1990"; ITRF1991 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); ITRF1991.GeographicInfo.Name = "GCS_ITRF_1991"; ITRF1991.GeographicInfo.Datum.Name = "D_ITRF_1991"; ITRF1992 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); ITRF1992.GeographicInfo.Name = "GCS_ITRF_1992"; ITRF1992.GeographicInfo.Datum.Name = "D_ITRF_1992"; ITRF1993 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); ITRF1993.GeographicInfo.Name = "GCS_ITRF_1993"; ITRF1993.GeographicInfo.Datum.Name = "D_ITRF_1993"; ITRF1994 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); ITRF1994.GeographicInfo.Name = "GCS_ITRF_1994"; ITRF1994.GeographicInfo.Datum.Name = "D_ITRF_1994"; ITRF1996 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); ITRF1996.GeographicInfo.Name = "GCS_ITRF_1996"; ITRF1996.GeographicInfo.Datum.Name = "D_ITRF_1996"; ITRF1997 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); ITRF1997.GeographicInfo.Name = "GCS_ITRF_1997"; ITRF1997.GeographicInfo.Name = "D_ITRF_1997"; ITRF2000 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=GRS80 +no_defs "); ITRF2000.GeographicInfo.Name = "GCS_ITRF_2000"; ITRF2000.GeographicInfo.Datum.Name = "D_ITRF_2000"; NSWC9Z2 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=WGS66 +no_defs "); NSWC9Z2.GeographicInfo.Name = "GCS_NSWC_9Z_2"; NSWC9Z2.GeographicInfo.Datum.Name = "D_NSWC_9Z_2"; WGS1966 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=WGS66 +no_defs "); WGS1966.GeographicInfo.Name = "GCS_WGS_1966"; WGS1966.GeographicInfo.Datum.Name = "D_WGS_1996"; WGS1972 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=WGS72 +no_defs "); WGS1972.GeographicInfo.Name = "GCS_WGS_1972"; WGS1972.GeographicInfo.Datum.Name = "D_WGS_1972"; WGS1972TBE = ProjectionInfo.FromProj4String("+proj=longlat +ellps=WGS72 +no_defs "); WGS1972TBE.GeographicInfo.Name = "GCS_WGS_1972_BE"; WGS1972TBE.GeographicInfo.Datum.Name = "D_WGS_1972_BE"; WGS1984 = ProjectionInfo.FromProj4String("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs "); WGS1984.GeographicInfo.Name = "GCS_WGS_1984"; WGS1984.GeographicInfo.Datum.Name = "D_WGS_1984"; }
public void NAD1927StatePlaneWyomingEastCentralFIPS4902() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneWyomingEastCentralFIPS4902; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneWyomingWestFIPS4904() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneWyomingWestFIPS4904; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneMichiganSouthFIPS2113() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneMichiganSouthFIPS2113; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneArizonaCentralFIPS0202() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneArizonaCentralFIPS0202; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneCaliforniaVIIFIPS0407() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneCaliforniaVIIFIPS0407; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneArkansasSouthFIPS0302() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneArkansasSouthFIPS0302; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneWisconsinSouthFIPS4803() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneWisconsinSouthFIPS4803; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneDelawareFIPS0700() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneDelawareFIPS0700; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneWashingtonSouthFIPS4602() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneWashingtonSouthFIPS4602; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneFloridaNorthFIPS0903() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneFloridaNorthFIPS0903; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneVirginiaNorthFIPS4501() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneVirginiaNorthFIPS4501; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneIdahoWestFIPS1103() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneIdahoWestFIPS1103; Tester.TestProjection(pStart); }
/// <inheritdoc /> public void Reproject(ProjectionInfo targetProjection) { // throw new NotImplementedException(); }
public void NAD1927StatePlaneIndianaEastFIPS1301() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneIndianaEastFIPS1301; Tester.TestProjection(pStart); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { // First, we need to retrieve all data from the input parameters. List <string> fields = new List <string>(); GH_Structure <IGH_Goo> attributes = new GH_Structure <IGH_Goo>(); GH_Structure <GH_Curve> inputPolygonTree = new GH_Structure <GH_Curve>(); bool writeFile = false; string filePath = ""; string prj = null; // access the input parameter by index. if (!DA.GetData(5, ref writeFile)) { return; } if (!DA.GetData(4, ref filePath)) { return; } if (!DA.GetDataTree(0, out inputPolygonTree)) { return; } if (!DA.GetDataList(1, fields)) { return; } if (!DA.GetDataTree(2, out attributes)) { return; } if (!DA.GetData(3, ref prj)) { return; } //create new feature set to add data to FeatureSet fs = new FeatureSet(FeatureType.Polygon); //FeatureSet fs = new FeatureSet(FeatureType.Point); //FeatureSet fs = new FeatureSet(FeatureType.MultiPoint); //FeatureSet fs = new FeatureSet(FeatureType.Line); if (prj != null) { //load projection file string cur_proj = System.IO.File.ReadAllText(@prj); ///create Projection system ProjectionInfo targetProjection = new ProjectionInfo(); targetProjection.ParseEsriString(cur_proj); fs.Projection = targetProjection; } if (writeFile) { // Add fields to the feature sets attribute table foreach (string field in fields) { //check for type string[] splitField = field.Split(';'); //if field type provided, specify it if (splitField.Length == 2) { fs.DataTable.Columns.Add(new DataColumn(splitField[0], Type.GetType(splitField[1]))); } else { //otherwise jsut use a string fs.DataTable.Columns.Add(new DataColumn(field, typeof(string))); } } // for every branch (ie feature) foreach (GH_Path path in inputPolygonTree.Paths) { //set branch IList branch = inputPolygonTree.get_Branch(path); //List<DotSpatial.Topology.LineString> theseLines = new List<DotSpatial.Topology.LineString>(); List <LinearRing> theseCurves = new List <LinearRing>(); foreach (GH_Curve curve in branch) { // create vertex list for this curve List <Coordinate> vertices = new List <Coordinate>(); //convert to rhino curve Curve rhinoCurve = null; GH_Convert.ToCurve(curve, ref rhinoCurve, 0); //curve to nurbes NurbsCurve thisNurbsCurve = rhinoCurve.ToNurbsCurve(); //Get list of control points Rhino.Geometry.Collections.NurbsCurvePointList theseControlPoints = thisNurbsCurve.Points; //for each control point foreach (ControlPoint thisPoint in theseControlPoints) { vertices.Add(new Coordinate(thisPoint.Location.X, thisPoint.Location.Y)); }//end each control point //create linering Geometry from coordinates LinearRing thisCurve = new LinearRing(vertices); // add curve to curve list theseCurves.Add(thisCurve); }//end curve itteration //Convert Coordinates to dot spatial point or multipoint geometry //DotSpatial.Topology.Point geom = new DotSpatial.Topology.Point(vertices); //DotSpatial.Topology.MultiPoint geom = new DotSpatial.Topology.MultiPoint(vertices); DotSpatial.Topology.ILinearRing outerCurve = theseCurves[0]; var innerCurves = theseCurves.GetRange(1, theseCurves.Count - 1).ToArray(); //convert list of line strings into single multilinestring feature //MultiLineString geom = new MultiLineString(theseLines); Polygon geom = new Polygon(outerCurve, innerCurves); //convert geom to a feature IFeature feature = fs.AddFeature(geom); //begin editing to add feature attributes feature.DataRow.BeginEdit(); //get this features attributes by its path IList <string> featrueAttributes = attributes.get_Branch(path) as IList <string>; int thisIndex = 0; //add each attribute for the pt's path foreach (var thisAttribute in attributes.get_Branch(path)) { string thisField = fields[thisIndex].Split(';')[0]; feature.DataRow[thisField] = thisAttribute.ToString(); //currently everything is a string.... thisIndex++; } //finish attribute additions feature.DataRow.EndEdit(); }//end of itterating through branches of pt tree fs.SaveAs(filePath, true); } }
public void NAD1927StatePlaneKentuckyNorthFIPS1601() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneKentuckyNorthFIPS1601; Tester.TestProjection(pStart); }
/// <summary> /// Creates a new ThemeManager /// </summary> public ThemeManager(ISearchPlugin searchPlugin) { _searchPlugin = searchPlugin; _wgs84Projection = ProjectionInfo.FromEsriString(Properties.Resources.Wgs84ProjectionString); }
public void NAD1927StatePlaneLouisianaSouthFIPS1702() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneLouisianaSouthFIPS1702; Tester.TestProjection(pStart); }
/// <summary> /// Initializes a new instance of the <see cref="WebMapPlugin"/> class. /// </summary> public WebMapPlugin() { DeactivationAllowed = false; _webMercProj = ServiceProviderFactory.WebMercProj.Value; }
public void NAD1927StatePlaneMaineWestFIPS1802() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneMaineWestFIPS1802; Tester.TestProjection(pStart); }
/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { _phi1 = projInfo.Phi1; _phi2 = projInfo.Phi2; Setup(); }
public void NAD1927StatePlaneAlaska1FIPS5001() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneAlaska1FIPS5001; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneMarylandFIPS1900() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneMarylandFIPS1900; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneMassachusettsMainlandFIPS2001() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneMassachusettsMainlandFIPS2001; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneColoradoSouthFIPS0503() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneColoradoSouthFIPS0503; Tester.TestProjection(pStart); }
public void NAD1927StatePlaneWestVirginiaSouthFIPS4702() { ProjectionInfo pStart = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneWestVirginiaSouthFIPS4702; Tester.TestProjection(pStart); }