mirror of
https://github.com/IeuanWalker/GeoUK.git
synced 2025-10-25 15:19:15 +00:00
Add project files.
This commit is contained in:
19
GeoUK.OSTN.Tests/ExtensionMethods.cs
Normal file
19
GeoUK.OSTN.Tests/ExtensionMethods.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace GeoUK.OSTN.Tests
|
||||
{
|
||||
// Source: https://scottlilly.com/c-tip-how-to-check-if-two-double-values-are-equal/
|
||||
public static class ExtensionMethods
|
||||
{
|
||||
public static bool IsApproximatelyEqualTo(this double initialValue, double value)
|
||||
{
|
||||
return IsApproximatelyEqualTo(initialValue, value, 0.00001);
|
||||
}
|
||||
|
||||
public static bool IsApproximatelyEqualTo(this double initialValue, double value, double maximumDifferenceAllowed)
|
||||
{
|
||||
// Handle comparisons of floating point values that may not be exactly the same
|
||||
return (Math.Abs(initialValue - value) < maximumDifferenceAllowed);
|
||||
}
|
||||
}
|
||||
}
|
||||
114
GeoUK.OSTN.Tests/GeoUK.OSTN.Tests.csproj
Normal file
114
GeoUK.OSTN.Tests/GeoUK.OSTN.Tests.csproj
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{7DAF4F03-B372-43B2-A22C-64C2790BCF68}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>GeoUK.OSTN.Tests</RootNamespace>
|
||||
<AssemblyName>GeoUK.OSTN.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="xunit.assert, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="xunit.core, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="xunit.execution.desktop, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ExtensionMethods.cs" />
|
||||
<Compile Include="Models\DataPoint.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TransformTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="TestDataFiles_OSGM15_OSTN15\OSGM15_NI_TestInput_ETRS89toIG.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="TestDataFiles_OSGM15_OSTN15\OSGM15_NI_TestInput_IGtoETRS89.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="TestDataFiles_OSGM15_OSTN15\OSGM15_NI_TestOutput_ETRS89toIG.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="TestDataFiles_OSGM15_OSTN15\OSGM15_NI_TestOutput_IGtoETRS89.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="TestDataFiles_OSGM15_OSTN15\OSTN15_OSGM15_TestFiles_README.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="TestDataFiles_OSGM15_OSTN15\OSTN15_OSGM15_TestInput_ETRStoOSGB.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="TestDataFiles_OSGM15_OSTN15\OSTN15_OSGM15_TestInput_OSGBtoETRS.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="TestDataFiles_OSGM15_OSTN15\OSTN15_OSGM15_TestOutput_ETRStoOSGB.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="TestDataFiles_OSGM15_OSTN15\OSTN15_OSGM15_TestOutput_OSGBtoETRS.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\GeoUK.OSTN\GeoUK.OSTN.csproj">
|
||||
<Project>{e7c614ac-e67d-4e04-ba4e-e1bbf4cac6fd}</Project>
|
||||
<Name>GeoUK.OSTN</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\GeoUK\GeoUK.csproj">
|
||||
<Project>{5c458fbf-4e2a-4f9d-acc2-9ce5bed34236}</Project>
|
||||
<Name>GeoUK</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
16
GeoUK.OSTN.Tests/Models/DataPoint.cs
Normal file
16
GeoUK.OSTN.Tests/Models/DataPoint.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GeoUK.OSTN.Tests.Models
|
||||
{
|
||||
public class DataPoint
|
||||
{
|
||||
public string PointID { get; set; }
|
||||
public double X { get; set; }
|
||||
public double Y { get; set; }
|
||||
public double Height { get; set; }
|
||||
}
|
||||
}
|
||||
36
GeoUK.OSTN.Tests/Properties/AssemblyInfo.cs
Normal file
36
GeoUK.OSTN.Tests/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("GeoUK.OSTN.Tests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("GeoUK.OSTN.Tests")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("7daf4f03-b372-43b2-a22c-64c2790bcf68")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,101 @@
|
||||
Point ID ETRS89GD-Lat ETRS89GD-Long ETRS89GD-Alt
|
||||
NI_ETRS89_1 55° 10' 57.600354" N 6° 23' 6.102018" W 124.5604
|
||||
NI_ETRS89_2 55° 11' 16.131144" N 6° 39' 7.795434" W 126.1876
|
||||
NI_ETRS89_3 55° 1' 25.417200" N 7° 18' 16.987264" W 128.3924
|
||||
NI_ETRS89_4 55° 1' 19.216214" N 7° 12' 51.087870" W 129.6496
|
||||
NI_ETRS89_5 54° 26' 50.486041" N 5° 50' 57.779906" W 129.9124
|
||||
NI_ETRS89_6 54° 20' 47.958197" N 5° 36' 12.881749" W 130.9826
|
||||
NI_ETRS89_7 54° 27' 30.284629" N 5° 42' 43.265004" W 132.3637
|
||||
NI_ETRS89_8 54° 29' 23.231246" N 6° 44' 49.929139" W 134.7233
|
||||
NI_ETRS89_9 54° 20' 24.887019" N 6° 33' 1.841097" W 135.8332
|
||||
NI_ETRS89_10 54° 25' 56.735894" N 6° 24' 26.758684" W 136.8675
|
||||
NI_ETRS89_11 54° 41' 50.168458" N 6° 5' 28.812607" W 137.8907
|
||||
NI_ETRS89_12 54° 36' 47.469253" N 7° 9' 26.937635" W 140.6274
|
||||
NI_ETRS89_13 54° 42' 0.189087" N 7° 23' 5.330432" W 141.9916
|
||||
NI_ETRS89_14 54° 46' 18.217870" N 7° 16' 37.412533" W 143.2558
|
||||
NI_ETRS89_15 54° 27' 25.462232" N 7° 17' 22.581828" W 144.6415
|
||||
NI_ETRS89_16 54° 34' 23.188960" N 7° 2' 13.898539" W 145.8260
|
||||
NI_ETRS89_17 54° 31' 13.520931" N 7° 28' 35.520175" W 147.4368
|
||||
NI_ETRS89_18 54° 41' 49.731453" N 7° 32' 53.488436" W 148.6126
|
||||
NI_ETRS89_19 55° 2' 37.538953" N 6° 4' 53.600211" W 148.3890
|
||||
NI_ETRS89_20 54° 20' 43.746204" N 5° 34' 2.859901" W 149.4504
|
||||
NI_ETRS89_21 54° 23' 35.927652" N 6° 0' 56.860881" W 151.2695
|
||||
NI_ETRS89_22 54° 31' 1.110912" N 6° 5' 21.644633" W 152.5213
|
||||
NI_ETRS89_23 54° 35' 29.829279" N 6° 12' 48.226416" W 153.8346
|
||||
NI_ETRS89_24 54° 39' 10.481038" N 5° 38' 56.891605" W 154.6126
|
||||
NI_ETRS89_25 54° 27' 33.108364" N 6° 5' 28.763244" W 156.5443
|
||||
NI_ETRS89_26 54° 22' 58.754876" N 6° 4' 37.196831" W 157.9147
|
||||
NI_ETRS89_27 54° 25' 44.820985" N 6° 24' 42.551091" W 159.3484
|
||||
NI_ETRS89_28 54° 16' 9.016976" N 6° 26' 34.745216" W 160.9039
|
||||
NI_ETRS89_29 54° 24' 10.616515" N 6° 51' 1.221453" W 162.6304
|
||||
NI_ETRS89_30 54° 21' 23.749986" N 6° 26' 17.508288" W 163.4338
|
||||
NI_ETRS89_31 54° 24' 12.832874" N 6° 14' 20.696172" W 164.5709
|
||||
NI_ETRS89_32 54° 59' 18.406527" N 7° 18' 43.614759" W 166.7807
|
||||
NI_ETRS89_33 54° 58' 14.147857" N 7° 15' 46.444426" W 168.0993
|
||||
NI_ETRS89_34 55° 10' 35.891866" N 6° 43' 26.321275" W 168.5979
|
||||
NI_ETRS89_35 54° 27' 4.263531" N 5° 52' 52.947143" W 169.6077
|
||||
NI_ETRS89_36 54° 23' 28.035477" N 5° 45' 23.264415" W 170.7855
|
||||
NI_ETRS89_37 54° 29' 36.267768" N 5° 28' 38.101975" W 171.7284
|
||||
NI_ETRS89_38 54° 36' 19.688119" N 5° 41' 38.137013" W 173.2245
|
||||
NI_ETRS89_39 54° 25' 43.363264" N 6° 25' 6.880031" W 175.2179
|
||||
NI_ETRS89_40 54° 23' 13.002291" N 6° 27' 51.269149" W 176.6385
|
||||
NI_ETRS89_41 54° 29' 29.519190" N 6° 25' 29.123339" W 177.7676
|
||||
NI_ETRS89_42 54° 6' 24.671003" N 6° 28' 43.032725" W 179.7115
|
||||
NI_ETRS89_43 54° 19' 56.267289" N 6° 38' 23.001578" W 180.8786
|
||||
NI_ETRS89_44 54° 20' 49.152501" N 6° 24' 9.875489" W 181.9154
|
||||
NI_ETRS89_45 54° 37' 27.352399" N 7° 17' 54.902328" W 184.3241
|
||||
NI_ETRS89_46 54° 38' 57.799074" N 7° 26' 19.089688" W 185.6732
|
||||
NI_ETRS89_47 54° 36' 19.468310" N 7° 16' 41.738664" W 186.9585
|
||||
NI_ETRS89_48 54° 43' 36.993774" N 7° 31' 31.479031" W 188.2365
|
||||
NI_ETRS89_49 54° 47' 0.028543" N 7° 31' 48.952312" W 189.4949
|
||||
NI_ETRS89_50 54° 58' 41.417196" N 7° 16' 28.602218" W 190.5680
|
||||
NI_ETRS89_51 54° 56' 25.799490" N 6° 12' 0.292229" W 190.9421
|
||||
NI_ETRS89_52 54° 54' 49.926946" N 6° 7' 46.064378" W 192.1404
|
||||
NI_ETRS89_53 55° 4' 42.861588" N 6° 26' 10.823044" W 193.5736
|
||||
NI_ETRS89_54 54° 36' 27.504590" N 7° 25' 39.318994" W 196.2993
|
||||
NI_ETRS89_55 54° 34' 7.752865" N 6° 52' 46.320239" W 197.1678
|
||||
NI_ETRS89_56 54° 28' 48.994004" N 8° 5' 37.119734" W 198.8240
|
||||
NI_ETRS89_57 54° 35' 51.167328" N 7° 12' 9.279948" W 200.1361
|
||||
NI_ETRS89_58 54° 39' 1.071653" N 7° 23' 12.991657" W 201.5267
|
||||
NI_ETRS89_59 54° 40' 48.575796" N 7° 43' 43.142295" W 202.8794
|
||||
NI_ETRS89_60 54° 37' 8.873864" N 6° 5' 1.784466" W 202.7461
|
||||
NI_ETRS89_61 54° 30' 6.300273" N 5° 55' 21.200053" W 203.9990
|
||||
NI_ETRS89_62 54° 19' 57.253537" N 5° 42' 33.040323" W 205.1238
|
||||
NI_ETRS89_63 54° 25' 38.666821" N 5° 47' 39.408247" W 206.5222
|
||||
NI_ETRS89_64 54° 26' 17.307491" N 5° 46' 52.762015" W 207.8229
|
||||
NI_ETRS89_65 54° 23' 58.853187" N 6° 1' 46.189294" W 209.4391
|
||||
NI_ETRS89_66 54° 30' 18.992276" N 6° 17' 42.542464" W 210.7495
|
||||
NI_ETRS89_67 54° 26' 46.454405" N 6° 42' 13.718041" W 212.6267
|
||||
NI_ETRS89_68 54° 10' 48.075347" N 6° 21' 4.870873" W 213.8538
|
||||
NI_ETRS89_69 54° 9' 42.033185" N 6° 19' 38.927332" W 215.2028
|
||||
NI_ETRS89_70 54° 24' 3.588037" N 7° 33' 49.034498" W 217.3612
|
||||
NI_ETRS89_71 54° 34' 54.308463" N 7° 16' 28.016679" W 218.6790
|
||||
NI_ETRS89_72 54° 46' 2.053898" N 7° 28' 14.738701" W 219.9074
|
||||
NI_ETRS89_73 54° 20' 2.365715" N 5° 42' 20.888018" W 219.6620
|
||||
NI_ETRS89_74 54° 35' 57.068444" N 5° 41' 28.757661" W 220.8122
|
||||
NI_ETRS89_75 54° 25' 5.933075" N 5° 50' 9.396230" W 222.4454
|
||||
NI_ETRS89_76 54° 26' 48.905447" N 5° 40' 33.721949" W 223.5367
|
||||
NI_ETRS89_77 54° 50' 53.676891" N 7° 26' 41.826452" W 226.4302
|
||||
NI_ETRS89_78 55° 2' 10.801907" N 7° 14' 26.516917" W 227.4698
|
||||
NI_ETRS89_79 54° 52' 29.049750" N 6° 15' 28.282800" W 227.9469
|
||||
NI_ETRS89_80 54° 12' 5.575072" N 7° 24' 50.324214" W 230.2550
|
||||
NI_ETRS89_81 54° 45' 58.084067" N 7° 25' 38.110453" W 231.8055
|
||||
NI_ETRS89_82 54° 43' 56.512130" N 7° 18' 5.001669" W 233.1619
|
||||
NI_ETRS89_83 54° 33' 19.869726" N 7° 24' 17.190780" W 234.6503
|
||||
NI_ETRS89_84 54° 34' 57.191954" N 7° 19' 12.686724" W 235.8977
|
||||
NI_ETRS89_85 54° 40' 16.239071" N 7° 39' 3.260261" W 237.2485
|
||||
NI_ETRS89_86 55° 8' 12.774267" N 6° 39' 17.113989" W 237.2990
|
||||
NI_ETRS89_87 55° 5' 6.334535" N 6° 21' 32.900792" W 238.5021
|
||||
NI_ETRS89_88 55° 14' 3.603854" N 6° 27' 24.193732" W 239.5588
|
||||
NI_ETRS89_89 54° 46' 58.778202" N 5° 58' 22.241747" W 240.8694
|
||||
NI_ETRS89_90 54° 19' 48.564102" N 5° 42' 46.439741" W 242.1445
|
||||
NI_ETRS89_91 54° 26' 39.669172" N 5° 58' 55.220676" W 243.7369
|
||||
NI_ETRS89_92 54° 30' 23.281593" N 6° 4' 42.668030" W 245.0595
|
||||
NI_ETRS89_93 54° 58' 34.571076" N 7° 12' 25.212454" W 247.3930
|
||||
NI_ETRS89_94 55° 3' 21.545684" N 7° 12' 50.801888" W 248.5692
|
||||
NI_ETRS89_95 54° 28' 11.272307" N 6° 45' 18.762066" W 249.7505
|
||||
NI_ETRS89_96 54° 28' 32.820057" N 6° 43' 9.451359" W 250.9918
|
||||
NI_ETRS89_97 54° 8' 38.568299" N 6° 22' 53.302916" W 252.3618
|
||||
NI_ETRS89_98 54° 28' 4.599567" N 6° 15' 16.042369" W 253.0849
|
||||
NI_ETRS89_99 54° 57' 43.976468" N 7° 15' 46.710016" W 255.3666
|
||||
NI_ETRS89_100 54° 39' 11.656497" N 6° 44' 11.477757" W 256.3562
|
||||
@@ -0,0 +1,101 @@
|
||||
Point ID IG_Easting IG_Northing IG_Ht
|
||||
NI_IG_1 223657.156 340618.902 37.958
|
||||
NI_IG_2 308131.471 390483.856 0.458
|
||||
NI_IG_3 285617.940 391534.815 0.916
|
||||
NI_IG_4 231359.936 350368.015 1.374
|
||||
NI_IG_5 307382.780 389574.390 1.832
|
||||
NI_IG_6 289273.066 438318.756 2.290
|
||||
NI_IG_7 235199.245 348098.753 2.748
|
||||
NI_IG_8 277294.209 432687.143 3.206
|
||||
NI_IG_9 269256.498 353065.196 3.664
|
||||
NI_IG_10 289507.735 329405.008 4.122
|
||||
NI_IG_11 278150.481 339654.628 4.580
|
||||
NI_IG_12 219760.890 331803.713 5.038
|
||||
NI_IG_13 287524.816 341546.247 5.496
|
||||
NI_IG_14 261473.213 417976.375 5.954
|
||||
NI_IG_15 287018.283 340515.091 6.412
|
||||
NI_IG_16 255760.008 417370.343 6.870
|
||||
NI_IG_17 232157.431 361042.148 7.328
|
||||
NI_IG_18 249296.146 333168.087 7.786
|
||||
NI_IG_19 285785.291 403694.860 8.244
|
||||
NI_IG_20 293390.375 404256.244 8.702
|
||||
NI_IG_21 285325.560 404325.616 9.160
|
||||
NI_IG_22 277798.221 356666.468 9.618
|
||||
NI_IG_23 273926.118 407140.192 10.076
|
||||
NI_IG_24 246715.781 410694.860 10.534
|
||||
NI_IG_25 242836.968 343206.078 10.992
|
||||
NI_IG_26 284401.312 350085.739 11.450
|
||||
NI_IG_27 302620.764 361216.360 11.908
|
||||
NI_IG_28 285293.980 400149.508 12.366
|
||||
NI_IG_29 291927.693 401421.475 12.824
|
||||
NI_IG_30 288615.900 399534.404 13.282
|
||||
NI_IG_31 293120.758 400613.750 13.740
|
||||
NI_IG_32 338525.080 373133.120 14.198
|
||||
NI_IG_33 337233.890 331646.344 14.656
|
||||
NI_IG_34 228823.113 355986.376 15.114
|
||||
NI_IG_35 243441.637 410488.232 15.572
|
||||
NI_IG_36 239945.234 418889.151 16.030
|
||||
NI_IG_37 252914.755 420340.657 16.488
|
||||
NI_IG_38 285148.013 336107.884 16.946
|
||||
NI_IG_39 285395.905 336466.311 17.404
|
||||
NI_IG_40 285338.893 336012.834 17.862
|
||||
NI_IG_41 285596.984 335277.780 18.320
|
||||
NI_IG_42 295790.087 337073.103 18.778
|
||||
NI_IG_43 239311.238 404857.191 19.236
|
||||
NI_IG_44 293094.485 400975.093 19.694
|
||||
NI_IG_45 322685.197 400715.582 20.152
|
||||
NI_IG_46 290083.169 402370.083 20.610
|
||||
NI_IG_47 328629.247 407547.174 21.068
|
||||
NI_IG_48 277115.388 365644.341 21.526
|
||||
NI_IG_49 286219.653 354597.951 21.984
|
||||
NI_IG_50 291244.745 315348.570 22.442
|
||||
NI_IG_51 349551.111 336642.049 22.900
|
||||
NI_IG_52 270428.823 427329.846 23.358
|
||||
NI_IG_53 293052.366 424057.767 23.816
|
||||
NI_IG_54 287813.458 418656.728 24.274
|
||||
NI_IG_55 288198.760 405149.475 24.732
|
||||
NI_IG_56 287004.529 421655.723 25.190
|
||||
NI_IG_57 299781.297 405138.724 25.648
|
||||
NI_IG_58 295211.840 402091.703 26.106
|
||||
NI_IG_59 297412.317 400874.690 26.564
|
||||
NI_IG_60 241777.987 415940.840 27.022
|
||||
NI_IG_61 236681.986 363384.155 27.480
|
||||
NI_IG_62 210970.495 366894.117 27.938
|
||||
NI_IG_63 244155.405 416296.469 28.396
|
||||
NI_IG_64 280758.516 352731.886 28.854
|
||||
NI_IG_65 280517.031 337725.958 29.312
|
||||
NI_IG_66 324717.985 366422.286 29.770
|
||||
NI_IG_67 267343.033 422649.495 30.228
|
||||
NI_IG_68 295459.677 400564.365 30.686
|
||||
NI_IG_69 317291.541 409474.585 31.144
|
||||
NI_IG_70 299234.982 401452.754 31.602
|
||||
NI_IG_71 300751.863 401301.366 32.060
|
||||
NI_IG_72 269346.630 377351.229 32.518
|
||||
NI_IG_73 234625.405 355957.603 32.976
|
||||
NI_IG_74 279585.407 342310.440 33.434
|
||||
NI_IG_75 324951.697 339569.311 33.892
|
||||
NI_IG_76 243092.967 421685.462 34.350
|
||||
NI_IG_77 319613.101 397847.948 34.808
|
||||
NI_IG_78 321055.749 398178.777 35.266
|
||||
NI_IG_79 321106.659 398973.595 35.724
|
||||
NI_IG_80 313913.640 396469.167 36.182
|
||||
NI_IG_81 327887.428 390936.675 36.640
|
||||
NI_IG_82 359163.562 349591.593 37.098
|
||||
NI_IG_83 337983.066 332643.682 37.556
|
||||
NI_IG_84 325861.667 364046.778 38.014
|
||||
NI_IG_85 350674.263 363131.918 38.472
|
||||
NI_IG_86 363948.751 362905.616 38.930
|
||||
NI_IG_87 296541.632 391219.430 39.388
|
||||
NI_IG_88 236441.014 401428.171 39.846
|
||||
NI_IG_89 243618.483 404152.692 40.304
|
||||
NI_IG_90 269666.423 408605.885 40.762
|
||||
NI_IG_91 240655.381 335663.798 41.220
|
||||
NI_IG_92 238800.763 368240.269 41.678
|
||||
NI_IG_93 305122.283 322904.222 42.136
|
||||
NI_IG_94 288505.165 366566.882 42.594
|
||||
NI_IG_95 313402.067 353690.323 43.052
|
||||
NI_IG_96 304944.599 425255.801 43.510
|
||||
NI_IG_97 291353.157 419992.403 43.968
|
||||
NI_IG_98 291402.060 418749.044 44.426
|
||||
NI_IG_99 355689.047 337037.080 44.884
|
||||
NI_IG_100 340258.929 369726.933 45.342
|
||||
@@ -0,0 +1,101 @@
|
||||
Point ID IG75-East IG75-North IG75-Height
|
||||
NI_ETRS89_1 302925.602 438473.935 68.4590
|
||||
NI_ETRS89_2 285898.282 438685.621 69.7810
|
||||
NI_ETRS89_3 244516.713 419809.585 71.1030
|
||||
NI_ETRS89_4 250308.728 419679.200 72.4250
|
||||
NI_ETRS89_5 339554.527 357556.523 73.7470
|
||||
NI_ETRS89_6 355877.829 346864.832 75.0690
|
||||
NI_ETRS89_7 348423.620 359067.714 76.3910
|
||||
NI_ETRS89_8 281234.919 360871.510 77.7130
|
||||
NI_ETRS89_9 294323.134 344471.708 79.0350
|
||||
NI_ETRS89_10 303396.207 354932.361 80.3570
|
||||
NI_ETRS89_11 323106.133 384919.018 81.6790
|
||||
NI_ETRS89_12 254483.171 374211.800 83.0010
|
||||
NI_ETRS89_13 239710.786 383729.253 84.3230
|
||||
NI_ETRS89_14 246575.617 391774.308 85.6450
|
||||
NI_ETRS89_15 246122.531 356739.541 86.9670
|
||||
NI_ETRS89_16 262315.912 369850.425 88.2890
|
||||
NI_ETRS89_17 233946.603 363685.083 89.6110
|
||||
NI_ETRS89_18 229179.629 383325.744 90.9330
|
||||
NI_ETRS89_19 322680.248 423502.078 92.2550
|
||||
NI_ETRS89_20 358230.413 346815.077 93.5770
|
||||
NI_ETRS89_21 328930.752 351224.708 94.8990
|
||||
NI_ETRS89_22 323780.256 364855.877 96.2210
|
||||
NI_ETRS89_23 315536.614 372952.738 97.5430
|
||||
NI_ETRS89_24 351776.843 380847.505 98.8650
|
||||
NI_ETRS89_25 323826.687 358421.786 100.1870
|
||||
NI_ETRS89_26 324987.149 349965.252 101.5090
|
||||
NI_ETRS89_27 303119.867 354557.552 102.8310
|
||||
NI_ETRS89_28 301490.801 336710.092 104.1530
|
||||
NI_ETRS89_29 274709.438 351091.529 105.4750
|
||||
NI_ETRS89_30 301587.157 346447.612 106.7970
|
||||
NI_ETRS89_31 314400.382 351980.183 108.1190
|
||||
NI_ETRS89_32 244082.323 415877.285 109.4410
|
||||
NI_ETRS89_33 247253.618 413922.311 110.7630
|
||||
NI_ETRS89_34 281347.159 437355.297 112.0850
|
||||
NI_ETRS89_35 337466.836 357919.529 113.4070
|
||||
NI_ETRS89_36 345780.552 351486.157 114.7290
|
||||
NI_ETRS89_37 363505.530 363482.289 116.0510
|
||||
NI_ETRS89_38 349059.874 375471.763 117.3730
|
||||
NI_ETRS89_39 302682.326 354502.612 118.6950
|
||||
NI_ETRS89_40 299820.395 349788.209 120.0170
|
||||
NI_ETRS89_41 302124.847 361485.848 121.3390
|
||||
NI_ETRS89_42 299558.540 318593.409 122.6610
|
||||
NI_ETRS89_43 288538.296 343471.203 123.9830
|
||||
NI_ETRS89_44 303916.175 345429.615 125.3050
|
||||
NI_ETRS89_45 245354.496 375344.838 126.6270
|
||||
NI_ETRS89_46 236285.928 378060.265 127.9490
|
||||
NI_ETRS89_47 246688.779 373259.065 129.2710
|
||||
NI_ETRS89_48 230625.976 386652.258 130.5930
|
||||
NI_ETRS89_49 230271.155 392928.524 131.9150
|
||||
NI_ETRS89_50 246494.910 414757.724 133.2370
|
||||
NI_ETRS89_51 315400.406 411806.733 134.5590
|
||||
NI_ETRS89_52 320004.913 408961.202 135.8810
|
||||
NI_ETRS89_53 299916.719 426812.199 137.2030
|
||||
NI_ETRS89_54 237036.967 373418.643 138.5250
|
||||
NI_ETRS89_55 272519.507 369524.264 139.8470
|
||||
NI_ETRS89_56 193978.359 359093.692 141.1690
|
||||
NI_ETRS89_57 251589.422 372436.857 142.4910
|
||||
NI_ETRS89_58 239621.990 378189.381 143.8130
|
||||
NI_ETRS89_59 217551.472 381374.632 145.1350
|
||||
NI_ETRS89_60 323827.485 376235.486 146.4570
|
||||
NI_ETRS89_61 334629.957 363467.580 147.7790
|
||||
NI_ETRS89_62 349063.308 345069.101 149.1010
|
||||
NI_ETRS89_63 343197.956 355446.897 150.4230
|
||||
NI_ETRS89_64 344001.088 356667.843 151.7450
|
||||
NI_ETRS89_65 328021.015 351908.476 153.0670
|
||||
NI_ETRS89_66 310485.496 363211.172 154.3890
|
||||
NI_ETRS89_67 284136.040 356075.066 155.7110
|
||||
NI_ETRS89_68 307692.022 326923.403 157.0330
|
||||
NI_ETRS89_69 309298.959 324918.297 158.3550
|
||||
NI_ETRS89_70 228389.635 350352.530 159.6770
|
||||
NI_ETRS89_71 246962.298 370628.344 160.9990
|
||||
NI_ETRS89_72 234113.167 391163.094 162.3210
|
||||
NI_ETRS89_73 349277.706 345234.273 163.6430
|
||||
NI_ETRS89_74 349251.174 374778.029 164.9650
|
||||
NI_ETRS89_75 340525.570 354351.070 166.2870
|
||||
NI_ETRS89_76 350799.008 357864.997 167.6090
|
||||
NI_ETRS89_77 235702.885 400193.741 168.9310
|
||||
NI_ETRS89_78 248595.948 421255.662 170.2530
|
||||
NI_ETRS89_79 311880.290 404392.977 171.5750
|
||||
NI_ETRS89_80 238292.775 328222.028 172.8970
|
||||
NI_ETRS89_81 236914.565 391062.358 174.2190
|
||||
NI_ETRS89_82 245053.456 387376.571 175.5410
|
||||
NI_ETRS89_83 238560.304 367628.936 176.8630
|
||||
NI_ETRS89_84 244003.838 370687.922 178.1850
|
||||
NI_ETRS89_85 222571.322 380396.900 179.5070
|
||||
NI_ETRS89_86 285842.723 433012.651 180.8290
|
||||
NI_ETRS89_87 304829.954 427651.075 182.1510
|
||||
NI_ETRS89_88 298231.721 444122.067 183.4730
|
||||
NI_ETRS89_89 330468.943 394674.322 184.7950
|
||||
NI_ETRS89_90 348829.952 344792.625 186.1170
|
||||
NI_ETRS89_91 330962.380 356967.427 187.4390
|
||||
NI_ETRS89_92 324513.256 363705.441 188.7610
|
||||
NI_ETRS89_93 250826.217 414593.033 190.0830
|
||||
NI_ETRS89_94 250271.247 423462.107 191.4050
|
||||
NI_ETRS89_95 280755.288 358637.382 192.7270
|
||||
NI_ETRS89_96 283071.912 359345.405 194.0490
|
||||
NI_ETRS89_97 305817.351 322874.069 195.3710
|
||||
NI_ETRS89_98 313224.439 359120.801 196.6930
|
||||
NI_ETRS89_99 247258.730 412989.265 198.0150
|
||||
NI_ETRS89_100 281599.928 379077.770 199.3370
|
||||
@@ -0,0 +1,101 @@
|
||||
Point ID ETRS89GD-Lat ETRS89GD-Long ETRS89GD-Alt
|
||||
NI_IG_1 54° 18' 49.673618" N 7° 38' 14.133209" W 95.4675
|
||||
NI_IG_2 54° 45' 2.413355" N 6° 19' 17.094677" W 56.7919
|
||||
NI_IG_3 54° 45' 51.996693" N 6° 40' 14.278131" W 57.8220
|
||||
NI_IG_4 54° 24' 3.462032" N 7° 31' 4.388969" W 59.0637
|
||||
NI_IG_5 54° 44' 33.592326" N 6° 20' 0.141736" W 58.1698
|
||||
NI_IG_6 55° 11' 2.122391" N 6° 35' 57.535378" W 58.6386
|
||||
NI_IG_7 54° 22' 49.174102" N 7° 27' 32.550076" W 60.3762
|
||||
NI_IG_8 55° 8' 7.312048" N 6° 47' 19.843047" W 59.8896
|
||||
NI_IG_9 54° 25' 17.207357" N 6° 56' 1.785140" W 60.9571
|
||||
NI_IG_10 54° 12' 20.875523" N 6° 37' 44.494849" W 61.1610
|
||||
NI_IG_11 54° 17' 58.964445" N 6° 48' 1.306088" W 61.6330
|
||||
NI_IG_12 54° 14' 5.181276" N 7° 41' 51.737622" W 62.5461
|
||||
NI_IG_13 54° 18' 54.658738" N 6° 39' 21.100953" W 62.4195
|
||||
NI_IG_14 55° 0' 19.649461" N 7° 2' 24.106126" W 63.1188
|
||||
NI_IG_15 54° 18' 21.630762" N 6° 39' 50.192961" W 63.3499
|
||||
NI_IG_16 55° 0' 2.473605" N 7° 7' 45.921543" W 64.1073
|
||||
NI_IG_17 54° 29' 48.471957" N 7° 30' 16.016273" W 65.1500
|
||||
NI_IG_18 54° 14' 42.143640" N 7° 14' 40.470387" W 65.1748
|
||||
NI_IG_19 54° 52' 25.019226" N 6° 39' 51.961404" W 65.0997
|
||||
NI_IG_20 54° 52' 38.270271" N 6° 32' 44.971889" W 65.3497
|
||||
NI_IG_21 54° 52' 45.693662" N 6° 40' 17.063744" W 66.0308
|
||||
NI_IG_22 54° 27' 9.207286" N 6° 48' 4.776192" W 66.7290
|
||||
NI_IG_23 54° 54' 23.218023" N 6° 50' 53.668031" W 67.2627
|
||||
NI_IG_24 54° 56' 29.971535" N 7° 16' 18.564310" W 67.9325
|
||||
NI_IG_25 54° 20' 8.849495" N 7° 20' 31.957450" W 68.5187
|
||||
NI_IG_26 54° 23' 32.650275" N 6° 42' 5.130061" W 68.3734
|
||||
NI_IG_27 54° 29' 20.447520" N 6° 25' 1.920880" W 68.3344
|
||||
NI_IG_28 54° 50' 30.703150" N 6° 40' 23.271090" W 69.2350
|
||||
NI_IG_29 54° 51' 7.603011" N 6° 34' 10.222830" W 69.5102
|
||||
NI_IG_30 54° 50' 8.743943" N 6° 37' 17.865486" W 70.0562
|
||||
NI_IG_31 54° 50' 40.698478" N 6° 33' 4.312438" W 70.3996
|
||||
NI_IG_32 54° 35' 14.890433" N 5° 51' 28.557044" W 70.2743
|
||||
NI_IG_33 54° 12' 55.372730" N 5° 53' 49.343639" W 71.0065
|
||||
NI_IG_34 54° 27' 5.694403" N 7° 33' 23.037942" W 72.8841
|
||||
NI_IG_35 54° 56' 24.353888" N 7° 19' 22.577749" W 72.9858
|
||||
NI_IG_36 55° 0' 57.050522" N 7° 22' 34.746016" W 73.3937
|
||||
NI_IG_37 55° 1' 39.631267" N 7° 10' 23.985000" W 73.6728
|
||||
NI_IG_38 54° 16' 0.268326" N 6° 41' 38.110124" W 73.9460
|
||||
NI_IG_39 54° 16' 11.708577" N 6° 41' 24.049899" W 74.3977
|
||||
NI_IG_40 54° 15' 57.080737" N 6° 41' 27.664119" W 74.8608
|
||||
NI_IG_41 54° 15' 33.159542" N 6° 41' 14.164099" W 75.3233
|
||||
NI_IG_42 54° 16' 24.706487" N 6° 31' 49.206868" W 75.6343
|
||||
NI_IG_43 54° 53' 23.501924" N 7° 23' 17.333659" W 76.6897
|
||||
NI_IG_44 54° 50' 52.397372" N 6° 33' 5.365614" W 76.3535
|
||||
NI_IG_45 54° 50' 21.089720" N 6° 5' 28.305137" W 76.3870
|
||||
NI_IG_46 54° 51' 39.475317" N 6° 35' 52.507761" W 77.3399
|
||||
NI_IG_47 54° 53' 56.512787" N 5° 59' 44.519153" W 77.1211
|
||||
NI_IG_48 54° 31' 59.861342" N 6° 48' 34.233752" W 78.6930
|
||||
NI_IG_49 54° 25' 57.441460" N 6° 40' 19.671627" W 78.8421
|
||||
NI_IG_50 54° 4' 45.301023" N 6° 36' 23.983604" W 79.4236
|
||||
NI_IG_51 54° 15' 24.420574" N 5° 42' 21.227858" W 78.9450
|
||||
NI_IG_52 55° 5' 17.788684" N 6° 53' 52.045855" W 80.2362
|
||||
NI_IG_53 55° 3' 18.617562" N 6° 32' 40.823165" W 80.2763
|
||||
NI_IG_54 55° 0' 27.443127" N 6° 37' 41.815054" W 80.8869
|
||||
NI_IG_55 54° 53' 10.535535" N 6° 37' 35.060196" W 81.5101
|
||||
NI_IG_56 55° 2' 4.904884" N 6° 38' 24.033213" W 81.7679
|
||||
NI_IG_57 54° 53' 2.360061" N 6° 26' 45.587395" W 82.1960
|
||||
NI_IG_58 54° 51' 27.062554" N 6° 31' 5.422378" W 82.7172
|
||||
NI_IG_59 54° 50' 46.198414" N 6° 29' 3.594228" W 83.1328
|
||||
NI_IG_60 54° 59' 21.175768" N 7° 20' 53.161829" W 84.3845
|
||||
NI_IG_61 54° 31' 3.104138" N 7° 26' 3.596281" W 85.2815
|
||||
NI_IG_62 54° 33' 0.959815" N 7° 49' 52.374315" W 85.6597
|
||||
NI_IG_63 54° 59' 31.937476" N 7° 18' 39.272701" W 85.7294
|
||||
NI_IG_64 54° 25' 0.331579" N 6° 45' 24.373417" W 85.8654
|
||||
NI_IG_65 54° 16' 55.282755" N 6° 45' 52.347151" W 86.3471
|
||||
NI_IG_66 54° 31' 50.912953" N 6° 4' 27.164752" W 86.0628
|
||||
NI_IG_67 55° 2' 48.007362" N 6° 56' 49.959690" W 87.1896
|
||||
NI_IG_68 54° 50' 37.518601" N 6° 30' 53.349446" W 87.2935
|
||||
NI_IG_69 54° 55' 8.837082" N 6° 10' 17.542422" W 87.4658
|
||||
NI_IG_70 54° 51' 3.598238" N 6° 27' 20.777215" W 88.1434
|
||||
NI_IG_71 54° 50' 57.615265" N 6° 25' 55.984387" W 88.5832
|
||||
NI_IG_72 54° 38' 22.425811" N 6° 55' 36.229202" W 89.9433
|
||||
NI_IG_73 54° 27' 3.461296" N 7° 28' 1.042790" W 90.7483
|
||||
NI_IG_74 54° 19' 24.039315" N 6° 46' 39.434844" W 90.4624
|
||||
NI_IG_75 54° 17' 22.763585" N 6° 4' 54.827228" W 90.3044
|
||||
NI_IG_76 55° 2' 26.523913" N 7° 19' 36.101347" W 91.6468
|
||||
NI_IG_77 54° 48' 51.076383" N 6° 8' 24.602649" W 91.0805
|
||||
NI_IG_78 54° 49' 0.524126" N 6° 7' 3.368447" W 91.5201
|
||||
NI_IG_79 54° 49' 26.168890" N 6° 6' 59.323433" W 91.9766
|
||||
NI_IG_80 54° 48' 11.282866" N 6° 13' 45.535791" W 92.5031
|
||||
NI_IG_81 54° 45' 0.370017" N 6° 0' 52.511502" W 92.7644
|
||||
NI_IG_82 54° 22' 12.414790" N 5° 33' 5.915418" W 92.9401
|
||||
NI_IG_83 54° 13' 26.882695" N 5° 53' 6.382691" W 93.8605
|
||||
NI_IG_84 54° 30' 33.117081" N 6° 3' 27.251764" W 94.3013
|
||||
NI_IG_85 54° 29' 39.230642" N 5° 40' 30.990364" W 94.3631
|
||||
NI_IG_86 54° 29' 17.122155" N 5° 28' 14.653278" W 94.6049
|
||||
NI_IG_87 54° 45' 34.678926" N 6° 30' 3.938132" W 95.9484
|
||||
NI_IG_88 54° 51' 33.402541" N 7° 25' 59.902150" W 97.3311
|
||||
NI_IG_89 54° 52' 59.437001" N 7° 19' 16.098648" W 97.7733
|
||||
NI_IG_90 54° 55' 12.807449" N 6° 54' 51.413236" W 97.9609
|
||||
NI_IG_91 54° 16' 5.582373" N 7° 22' 36.376096" W 98.6853
|
||||
NI_IG_92 54° 33' 39.572730" N 7° 24' 3.522368" W 99.4641
|
||||
NI_IG_93 54° 8' 40.056133" N 6° 23' 31.539197" W 99.1407
|
||||
NI_IG_94 54° 32' 22.992359" N 6° 38' 0.027352" W 99.3209
|
||||
NI_IG_95 54° 25' 8.916786" N 6° 15' 13.661268" W 99.4957
|
||||
NI_IG_96 55° 3' 48.824098" N 6° 21' 29.612555" W 99.9134
|
||||
NI_IG_97 55° 1' 8.330979" N 6° 34' 21.185977" W 100.5147
|
||||
NI_IG_98 55° 0' 28.104702" N 6° 34' 19.863422" W 100.9941
|
||||
NI_IG_99 54° 15' 30.603785" N 5° 36' 41.737215" W 100.8276
|
||||
NI_IG_100 54° 33' 23.096554" N 5° 49' 57.923854" W 101.4230
|
||||
@@ -0,0 +1,15 @@
|
||||
Four files are supplied to test implementations of the OSTN15/OSGM15 transformation in Great Briatin.
|
||||
|
||||
All files are comma delimited with a header line on line #1.
|
||||
|
||||
Two input files:
|
||||
1. OSTN15_OSGM15_TestInput_ETRStoOSGB.txt
|
||||
A selection of points to test the transformation from ETRS89 (latitude, longitude and height) to OSGB36 (eastings, northings and height).
|
||||
2. OSTN15_OSGM15_TestInput_OSGBtoETRS.txt
|
||||
A selection of points to test the transformation from OSGB36 (eastings, northings and height) to ETRS89 (latitude, longitude and height).
|
||||
|
||||
Two output files corresponding to the above inputs:
|
||||
1. OSTN15_OSGM15_TestOutput_ETRStoOSGB.txt
|
||||
Results of OSTN15_OSGM15_TestInput_ETRStoOSGB.txt passed through OSTN15/OSGM15. The intermediate values from the bilinear interpolation are also given.
|
||||
2. OSTN15_OSGM15_TestOutput_OSGBtoETRS.txt
|
||||
Results of OSTN15_OSGM15_TestInput_OSGBtoETRS.txt passed through OSTN15/OSGM15. The intermediate values from the bilinear interpolation are also given. The iterative steps are also given so each result usually consists of 4 lines - 3 iterative steps plus the final ETRS89 output. Results from different points are seperated by a blank line.
|
||||
@@ -0,0 +1,41 @@
|
||||
PointID,ETRS89 Latitude,ETRS Longitude,ETRS Height
|
||||
TP01,49.92226393730,-6.29977752014,100.000
|
||||
TP02,49.96006137820,-5.20304609998,124.269
|
||||
TP03,50.43885825610,-4.10864563561,215.251
|
||||
TP04,50.57563665000,-1.29782277240,94.688
|
||||
TP05,50.93127937910,-1.45051433700,100.405
|
||||
TP06,51.40078220140,-3.55128349240,112.371
|
||||
TP07,51.37447025550,1.44454730409,99.439
|
||||
TP08,51.42754743020,-2.54407618349,104.018
|
||||
TP09,51.48936564950,-0.11992557180,66.057
|
||||
TP10,51.85890896400,-4.30852476960,81.351
|
||||
TP11,51.89436637350,0.89724327012,75.274
|
||||
TP12,52.25529381630,-2.15458614387,101.526
|
||||
TP13,52.25160951230,-0.91248956970,131.594
|
||||
TP14,52.75136687170,0.40153547065,66.431
|
||||
TP15,52.96219109410,-1.19747655922,93.825
|
||||
TP16,53.34480280190,-2.64049320810,88.411
|
||||
TP17,53.41628516040,-4.28918069756,100.776
|
||||
TP18,53.41630925420,-4.28917792869,100.854
|
||||
TP19,53.77911025760,-3.04045490691,64.940
|
||||
TP20,53.80021519630,-1.66379168242,215.609
|
||||
TP21,54.08666318080,-4.63452168212,84.366
|
||||
TP22,54.11685144290,-0.07773133187,86.778
|
||||
TP23,54.32919541010,-4.38849118133,94.503
|
||||
TP24,54.89542340420,-2.93827741149,93.542
|
||||
TP25,54.97912273660,-1.61657685184,125.878
|
||||
TP26,55.85399952950,-4.29649016251,71.617
|
||||
TP27,55.92478265510,-3.29479219337,119.032
|
||||
TP28,57.00606696050,-5.82836691850,68.494
|
||||
TP29,57.13902518960,-2.04856030746,108.611
|
||||
TP30,57.48625000720,-4.21926398555,66.178
|
||||
TP31,57.81351838410,-8.57854456076,100.001
|
||||
TP32,58.21262247180,-7.59255560556,140.404
|
||||
TP33,58.51560361300,-6.26091455533,115.026
|
||||
TP34,58.58120461280,-3.72631022121,98.634
|
||||
TP35,59.03743871190,-3.21454001115,100.000
|
||||
TP36,59.09335035320,-4.41757674598,100.000
|
||||
TP37,59.09671617400,-5.82799339844,140.716
|
||||
TP38,59.53470794490,-1.62516966058,100.000
|
||||
TP39,59.85409913890,-1.27486910356,149.890
|
||||
TP40,60.13308091660,-2.07382822798,140.716
|
||||
@@ -0,0 +1,41 @@
|
||||
PointID,OSGB36 Eastings,OSGB36 Northing, Ortho Height
|
||||
TP01,91492.146,11318.804,46.519
|
||||
TP02,170370.718,11572.405,71.264
|
||||
TP03,250359.811,62016.569,163.097
|
||||
TP04,449816.371,75335.861,48.589
|
||||
TP05,438710.920,114792.250,54.056
|
||||
TP06,292184.870,168003.465,60.646
|
||||
TP07,639821.835,169565.858,55.149
|
||||
TP08,362269.991,169978.690,54.485
|
||||
TP09,530624.974,178388.464,20.544
|
||||
TP10,241124.584,220332.641,27.613
|
||||
TP11,599445.590,225722.826,30.206
|
||||
TP12,389544.190,261912.153,51.998
|
||||
TP13,474335.969,262047.755,83.982
|
||||
TP14,562180.547,319784.995,20.912
|
||||
TP15,454002.834,340834.943,45.275
|
||||
TP16,357455.843,383290.436,36.779
|
||||
TP17,247958.971,393492.909,46.335
|
||||
TP18,247959.241,393495.583,46.413
|
||||
TP19,331534.564,431920.794,12.658
|
||||
TP20,422242.186,433818.701,165.912
|
||||
TP21,227778.330,468847.388,29.335
|
||||
TP22,525745.670,470703.214,41.232
|
||||
TP23,244780.636,495254.887,39.891
|
||||
TP24,339921.145,556034.761,41.106
|
||||
TP25,424639.355,565012.703,76.574
|
||||
TP26,256340.925,664697.269,17.459
|
||||
TP27,319188.434,670947.534,66.388
|
||||
TP28,167634.202,797067.144,13.192
|
||||
TP29,397160.491,805349.736,58.932
|
||||
TP30,267056.768,846176.972,13.260
|
||||
TP31,9587.906,899449.000,42.012
|
||||
TP32,71713.131,938516.405,83.732
|
||||
TP33,151968.652,966483.780,58.921
|
||||
TP34,299721.891,967202.992,46.021
|
||||
TP35,330398.323,1017347.016,47.956
|
||||
TP36,261596.778,1025447.602,46.445
|
||||
TP37,180862.461,1029604.114,85.349
|
||||
TP38,421300.525,1072147.239,51.049
|
||||
TP39,440725.073,1107878.448,100.989
|
||||
TP40,395999.668,1138728.951,90.015
|
||||
@@ -0,0 +1,41 @@
|
||||
PointID,OSGBEast,OSGBNorth,ODNHeight,OSGBDatumFlag,RecNoS0,Se0,Sn0,Sg0,Flag0,RecNoS1,Se1,Sn1,Sg1,Flag1,RecNoS2,Se2,Sn2,Sg2,Flag2,RecNoS3,Se3,Sn3,Sg3,Flag3,Se,Sn,Sg
|
||||
TP01,91492.146,11318.804,46.519,2,7803,92.139,-81.209,53.484,2,7804,92.159,-81.196,53.475,2,8505,92.153,-81.176,53.477,2,8504,92.137,-81.187,53.487,2,92.14556,-81.19532,53.48144
|
||||
TP02,170370.718,11572.405,71.264,1,7882,93.528,-80.507,53.007,1,7883,93.535,-80.497,53.003,1,8584,93.533,-80.475,53.002,1,8583,93.526,-80.485,53.005,1,93.52863,-80.48986,53.00477
|
||||
TP03,250359.811,62016.569,163.097,1,43713,94.023,-79.322,52.159,1,43714,94.020,-79.295,52.140,1,44415,94.020,-79.297,52.142,1,44414,94.019,-79.318,52.160,1,94.02192,-79.31459,52.15407
|
||||
TP04,449816.371,75335.861,48.589,1,53025,96.942,-79.741,46.113,1,53026,96.981,-79.740,46.090,1,53727,96.977,-79.723,46.097,1,53726,96.938,-79.723,46.119,1,96.96839,-79.73310,46.09925
|
||||
TP05,438710.920,114792.250,54.056,1,80353,96.865,-78.965,46.353,1,80354,96.896,-78.943,46.330,1,81055,96.878,-78.942,46.342,1,81054,96.867,-78.938,46.364,1,96.87508,-78.94188,46.34900
|
||||
TP06,292184.870,168003.465,60.646,1,118061,94.580,-77.818,51.726,1,118062,94.581,-77.815,51.702,1,118763,94.594,-77.795,51.720,1,118762,94.593,-77.799,51.742,1,94.58115,-77.81618,51.72515
|
||||
TP07,639821.835,169565.858,55.149,1,119109,101.578,-79.979,44.302,1,119110,101.610,-79.995,44.284,1,119811,101.625,-79.957,44.285,1,119810,101.595,-79.940,44.304,1,101.61110,-79.96580,44.28986
|
||||
TP08,362269.991,169978.690,54.485,1,119533,95.577,-77.811,49.538,1,119534,95.600,-77.807,49.505,1,120235,95.630,-77.802,49.510,1,120234,95.614,-77.803,49.543,1,95.58303,-77.80988,49.53253
|
||||
TP09,530624.974,178388.464,20.544,1,125309,98.555,-78.581,45.518,1,125310,98.565,-78.588,45.500,1,126011,98.569,-78.577,45.510,1,126010,98.557,-78.571,45.528,1,98.56169,-78.57977,45.51320
|
||||
TP10,241124.584,220332.641,27.613,1,154462,93.853,-77.235,53.728,1,154463,93.859,-77.264,53.710,1,155164,93.859,-77.212,53.735,1,155163,93.853,-77.188,53.754,1,93.85318,-77.21656,53.73809
|
||||
TP11,599445.590,225722.826,30.207,1,158325,100.416,-78.692,45.069,1,158326,100.421,-78.678,45.053,1,159027,100.400,-78.660,45.058,1,159026,100.382,-78.648,45.074,1,100.39407,-78.65910,45.06748
|
||||
TP12,389544.190,261912.153,51.998,1,183351,96.151,-77.131,49.517,1,183352,96.141,-77.150,49.490,1,184053,96.148,-77.127,49.513,1,184052,96.148,-77.111,49.540,1,96.14798,-77.11840,49.52766
|
||||
TP13,474335.969,262047.755,83.982,1,184137,98.092,-77.584,47.618,1,184138,98.103,-77.570,47.589,1,184839,98.109,-77.556,47.593,1,184838,98.095,-77.561,47.622,1,98.09508,-77.57806,47.61160
|
||||
TP14,562180.547,319784.995,20.912,1,224182,100.723,-77.063,45.526,1,224183,100.744,-77.088,45.512,1,224884,100.770,-77.077,45.505,1,224883,100.743,-77.041,45.519,1,100.74233,-77.04679,45.51885
|
||||
TP15,454002.834,340834.943,45.275,1,238794,98.521,-75.815,48.582,1,238795,98.542,-75.854,48.535,1,239496,98.567,-75.796,48.547,1,239495,98.566,-75.783,48.594,1,98.56450,-75.79971,48.55043
|
||||
TP16,357455.843,383290.436,36.779,1,268841,96.158,-73.723,51.643,1,268842,96.166,-73.733,51.610,1,269543,96.163,-73.697,51.612,1,269542,96.156,-73.694,51.645,1,96.16002,-73.71512,51.63186
|
||||
TP17,247958.971,393492.909,46.335,1,275741,93.503,-73.380,54.462,1,275742,93.530,-73.374,54.449,1,276443,93.525,-73.340,54.432,1,276442,93.499,-73.346,54.444,1,93.52361,-73.35555,54.44105
|
||||
TP18,247959.241,393495.583,46.413,1,275741,93.503,-73.380,54.462,1,275742,93.530,-73.374,54.449,1,276443,93.525,-73.340,54.432,1,276442,93.499,-73.346,54.444,1,93.52361,-73.35546,54.44100
|
||||
TP19,331534.564,431920.794,12.658,1,302463,95.395,-72.187,52.294,1,302464,95.417,-72.193,52.272,1,303165,95.419,-72.156,52.270,1,303164,95.393,-72.144,52.292,1,95.40442,-72.14955,52.28235
|
||||
TP20,422242.186,433818.701,165.912,1,303956,98.484,-72.529,49.706,1,303957,98.521,-72.545,49.651,1,304658,98.541,-72.515,49.650,1,304657,98.504,-72.500,49.705,1,98.50714,-72.50533,49.69721
|
||||
TP21,227778.330,468847.388,29.335,3,328296,92.414,-70.980,55.036,3,328297,92.455,-70.980,55.013,3,328998,92.461,-70.939,55.025,3,328997,92.420,-70.941,55.047,3,92.44763,-70.94293,55.03096
|
||||
TP22,525745.670,470703.214,41.232,1,329996,102.153,-72.424,45.558,1,329997,102.180,-72.426,45.523,1,330698,102.192,-72.388,45.536,1,330697,102.165,-72.387,45.572,1,102.17968,-72.39609,45.54584
|
||||
TP23,244780.636,495254.887,39.891,3,347240,93.096,-69.758,54.643,3,347241,93.134,-69.733,54.604,3,347942,93.125,-69.682,54.591,3,347941,93.087,-69.706,54.628,3,93.11920,-69.72416,54.61176
|
||||
TP24,339921.145,556034.761,41.107,1,390096,96.519,-67.740,52.454,1,390097,96.552,-67.749,52.433,1,390798,96.553,-67.709,52.421,1,390797,96.520,-67.701,52.443,1,96.54631,-67.74334,52.43547
|
||||
TP25,424639.355,565012.703,76.574,1,396490,99.617,-67.829,49.329,1,396491,99.647,-67.833,49.283,1,397192,99.688,-67.812,49.279,1,397191,99.666,-67.810,49.325,1,99.63679,-67.82954,49.30385
|
||||
TP26,256340.925,664697.269,17.459,1,465721,93.431,-63.051,54.173,1,465722,93.465,-63.066,54.153,1,466423,93.469,-63.022,54.139,1,466422,93.430,-63.010,54.160,1,93.43960,-63.02298,54.15798
|
||||
TP27,319188.434,670947.534,66.388,1,470691,96.103,-63.096,52.647,1,470692,96.131,-63.106,52.614,1,471393,96.163,-63.098,52.581,1,471392,96.121,-63.054,52.615,1,96.10579,-63.09651,52.64361
|
||||
TP28,167634.202,797067.144,13.192,1,558865,91.376,-57.008,55.300,1,558866,91.409,-57.020,55.303,1,559567,91.428,-56.974,55.306,1,559566,91.396,-56.962,55.305,1,91.39633,-57.00880,55.30211
|
||||
TP29,397160.491,805349.736,58.933,1,564703,99.422,-58.420,49.682,1,564704,99.456,-58.429,49.657,1,565405,99.449,-58.401,49.653,1,565404,99.415,-58.393,49.677,1,99.42122,-58.40950,49.67846
|
||||
TP30,267056.768,846176.972,13.260,1,593313,95.249,-56.666,52.969,1,593314,95.287,-56.681,52.920,1,594015,95.294,-56.655,52.902,1,594014,95.253,-56.641,52.953,1,95.28714,-56.67436,52.91770
|
||||
TP31,9587.909,899448.996,42.013,15,630209,87.931,-50.965,57.985,15,630210,87.877,-50.993,57.982,15,630911,87.894,-51.034,57.992,15,630910,87.912,-50.990,57.995,15,87.90350,-50.99550,57.98850
|
||||
TP32,71713.132,938516.404,83.732,15,657610,90.649,-50.904,56.682,15,657611,90.682,-50.924,56.667,15,658312,90.702,-50.891,56.665,15,658311,90.669,-50.872,56.680,15,90.68089,-50.89794,56.67153
|
||||
TP33,151968.652,966483.780,58.921,4,677318,93.633,-51.549,56.129,4,677319,93.662,-51.566,56.108,4,678020,93.681,-51.542,56.098,4,678019,93.650,-51.525,56.119,4,93.66841,-51.55103,56.10527
|
||||
TP34,299721.891,967202.992,46.021,1,678167,97.247,-53.604,52.633,1,678168,97.272,-53.615,52.602,1,678869,97.280,-53.586,52.598,1,678868,97.255,-53.574,52.628,1,97.26467,-53.60333,52.61251
|
||||
TP35,330398.323,1017347.016,47.956,7,713248,98.317,-52.985,52.048,7,713249,98.348,-53.001,52.021,7,713950,98.342,-52.985,52.032,7,713949,98.308,-52.972,52.059,7,98.32306,-52.98424,52.04430
|
||||
TP36,261596.778,1025447.602,46.445,15,718787,96.760,-52.404,53.563,15,718788,96.776,-52.425,53.538,15,719489,96.796,-52.393,53.547,15,719488,96.781,-52.371,53.572,15,96.77825,-52.39825,53.55500
|
||||
TP37,180862.461,1029604.114,85.349,15,721510,95.603,-50.526,55.368,15,721511,95.631,-50.546,55.351,15,722212,95.650,-50.521,55.369,15,722211,95.620,-50.502,55.385,15,95.63660,-50.52512,55.36659
|
||||
TP38,421300.525,1072147.239,51.049,15,751894,100.519,-52.762,48.956,15,751895,100.547,-52.779,48.929,15,752596,100.549,-52.758,48.928,15,752595,100.522,-52.741,48.956,15,100.52516,-52.76120,48.95056
|
||||
TP39,440725.073,1107878.448,100.989,6,776448,101.452,-52.342,48.891,6,776449,101.481,-52.357,48.872,6,777150,101.492,-52.336,48.895,6,777149,101.463,-52.324,48.916,6,101.48032,-52.33286,48.90126
|
||||
TP40,395999.668,1138728.951,90.015,15,798134,101.061,-51.402,50.714,15,798135,101.082,-51.405,50.670,15,798836,101.095,-51.392,50.704,15,798835,101.073,-51.389,50.748,15,101.08994,-51.39455,50.70099
|
||||
@@ -0,0 +1,199 @@
|
||||
PointID,Iteration No./RESULT,ETRSEast/Lat,ETRSNorth/Long,ETRSHeight,OSGBDatumFlag,RecNoS0,Se0,Sn0,Sg0,Flag0,RecNoS1,Se1,Sn1,Sg1,Flag1,RecNoS2,Se2,Sn2,Sg2,Flag2,RecNoS3,Se3,Sn3,Sg3,Flag3,Se,Sn,Sg
|
||||
TP01,1,91399.9984,11399.9999,99.9994,Flag,7803,92.139,-81.209,53.484,2,7804,92.159,-81.196,53.475,2,8505,92.153,-81.176,53.477,2,8504,92.137,-81.187,53.487,2,92.1476,-81.1959,53.4804
|
||||
TP01,2,91400.0004,11399.9993,100.0004,Flag,7803,92.139,-81.209,53.484,2,7804,92.159,-81.196,53.475,2,8505,92.153,-81.176,53.477,2,8504,92.137,-81.187,53.487,2,92.1456,-81.1953,53.4814
|
||||
TP01,3,91400.0004,11399.9993,100.0004,Flag,7803,92.139,-81.209,53.484,2,7804,92.159,-81.196,53.475,2,8505,92.153,-81.176,53.477,2,8504,92.137,-81.187,53.487,2,92.1456,-81.1953,53.4814
|
||||
TP01,RESULT,49.92226393730,-6.29977752014,100.0004,2,7803,92.139,-81.209,53.484,2,7804,92.159,-81.196,53.475,2,8505,92.153,-81.176,53.477,2,8504,92.137,-81.187,53.487,2,92.1456,-81.1953,53.4814
|
||||
|
||||
TP02,1,170277.1886,11652.8957,124.2686,Flag,7882,93.528,-80.507,53.007,1,7883,93.535,-80.497,53.003,1,8584,93.533,-80.475,53.002,1,8583,93.526,-80.485,53.005,1,93.5295,-80.4907,53.0046
|
||||
TP02,2,170277.1894,11652.8949,124.2688,Flag,7882,93.528,-80.507,53.007,1,7883,93.535,-80.497,53.003,1,8584,93.533,-80.475,53.002,1,8583,93.526,-80.485,53.005,1,93.5286,-80.4899,53.0048
|
||||
TP02,RESULT,49.96006137820,-5.20304609998,124.2688,1,7882,93.528,-80.507,53.007,1,7883,93.535,-80.497,53.003,1,8584,93.533,-80.475,53.002,1,8583,93.526,-80.485,53.005,1,93.5286,-80.4899,53.0048
|
||||
|
||||
TP03,1,250265.7891,62095.8813,215.2492,Flag,43713,94.023,-79.322,52.159,1,43714,94.020,-79.295,52.140,1,44415,94.020,-79.297,52.142,1,44414,94.019,-79.318,52.160,1,94.0219,-79.3123,52.1522
|
||||
TP03,2,250265.7891,62095.8836,215.2511,Flag,43713,94.023,-79.322,52.159,1,43714,94.020,-79.295,52.140,1,44415,94.020,-79.297,52.142,1,44414,94.019,-79.318,52.160,1,94.0219,-79.3146,52.1541
|
||||
TP03,3,250265.7891,62095.8836,215.2511,Flag,43713,94.023,-79.322,52.159,1,43714,94.020,-79.295,52.140,1,44415,94.020,-79.297,52.142,1,44414,94.019,-79.318,52.160,1,94.0219,-79.3146,52.1541
|
||||
TP03,RESULT,50.43885825610,-4.10864563561,215.2511,1,43713,94.023,-79.322,52.159,1,43714,94.020,-79.295,52.140,1,44415,94.020,-79.297,52.142,1,44414,94.019,-79.318,52.160,1,94.0219,-79.3146,52.1541
|
||||
|
||||
TP04,1,449719.3985,75415.5954,94.6855,Flag,53025,96.942,-79.741,46.113,1,53026,96.981,-79.740,46.090,1,53727,96.977,-79.723,46.097,1,53726,96.938,-79.723,46.119,1,96.9725,-79.7344,46.0965
|
||||
TP04,2,449719.4026,75415.5941,94.6883,Flag,53025,96.942,-79.741,46.113,1,53026,96.981,-79.740,46.090,1,53727,96.977,-79.723,46.097,1,53726,96.938,-79.723,46.119,1,96.9684,-79.7331,46.0992
|
||||
TP04,3,449719.4026,75415.5941,94.6883,Flag,53025,96.942,-79.741,46.113,1,53026,96.981,-79.740,46.090,1,53727,96.977,-79.723,46.097,1,53726,96.938,-79.723,46.119,1,96.9684,-79.7331,46.0992
|
||||
TP04,RESULT,50.57563665000,-1.29782277240,94.6883,1,53025,96.942,-79.741,46.113,1,53026,96.981,-79.740,46.090,1,53727,96.977,-79.723,46.097,1,53726,96.938,-79.723,46.119,1,96.9684,-79.7331,46.0992
|
||||
|
||||
TP05,1,438614.0426,114871.1926,100.4019,Flag,80353,96.865,-78.965,46.353,1,80354,96.896,-78.943,46.330,1,81055,96.878,-78.942,46.342,1,81054,96.867,-78.938,46.364,1,96.8774,-78.9426,46.3459
|
||||
TP05,2,438614.0449,114871.1919,100.4050,Flag,80353,96.865,-78.965,46.353,1,80354,96.896,-78.943,46.330,1,81055,96.878,-78.942,46.342,1,81054,96.867,-78.938,46.364,1,96.8751,-78.9419,46.3490
|
||||
TP05,3,438614.0449,114871.1919,100.4050,Flag,80353,96.865,-78.965,46.353,1,80354,96.896,-78.943,46.330,1,81055,96.878,-78.942,46.342,1,81054,96.867,-78.938,46.364,1,96.8751,-78.9419,46.3490
|
||||
TP05,RESULT,50.93127937910,-1.45051433700,100.4050,1,80353,96.865,-78.965,46.353,1,80354,96.896,-78.943,46.330,1,81055,96.878,-78.942,46.342,1,81054,96.867,-78.938,46.364,1,96.8751,-78.9419,46.3490
|
||||
|
||||
TP06,1,292090.2898,168081.2824,112.3676,Flag,118061,94.580,-77.818,51.726,1,118062,94.581,-77.815,51.702,1,118763,94.594,-77.795,51.720,1,118762,94.593,-77.799,51.742,1,94.5802,-77.8174,51.7216
|
||||
TP06,2,292090.2889,168081.2812,112.3712,Flag,118061,94.580,-77.818,51.726,1,118062,94.581,-77.815,51.702,1,118763,94.594,-77.795,51.720,1,118762,94.593,-77.799,51.742,1,94.5811,-77.8162,51.7251
|
||||
TP06,3,292090.2889,168081.2812,112.3712,Flag,118061,94.580,-77.818,51.726,1,118062,94.581,-77.815,51.702,1,118763,94.594,-77.795,51.720,1,118762,94.593,-77.799,51.742,1,94.5811,-77.8162,51.7251
|
||||
TP06,RESULT,51.40078220140,-3.55128349240,112.3712,1,118061,94.580,-77.818,51.726,1,118062,94.581,-77.815,51.702,1,118763,94.594,-77.795,51.720,1,118762,94.593,-77.799,51.742,1,94.5811,-77.8162,51.7251
|
||||
|
||||
TP07,1,639720.2220,169645.8285,99.4369,Flag,119109,101.578,-79.979,44.302,1,119110,101.610,-79.995,44.284,1,119811,101.625,-79.957,44.285,1,119810,101.595,-79.940,44.304,1,101.6130,-79.9705,44.2879
|
||||
TP07,2,639720.2239,169645.8238,99.4389,Flag,119109,101.578,-79.979,44.302,1,119110,101.610,-79.995,44.284,1,119811,101.625,-79.957,44.285,1,119810,101.595,-79.940,44.304,1,101.6111,-79.9658,44.2899
|
||||
TP07,3,639720.2239,169645.8238,99.4389,Flag,119109,101.578,-79.979,44.302,1,119110,101.610,-79.995,44.284,1,119811,101.625,-79.957,44.285,1,119810,101.595,-79.940,44.304,1,101.6111,-79.9658,44.2899
|
||||
TP07,RESULT,51.37447025550,1.44454730409,99.4389,1,119109,101.578,-79.979,44.302,1,119110,101.610,-79.995,44.284,1,119811,101.625,-79.957,44.285,1,119810,101.595,-79.940,44.304,1,101.6111,-79.9658,44.2899
|
||||
|
||||
TP08,1,362174.4082,170056.5001,104.0140,Flag,118832,95.561,-77.821,49.535,1,118833,95.571,-77.814,49.501,1,119534,95.600,-77.807,49.505,1,119533,95.577,-77.811,49.538,1,95.5828,-77.8101,49.5290
|
||||
TP08,2,362174.4080,170056.4999,104.0175,Flag,119533,95.577,-77.811,49.538,1,119534,95.600,-77.807,49.505,1,120235,95.630,-77.802,49.510,1,120234,95.614,-77.803,49.543,1,95.5830,-77.8099,49.5325
|
||||
TP08,3,362174.4080,170056.4999,104.0175,Flag,119533,95.577,-77.811,49.538,1,119534,95.600,-77.807,49.505,1,120235,95.630,-77.802,49.510,1,120234,95.614,-77.803,49.543,1,95.5830,-77.8099,49.5325
|
||||
TP08,RESULT,51.42754743020,-2.54407618349,104.0175,1,119533,95.577,-77.811,49.538,1,119534,95.600,-77.807,49.505,1,120235,95.630,-77.802,49.510,1,120234,95.614,-77.803,49.543,1,95.5830,-77.8099,49.5325
|
||||
|
||||
TP09,1,530526.4115,178467.0452,66.0546,Flag,125309,98.555,-78.581,45.518,1,125310,98.565,-78.588,45.500,1,126011,98.569,-78.577,45.510,1,126010,98.557,-78.571,45.528,1,98.5625,-78.5812,45.5106
|
||||
TP09,2,530526.4123,178467.0438,66.0572,Flag,125309,98.555,-78.581,45.518,1,125310,98.565,-78.588,45.500,1,126011,98.569,-78.577,45.510,1,126010,98.557,-78.571,45.528,1,98.5617,-78.5798,45.5132
|
||||
TP09,3,530526.4123,178467.0438,66.0572,Flag,125309,98.555,-78.581,45.518,1,125310,98.565,-78.588,45.500,1,126011,98.569,-78.577,45.510,1,126010,98.557,-78.571,45.528,1,98.5617,-78.5798,45.5132
|
||||
TP09,RESULT,51.48936564950,-0.11992557180,66.0572,1,125309,98.555,-78.581,45.518,1,125310,98.565,-78.588,45.500,1,126011,98.569,-78.577,45.510,1,126010,98.557,-78.571,45.528,1,98.5617,-78.5798,45.5132
|
||||
|
||||
TP10,1,241030.7303,220409.8638,81.3474,Flag,154462,93.853,-77.235,53.728,1,154463,93.859,-77.264,53.710,1,155164,93.859,-77.212,53.735,1,155163,93.853,-77.188,53.754,1,93.8537,-77.2228,53.7344
|
||||
TP10,2,241030.7308,220409.8576,81.3511,Flag,154462,93.853,-77.235,53.728,1,154463,93.859,-77.264,53.710,1,155164,93.859,-77.212,53.735,1,155163,93.853,-77.188,53.754,1,93.8532,-77.2166,53.7381
|
||||
TP10,3,241030.7308,220409.8576,81.3511,Flag,154462,93.853,-77.235,53.728,1,154463,93.859,-77.264,53.710,1,155164,93.859,-77.212,53.735,1,155163,93.853,-77.188,53.754,1,93.8532,-77.2166,53.7381
|
||||
TP10,RESULT,51.85890896400,-4.30852476960,81.3511,1,154462,93.853,-77.235,53.728,1,154463,93.859,-77.264,53.710,1,155164,93.859,-77.212,53.735,1,155163,93.853,-77.188,53.754,1,93.8532,-77.2166,53.7381
|
||||
|
||||
TP11,1,599345.1922,225801.4883,75.2715,Flag,158325,100.416,-78.692,45.069,1,158326,100.421,-78.678,45.053,1,159027,100.400,-78.660,45.058,1,159026,100.382,-78.648,45.074,1,100.3978,-78.6623,45.0655
|
||||
TP11,2,599345.1959,225801.4851,75.2735,Flag,158325,100.416,-78.692,45.069,1,158326,100.421,-78.678,45.053,1,159027,100.400,-78.660,45.058,1,159026,100.382,-78.648,45.074,1,100.3941,-78.6591,45.0675
|
||||
TP11,3,599345.1959,225801.4851,75.2735,Flag,158325,100.416,-78.692,45.069,1,158326,100.421,-78.678,45.053,1,159027,100.400,-78.660,45.058,1,159026,100.382,-78.648,45.074,1,100.3941,-78.6591,45.0675
|
||||
TP11,RESULT,51.89436637350,0.89724327012,75.2735,1,158325,100.416,-78.692,45.069,1,158326,100.421,-78.678,45.053,1,159027,100.400,-78.660,45.058,1,159026,100.382,-78.648,45.074,1,100.3941,-78.6591,45.0675
|
||||
|
||||
TP12,1,389448.0422,261989.2746,101.5213,Flag,183351,96.151,-77.131,49.517,1,183352,96.141,-77.150,49.490,1,184053,96.148,-77.127,49.513,1,184052,96.148,-77.111,49.540,1,96.1478,-77.1216,49.5233
|
||||
TP12,2,389448.0420,261989.2714,101.5257,Flag,183351,96.151,-77.131,49.517,1,183352,96.141,-77.150,49.490,1,184053,96.148,-77.127,49.513,1,184052,96.148,-77.111,49.540,1,96.1480,-77.1184,49.5277
|
||||
TP12,3,389448.0420,261989.2714,101.5257,Flag,183351,96.151,-77.131,49.517,1,183352,96.141,-77.150,49.490,1,184053,96.148,-77.127,49.513,1,184052,96.148,-77.111,49.540,1,96.1480,-77.1184,49.5277
|
||||
TP12,RESULT,52.25529381630,-2.15458614387,101.5257,1,183351,96.151,-77.131,49.517,1,183352,96.141,-77.150,49.490,1,184053,96.148,-77.127,49.513,1,184052,96.148,-77.111,49.540,1,96.1480,-77.1184,49.5277
|
||||
|
||||
TP13,1,474237.8731,262125.3333,131.5905,Flag,184137,98.092,-77.584,47.618,1,184138,98.103,-77.570,47.589,1,184839,98.109,-77.556,47.593,1,184838,98.095,-77.561,47.622,1,98.0959,-77.5783,47.6084
|
||||
TP13,2,474237.8739,262125.3331,131.5936,Flag,184137,98.092,-77.584,47.618,1,184138,98.103,-77.570,47.589,1,184839,98.109,-77.556,47.593,1,184838,98.095,-77.561,47.622,1,98.0951,-77.5781,47.6116
|
||||
TP13,3,474237.8739,262125.3331,131.5936,Flag,184137,98.092,-77.584,47.618,1,184138,98.103,-77.570,47.589,1,184839,98.109,-77.556,47.593,1,184838,98.095,-77.561,47.622,1,98.0951,-77.5781,47.6116
|
||||
TP13,RESULT,52.25160951230,-0.91248956970,131.5936,1,184137,98.092,-77.584,47.618,1,184138,98.103,-77.570,47.589,1,184839,98.109,-77.556,47.593,1,184838,98.095,-77.561,47.622,1,98.0951,-77.5781,47.6116
|
||||
|
||||
TP14,1,562079.8037,319862.0468,66.4300,Flag,224182,100.723,-77.063,45.526,1,224183,100.744,-77.088,45.512,1,224884,100.770,-77.077,45.505,1,224883,100.743,-77.041,45.519,1,100.7433,-77.0518,45.5180
|
||||
TP14,2,562079.8047,319862.0418,66.4309,Flag,224182,100.723,-77.063,45.526,1,224183,100.744,-77.088,45.512,1,224884,100.770,-77.077,45.505,1,224883,100.743,-77.041,45.519,1,100.7423,-77.0468,45.5188
|
||||
TP14,3,562079.8047,319862.0418,66.4309,Flag,224182,100.723,-77.063,45.526,1,224183,100.744,-77.088,45.512,1,224884,100.770,-77.077,45.505,1,224883,100.743,-77.041,45.519,1,100.7423,-77.0468,45.5188
|
||||
TP14,RESULT,52.75136687170,0.40153547065,66.4309,1,224182,100.723,-77.063,45.526,1,224183,100.744,-77.088,45.512,1,224884,100.770,-77.077,45.505,1,224883,100.743,-77.041,45.519,1,100.7423,-77.0468,45.5188
|
||||
|
||||
TP15,1,453904.2712,340910.7486,93.8199,Flag,238795,98.542,-75.854,48.535,1,238796,98.540,-75.862,48.489,1,239497,98.556,-75.792,48.499,1,239496,98.567,-75.796,48.547,1,98.5628,-75.8056,48.5449
|
||||
TP15,2,453904.2695,340910.7427,93.8254,Flag,238794,98.521,-75.815,48.582,1,238795,98.542,-75.854,48.535,1,239496,98.567,-75.796,48.547,1,239495,98.566,-75.783,48.594,1,98.5645,-75.7997,48.5504
|
||||
TP15,3,453904.2695,340910.7427,93.8254,Flag,238794,98.521,-75.815,48.582,1,238795,98.542,-75.854,48.535,1,239496,98.567,-75.796,48.547,1,239495,98.566,-75.783,48.594,1,98.5645,-75.7997,48.5504
|
||||
TP15,RESULT,52.96219109410,-1.19747655922,93.8254,1,238794,98.521,-75.815,48.582,1,238795,98.542,-75.854,48.535,1,239496,98.567,-75.796,48.547,1,239495,98.566,-75.783,48.594,1,98.5645,-75.7997,48.5504
|
||||
|
||||
TP16,1,357359.6821,383364.1542,88.4075,Flag,268841,96.158,-73.723,51.643,1,268842,96.166,-73.733,51.610,1,269543,96.163,-73.697,51.612,1,269542,96.156,-73.694,51.645,1,96.1609,-73.7182,51.6285
|
||||
TP16,2,357359.6830,383364.1511,88.4109,Flag,268841,96.158,-73.723,51.643,1,268842,96.166,-73.733,51.610,1,269543,96.163,-73.697,51.612,1,269542,96.156,-73.694,51.645,1,96.1600,-73.7151,51.6319
|
||||
TP16,3,357359.6830,383364.1511,88.4109,Flag,268841,96.158,-73.723,51.643,1,268842,96.166,-73.733,51.610,1,269543,96.163,-73.697,51.612,1,269542,96.156,-73.694,51.645,1,96.1600,-73.7151,51.6319
|
||||
TP16,RESULT,53.34480280190,-2.64049320810,88.4109,1,268841,96.158,-73.723,51.643,1,268842,96.166,-73.733,51.610,1,269543,96.163,-73.697,51.612,1,269542,96.156,-73.694,51.645,1,96.1600,-73.7151,51.6319
|
||||
|
||||
TP17,1,247865.4446,393566.2665,100.7761,Flag,275741,93.503,-73.380,54.462,1,275742,93.530,-73.374,54.449,1,276443,93.525,-73.340,54.432,1,276442,93.499,-73.346,54.444,1,93.5264,-73.3575,54.4411
|
||||
TP17,2,247865.4474,393566.2646,100.7761,Flag,275741,93.503,-73.380,54.462,1,275742,93.530,-73.374,54.449,1,276443,93.525,-73.340,54.432,1,276442,93.499,-73.346,54.444,1,93.5236,-73.3556,54.4410
|
||||
TP17,3,247865.4474,393566.2646,100.7761,Flag,275741,93.503,-73.380,54.462,1,275742,93.530,-73.374,54.449,1,276443,93.525,-73.340,54.432,1,276442,93.499,-73.346,54.444,1,93.5236,-73.3556,54.4410
|
||||
TP17,RESULT,53.41628516040,-4.28918069756,100.7761,1,275741,93.503,-73.380,54.462,1,275742,93.530,-73.374,54.449,1,276443,93.525,-73.340,54.432,1,276442,93.499,-73.346,54.444,1,93.5236,-73.3556,54.4410
|
||||
|
||||
TP18,1,247865.7146,393568.9404,100.8541,Flag,275741,93.503,-73.380,54.462,1,275742,93.530,-73.374,54.449,1,276443,93.525,-73.340,54.432,1,276442,93.499,-73.346,54.444,1,93.5264,-73.3574,54.4411
|
||||
TP18,2,247865.7174,393568.9385,100.8540,Flag,275741,93.503,-73.380,54.462,1,275742,93.530,-73.374,54.449,1,276443,93.525,-73.340,54.432,1,276442,93.499,-73.346,54.444,1,93.5236,-73.3555,54.4410
|
||||
TP18,3,247865.7174,393568.9385,100.8540,Flag,275741,93.503,-73.380,54.462,1,275742,93.530,-73.374,54.449,1,276443,93.525,-73.340,54.432,1,276442,93.499,-73.346,54.444,1,93.5236,-73.3555,54.4410
|
||||
TP18,RESULT,53.41630925420,-4.28917792869,100.8540,1,275741,93.503,-73.380,54.462,1,275742,93.530,-73.374,54.449,1,276443,93.525,-73.340,54.432,1,276442,93.499,-73.346,54.444,1,93.5236,-73.3555,54.4410
|
||||
|
||||
TP19,1,331439.1571,431992.9476,64.9384,Flag,302463,95.395,-72.187,52.294,1,302464,95.417,-72.193,52.272,1,303165,95.419,-72.156,52.270,1,303164,95.393,-72.144,52.292,1,95.4069,-72.1536,52.2804
|
||||
TP19,2,331439.1596,431992.9436,64.9404,Flag,302463,95.395,-72.187,52.294,1,302464,95.417,-72.193,52.272,1,303165,95.419,-72.156,52.270,1,303164,95.393,-72.144,52.292,1,95.4044,-72.1496,52.2824
|
||||
TP19,3,331439.1596,431992.9436,64.9404,Flag,302463,95.395,-72.187,52.294,1,302464,95.417,-72.193,52.272,1,303165,95.419,-72.156,52.270,1,303164,95.393,-72.144,52.292,1,95.4044,-72.1496,52.2824
|
||||
TP19,RESULT,53.77911025760,-3.04045490691,64.9404,1,302463,95.395,-72.187,52.294,1,302464,95.417,-72.193,52.272,1,303165,95.419,-72.156,52.270,1,303164,95.393,-72.144,52.292,1,95.4044,-72.1496,52.2824
|
||||
|
||||
TP20,1,422143.6767,433891.2099,215.6039,Flag,303956,98.484,-72.529,49.706,1,303957,98.521,-72.545,49.651,1,304658,98.541,-72.515,49.650,1,304657,98.504,-72.500,49.705,1,98.5093,-72.5089,49.6919
|
||||
TP20,2,422143.6789,433891.2063,215.6092,Flag,303956,98.484,-72.529,49.706,1,303957,98.521,-72.545,49.651,1,304658,98.541,-72.515,49.650,1,304657,98.504,-72.500,49.705,1,98.5071,-72.5053,49.6972
|
||||
TP20,3,422143.6789,433891.2063,215.6092,Flag,303956,98.484,-72.529,49.706,1,303957,98.521,-72.545,49.651,1,304658,98.541,-72.515,49.650,1,304657,98.504,-72.500,49.705,1,98.5071,-72.5053,49.6972
|
||||
TP20,RESULT,53.80021519630,-1.66379168242,215.6092,1,303956,98.484,-72.529,49.706,1,303957,98.521,-72.545,49.651,1,304658,98.541,-72.515,49.650,1,304657,98.504,-72.500,49.705,1,98.5071,-72.5053,49.6972
|
||||
|
||||
TP21,1,227685.8790,468918.3336,84.3631,Flag,328296,92.414,-70.980,55.036,3,328297,92.455,-70.980,55.013,3,328998,92.461,-70.939,55.025,3,328997,92.420,-70.941,55.047,3,92.4510,-70.9456,55.0281
|
||||
TP21,2,227685.8824,468918.3309,84.3660,Flag,328296,92.414,-70.980,55.036,3,328297,92.455,-70.980,55.013,3,328998,92.461,-70.939,55.025,3,328997,92.420,-70.941,55.047,3,92.4476,-70.9429,55.0310
|
||||
TP21,3,227685.8824,468918.3309,84.3660,Flag,328296,92.414,-70.980,55.036,3,328297,92.455,-70.980,55.013,3,328998,92.461,-70.939,55.025,3,328997,92.420,-70.941,55.047,3,92.4476,-70.9429,55.0310
|
||||
TP21,RESULT,54.08666318080,-4.63452168212,84.3660,3,328296,92.414,-70.980,55.036,3,328297,92.455,-70.980,55.013,3,328998,92.461,-70.939,55.025,3,328997,92.420,-70.941,55.047,3,92.4476,-70.9429,55.0310
|
||||
|
||||
TP22,1,525643.4884,470775.6129,86.7732,Flag,329996,102.153,-72.424,45.558,1,329997,102.180,-72.426,45.523,1,330698,102.192,-72.388,45.536,1,330697,102.165,-72.387,45.572,1,102.1816,-72.3989,45.5412
|
||||
TP22,2,525643.4903,470775.6101,86.7778,Flag,329996,102.153,-72.424,45.558,1,329997,102.180,-72.426,45.523,1,330698,102.192,-72.388,45.536,1,330697,102.165,-72.387,45.572,1,102.1797,-72.3961,45.5458
|
||||
TP22,3,525643.4903,470775.6101,86.7778,Flag,329996,102.153,-72.424,45.558,1,329997,102.180,-72.426,45.523,1,330698,102.192,-72.388,45.536,1,330697,102.165,-72.387,45.572,1,102.1797,-72.3961,45.5458
|
||||
TP22,RESULT,54.11685144290,-0.07773133187,86.7778,1,329996,102.153,-72.424,45.558,1,329997,102.180,-72.426,45.523,1,330698,102.192,-72.388,45.536,1,330697,102.165,-72.387,45.572,1,102.1797,-72.3961,45.5458
|
||||
|
||||
TP23,1,244687.5126,495324.6124,94.5001,Flag,347240,93.096,-69.758,54.643,3,347241,93.134,-69.733,54.604,3,347942,93.125,-69.682,54.591,3,347941,93.087,-69.706,54.628,3,93.1234,-69.7254,54.6091
|
||||
TP23,2,244687.5168,495324.6112,94.5028,Flag,347240,93.096,-69.758,54.643,3,347241,93.134,-69.733,54.604,3,347942,93.125,-69.682,54.591,3,347941,93.087,-69.706,54.628,3,93.1192,-69.7242,54.6118
|
||||
TP23,3,244687.5168,495324.6112,94.5028,Flag,347240,93.096,-69.758,54.643,3,347241,93.134,-69.733,54.604,3,347942,93.125,-69.682,54.591,3,347941,93.087,-69.706,54.628,3,93.1192,-69.7242,54.6118
|
||||
TP23,RESULT,54.32919541010,-4.38849118133,94.5028,3,347240,93.096,-69.758,54.643,3,347241,93.134,-69.733,54.604,3,347942,93.125,-69.682,54.591,3,347941,93.087,-69.706,54.628,3,93.1192,-69.7242,54.6118
|
||||
|
||||
TP24,1,339824.5956,556102.5079,93.5402,Flag,390096,96.519,-67.740,52.454,1,390097,96.552,-67.749,52.433,1,390798,96.553,-67.709,52.421,1,390797,96.520,-67.701,52.443,1,96.5494,-67.7469,52.4342
|
||||
TP24,2,339824.5987,556102.5043,93.5415,Flag,390096,96.519,-67.740,52.454,1,390097,96.552,-67.749,52.433,1,390798,96.553,-67.709,52.421,1,390797,96.520,-67.701,52.443,1,96.5463,-67.7433,52.4355
|
||||
TP24,3,339824.5987,556102.5043,93.5415,Flag,390096,96.519,-67.740,52.454,1,390097,96.552,-67.749,52.433,1,390798,96.553,-67.709,52.421,1,390797,96.520,-67.701,52.443,1,96.5463,-67.7433,52.4355
|
||||
TP24,RESULT,54.89542340420,-2.93827741149,93.5415,1,390096,96.519,-67.740,52.454,1,390097,96.552,-67.749,52.433,1,390798,96.553,-67.709,52.421,1,390797,96.520,-67.701,52.443,1,96.5463,-67.7433,52.4355
|
||||
|
||||
TP25,1,424539.7183,565080.5343,125.8735,Flag,396490,99.617,-67.829,49.329,1,396491,99.647,-67.833,49.283,1,397192,99.688,-67.812,49.279,1,397191,99.666,-67.810,49.325,1,99.6367,-67.8313,49.2995
|
||||
TP25,2,424539.7182,565080.5325,125.8779,Flag,396490,99.617,-67.829,49.329,1,396491,99.647,-67.833,49.283,1,397192,99.688,-67.812,49.279,1,397191,99.666,-67.810,49.325,1,99.6368,-67.8295,49.3039
|
||||
TP25,3,424539.7182,565080.5325,125.8779,Flag,396490,99.617,-67.829,49.329,1,396491,99.647,-67.833,49.283,1,397192,99.688,-67.812,49.279,1,397191,99.666,-67.810,49.325,1,99.6368,-67.8295,49.3039
|
||||
TP25,RESULT,54.97912273660,-1.61657685184,125.8779,1,396490,99.617,-67.829,49.329,1,396491,99.647,-67.833,49.283,1,397192,99.688,-67.812,49.279,1,397191,99.666,-67.810,49.325,1,99.6368,-67.8295,49.3039
|
||||
|
||||
TP26,1,256247.4819,664760.2958,71.6159,Flag,465721,93.431,-63.051,54.173,1,465722,93.465,-63.066,54.153,1,466423,93.469,-63.022,54.139,1,466422,93.430,-63.010,54.160,1,93.4431,-63.0268,54.1569
|
||||
TP26,2,256247.4854,664760.2920,71.6170,Flag,465721,93.431,-63.051,54.173,1,465722,93.465,-63.066,54.153,1,466423,93.469,-63.022,54.139,1,466422,93.430,-63.010,54.160,1,93.4396,-63.0230,54.1580
|
||||
TP26,3,256247.4854,664760.2920,71.6170,Flag,465721,93.431,-63.051,54.173,1,465722,93.465,-63.066,54.153,1,466423,93.469,-63.022,54.139,1,466422,93.430,-63.010,54.160,1,93.4396,-63.0230,54.1580
|
||||
TP26,RESULT,55.85399952950,-4.29649016251,71.6170,1,465721,93.431,-63.051,54.173,1,465722,93.465,-63.066,54.153,1,466423,93.469,-63.022,54.139,1,466422,93.430,-63.010,54.160,1,93.4396,-63.0230,54.1580
|
||||
|
||||
TP27,1,319092.3265,671010.6345,119.0307,Flag,469990,96.086,-63.148,52.684,1,469991,96.124,-63.151,52.651,1,470692,96.131,-63.106,52.614,1,470691,96.103,-63.096,52.647,1,96.1075,-63.1005,52.6427
|
||||
TP27,2,319092.3282,671010.6305,119.0316,Flag,470691,96.103,-63.096,52.647,1,470692,96.131,-63.106,52.614,1,471393,96.163,-63.098,52.581,1,471392,96.121,-63.054,52.615,1,96.1058,-63.0965,52.6436
|
||||
TP27,3,319092.3282,671010.6305,119.0316,Flag,470691,96.103,-63.096,52.647,1,470692,96.131,-63.106,52.614,1,471393,96.163,-63.098,52.581,1,471392,96.121,-63.054,52.615,1,96.1058,-63.0965,52.6436
|
||||
TP27,RESULT,55.92478265510,-3.29479219337,119.0316,1,470691,96.103,-63.096,52.647,1,470692,96.131,-63.106,52.614,1,471393,96.163,-63.098,52.581,1,471392,96.121,-63.054,52.615,1,96.1058,-63.0965,52.6436
|
||||
|
||||
TP28,1,167542.8038,797124.1565,68.4942,Flag,558865,91.376,-57.008,55.300,1,558866,91.409,-57.020,55.303,1,559567,91.428,-56.974,55.306,1,559566,91.396,-56.962,55.305,1,91.3982,-57.0125,55.3022
|
||||
TP28,2,167542.8057,797124.1528,68.4941,Flag,558865,91.376,-57.008,55.300,1,558866,91.409,-57.020,55.303,1,559567,91.428,-56.974,55.306,1,559566,91.396,-56.962,55.305,1,91.3963,-57.0088,55.3021
|
||||
TP28,3,167542.8057,797124.1528,68.4941,Flag,558865,91.376,-57.008,55.300,1,558866,91.409,-57.020,55.303,1,559567,91.428,-56.974,55.306,1,559566,91.396,-56.962,55.305,1,91.3963,-57.0088,55.3021
|
||||
TP28,RESULT,57.00606696050,-5.82836691850,68.4941,1,558865,91.376,-57.008,55.300,1,558866,91.409,-57.020,55.303,1,559567,91.428,-56.974,55.306,1,559566,91.396,-56.962,55.305,1,91.3963,-57.0088,55.3021
|
||||
|
||||
TP29,1,397061.0660,805408.1479,108.6083,Flag,564703,99.422,-58.420,49.682,1,564704,99.456,-58.429,49.657,1,565405,99.449,-58.401,49.653,1,565404,99.415,-58.393,49.677,1,99.4250,-58.4119,49.6763
|
||||
TP29,2,397061.0698,805408.1455,108.6105,Flag,564703,99.422,-58.420,49.682,1,564704,99.456,-58.429,49.657,1,565405,99.449,-58.401,49.653,1,565404,99.415,-58.393,49.677,1,99.4212,-58.4095,49.6785
|
||||
TP29,3,397061.0698,805408.1455,108.6105,Flag,564703,99.422,-58.420,49.682,1,564704,99.456,-58.429,49.657,1,565405,99.449,-58.401,49.653,1,565404,99.415,-58.393,49.677,1,99.4212,-58.4095,49.6785
|
||||
TP29,RESULT,57.13902518960,-2.04856030746,108.6105,1,564703,99.422,-58.420,49.682,1,564704,99.456,-58.429,49.657,1,565405,99.449,-58.401,49.653,1,565404,99.415,-58.393,49.677,1,99.4212,-58.4095,49.6785
|
||||
|
||||
TP30,1,266961.4775,846233.6493,66.1742,Flag,593314,95.287,-56.681,52.920,1,593315,95.327,-56.696,52.875,1,594016,95.334,-56.671,52.854,1,594015,95.294,-56.655,52.902,1,95.2905,-56.6773,52.9142
|
||||
TP30,2,266961.4809,846233.6464,66.1777,Flag,593313,95.249,-56.666,52.969,1,593314,95.287,-56.681,52.920,1,594015,95.294,-56.655,52.902,1,594014,95.253,-56.641,52.953,1,95.2871,-56.6744,52.9177
|
||||
TP30,3,266961.4809,846233.6464,66.1777,Flag,593313,95.249,-56.666,52.969,1,593314,95.287,-56.681,52.920,1,594015,95.294,-56.655,52.902,1,594014,95.253,-56.641,52.953,1,95.2871,-56.6744,52.9177
|
||||
TP30,RESULT,57.48625000720,-4.21926398555,66.1777,1,593313,95.249,-56.666,52.969,1,593314,95.287,-56.681,52.920,1,594015,95.294,-56.655,52.902,1,594014,95.253,-56.641,52.953,1,95.2871,-56.6744,52.9177
|
||||
|
||||
TP31,1,9500.0058,899499.9969,99.9997,Flag,630209,87.931,-50.965,57.985,15,630210,87.877,-50.993,57.982,15,630911,87.894,-51.034,57.992,15,630910,87.912,-50.990,57.995,15,87.9002,-50.9969,57.9877
|
||||
TP31,2,9500.0025,899499.9955,100.0005,Flag,630209,87.931,-50.965,57.985,15,630210,87.877,-50.993,57.982,15,630911,87.894,-51.034,57.992,15,630910,87.912,-50.990,57.995,15,87.9035,-50.9955,57.9885
|
||||
TP31,3,9500.0025,899499.9955,100.0005,Flag,630209,87.931,-50.965,57.985,15,630210,87.877,-50.993,57.982,15,630911,87.894,-51.034,57.992,15,630910,87.912,-50.990,57.995,15,87.9035,-50.9955,57.9885
|
||||
TP31,RESULT,57.81351838410,-8.57854456076,100.0005,15,630209,87.931,-50.965,57.985,15,630210,87.877,-50.993,57.982,15,630911,87.894,-51.034,57.992,15,630910,87.912,-50.990,57.995,15,87.9035,-50.9955,57.9885
|
||||
|
||||
TP32,1,71622.4481,938567.3064,140.4023,Flag,657610,90.649,-50.904,56.682,15,657611,90.682,-50.924,56.667,15,658312,90.702,-50.891,56.665,15,658311,90.669,-50.872,56.680,15,90.6829,-50.9014,56.6703
|
||||
TP32,2,71622.4501,938567.3029,140.4035,Flag,657610,90.649,-50.904,56.682,15,657611,90.682,-50.924,56.667,15,658312,90.702,-50.891,56.665,15,658311,90.669,-50.872,56.680,15,90.6809,-50.8979,56.6715
|
||||
TP32,3,71622.4501,938567.3029,140.4035,Flag,657610,90.649,-50.904,56.682,15,657611,90.682,-50.924,56.667,15,658312,90.702,-50.891,56.665,15,658311,90.669,-50.872,56.680,15,90.6809,-50.8979,56.6715
|
||||
TP32,RESULT,58.21262247180,-7.59255560556,140.4035,15,657610,90.649,-50.904,56.682,15,657611,90.682,-50.924,56.667,15,658312,90.702,-50.891,56.665,15,658311,90.669,-50.872,56.680,15,90.6809,-50.8979,56.6715
|
||||
|
||||
TP33,1,151874.9817,966535.3339,115.0248,Flag,677318,93.633,-51.549,56.129,4,677319,93.662,-51.566,56.108,4,678020,93.681,-51.542,56.098,4,678019,93.650,-51.525,56.119,4,93.6703,-51.5539,56.1038
|
||||
TP33,2,151874.9836,966535.3310,115.0263,Flag,677318,93.633,-51.549,56.129,4,677319,93.662,-51.566,56.108,4,678020,93.681,-51.542,56.098,4,678019,93.650,-51.525,56.119,4,93.6684,-51.5510,56.1053
|
||||
TP33,3,151874.9836,966535.3310,115.0263,Flag,677318,93.633,-51.549,56.129,4,677319,93.662,-51.566,56.108,4,678020,93.681,-51.542,56.098,4,678019,93.650,-51.525,56.119,4,93.6684,-51.5510,56.1053
|
||||
TP33,RESULT,58.51560361300,-6.26091455533,115.0263,4,677318,93.633,-51.549,56.129,4,677319,93.662,-51.566,56.108,4,678020,93.681,-51.542,56.098,4,678019,93.650,-51.525,56.119,4,93.6684,-51.5510,56.1053
|
||||
|
||||
TP34,1,299624.6243,967256.5980,98.6308,Flag,678167,97.247,-53.604,52.633,1,678168,97.272,-53.615,52.602,1,678869,97.280,-53.586,52.598,1,678868,97.255,-53.574,52.628,1,97.2667,-53.6060,52.6098
|
||||
TP34,2,299624.6263,967256.5953,98.6335,Flag,678167,97.247,-53.604,52.633,1,678168,97.272,-53.615,52.602,1,678869,97.280,-53.586,52.598,1,678868,97.255,-53.574,52.628,1,97.2647,-53.6033,52.6125
|
||||
TP34,3,299624.6263,967256.5953,98.6335,Flag,678167,97.247,-53.604,52.633,1,678168,97.272,-53.615,52.602,1,678869,97.280,-53.586,52.598,1,678868,97.255,-53.574,52.628,1,97.2647,-53.6033,52.6125
|
||||
TP34,RESULT,58.58120461280,-3.72631022121,98.6335,1,678167,97.247,-53.604,52.633,1,678168,97.272,-53.615,52.602,1,678869,97.280,-53.586,52.598,1,678868,97.255,-53.574,52.628,1,97.2647,-53.6033,52.6125
|
||||
|
||||
TP35,1,330299.9964,1017400.0025,99.9971,Flag,713248,98.317,-52.985,52.048,7,713249,98.348,-53.001,52.021,7,713950,98.342,-52.985,52.032,7,713949,98.308,-52.972,52.059,7,98.3266,-52.9864,52.0411
|
||||
TP35,2,330299.9999,1017400.0002,100.0003,Flag,713248,98.317,-52.985,52.048,7,713249,98.348,-53.001,52.021,7,713950,98.342,-52.985,52.032,7,713949,98.308,-52.972,52.059,7,98.3231,-52.9842,52.0443
|
||||
TP35,3,330299.9999,1017400.0002,100.0003,Flag,713248,98.317,-52.985,52.048,7,713249,98.348,-53.001,52.021,7,713950,98.342,-52.985,52.032,7,713949,98.308,-52.972,52.059,7,98.3231,-52.9842,52.0443
|
||||
TP35,RESULT,59.03743871190,-3.21454001115,100.0003,7,713248,98.317,-52.985,52.048,7,713249,98.348,-53.001,52.021,7,713950,98.342,-52.985,52.032,7,713949,98.308,-52.972,52.059,7,98.3231,-52.9842,52.0443
|
||||
|
||||
TP36,1,261499.9993,1025500.0040,99.9971,Flag,718787,96.760,-52.404,53.563,15,718788,96.776,-52.425,53.538,15,719489,96.796,-52.393,53.547,15,719488,96.781,-52.371,53.572,15,96.7787,-52.4020,53.5521
|
||||
TP36,2,261499.9998,1025500.0003,100.0000,Flag,718787,96.760,-52.404,53.563,15,718788,96.776,-52.425,53.538,15,719489,96.796,-52.393,53.547,15,719488,96.781,-52.371,53.572,15,96.7783,-52.3982,53.5550
|
||||
TP36,3,261499.9998,1025500.0003,100.0000,Flag,718787,96.760,-52.404,53.563,15,718788,96.776,-52.425,53.538,15,719489,96.796,-52.393,53.547,15,719488,96.781,-52.371,53.572,15,96.7783,-52.3982,53.5550
|
||||
TP36,RESULT,59.09335035320,-4.41757674598,100.0000,15,718787,96.760,-52.404,53.563,15,718788,96.776,-52.425,53.538,15,719489,96.796,-52.393,53.547,15,719488,96.781,-52.371,53.572,15,96.7783,-52.3982,53.5550
|
||||
|
||||
TP37,1,180766.8225,1029654.6422,140.7131,Flag,721510,95.603,-50.526,55.368,15,721511,95.631,-50.546,55.351,15,722212,95.650,-50.521,55.369,15,722211,95.620,-50.502,55.385,15,95.6385,-50.5282,55.3641
|
||||
TP37,2,180766.8244,1029654.6391,140.7156,Flag,721510,95.603,-50.526,55.368,15,721511,95.631,-50.546,55.351,15,722212,95.650,-50.521,55.369,15,722211,95.620,-50.502,55.385,15,95.6366,-50.5251,55.3666
|
||||
TP37,3,180766.8244,1029654.6391,140.7156,Flag,721510,95.603,-50.526,55.368,15,721511,95.631,-50.546,55.351,15,722212,95.650,-50.521,55.369,15,722211,95.620,-50.502,55.385,15,95.6366,-50.5251,55.3666
|
||||
TP37,RESULT,59.09671617400,-5.82799339844,140.7156,15,721510,95.603,-50.526,55.368,15,721511,95.631,-50.546,55.351,15,722212,95.650,-50.521,55.369,15,722211,95.620,-50.502,55.385,15,95.6366,-50.5251,55.3666
|
||||
|
||||
TP38,1,421199.9972,1072200.0030,99.9968,Flag,751894,100.519,-52.762,48.956,15,751895,100.547,-52.779,48.929,15,752596,100.549,-52.758,48.928,15,752595,100.522,-52.741,48.956,15,100.5278,-52.7640,48.9478
|
||||
TP38,2,421199.9998,1072200.0002,99.9996,Flag,751894,100.519,-52.762,48.956,15,751895,100.547,-52.779,48.929,15,752596,100.549,-52.758,48.928,15,752595,100.522,-52.741,48.956,15,100.5252,-52.7612,48.9506
|
||||
TP38,3,421199.9998,1072200.0002,99.9996,Flag,751894,100.519,-52.762,48.956,15,751895,100.547,-52.779,48.929,15,752596,100.549,-52.758,48.928,15,752595,100.522,-52.741,48.956,15,100.5252,-52.7612,48.9506
|
||||
TP38,RESULT,59.53470794490,-1.62516966058,99.9996,15,751894,100.519,-52.762,48.956,15,751895,100.547,-52.779,48.929,15,752596,100.549,-52.758,48.928,15,752595,100.522,-52.741,48.956,15,100.5252,-52.7612,48.9506
|
||||
|
||||
TP39,1,440623.5903,1107930.7832,149.8869,Flag,776448,101.452,-52.342,48.891,6,776449,101.481,-52.357,48.872,6,777150,101.492,-52.336,48.895,6,777149,101.463,-52.324,48.916,6,101.4827,-52.3352,48.8979
|
||||
TP39,2,440623.5927,1107930.7809,149.8903,Flag,776448,101.452,-52.342,48.891,6,776449,101.481,-52.357,48.872,6,777150,101.492,-52.336,48.895,6,777149,101.463,-52.324,48.916,6,101.4803,-52.3329,48.9013
|
||||
TP39,3,440623.5927,1107930.7809,149.8903,Flag,776448,101.452,-52.342,48.891,6,776449,101.481,-52.357,48.872,6,777150,101.492,-52.336,48.895,6,777149,101.463,-52.324,48.916,6,101.4803,-52.3329,48.9013
|
||||
TP39,RESULT,59.85409913890,-1.27486910356,149.8903,6,776448,101.452,-52.342,48.891,6,776449,101.481,-52.357,48.872,6,777150,101.492,-52.336,48.895,6,777149,101.463,-52.324,48.916,6,101.4803,-52.3329,48.9013
|
||||
|
||||
TP40,1,395898.5765,1138780.3465,140.7098,Flag,798134,101.061,-51.402,50.714,15,798135,101.082,-51.405,50.670,15,798836,101.095,-51.392,50.704,15,798835,101.073,-51.389,50.748,15,101.0915,-51.3955,50.6948
|
||||
TP40,2,395898.5781,1138780.3456,140.7160,Flag,798134,101.061,-51.402,50.714,15,798135,101.082,-51.405,50.670,15,798836,101.095,-51.392,50.704,15,798835,101.073,-51.389,50.748,15,101.0899,-51.3946,50.7010
|
||||
TP40,3,395898.5781,1138780.3456,140.7160,Flag,798134,101.061,-51.402,50.714,15,798135,101.082,-51.405,50.670,15,798836,101.095,-51.392,50.704,15,798835,101.073,-51.389,50.748,15,101.0899,-51.3946,50.7010
|
||||
TP40,RESULT,60.13308091660,-2.07382822798,140.7160,15,798134,101.061,-51.402,50.714,15,798135,101.082,-51.405,50.670,15,798836,101.095,-51.392,50.704,15,798835,101.073,-51.389,50.748,15,101.0899,-51.3946,50.7010
|
||||
156
GeoUK.OSTN.Tests/TransformTests.cs
Normal file
156
GeoUK.OSTN.Tests/TransformTests.cs
Normal file
@@ -0,0 +1,156 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GeoUK.Coordinates;
|
||||
using GeoUK.OSTN.Tests.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace GeoUK.OSTN.Tests
|
||||
{
|
||||
public class TransformTests
|
||||
{
|
||||
[Fact]
|
||||
public void Etrs89ToOsgb_OSTN15_Test()
|
||||
{
|
||||
string inputFileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestDataFiles_OSGM15_OSTN15/OSTN15_OSGM15_TestInput_ETRStoOSGB.txt");
|
||||
string outputFileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestDataFiles_OSGM15_OSTN15/OSTN15_OSGM15_TestOutput_ETRStoOSGB.txt");
|
||||
|
||||
var inputData = new List<DataPoint>();
|
||||
var outputData = new Dictionary<string, DataPoint>();
|
||||
|
||||
using (var inputFile = new StreamReader(inputFileName))
|
||||
{
|
||||
string line;
|
||||
while ((line = inputFile.ReadLine()) != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(line) && line.StartsWith("TP"))
|
||||
{
|
||||
var values = line.Split(',');
|
||||
var point = new DataPoint
|
||||
{
|
||||
PointID = values[0],
|
||||
X = double.Parse(values[1]),
|
||||
Y = double.Parse(values[2]),
|
||||
Height = double.Parse(values[3])
|
||||
};
|
||||
inputData.Add(point);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
using (var outputFile = new StreamReader(outputFileName))
|
||||
{
|
||||
string line;
|
||||
while ((line = outputFile.ReadLine()) != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(line) && line.StartsWith("TP"))
|
||||
{
|
||||
var values = line.Split(',');
|
||||
var point = new DataPoint
|
||||
{
|
||||
PointID = values[0],
|
||||
X = double.Parse(values[1]),
|
||||
Y = double.Parse(values[2]),
|
||||
Height = double.Parse(values[3])
|
||||
};
|
||||
outputData[point.PointID] = point;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var dataPoint in inputData)
|
||||
{
|
||||
var transformation = Transform.Etrs89ToOsgb(new LatitudeLongitude(dataPoint.X, dataPoint.Y, dataPoint.Height), OstnVersionEnum.OSTN15);
|
||||
|
||||
// Comparing values with a precision of 3 decimals, as they are given in the output file.
|
||||
var latitudesEqual = outputData[dataPoint.PointID].X
|
||||
.IsApproximatelyEqualTo(transformation.Easting, 0.001);
|
||||
var longitudesEqual = outputData[dataPoint.PointID].Y
|
||||
.IsApproximatelyEqualTo(transformation.Northing, 0.001);
|
||||
var heightsEqual = outputData[dataPoint.PointID].Height
|
||||
.IsApproximatelyEqualTo(transformation.Height, 0.001);
|
||||
|
||||
Assert.True(latitudesEqual);
|
||||
Assert.True(longitudesEqual);
|
||||
Assert.True(heightsEqual);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OsgbToEtrs89_OSTN15_Test()
|
||||
{
|
||||
string inputFileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestDataFiles_OSGM15_OSTN15/OSTN15_OSGM15_TestInput_OSGBtoETRS.txt");
|
||||
string outputFileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestDataFiles_OSGM15_OSTN15/OSTN15_OSGM15_TestOutput_OSGBtoETRS.txt");
|
||||
|
||||
var inputData = new List<DataPoint>();
|
||||
var outputData = new Dictionary<string, DataPoint>();
|
||||
|
||||
using (var inputFile = new StreamReader(inputFileName))
|
||||
{
|
||||
string line;
|
||||
while ((line = inputFile.ReadLine()) != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(line) && line.StartsWith("TP"))
|
||||
{
|
||||
var values = line.Split(',');
|
||||
var point = new DataPoint
|
||||
{
|
||||
PointID = values[0],
|
||||
X = double.Parse(values[1]),
|
||||
Y = double.Parse(values[2]),
|
||||
Height = double.Parse(values[3])
|
||||
};
|
||||
inputData.Add(point);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
using (var outputFile = new StreamReader(outputFileName))
|
||||
{
|
||||
string line;
|
||||
while ((line = outputFile.ReadLine()) != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(line) && line.StartsWith("TP"))
|
||||
{
|
||||
var values = line.Split(',');
|
||||
if (values[1] == "RESULT")
|
||||
{
|
||||
var point = new DataPoint
|
||||
{
|
||||
PointID = values[0],
|
||||
X = double.Parse(values[2]),
|
||||
Y = double.Parse(values[3]),
|
||||
Height = double.Parse(values[4])
|
||||
};
|
||||
outputData[point.PointID] = point;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var dataPoint in inputData)
|
||||
{
|
||||
var transformation = Transform.OsgbToEtrs89(new Osgb36(dataPoint.X, dataPoint.Y), OstnVersionEnum.OSTN15);
|
||||
|
||||
// Comparing values with a precision of 3 decimals, as they are given in the output file.
|
||||
var latitudesEqual = outputData[dataPoint.PointID].X
|
||||
.IsApproximatelyEqualTo(transformation.Latitude, 0.0000000001);
|
||||
var longitudesEqual = outputData[dataPoint.PointID].Y
|
||||
.IsApproximatelyEqualTo(transformation.Longitude, 0.0000000001);
|
||||
|
||||
// Comparing heights with a precision of 4 decimals, as they are given in the output file
|
||||
// Not implemented
|
||||
//var heightsEqual = outputData[dataPoint.PointID].Height
|
||||
// .IsApproximatelyEqualTo(transformation.ElipsoidalHeight, 0.0001);
|
||||
|
||||
Assert.True(latitudesEqual);
|
||||
Assert.True(longitudesEqual);
|
||||
// Not implemented
|
||||
//Assert.True(heightsEqual);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
9
GeoUK.OSTN.Tests/packages.config
Normal file
9
GeoUK.OSTN.Tests/packages.config
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="xunit" version="2.2.0" targetFramework="net452" />
|
||||
<package id="xunit.abstractions" version="2.0.1" targetFramework="net452" />
|
||||
<package id="xunit.assert" version="2.2.0" targetFramework="net452" />
|
||||
<package id="xunit.core" version="2.2.0" targetFramework="net452" />
|
||||
<package id="xunit.extensibility.core" version="2.2.0" targetFramework="net452" />
|
||||
<package id="xunit.extensibility.execution" version="2.2.0" targetFramework="net452" />
|
||||
</packages>
|
||||
34
GeoUK.OSTN.sln
Normal file
34
GeoUK.OSTN.sln
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25123.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeoUK.OSTN", "GeoUK.OSTN\GeoUK.OSTN.csproj", "{E7C614AC-E67D-4E04-BA4E-E1BBF4CAC6FD}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeoUK", "GeoUK\GeoUK.csproj", "{5C458FBF-4E2A-4F9D-ACC2-9CE5BED34236}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeoUK.OSTN.Tests", "GeoUK.OSTN.Tests\GeoUK.OSTN.Tests.csproj", "{7DAF4F03-B372-43B2-A22C-64C2790BCF68}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E7C614AC-E67D-4E04-BA4E-E1BBF4CAC6FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E7C614AC-E67D-4E04-BA4E-E1BBF4CAC6FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E7C614AC-E67D-4E04-BA4E-E1BBF4CAC6FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E7C614AC-E67D-4E04-BA4E-E1BBF4CAC6FD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5C458FBF-4E2A-4F9D-ACC2-9CE5BED34236}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5C458FBF-4E2A-4F9D-ACC2-9CE5BED34236}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5C458FBF-4E2A-4F9D-ACC2-9CE5BED34236}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5C458FBF-4E2A-4F9D-ACC2-9CE5BED34236}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7DAF4F03-B372-43B2-A22C-64C2790BCF68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7DAF4F03-B372-43B2-A22C-64C2790BCF68}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7DAF4F03-B372-43B2-A22C-64C2790BCF68}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7DAF4F03-B372-43B2-A22C-64C2790BCF68}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
58
GeoUK.OSTN/GeoUK.OSTN.csproj
Normal file
58
GeoUK.OSTN/GeoUK.OSTN.csproj
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{E7C614AC-E67D-4E04-BA4E-E1BBF4CAC6FD}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>GeoUK.OSTN</RootNamespace>
|
||||
<AssemblyName>GeoUK.OSTN</AssemblyName>
|
||||
<TargetFrameworkProfile>Profile78</TargetFrameworkProfile>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="OstnDataRecord.cs" />
|
||||
<Compile Include="OstnVersionEnum.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ResourceManager.cs" />
|
||||
<Compile Include="Transform.cs" />
|
||||
<Compile Include="Shifts.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="OSTN02_OSGM02_GB.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\GeoUK\GeoUK.csproj">
|
||||
<Project>{5C458FBF-4E2A-4F9D-ACC2-9CE5BED34236}</Project>
|
||||
<Name>GeoUK</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="OSTN15_OSGM15_DataFile.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Readme.txt" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
876952
GeoUK.OSTN/OSTN02_OSGM02_GB.txt
Normal file
876952
GeoUK.OSTN/OSTN02_OSGM02_GB.txt
Normal file
File diff suppressed because it is too large
Load Diff
876952
GeoUK.OSTN/OSTN15_OSGM15_DataFile.txt
Normal file
876952
GeoUK.OSTN/OSTN15_OSGM15_DataFile.txt
Normal file
File diff suppressed because it is too large
Load Diff
19
GeoUK.OSTN/OstnDataRecord.cs
Normal file
19
GeoUK.OSTN/OstnDataRecord.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GeoUK.OSTN
|
||||
{
|
||||
public class OstnDataRecord
|
||||
{
|
||||
public int Point_ID { get; set; }
|
||||
public double ETRS89_Easting { get; set; }
|
||||
public double ETRS89_Northing { get; set; }
|
||||
public double ETRS89_OSGB36_EShift { get; set; }
|
||||
public double ETRS89_OSGB36_NShift { get; set; }
|
||||
public double ETRS89_ODN_HeightShift { get; set; }
|
||||
public double Height_Datum_Flag { get; set; }
|
||||
}
|
||||
}
|
||||
8
GeoUK.OSTN/OstnVersionEnum.cs
Normal file
8
GeoUK.OSTN/OstnVersionEnum.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace GeoUK.OSTN
|
||||
{
|
||||
public enum OstnVersionEnum
|
||||
{
|
||||
OSTN02 = 1,
|
||||
OSTN15 = 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
|
||||
[assembly: AssemblyTitle ("GeoUK.OSTN")]
|
||||
[assembly: AssemblyDescription ("Geodetic transformations for UK based coordinate systems. This assembly is dependant upon GeoUK.")]
|
||||
[assembly: AssemblyConfiguration ("")]
|
||||
[assembly: AssemblyCompany ("")]
|
||||
[assembly: AssemblyProduct ("")]
|
||||
[assembly: AssemblyCopyright ("(c) John Newcombe 2015")]
|
||||
[assembly: AssemblyTrademark ("")]
|
||||
[assembly: AssemblyCulture ("")]
|
||||
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
|
||||
[assembly: AssemblyVersion ("1.0.*")]
|
||||
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
||||
[InternalsVisibleTo("GeoUK.Tests")]
|
||||
27
GeoUK.OSTN/Properties/AssemblyInfo.cs
Normal file
27
GeoUK.OSTN/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
|
||||
[assembly: AssemblyTitle ("GeoUK.OSTN")]
|
||||
[assembly: AssemblyDescription ("Geodetic transformations for UK based coordinate systems. This assembly is dependant upon GeoUK.")]
|
||||
[assembly: AssemblyConfiguration ("")]
|
||||
[assembly: AssemblyCompany ("")]
|
||||
[assembly: AssemblyProduct ("")]
|
||||
[assembly: AssemblyCopyright ("(c) John Newcombe 2015")]
|
||||
[assembly: AssemblyTrademark ("")]
|
||||
[assembly: AssemblyCulture ("")]
|
||||
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
|
||||
[assembly: AssemblyVersion ("1.1.0")]
|
||||
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
||||
[assembly: InternalsVisibleTo("GeoUK.Tests")]
|
||||
4
GeoUK.OSTN/Readme.txt
Normal file
4
GeoUK.OSTN/Readme.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Sources
|
||||
|
||||
OSTN15 and OSGM15 for developers:
|
||||
https://www.ordnancesurvey.co.uk/business-and-government/help-and-support/navigation-technology/os-net/formats-for-developers.html
|
||||
122
GeoUK.OSTN/ResourceManager.cs
Normal file
122
GeoUK.OSTN/ResourceManager.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
|
||||
namespace GeoUK.OSTN
|
||||
{
|
||||
internal static class ResourceManager
|
||||
{
|
||||
private static Dictionary<int, OstnDataRecord> _ostn02Data;
|
||||
public static Dictionary<int, OstnDataRecord> Ostn02Data
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_ostn02Data == null)
|
||||
_ostn02Data = RetrieveEmbeddedOSTN(OstnVersionEnum.OSTN02);
|
||||
return _ostn02Data;
|
||||
}
|
||||
}
|
||||
|
||||
private static Dictionary<int, OstnDataRecord> _ostn15Data;
|
||||
public static Dictionary<int, OstnDataRecord> Ostn15Data
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_ostn15Data == null)
|
||||
_ostn15Data = RetrieveEmbeddedOSTN(OstnVersionEnum.OSTN15);
|
||||
return _ostn15Data;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the OSTN data into memory.
|
||||
/// </summary>
|
||||
/// <param name="ostnVersion">If not provided, it will load both OSTN02 and OSTN15 data.</param>
|
||||
public static void LoadResources(OstnVersionEnum? ostnVersion = null)
|
||||
{
|
||||
if(!ostnVersion.HasValue || ostnVersion.Value == OstnVersionEnum.OSTN02)
|
||||
_ostn02Data = RetrieveEmbeddedOSTN(OstnVersionEnum.OSTN02);
|
||||
|
||||
if (!ostnVersion.HasValue || ostnVersion.Value == OstnVersionEnum.OSTN15)
|
||||
_ostn15Data = RetrieveEmbeddedOSTN(OstnVersionEnum.OSTN15);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the embedded OSTN data
|
||||
/// </summary>
|
||||
/// <param name="ostnVersion"></param>
|
||||
/// <returns></returns>
|
||||
private static Dictionary<int, OstnDataRecord> RetrieveEmbeddedOSTN(OstnVersionEnum ostnVersion)
|
||||
{
|
||||
Stream stream;
|
||||
switch (ostnVersion)
|
||||
{
|
||||
case OstnVersionEnum.OSTN02:
|
||||
stream = ResourceManager.GetEmbeddedResourceStream(typeof(Transform).GetTypeInfo().Assembly, "OSTN02_OSGM02_GB.txt");
|
||||
break;
|
||||
case OstnVersionEnum.OSTN15:
|
||||
stream = ResourceManager.GetEmbeddedResourceStream(typeof(Transform).GetTypeInfo().Assembly, "OSTN15_OSGM15_DataFile.txt");
|
||||
break;
|
||||
default:
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
var data = new Dictionary<int, OstnDataRecord>();
|
||||
using (var reader = new StreamReader(stream))
|
||||
{
|
||||
// Skipping the header row
|
||||
reader.ReadLine();
|
||||
|
||||
string line;
|
||||
while ((line = reader.ReadLine()) != null)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(line))
|
||||
{
|
||||
var values = line.Split(',');
|
||||
var record = new OstnDataRecord
|
||||
{
|
||||
Point_ID = Int32.Parse(values[0]),
|
||||
ETRS89_Easting = Double.Parse(values[1]),
|
||||
ETRS89_Northing = Double.Parse(values[2]),
|
||||
ETRS89_OSGB36_EShift = Double.Parse(values[3]),
|
||||
ETRS89_OSGB36_NShift = Double.Parse(values[4]),
|
||||
ETRS89_ODN_HeightShift = Double.Parse(values[5]),
|
||||
Height_Datum_Flag = Double.Parse(values[6]),
|
||||
};
|
||||
data[record.Point_ID] = record;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to find and return the given resource from within the specified assembly.
|
||||
/// </summary>
|
||||
/// <returns>The embedded resource stream.</returns>
|
||||
/// <param name="assembly">Assembly.</param>
|
||||
/// <param name="resourceFileName">Resource file name.</param>
|
||||
private static Stream GetEmbeddedResourceStream (Assembly assembly, string resourceFileName)
|
||||
{
|
||||
var resourceNames = assembly.GetManifestResourceNames ();
|
||||
|
||||
var resourcePaths = resourceNames
|
||||
.Where (x => x.EndsWith (resourceFileName, StringComparison.CurrentCultureIgnoreCase))
|
||||
.ToArray ();
|
||||
|
||||
if (!resourcePaths.Any ()) {
|
||||
throw new Exception (String.Format ("Resource ending with {0} not found.", resourceFileName));
|
||||
}
|
||||
|
||||
if (resourcePaths.Count () > 1) {
|
||||
throw new Exception (String.Format ("Multiple resources ending with {0} found: {1}{2}", resourceFileName, Environment.NewLine, String.Join (Environment.NewLine, resourcePaths)));
|
||||
}
|
||||
|
||||
return assembly.GetManifestResourceStream (resourcePaths.Single ());
|
||||
}
|
||||
}
|
||||
}
|
||||
16
GeoUK.OSTN/Shifts.cs
Normal file
16
GeoUK.OSTN/Shifts.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using GeoUK.Coordinates;
|
||||
|
||||
namespace GeoUK.OSTN
|
||||
{
|
||||
public class Shifts
|
||||
{
|
||||
|
||||
public double Se { get; set; }
|
||||
public double Sn { get; set; }
|
||||
public double Sg { get; set; }
|
||||
|
||||
public Osgb36GeoidDatum GeoidDatum { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
167
GeoUK.OSTN/Transform.cs
Normal file
167
GeoUK.OSTN/Transform.cs
Normal file
@@ -0,0 +1,167 @@
|
||||
using System;
|
||||
using GeoUK.Coordinates;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using GeoUK.Ellipsoids;
|
||||
using GeoUK.Projections;
|
||||
|
||||
namespace GeoUK.OSTN
|
||||
{
|
||||
public static class Transform
|
||||
{
|
||||
/// <summary>
|
||||
/// Loads the OSTN data into memory.
|
||||
/// </summary>
|
||||
/// <param name="ostnVersion">If not provided, it will load both OSTN02 and OSTN15 data.</param>
|
||||
public static void PreloadResources(OstnVersionEnum? ostnVersion = null)
|
||||
{
|
||||
ResourceManager.LoadResources(ostnVersion);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs an ETRS89 to OSGB36/ODN datum transformation. Accuracy is approximately 10 centimeters.
|
||||
/// Whilst very accurate this method is much slower than the Helmert transformation.
|
||||
/// </summary>
|
||||
public static Osgb36 Etrs89ToOsgb(LatitudeLongitude coordinates, OstnVersionEnum ostnVersion = OstnVersionEnum.OSTN15)
|
||||
{
|
||||
var enCoordinates = Convert.ToEastingNorthing (new Grs80 (), new BritishNationalGrid (), coordinates);
|
||||
return Etrs89ToOsgb (enCoordinates, coordinates.ElipsoidalHeight);
|
||||
}
|
||||
|
||||
private static Osgb36 Etrs89ToOsgb(EastingNorthing coordinates, double ellipsoidHeight, OstnVersionEnum ostnVersion = OstnVersionEnum.OSTN15)
|
||||
{
|
||||
var shifts = GetShifts (coordinates, ellipsoidHeight, ostnVersion);
|
||||
|
||||
var easting = coordinates.Easting + shifts.Se;
|
||||
var northing = coordinates.Northing + shifts.Sn;
|
||||
var height = ellipsoidHeight - shifts.Sg;
|
||||
|
||||
return new Osgb36(easting, northing, height, shifts.GeoidDatum);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs an OSGB36/ODN to ETRS89 datum transformation. Accuracy is approximately 10 centimeters.
|
||||
/// Whilst very accurate this method is much slower than the Helmert transformation.
|
||||
/// </summary>
|
||||
public static LatitudeLongitude OsgbToEtrs89 (Osgb36 coordinates, OstnVersionEnum ostnVersion = OstnVersionEnum.OSTN15)
|
||||
{
|
||||
//calculate shifts from OSGB36 point
|
||||
double errorN = double.MaxValue;
|
||||
double errorE = double.MaxValue;
|
||||
EastingNorthing enCoordinates = null;
|
||||
|
||||
var shiftsA = GetShifts (coordinates, coordinates.Height, ostnVersion);
|
||||
|
||||
//0.0001 error meters
|
||||
int iter = 0;
|
||||
while ((errorN > 0.0001 || errorE > 0.0001) && iter <10) {
|
||||
|
||||
enCoordinates = new EastingNorthing (coordinates.Easting - shiftsA.Se, coordinates.Northing - shiftsA.Sn);
|
||||
var shiftsB = GetShifts (enCoordinates, coordinates.Height, ostnVersion);
|
||||
|
||||
errorE = Math.Abs (shiftsA.Se - shiftsB.Se);
|
||||
errorN = Math.Abs (shiftsA.Sn - shiftsB.Sn);
|
||||
|
||||
shiftsA = shiftsB;
|
||||
iter++;
|
||||
|
||||
}
|
||||
|
||||
return Convert.ToLatitudeLongitude(new Wgs84(), new BritishNationalGrid(), enCoordinates);
|
||||
|
||||
}
|
||||
|
||||
private static Shifts GetShifts (EastingNorthing coordinates, double ellipsoidHeight, OstnVersionEnum ostnVersion)
|
||||
{
|
||||
//See OS Document: Transformations and OSGM02/OSGM15 user guide chapter 3
|
||||
var ostnData = GetOstnData(ostnVersion);
|
||||
|
||||
List<int> recordNumbers = new List<int> ();
|
||||
var records = new OstnDataRecord[4];
|
||||
|
||||
//determine record numbers
|
||||
int eastIndex = (int)(coordinates.Easting / 1000.0);
|
||||
int northIndex = (int)(coordinates.Northing / 1000.0);
|
||||
|
||||
double x0 = eastIndex * 1000;
|
||||
double y0 = northIndex * 1000;
|
||||
|
||||
//work out the four records
|
||||
recordNumbers.Add (CalculateRecordNumber (eastIndex, northIndex));
|
||||
recordNumbers.Add (CalculateRecordNumber (eastIndex + 1, northIndex));
|
||||
recordNumbers.Add (CalculateRecordNumber (eastIndex + 1, northIndex + 1));
|
||||
recordNumbers.Add (CalculateRecordNumber (eastIndex, northIndex + 1));
|
||||
|
||||
// Get the corresponding reccords from the data dictionary
|
||||
for (int index = 0; index < 4; index++)
|
||||
{
|
||||
records[index] = ostnData[recordNumbers[index]];
|
||||
}
|
||||
|
||||
//populate the properties
|
||||
var se0 = System.Convert.ToDouble (records[0].ETRS89_OSGB36_EShift);
|
||||
var se1 = System.Convert.ToDouble (records[1].ETRS89_OSGB36_EShift);
|
||||
var se2 = System.Convert.ToDouble (records[2].ETRS89_OSGB36_EShift);
|
||||
var se3 = System.Convert.ToDouble (records[3].ETRS89_OSGB36_EShift);
|
||||
|
||||
var sn0 = System.Convert.ToDouble (records[0].ETRS89_OSGB36_NShift);
|
||||
var sn1 = System.Convert.ToDouble (records[1].ETRS89_OSGB36_NShift);
|
||||
var sn2 = System.Convert.ToDouble (records[2].ETRS89_OSGB36_NShift);
|
||||
var sn3 = System.Convert.ToDouble (records[3].ETRS89_OSGB36_NShift);
|
||||
|
||||
var sg0 = System.Convert.ToDouble (records[0].ETRS89_ODN_HeightShift);
|
||||
var sg1 = System.Convert.ToDouble (records[1].ETRS89_ODN_HeightShift);
|
||||
var sg2 = System.Convert.ToDouble (records[2].ETRS89_ODN_HeightShift);
|
||||
var sg3 = System.Convert.ToDouble (records[3].ETRS89_ODN_HeightShift);
|
||||
|
||||
var dx = coordinates.Easting - x0;
|
||||
var dy = coordinates.Northing - y0;
|
||||
|
||||
var t = dx / 1000.0;
|
||||
var u = dy / 1000.0;
|
||||
|
||||
var shifts = new Shifts ();
|
||||
|
||||
shifts.Se = (1 - t) * (1 - u) * se0 + t * (1 - u) * se1 + t * u * se2 + (1 - t) * u * se3;
|
||||
shifts.Sn = (1 - t) * (1 - u) * sn0 + t * (1 - u) * sn1 + t * u * sn2 + (1 - t) * u * sn3;
|
||||
shifts.Sg = (1 - t) * (1 - u) * sg0 + t * (1 - u) * sg1 + t * u * sg2 + (1 - t) * u * sg3;
|
||||
|
||||
shifts.GeoidDatum = (Osgb36GeoidDatum)System.Convert.ToInt32 (records[0].Height_Datum_Flag);
|
||||
|
||||
return shifts;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates a data file record number.
|
||||
/// </summary>
|
||||
/// <param name="eastIndex"></param>
|
||||
/// <param name="northIndex"></param>
|
||||
/// <returns></returns>
|
||||
private static int CalculateRecordNumber(int eastIndex, int northIndex)
|
||||
{
|
||||
return eastIndex + (northIndex * 701) + 1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the parsed OSTN data from the embedded resource file.
|
||||
/// </summary>
|
||||
/// <param name="ostnVersion"></param>
|
||||
/// <returns></returns>
|
||||
private static Dictionary<int, OstnDataRecord> GetOstnData(OstnVersionEnum ostnVersion)
|
||||
{
|
||||
switch (ostnVersion)
|
||||
{
|
||||
case OstnVersionEnum.OSTN02:
|
||||
return ResourceManager.Ostn02Data;
|
||||
case OstnVersionEnum.OSTN15:
|
||||
return ResourceManager.Ostn15Data;
|
||||
default:
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
385
GeoUK/Convert.cs
Normal file
385
GeoUK/Convert.cs
Normal file
@@ -0,0 +1,385 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Globalization;
|
||||
using GeoUK.Coordinates;
|
||||
using GeoUK.Ellipsoids;
|
||||
using GeoUK.Projections;
|
||||
|
||||
namespace GeoUK
|
||||
{
|
||||
/// <summary>
|
||||
/// This class performs various generic conversions between coordinate systems and units of measure.
|
||||
/// This class does not perform transformations.
|
||||
/// </summary>
|
||||
public static class Convert
|
||||
{
|
||||
/// <summary>
|
||||
/// Method to convert from Easting Northing coordinates to Latitude Longitude coordinates.
|
||||
/// </summary>
|
||||
/// <returns>The latitude longitude.</returns>
|
||||
/// <param name = "ellipsoid"></param>
|
||||
/// <param name="projection">Projection.</param>
|
||||
/// <param name="coordinates">Coordinates.</param>
|
||||
public static LatitudeLongitude ToLatitudeLongitude (Ellipsoid ellipsoid, Projections.Projection projection, EastingNorthing coordinates)
|
||||
{
|
||||
double M;
|
||||
var N = coordinates.Northing;
|
||||
var E = coordinates.Easting;
|
||||
|
||||
//from OS Guide
|
||||
//constants needed are a Semi-Major Axis , b , e2 , N0 , E0 , F0 ,φ0 , and λ0
|
||||
double a = ellipsoid.SemiMajorAxis;
|
||||
double b = ellipsoid.SemiMinorAxis;
|
||||
double e2 = ellipsoid.EccentricitySquared;
|
||||
double F0 = projection.ScaleFactor;
|
||||
double lat0 = ToRadians (projection.TrueOriginLatitude);
|
||||
double lon0 = ToRadians (projection.TrueOriginLongitude);
|
||||
double E0 = projection.TrueOriginEasting;
|
||||
double N0 = projection.TrueOriginNorthing;
|
||||
|
||||
/*
|
||||
Console.WriteLine ("a: {0}", a);
|
||||
Console.WriteLine ("b: {0}", b);
|
||||
Console.WriteLine ("e2: {0}", e2);
|
||||
Console.WriteLine ("F0: {0}", F0);
|
||||
Console.WriteLine ("lat0 (deg): {0}", projection.TrueOriginLatitude);
|
||||
Console.WriteLine ("lon0 (deg): {0}", projection.TrueOriginLongitude);
|
||||
Console.WriteLine ("lat0 (rad): {0}", lat0);
|
||||
Console.WriteLine ("lon0 (rad): {0}", lon0);
|
||||
Console.WriteLine ("E0: {0}", E0);
|
||||
Console.WriteLine ("N0: {0}", N0);
|
||||
Console.WriteLine ("N: {0}", N);
|
||||
Console.WriteLine ("E: {0}", E);
|
||||
*/
|
||||
|
||||
var lat = ((N - N0) / (a * F0)) + lat0;
|
||||
|
||||
//double n = (a - b) / (a + b);
|
||||
//check for error and reiterate as required
|
||||
int loopCount = 0;
|
||||
do {
|
||||
M = CalculateM (lat, lat0, a, b, F0);
|
||||
|
||||
lat += ((N - N0 - M) / (a * F0));
|
||||
|
||||
/*
|
||||
Console.WriteLine ("\nlat #{0}: {1}", loopCount + 1, lat);
|
||||
Console.WriteLine ("M #{0}: {1}", loopCount + 1, M);
|
||||
Console.WriteLine ("N - N0 - M #{0}: {1}\n", loopCount + 1, N - N0 - M);
|
||||
*/
|
||||
|
||||
loopCount++;
|
||||
|
||||
} while (!IsNearlyZero (N - N0 - M, 1e-16) & loopCount < 10);
|
||||
|
||||
double v = a * F0 * Math.Pow ((1 - e2 * Math.Pow (Math.Sin (lat), 2)), -0.5);
|
||||
double p = a * F0 * (1 - e2) * Math.Pow ((1 - e2 * Math.Pow (Math.Sin (lat), 2)), -1.5);
|
||||
double n2 = (v / p) - 1;
|
||||
|
||||
var VII = Math.Tan (lat) / (2 * p * v);
|
||||
|
||||
var VIIIa = Math.Tan (lat) / (24 * p * Math.Pow (v, 3));
|
||||
var VIIIb = 5 + (3 * Math.Pow (Math.Tan (lat), 2)) + n2 - 9 * (Math.Pow (Math.Tan (lat), 2)) * n2;
|
||||
var VIII = VIIIa * VIIIb;
|
||||
|
||||
var IXa = Math.Tan (lat) / (720 * p * Math.Pow (v, 5));
|
||||
var IXb = 61 + (90 * Math.Pow (Math.Tan (lat), 2)) + (45 * Math.Pow (Math.Tan (lat), 4));
|
||||
var IX = IXa * IXb;
|
||||
|
||||
var X = MathEx.Secant (lat) / v;
|
||||
|
||||
var XIa = MathEx.Secant (lat) / (6 * Math.Pow (v, 3));
|
||||
var XIb = v / p + (2 * Math.Pow (Math.Tan (lat), 2));
|
||||
var XI = XIa * XIb;
|
||||
|
||||
var XIIa = MathEx.Secant (lat) / (120 * Math.Pow (v, 5));
|
||||
var XIIb = 5 + (28 * Math.Pow (Math.Tan (lat), 2)) + (24 * Math.Pow (Math.Tan (lat), 4));
|
||||
var XII = XIIa * XIIb;
|
||||
|
||||
var XIIAa = MathEx.Secant (lat) / (5040 * Math.Pow (v, 7));
|
||||
var XIIAb = 61 + (662 * Math.Pow (Math.Tan (lat), 2)) + (1320 * Math.Pow (Math.Tan (lat), 4)) + (720 * Math.Pow (Math.Tan (lat), 6));
|
||||
var XIIA = XIIAa * XIIAb;
|
||||
|
||||
lat = lat - VII * Math.Pow (E - E0, 2) + VIII * Math.Pow (E - E0, 4) - IX * Math.Pow (E - E0, 6);
|
||||
var lon = lon0 + X * (E - E0) - XI * Math.Pow (E - E0, 3) + XII * Math.Pow (E - E0, 5) - XIIA * Math.Pow (E - E0, 7);
|
||||
|
||||
/*
|
||||
Console.WriteLine ("v: {0}", v);
|
||||
Console.WriteLine ("p: {0}", p);
|
||||
Console.WriteLine ("n2: {0}", n2);
|
||||
Console.WriteLine ("VII: {0}", VII);
|
||||
Console.WriteLine ("VIII: {0}", VIII);
|
||||
Console.WriteLine ("IX: {0}", IX);
|
||||
Console.WriteLine ("X: {0}", X);
|
||||
Console.WriteLine ("XI: {0}", XI);
|
||||
Console.WriteLine ("XII: {0}", XII);
|
||||
Console.WriteLine ("XIIA: {0}", XIIA);
|
||||
Console.WriteLine ("lat (final): {0}", lat);
|
||||
Console.WriteLine ("lon: {0}", lon);
|
||||
*/
|
||||
|
||||
return new LatitudeLongitude (ToDegrees (lat), ToDegrees (lon));
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static bool IsNearlyZero (double x, double tolerance)
|
||||
{
|
||||
if (x < 0) {
|
||||
x = x * -1;
|
||||
}
|
||||
|
||||
return (x < 0 && x > tolerance * -1) || (x >= 0 && x < tolerance);
|
||||
|
||||
}
|
||||
|
||||
private static double CalculateM (double latitude, double latitudeOrigin, double semiMajorAxis, double semiMinorAxis, double scaleFactor)
|
||||
{
|
||||
double n = (semiMajorAxis - semiMinorAxis) / (semiMajorAxis + semiMinorAxis);
|
||||
|
||||
double Ma = (1 + n + ((5.0 / 4.0) * Math.Pow (n, 2)) + ((5.0 / 4.0) * Math.Pow (n, 3))) * (latitude - latitudeOrigin);
|
||||
double Mb = ((3 * n) + (3 * Math.Pow (n, 2)) + ((21.0 / 8.0) * Math.Pow (n, 3))) * Math.Sin (latitude - latitudeOrigin) * Math.Cos (latitude + latitudeOrigin);
|
||||
double Mc = (((15.0 / 8.0) * Math.Pow (n, 2)) + (15.0 / 8.0) * Math.Pow (n, 3)) * Math.Sin (2 * (latitude - latitudeOrigin)) * Math.Cos (2 * (latitude + latitudeOrigin));
|
||||
double Md = (35.0 / 24.0 * Math.Pow (n, 3)) * Math.Sin (3 * (latitude - latitudeOrigin)) * Math.Cos (3 * (latitude + latitudeOrigin));
|
||||
double M = semiMinorAxis * scaleFactor * (Ma - Mb + Mc - Md);
|
||||
|
||||
return M;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Converts decimal degrees to radians.
|
||||
/// </summary>
|
||||
/// <param name="degrees"></param>
|
||||
/// <returns></returns>
|
||||
public static double ToRadians (double degrees)
|
||||
{
|
||||
return degrees * (Math.PI / 180);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts radians to decimal degrees.
|
||||
/// </summary>
|
||||
/// <param name="radians"></param>
|
||||
/// <returns></returns>
|
||||
public static double ToDegrees (double radians)
|
||||
{
|
||||
return radians * (180 / Math.PI);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts cartesian coordinates to grid eastings and northings for any Transverse Mercator map projection, including the Ordnance Survey National Grid.
|
||||
/// Ellipsoid height is ignored.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// When converting OSGB36 coordinates between (easting, northing) and (latitude, longitude),
|
||||
/// use the Airy 1830 ellipsoid. When converting ETRS89 coordinates between (easting, northing) and
|
||||
/// (latitude, longitude), use the GRS80 ellipsoid. Use the same National Grid projection
|
||||
/// constants for both ETRS89 and OSGB36 coordinates.
|
||||
/// </remarks>
|
||||
public static EastingNorthing ToEastingNorthing (Ellipsoid ellipsoid, Projections.Projection projection, Cartesian coordinates)
|
||||
{
|
||||
LatitudeLongitude coords = ToLatitudeLongitude (ellipsoid, coordinates);
|
||||
return ToEastingNorthing (ellipsoid, projection, coords);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts latitude and longitude to grid eastings and northings for any Transverse Mercator map projection, including the Ordnance Survey National Grid.
|
||||
/// Ellipsoid height is ignored.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// When converting OSGB36 coordinates between (easting, northing) and (latitude, longitude),
|
||||
/// use the Airy 1830 ellipsoid. When converting ETRS89 coordinates between (easting, northing) and
|
||||
/// (latitude, longitude), use the GRS80 ellipsoid. Use the same National Grid projection
|
||||
/// constants for both ETRS89 and OSGB36 coordinates.
|
||||
/// </remarks>
|
||||
/// <param name="ellipsoid"></param>
|
||||
/// <param name="projection"></param>
|
||||
/// <param name="coordinates"></param>
|
||||
/// <returns></returns>
|
||||
public static EastingNorthing ToEastingNorthing (Ellipsoid ellipsoid, Projections.Projection projection, LatitudeLongitude coordinates)
|
||||
{
|
||||
double lat = ToRadians (coordinates.Latitude);
|
||||
double lon = ToRadians (coordinates.Longitude);
|
||||
|
||||
//OS Document Transformation and OSGM02 User Guide, Appendix B.
|
||||
//B1
|
||||
double a = ellipsoid.SemiMajorAxis;
|
||||
double b = ellipsoid.SemiMinorAxis;
|
||||
double e2 = ellipsoid.EccentricitySquared;
|
||||
double F0 = projection.ScaleFactor;
|
||||
double lat0 = ToRadians (projection.TrueOriginLatitude);
|
||||
double lon0 = ToRadians (projection.TrueOriginLongitude);
|
||||
double E0 = projection.TrueOriginEasting;
|
||||
double N0 = projection.TrueOriginNorthing;
|
||||
|
||||
//B2
|
||||
//double n = (a - b) / (a + b);
|
||||
|
||||
//B3
|
||||
double v = a * F0 * Math.Pow ((1 - e2 * Math.Pow (Math.Sin (lat), 2)), -0.5);
|
||||
|
||||
//B4
|
||||
double p = a * F0 * (1 - e2) * Math.Pow ((1 - e2 * Math.Pow (Math.Sin (lat), 2)), -1.5);
|
||||
|
||||
//B5
|
||||
double n2 = v / p - 1;
|
||||
|
||||
//B6
|
||||
var M = CalculateM (lat, lat0, a, b, F0);
|
||||
|
||||
// double Ma = (1 + n + ((5.0 / 4.0) * Math.Pow (n, 2)) + ((5.0 / 4.0) * Math.Pow (n, 3))) * (lat - lat0);
|
||||
// double Mb = ((3 * n) + (3 * Math.Pow (n, 2)) + ((21.0 / 8.0) * Math.Pow (n, 3))) * Math.Sin (lat - lat0) * Math.Cos (lat + lat0);
|
||||
// double Mc = (((15.0 / 8.0) * Math.Pow (n, 2)) + (15.0 / 8.0) * Math.Pow (n, 3)) * Math.Sin (2 * (lat - lat0)) * Math.Cos (2 * (lat + lat0));
|
||||
// double Md = (35.0 / 24.0 * Math.Pow (n, 3)) * Math.Sin (3 * (lat - lat0)) * Math.Cos (3 * (lat + lat0));
|
||||
// double M = b * F0 * (Ma - Mb + Mc - Md);
|
||||
|
||||
double I = M + N0;
|
||||
double II = (v / 2) * Math.Sin (lat) * Math.Cos (lat);
|
||||
double III = (v / 24) * Math.Sin (lat) * Math.Pow (Math.Cos (lat), 3) * (5 - Math.Pow (Math.Tan (lat), 2) + 9 * n2);
|
||||
double IIIA = (v / 720) * Math.Sin (lat) * Math.Pow (Math.Cos (lat), 5) * (61 - 58 * Math.Pow (Math.Tan (lat), 2) + Math.Pow (Math.Tan (lat), 4));
|
||||
double IV = v * Math.Cos (lat);
|
||||
double V = (v / 6) * Math.Pow (Math.Cos (lat), 3) * ((v / p) - Math.Pow (Math.Tan (lat), 2));
|
||||
double VI = (v / 120) * Math.Pow (Math.Cos (lat), 5) * (5 - 18 * Math.Pow (Math.Tan (lat), 2) + Math.Pow (Math.Tan (lat), 4) + 14 * n2 - 58 * Math.Pow (Math.Tan (lat), 2) * n2);
|
||||
|
||||
//B7
|
||||
double N = I + (II * Math.Pow ((lon - lon0), 2)) + (III * Math.Pow ((lon - lon0), 4)) + (IIIA * Math.Pow ((lon - lon0), 6));
|
||||
|
||||
//B8
|
||||
double E = E0 + (IV * (lon - lon0)) + (V * Math.Pow ((lon - lon0), 3)) + (VI * Math.Pow ((lon - lon0), 5));
|
||||
|
||||
return new EastingNorthing (E, N, coordinates.ElipsoidalHeight); //height is still with respect to the ellipsoid
|
||||
}
|
||||
|
||||
public static Cartesian ToCartesian (Ellipsoid ellipsoid, Projection projection, EastingNorthing coordinates)
|
||||
{
|
||||
var latLongCoordinates = ToLatitudeLongitude (
|
||||
ellipsoid,
|
||||
projection,
|
||||
coordinates);
|
||||
|
||||
return ToCartesian (ellipsoid, latLongCoordinates);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts latitude, longitude and elipsoidal height coordinates to cartesian coordinates using the same ellipsoid.
|
||||
/// Please note this is not a transformation between ellipsoids.
|
||||
/// </summary>
|
||||
/// <param name="ellipsoid"></param>
|
||||
/// <param name="coordinates"></param>
|
||||
/// <returns></returns>
|
||||
public static Cartesian ToCartesian (Ellipsoid ellipsoid, LatitudeLongitude coordinates)
|
||||
{
|
||||
|
||||
double lat = ToRadians (coordinates.Latitude);
|
||||
double lon = ToRadians (coordinates.Longitude);
|
||||
double height = coordinates.ElipsoidalHeight;
|
||||
|
||||
double e2 = ellipsoid.EccentricitySquared;
|
||||
double a = ellipsoid.SemiMajorAxis;
|
||||
|
||||
double v = a / Math.Sqrt (1 - (e2 * Math.Pow (Math.Sin (lat), 2)));
|
||||
|
||||
double x = (v + height) * Math.Cos (lat) * Math.Cos (lon);
|
||||
double y = (v + height) * Math.Cos (lat) * Math.Sin (lon);
|
||||
double z = ((1 - e2) * v + height) * Math.Sin (lat);
|
||||
|
||||
return new Cartesian (x, y, z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts cartesian coordinates to latitude, longitude and elipsoidal height using the same ellipsoid.
|
||||
/// Please note this is not a transformation between ellipsoids.
|
||||
/// </summary>
|
||||
/// <param name="ellipsoid"></param>
|
||||
/// <param name="coordinates"></param>
|
||||
/// <returns></returns>
|
||||
public static LatitudeLongitude ToLatitudeLongitude (Ellipsoid ellipsoid, Cartesian coordinates)
|
||||
{
|
||||
double e2 = ellipsoid.EccentricitySquared;
|
||||
double a = ellipsoid.SemiMajorAxis;
|
||||
double p = Math.Sqrt (Math.Pow (coordinates.X, 2) + Math.Pow (coordinates.Y, 2));
|
||||
double lon = Math.Atan (coordinates.Y / coordinates.X);
|
||||
|
||||
//have a first stab
|
||||
double v = 0.0;
|
||||
double lat = Math.Atan (coordinates.Z / (p * (1 - e2)));
|
||||
|
||||
//iterate a few times 3 is enough but 10 to be safe
|
||||
for (int iterations = 0; iterations < 10; iterations++) {
|
||||
v = a / Math.Sqrt (1 - (e2 * Math.Pow (Math.Sin (lat), 2)));
|
||||
lat = Math.Atan ((coordinates.Z + e2 * v * Math.Sin (lat)) / p);
|
||||
}
|
||||
double height = (p / Math.Cos (lat)) - v;
|
||||
|
||||
return new LatitudeLongitude (ToDegrees (lat), ToDegrees (lon), height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts degrees minutes and seconds to decimal degrees.
|
||||
/// </summary>
|
||||
/// <param name="degrees"></param>
|
||||
/// <param name="minutes"></param>
|
||||
/// <param name="seconds"></param>
|
||||
/// <returns></returns>
|
||||
public static double ToDecimelDegrees (int degrees, int minutes, double seconds)
|
||||
{
|
||||
//determine seconds as minutes
|
||||
double m = minutes + (seconds / 60.0);
|
||||
return ToDecimelDegrees (degrees, m);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts degrees and decimel minutes to decimal degrees.
|
||||
/// </summary>
|
||||
/// <param name="degrees"></param>
|
||||
/// <param name="minutes"></param>
|
||||
/// <returns></returns>
|
||||
public static double ToDecimelDegrees (int degrees, double minutes)
|
||||
{
|
||||
//determine minutes as derees
|
||||
return degrees + (minutes / 60.0);
|
||||
}
|
||||
|
||||
private static double Div (double value, double divisor)
|
||||
{
|
||||
double dblResult = 0;
|
||||
bool blnNegative = false;
|
||||
|
||||
//make the division
|
||||
dblResult = value / divisor;
|
||||
|
||||
//do all calculations on positive numbers
|
||||
if (dblResult < 0) {
|
||||
blnNegative = true;
|
||||
dblResult = dblResult * -1;
|
||||
}
|
||||
|
||||
//see if there is any remainder
|
||||
if (dblResult % 1 > 0) {
|
||||
dblResult = Math.Ceiling (dblResult) - 1;
|
||||
} else {
|
||||
dblResult = System.Convert.ToInt32 (dblResult, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
if (blnNegative) {
|
||||
dblResult = Negate (dblResult);
|
||||
}
|
||||
|
||||
return dblResult;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper funtion to reverse the sign of a value. Helps code to be more readable.
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
private static double Negate (double value)
|
||||
{
|
||||
return value * -1.0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
51
GeoUK/Coordinates/Cartesian.cs
Normal file
51
GeoUK/Coordinates/Cartesian.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace GeoUK.Coordinates
|
||||
{
|
||||
/// <summary>
|
||||
/// This immutable class represents a set of cartesian coordinates.
|
||||
/// </summary>
|
||||
public class Cartesian
|
||||
{
|
||||
private double _x;
|
||||
private double _z;
|
||||
private double _y;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
/// <param name="z"></param>
|
||||
public Cartesian(double x, double y, double z)
|
||||
{
|
||||
_x = x;
|
||||
_y = y;
|
||||
_z = z;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns the X axis parameter.
|
||||
/// </summary>
|
||||
public double X
|
||||
{
|
||||
get { return _x; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns the Y axis parameter.
|
||||
/// </summary>
|
||||
public double Y
|
||||
{
|
||||
get { return _y; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns the Z axis parameter.
|
||||
/// </summary>
|
||||
public double Z
|
||||
{
|
||||
get { return _z; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
61
GeoUK/Coordinates/EastingNorthing.cs
Normal file
61
GeoUK/Coordinates/EastingNorthing.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace GeoUK.Coordinates
|
||||
{
|
||||
/// <summary>
|
||||
/// this immutable class represents a set of easting/northing parameters. For convenience the class also
|
||||
/// includes a parameter for height.
|
||||
/// </summary>
|
||||
public class EastingNorthing
|
||||
{
|
||||
double _easting;
|
||||
double _northing;
|
||||
double _height;
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="easting"></param>
|
||||
/// <param name="northing"></param>
|
||||
public EastingNorthing(double easting, double northing)
|
||||
{
|
||||
_easting = easting;
|
||||
_northing = northing;
|
||||
_height = 0;
|
||||
}
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="easting"></param>
|
||||
/// <param name="northing"></param>
|
||||
/// <param name="height"></param>
|
||||
public EastingNorthing(double easting, double northing, double height)
|
||||
{
|
||||
_easting = easting;
|
||||
_northing = northing;
|
||||
_height = height;
|
||||
}
|
||||
/// <summary>
|
||||
/// Retruns the easting parameter.
|
||||
/// </summary>
|
||||
public double Easting
|
||||
{
|
||||
get { return _easting; }
|
||||
}
|
||||
/// <summary>
|
||||
/// returns the northing parameter.
|
||||
/// </summary>
|
||||
public double Northing
|
||||
{
|
||||
get { return _northing; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns the height parameter.
|
||||
/// </summary>
|
||||
public double Height
|
||||
{
|
||||
get { return _height; }
|
||||
}
|
||||
}
|
||||
}
|
||||
73
GeoUK/Coordinates/GeoidDatum.cs
Normal file
73
GeoUK/Coordinates/GeoidDatum.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace GeoUK.Coordinates
|
||||
{
|
||||
/// <summary>
|
||||
/// Enumerator for the Geoid datums in use with OSGB 36/OSTN02.
|
||||
/// </summary>
|
||||
public enum Osgb36GeoidDatum
|
||||
{
|
||||
/// <summary>
|
||||
/// Outside Model Boundary
|
||||
/// </summary>
|
||||
OutsideModelBoundary = 0,
|
||||
/// <summary>
|
||||
/// Newlyn, Uk Mainland
|
||||
/// </summary>
|
||||
NewlynUkMainland = 1,
|
||||
/// <summary>
|
||||
/// StMarys, Scilly Isles
|
||||
/// </summary>
|
||||
StMarysScillyIsles = 2,
|
||||
/// <summary>
|
||||
/// Douglas02, Isle of Man
|
||||
/// </summary>
|
||||
Douglas02IsleofMan = 3,
|
||||
/// <summary>
|
||||
/// Stornoway, Outer Hebrides
|
||||
/// </summary>
|
||||
StornowayOuterHebrides = 4,
|
||||
/// <summary>
|
||||
/// St. Kilda, St. Kilda
|
||||
/// </summary>
|
||||
StKildaStKilda = 5,
|
||||
/// <summary>
|
||||
/// Lerwick, Shetland Isles
|
||||
/// </summary>
|
||||
LerwickShetlandIsles = 6,
|
||||
/// <summary>
|
||||
/// Newlyn, Orkney Isles
|
||||
/// </summary>
|
||||
NewlynOrkneyIsles = 7,
|
||||
/// <summary>
|
||||
/// Fair Isle, Fair Isle
|
||||
/// </summary>
|
||||
FairIsleFairIsle = 8,
|
||||
/// <summary>
|
||||
/// Flannan Isles, Flannan Isles
|
||||
/// </summary>
|
||||
FlannanIslesFlannanIsles = 9,
|
||||
/// <summary>
|
||||
/// North Rona, North Rona
|
||||
/// </summary>
|
||||
NorthRonaNorthRona = 10,
|
||||
/// <summary>
|
||||
/// Sule Skerry, Sule Skerry
|
||||
/// </summary>
|
||||
SuleSkerrySuleSkerry = 11,
|
||||
/// <summary>
|
||||
/// Foula, Foula.
|
||||
/// </summary>
|
||||
FoulaFoula = 12,
|
||||
/// <summary>
|
||||
/// Malin Head, Republic of Ireland
|
||||
/// </summary>
|
||||
MalinHeadRepublicofIreland = 13,
|
||||
/// <summary>
|
||||
/// Belfast, Northern Ireland
|
||||
/// </summary>
|
||||
BelfastNorthernIreland = 14
|
||||
}
|
||||
}
|
||||
68
GeoUK/Coordinates/LatitudeLongitude.cs
Normal file
68
GeoUK/Coordinates/LatitudeLongitude.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
|
||||
namespace GeoUK.Coordinates
|
||||
{
|
||||
/// <summary>
|
||||
/// This immutable class represents a set of latitude/longitude/ellipsoidal height coordinates.
|
||||
/// </summary>
|
||||
public class LatitudeLongitude
|
||||
|
||||
{
|
||||
private double _degreesLatitude = 0.0;
|
||||
private double _degreesLongitude = 0.0;
|
||||
private double _elipsoidalHeight = 0.0;
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="degreesLatitude"></param>
|
||||
/// <param name="degreesLongitude"></param>
|
||||
public LatitudeLongitude(double degreesLatitude, double degreesLongitude)
|
||||
{
|
||||
_degreesLatitude = degreesLatitude;
|
||||
_degreesLongitude = degreesLongitude;
|
||||
_elipsoidalHeight = 0.0;
|
||||
}
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="degreesLatitude"></param>
|
||||
/// <param name="degreesLongitude"></param>
|
||||
/// <param name="elipsoidalHeight"></param>
|
||||
public LatitudeLongitude(double degreesLatitude, double degreesLongitude, double elipsoidalHeight)
|
||||
{
|
||||
_degreesLatitude = degreesLatitude;
|
||||
_degreesLongitude = degreesLongitude;
|
||||
_elipsoidalHeight = elipsoidalHeight;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns latitude in degrees.
|
||||
/// </summary>
|
||||
public double Latitude
|
||||
{
|
||||
get
|
||||
{
|
||||
return _degreesLatitude;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns longitude in degrees.
|
||||
/// </summary>
|
||||
public double Longitude
|
||||
{
|
||||
get
|
||||
{
|
||||
return _degreesLongitude;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// returns elipsoidal height in meters.
|
||||
/// </summary>
|
||||
public double ElipsoidalHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return _elipsoidalHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
145
GeoUK/Coordinates/Osgb36.cs
Normal file
145
GeoUK/Coordinates/Osgb36.cs
Normal file
@@ -0,0 +1,145 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace GeoUK.Coordinates
|
||||
{
|
||||
/// <summary>
|
||||
/// This immutable class, derived from EastingNorthingCoordinates, provides a convenient means
|
||||
/// to represent OSGB36 eastings and northings.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Eastings and northings are represented in British National Grid and Height is specifgied
|
||||
/// in meters based on the geoid datum returned by the RegionGeoidDatum property.
|
||||
/// </remarks>
|
||||
public class Osgb36 : EastingNorthing
|
||||
{
|
||||
Osgb36GeoidDatum _datum = Osgb36GeoidDatum.OutsideModelBoundary;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GeoUK.Coordinates.Osgb36Cordinates"/> class.
|
||||
/// </summary>
|
||||
/// <param name="easting">Easting.</param>
|
||||
/// <param name="northing">Northing.</param>
|
||||
public Osgb36(double easting, double northing)
|
||||
: base(easting, northing, 0)
|
||||
{
|
||||
_datum = Osgb36GeoidDatum.NewlynUkMainland;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GeoUK.Coordinates.Osgb36Cordinates"/> class.
|
||||
/// </summary>
|
||||
/// <param name="eastingNorthingCoordinates">Easting northing coordinates.</param>
|
||||
public Osgb36(EastingNorthing eastingNorthingCoordinates)
|
||||
: base(eastingNorthingCoordinates.Easting, eastingNorthingCoordinates.Northing, eastingNorthingCoordinates.Height)
|
||||
{
|
||||
_datum = Osgb36GeoidDatum.NewlynUkMainland;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GeoUK.Coordinates.Osgb36Cordinates"/> class.
|
||||
/// </summary>
|
||||
/// <param name="eastingNorthingCoordinates">Easting northing coordinates.</param>
|
||||
/// <param name="datum">Datum.</param>
|
||||
public Osgb36(EastingNorthing eastingNorthingCoordinates, Osgb36GeoidDatum datum)
|
||||
: base(eastingNorthingCoordinates.Easting, eastingNorthingCoordinates.Northing, eastingNorthingCoordinates.Height)
|
||||
{
|
||||
_datum = datum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GeoUK.Coordinates.Osgb36Cordinates"/> class.
|
||||
/// </summary>
|
||||
/// <param name="easting">Easting.</param>
|
||||
/// <param name="northing">Northing.</param>
|
||||
/// <param name="height">Height.</param>
|
||||
/// <param name="datum">Datum.</param>
|
||||
public Osgb36(double easting, double northing, double height, Osgb36GeoidDatum datum)
|
||||
: base(easting, northing, height)
|
||||
{
|
||||
_datum = datum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the Local Geoid datum in use. other property values should be
|
||||
/// considered invalid if this property is set to OutsideModelBoundary.
|
||||
/// </summary>
|
||||
public Osgb36GeoidDatum RegionGeoidDatum
|
||||
{
|
||||
get { return _datum; }
|
||||
}
|
||||
|
||||
public string MapReference {
|
||||
get {
|
||||
/*
|
||||
10km (2-figure) Grid Reference: SO84 = 380000 Easting 240000 Northing
|
||||
1km (4-figure) Grid Reference: NS2468 = 224000 Easting 668000 Northing
|
||||
100m (6-figure) Grid Reference: TL123456 = 512300 Easting 245600 Northing
|
||||
*/
|
||||
var easting = this.Easting;
|
||||
var northing = this.Northing;
|
||||
|
||||
var bngSquare = GetBngSquare (easting, northing);
|
||||
|
||||
//get the number of complete 500k squares
|
||||
var indexNorthing = (int)Math.Floor (northing / 500000);
|
||||
var indexEasting = (int)Math.Floor (easting / 500000);
|
||||
|
||||
//reduce E and N by the number of 500k squares
|
||||
northing = northing - indexNorthing * 500000;
|
||||
easting = easting - indexEasting * 500000;
|
||||
|
||||
//reduce by the number of 100k squares within the 500k square.
|
||||
indexNorthing = (int)Math.Floor (northing) / 100000;
|
||||
indexEasting = (int)Math.Floor (easting) / 100000;
|
||||
|
||||
northing = northing - indexNorthing * 100000;
|
||||
easting = easting - indexEasting * 100000;
|
||||
|
||||
northing = Math.Round (northing / 100);
|
||||
easting = Math.Round (easting / 100);
|
||||
return string.Format ("{0}{1}{2}", bngSquare, Math.Round (easting).ToString("000"), Math.Round (northing).ToString ("000"));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the two letter OS code based on easting and northing in metres.
|
||||
/// </summary>
|
||||
/// <returns>The square with northing.</returns>
|
||||
/// <param name="northing">Northing.</param>
|
||||
/// <param name="easting">Easting.</param>
|
||||
public static string GetBngSquare(double easting, double northing)
|
||||
{
|
||||
var result = string.Empty;
|
||||
|
||||
//test for our upper and lower limits
|
||||
if (easting >=0 && easting < 700000 && northing >=0 && northing < 1300000)
|
||||
{
|
||||
|
||||
var firstChar = new char[6] { 'S', 'N', 'H', 'T', 'O', 'J' };
|
||||
var secondChar = new char[25] {'V', 'Q', 'L', 'F', 'A', 'W', 'R', 'M', 'G', 'B', 'X', 'S', 'N', 'H', 'C', 'Y', 'T', 'O', 'J', 'D', 'Z', 'U', 'P', 'K', 'E'};
|
||||
|
||||
//calculate the first letter
|
||||
var indexNorthing = (int)Math.Floor(northing / 500000);
|
||||
var indexEasting = (int)Math.Floor(easting / 500000);
|
||||
|
||||
//get the first char
|
||||
var chr1 = firstChar[(indexEasting * 3) + indexNorthing];
|
||||
|
||||
//to get the second letter we subtract the number of 500km sectors calculated above
|
||||
indexNorthing = (int)Math.Floor((northing - (indexNorthing * 500000)) / 100000);
|
||||
indexEasting = (int)Math.Floor((easting - (indexEasting * 500000))/ 100000);
|
||||
|
||||
//get the second char
|
||||
var chr2 = secondChar[(indexEasting * 5) + indexNorthing];
|
||||
|
||||
result = string.Format("{0}{1}", chr1, chr2);
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
25
GeoUK/Ellipsoids/Airy1830.cs
Normal file
25
GeoUK/Ellipsoids/Airy1830.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace GeoUK.Ellipsoids
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// This immutable class, derived from Ellipsoid, represents an Airy1930 ellipsoid and is provided for convienience.
|
||||
/// </summary>
|
||||
public class Airy1830 : Ellipsoid
|
||||
{
|
||||
private const double C_SEMI_MAJOR_AXIS = 6377563.396; //a
|
||||
private const double C_SEMI_MINOR_AXIS = 6356256.909; //b
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
public Airy1830()
|
||||
: base(C_SEMI_MAJOR_AXIS, C_SEMI_MINOR_AXIS)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
25
GeoUK/Ellipsoids/Airy1830Modified.cs
Normal file
25
GeoUK/Ellipsoids/Airy1830Modified.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace GeoUK.Ellipsoids
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// This immutable class, derived from Ellipsoid, represents an Airy1930 ellipsoid and is provided for convienience.
|
||||
/// </summary>
|
||||
public class Airy1830Modified : Ellipsoid
|
||||
{
|
||||
private const double C_SEMI_MAJOR_AXIS = 6377340.189; //a
|
||||
private const double C_SEMI_MINOR_AXIS = 6356034.447; //b
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
public Airy1830Modified()
|
||||
: base(C_SEMI_MAJOR_AXIS, C_SEMI_MINOR_AXIS)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
115
GeoUK/Ellipsoids/Ellipsoid.cs
Normal file
115
GeoUK/Ellipsoids/Ellipsoid.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace GeoUK.Ellipsoids
|
||||
{
|
||||
/// <summary>
|
||||
/// This immutable class represents a generic ellipsoid and is used as a base type for other specific ellipsoids.
|
||||
/// </summary>
|
||||
public class Ellipsoid
|
||||
{
|
||||
|
||||
private double _semiMajorAxis = 0.0;
|
||||
private double _semiMinorAxis = 0.0;
|
||||
private double _eccentricity = 0.0;
|
||||
private double _eccentricitySquared = 0.0;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="semiMajorAxis"></param>
|
||||
/// <param name="semiMinorAxis"></param>
|
||||
public Ellipsoid(double semiMajorAxis, double semiMinorAxis)
|
||||
{
|
||||
_semiMinorAxis = semiMinorAxis;
|
||||
_semiMajorAxis = semiMajorAxis;
|
||||
_eccentricitySquared = (Math.Pow(semiMajorAxis, 2) - Math.Pow(semiMinorAxis, 2)) / Math.Pow(semiMajorAxis, 2);
|
||||
_eccentricity = Math.Sqrt(_eccentricitySquared);
|
||||
}
|
||||
/// <summary>
|
||||
/// Calculates the Radius of curvature for a given latitude.
|
||||
/// </summary>
|
||||
/// <param name="degreesLatitude"></param>
|
||||
/// <returns></returns>
|
||||
public double GetRadiusOfCurvatureInPV(double degreesLatitude)
|
||||
{
|
||||
double dblRadians = DegreesToRadians(degreesLatitude);
|
||||
|
||||
//this is the working VB example
|
||||
//GetRadiusOfCurvatureInPV = C_SEMI_MAJOR_AXIS / (1 - C_ECCENTRICITY_SQUARED * Sin(Latitude) ^ 2) ^ 0.5
|
||||
|
||||
//GetRadiusOfCurvatureInPV = 6392142.007676
|
||||
//return (C_SEMI_MAJOR_AXIS / Math.Pow((1 - m_EccentricitySquared * Math.Pow(Math.Sin(dblRadians),2)), 0.5));
|
||||
return _semiMajorAxis / Math.Pow((1 - _eccentricitySquared * Math.Pow(Math.Sin(dblRadians), 2)), 0.5);
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns the semi-major axis of the ellipsoid.
|
||||
/// </summary>
|
||||
public double SemiMajorAxis
|
||||
{
|
||||
get
|
||||
{
|
||||
return _semiMajorAxis;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns the semi-major axis of the ellipsoid.
|
||||
/// </summary>
|
||||
public double SemiMinorAxis
|
||||
{
|
||||
get
|
||||
{
|
||||
return _semiMinorAxis;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// returns the eccentricity of the ellipsoid.
|
||||
/// </summary>
|
||||
public double Eccentricity
|
||||
{
|
||||
get
|
||||
{
|
||||
return _eccentricity;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// returns the eccentricity squared of the ellipsoid.
|
||||
/// </summary>
|
||||
public double EccentricitySquared
|
||||
{
|
||||
get
|
||||
{
|
||||
return _eccentricitySquared;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// returns the second eccentricity squared of the ellipsoid.
|
||||
/// </summary>
|
||||
public double SecondEccentricitySquared
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Math.Pow(_semiMajorAxis, 2) - Math.Pow(_semiMinorAxis, 2)) / Math.Pow(_semiMinorAxis, 2);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns radians for a given value of degrees.
|
||||
/// </summary>
|
||||
/// <param name="degrees"></param>
|
||||
/// <returns></returns>
|
||||
protected double DegreesToRadians(double degrees)
|
||||
{
|
||||
return degrees * (Math.PI / 180);
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns degrees for a given value of radians.
|
||||
/// </summary>
|
||||
/// <param name="radians"></param>
|
||||
/// <returns></returns>
|
||||
protected double RadiansToDegrees(double radians)
|
||||
{
|
||||
return radians * (180 / Math.PI);
|
||||
}
|
||||
}
|
||||
}
|
||||
24
GeoUK/Ellipsoids/Grs80.cs
Normal file
24
GeoUK/Ellipsoids/Grs80.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace GeoUK.Ellipsoids
|
||||
{
|
||||
/// <summary>
|
||||
/// This immutable class, derived from Ellipsoid, represents an GRS80 ellipsoid and is provided for convienience.
|
||||
/// </summary>
|
||||
public class Grs80 : Ellipsoid
|
||||
{
|
||||
//WGS constants
|
||||
private const double C_SEMI_MAJOR_AXIS = 6378137; //a
|
||||
private const double C_SEMI_MINOR_AXIS = 6356752.314; //b
|
||||
|
||||
/// <summary>
|
||||
/// Consructor.
|
||||
/// </summary>
|
||||
public Grs80()
|
||||
: base(C_SEMI_MAJOR_AXIS, C_SEMI_MINOR_AXIS)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
21
GeoUK/Ellipsoids/Hayford1909.cs
Normal file
21
GeoUK/Ellipsoids/Hayford1909.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
|
||||
namespace GeoUK.Ellipsoids
|
||||
{
|
||||
public class Hayford1909 : Ellipsoid
|
||||
{
|
||||
//WGS constants
|
||||
private const double C_SEMI_MAJOR_AXIS = 6378388; //a
|
||||
private const double C_SEMI_MINOR_AXIS = 6356911.946; //b
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
public Hayford1909()
|
||||
: base(C_SEMI_MAJOR_AXIS, C_SEMI_MINOR_AXIS)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
22
GeoUK/Ellipsoids/Wgs84.cs
Normal file
22
GeoUK/Ellipsoids/Wgs84.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
|
||||
namespace GeoUK.Ellipsoids
|
||||
{
|
||||
/// <summary>
|
||||
/// This immutable class, derived from Ellipsoid, represents an WGS84 ellipsoid and is provided for convienience.
|
||||
/// </summary>
|
||||
public class Wgs84 : Ellipsoid
|
||||
{
|
||||
//WGS constants
|
||||
private const double C_SEMI_MAJOR_AXIS = 6378137; //a
|
||||
private const double C_SEMI_MINOR_AXIS = 6356752.3141; //b
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
public Wgs84()
|
||||
: base(C_SEMI_MAJOR_AXIS, C_SEMI_MINOR_AXIS)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
59
GeoUK/GeoUK.csproj
Normal file
59
GeoUK/GeoUK.csproj
Normal file
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<ProjectGuid>{5C458FBF-4E2A-4F9D-ACC2-9CE5BED34236}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>GeoUK</RootNamespace>
|
||||
<AssemblyName>GeoUK</AssemblyName>
|
||||
<TargetFrameworkProfile>Profile78</TargetFrameworkProfile>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Convert.cs" />
|
||||
<Compile Include="MathEx.cs" />
|
||||
<Compile Include="Coordinates\GeoidDatum.cs" />
|
||||
<Compile Include="Ellipsoids\Ellipsoid.cs" />
|
||||
<Compile Include="Projections\Projection.cs" />
|
||||
<Compile Include="Ellipsoids\Airy1830Modified.cs" />
|
||||
<Compile Include="Ellipsoids\Airy1830.cs" />
|
||||
<Compile Include="Ellipsoids\Grs80.cs" />
|
||||
<Compile Include="Ellipsoids\Hayford1909.cs" />
|
||||
<Compile Include="Ellipsoids\Wgs84.cs" />
|
||||
<Compile Include="Coordinates\Osgb36.cs" />
|
||||
<Compile Include="Coordinates\LatitudeLongitude.cs" />
|
||||
<Compile Include="Coordinates\EastingNorthing.cs" />
|
||||
<Compile Include="Coordinates\Cartesian.cs" />
|
||||
<Compile Include="Projections\BritishNationalGrid.cs" />
|
||||
<Compile Include="Projections\IrishNationalGrid.cs" />
|
||||
<Compile Include="Projections\UniversalTransverseMercator.cs" />
|
||||
<Compile Include="Transform.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
34
GeoUK/MathEx.cs
Normal file
34
GeoUK/MathEx.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
|
||||
namespace GeoUK
|
||||
{
|
||||
public static class MathEx
|
||||
{
|
||||
public static double Secant(double x){
|
||||
return 1 / Math.Cos(x);
|
||||
}
|
||||
|
||||
// Cosecant Cosec(X) = 1 / Sin(X)
|
||||
// Cotangent Cotan(X) = 1 / Tan(X)
|
||||
// Inverse Sine Arcsin(X) = Atn(X / Sqr(-X * X + 1))
|
||||
// Inverse Cosine Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
|
||||
// Inverse Secant Arcsec(X) = 2 * Atn(1) - Atn(Sgn(X) / Sqr(X * X - 1))
|
||||
// Inverse Cosecant Arccosec(X) = Atn(Sgn(X) / Sqr(X * X - 1))
|
||||
// Inverse Cotangent Arccotan(X) = 2 * Atn(1) - Atn(X)
|
||||
// Hyperbolic Sine HSin(X) = (Exp(X) - Exp(-X)) / 2
|
||||
// Hyperbolic Cosine HCos(X) = (Exp(X) + Exp(-X)) / 2
|
||||
// Hyperbolic Tangent HTan(X) = (Exp(X) - Exp(-X)) / (Exp(X) + Exp(-X))
|
||||
// Hyperbolic Secant HSec(X) = 2 / (Exp(X) + Exp(-X))
|
||||
// Hyperbolic Cosecant HCosec(X) = 2 / (Exp(X) - Exp(-X))
|
||||
// Hyperbolic Cotangent HCotan(X) = (Exp(X) + Exp(-X)) / (Exp(X) - Exp(-X))
|
||||
// Inverse Hyperbolic Sine HArcsin(X) = Log(X + Sqr(X * X + 1))
|
||||
// Inverse Hyperbolic Cosine HArccos(X) = Log(X + Sqr(X * X - 1))
|
||||
// Inverse Hyperbolic Tangent HArctan(X) = Log((1 + X) / (1 - X)) / 2
|
||||
// Inverse Hyperbolic Secant HArcsec(X) = Log((Sqr(-X * X + 1) + 1) / X)
|
||||
// Inverse Hyperbolic Cosecant HArccosec(X) = Log((Sgn(X) * Sqr(X * X + 1) + 1) / X)
|
||||
// Inverse Hyperbolic Cotangent HArccotan(X) = Log((X + 1) / (X - 1)) / 2
|
||||
// Logarithm to base N LogN(X) = Log(X) / Log(N)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
116
GeoUK/OSTN02Transform.cs
Normal file
116
GeoUK/OSTN02Transform.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
using GeoUK.Coordinates;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using GeoUK.Ellipsoids;
|
||||
using GeoUK.Projections;
|
||||
|
||||
namespace GeoUK
|
||||
{
|
||||
public static class OSTN02Transform
|
||||
{
|
||||
/// <summary>
|
||||
/// Performs an ETRS89 to OSGB36/ODN datum transformation. Accuracy is approximately 10 centimeters.
|
||||
/// Whilst very accurate this method is much slower than the Helmert transformation.
|
||||
/// </summary>
|
||||
public static Osgb36 Etrs89ToOsgb(LatitudeLongitude coordinates)
|
||||
{
|
||||
var enCoordinates = Convert.ToEastingNorthing (new Grs80 (), new BritishNationalGrid (), coordinates);
|
||||
return Etrs89ToOsgb (enCoordinates, coordinates.ElipsoidalHeight);
|
||||
}
|
||||
|
||||
private static Osgb36 Etrs89ToOsgb(EastingNorthing coordinates, double ellipsoidHeight)
|
||||
{
|
||||
var dataStream = GetEmbeddedOSTN02 ();
|
||||
|
||||
TextReader tr = new StreamReader(dataStream);
|
||||
List<int> recordNumbers = new List<int>();
|
||||
string[] records = new string[4];
|
||||
|
||||
//determine record numbers
|
||||
int eastIndex = (int)(coordinates.Easting / 1000.0);
|
||||
int northIndex = (int)(coordinates.Northing / 1000.0);
|
||||
|
||||
double x0 = eastIndex * 1000;
|
||||
double y0 = northIndex * 1000;
|
||||
|
||||
//work out the four records
|
||||
recordNumbers.Add(CalculateRecordNumber(eastIndex, northIndex));
|
||||
recordNumbers.Add(CalculateRecordNumber(eastIndex + 1, northIndex));
|
||||
recordNumbers.Add(CalculateRecordNumber(eastIndex + 1, northIndex + 1));
|
||||
recordNumbers.Add(CalculateRecordNumber(eastIndex, northIndex + 1));
|
||||
|
||||
//get records from the data file
|
||||
int recordsFound = 0;
|
||||
while (recordsFound < 4)
|
||||
{
|
||||
string csvRecord = tr.ReadLine();
|
||||
for (int index = 0; index < 4; index++)
|
||||
{
|
||||
if (csvRecord.StartsWith (recordNumbers [index].ToString ().Trim () + ",", StringComparison.Ordinal)) {
|
||||
//dont use add as we need to keep these in same order as record numbers
|
||||
records [index] = csvRecord;
|
||||
recordsFound++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//populate the properties
|
||||
string[] fields0 = records[0].Split(",".ToCharArray());
|
||||
string[] fields1 = records[1].Split(",".ToCharArray());
|
||||
string[] fields2 = records[2].Split(",".ToCharArray());
|
||||
string[] fields3 = records[3].Split(",".ToCharArray());
|
||||
|
||||
var se0 = System.Convert.ToDouble(fields0[3]);
|
||||
var se1 = System.Convert.ToDouble(fields1[3]);
|
||||
var se2 = System.Convert.ToDouble(fields2[3]);
|
||||
var se3 = System.Convert.ToDouble(fields3[3]);
|
||||
|
||||
var sn0 = System.Convert.ToDouble(fields0[4]);
|
||||
var sn1 = System.Convert.ToDouble(fields1[4]);
|
||||
var sn2 = System.Convert.ToDouble(fields2[4]);
|
||||
var sn3 = System.Convert.ToDouble(fields3[4]);
|
||||
|
||||
var sg0 = System.Convert.ToDouble(fields0[5]);
|
||||
var sg1 = System.Convert.ToDouble(fields1[5]);
|
||||
var sg2 = System.Convert.ToDouble(fields2[5]);
|
||||
var sg3 = System.Convert.ToDouble(fields3[5]);
|
||||
|
||||
var dx = coordinates.Easting - x0;
|
||||
var dy = coordinates.Northing - y0;
|
||||
|
||||
var t = dx / 1000.0;
|
||||
var u = dy / 1000.0;
|
||||
|
||||
var se = (1 - t) * (1 - u) * se0 + t * (1 - u) * se1 + t * u * se2 + (1 - t) * u * se3;
|
||||
var sn = (1 - t) * (1 - u) * sn0 + t * (1 - u) * sn1 + t * u * sn2 + (1 - t) * u * sn3;
|
||||
var sg = (1 - t) * (1 - u) * sg0 + t * (1 - u) * sg1 + t * u * sg2 + (1 - t) * u * sg3;
|
||||
|
||||
var geoidDatum = (Osgb36GeoidDatum)System.Convert.ToInt32(fields0[6]);
|
||||
|
||||
var easting = coordinates.Easting + se;
|
||||
var northing = coordinates.Northing + sn;
|
||||
var height = ellipsoidHeight - sg;
|
||||
|
||||
return new Osgb36(easting, northing, height, geoidDatum);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates a data file record number.
|
||||
/// </summary>
|
||||
/// <param name="eastIndex"></param>
|
||||
/// <param name="northIndex"></param>
|
||||
/// <returns></returns>
|
||||
private static int CalculateRecordNumber(int eastIndex, int northIndex)
|
||||
{
|
||||
return eastIndex + (northIndex * 701) + 1;
|
||||
}
|
||||
private static Stream GetEmbeddedOSTN02()
|
||||
{
|
||||
return ResourceManager.GetEmbeddedResourceStream (typeof(OSTN02Transform).GetTypeInfo ().Assembly, "OSTN02_OSGM02_GB.txt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
26
GeoUK/Projections/BritishNationalGrid.cs
Normal file
26
GeoUK/Projections/BritishNationalGrid.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace GeoUK.Projections
|
||||
{
|
||||
/// <summary>
|
||||
/// This immutable class, derived from Projection, represents the British National Grid projection and is provided for convienience.
|
||||
/// </summary>
|
||||
public class BritishNationalGrid : Projection
|
||||
{
|
||||
private const double SCALE_FACTOR = 0.9996012717;
|
||||
private const double E = 400000;
|
||||
private const double TO_LAT = 49;
|
||||
private const double TO_LONG = -2;
|
||||
private const double N_NH = -100000;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
public BritishNationalGrid()
|
||||
: base(SCALE_FACTOR, E, N_NH, TO_LAT, TO_LONG)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
26
GeoUK/Projections/IrishNationalGrid.cs
Normal file
26
GeoUK/Projections/IrishNationalGrid.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace GeoUK.Projections
|
||||
{
|
||||
/// <summary>
|
||||
/// This immutable class, derived from Projection, represents the British National Grid projection and is provided for convienience.
|
||||
/// </summary>
|
||||
public class IrishNationalGrid : Projection
|
||||
{
|
||||
private const double SCALE_FACTOR = 1.000035;
|
||||
private const double E = 200000;
|
||||
private const double TO_LAT = 53.5;
|
||||
private const double TO_LONG = -8;
|
||||
private const double N_NH = 250000;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
public IrishNationalGrid()
|
||||
: base(SCALE_FACTOR, E, N_NH, TO_LAT, TO_LONG)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
116
GeoUK/Projections/Projection.cs
Normal file
116
GeoUK/Projections/Projection.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Globalization;
|
||||
|
||||
namespace GeoUK.Projections
|
||||
{
|
||||
/// <summary>
|
||||
/// This immutable class represents a generic projection and is used as a base type for other specific projections.
|
||||
/// </summary>
|
||||
public class Projection
|
||||
{
|
||||
private double _trueOriginLatitude = 0.0;
|
||||
private double _trueOriginLongitude = 0.0;
|
||||
private double _scaleFactor = 0.0;
|
||||
private double _trueOriginEasting = 0.0;
|
||||
private double _trueOriginNorthing = 0.0;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
public Projection(double scaleFactor, double trueOriginEasting, double trueOriginNorthing, double trueOriginLatitude, double trueOriginLongitude)
|
||||
{
|
||||
_scaleFactor = scaleFactor;
|
||||
_trueOriginEasting = trueOriginEasting;
|
||||
_trueOriginNorthing = trueOriginNorthing;
|
||||
_trueOriginLatitude = trueOriginLatitude;
|
||||
_trueOriginLongitude = trueOriginLongitude;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the scale factor.
|
||||
/// </summary>
|
||||
public double ScaleFactor
|
||||
{
|
||||
get { return _scaleFactor; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns the Easting coordinate of the true origin.
|
||||
/// </summary>
|
||||
public double TrueOriginEasting
|
||||
{
|
||||
get { return _trueOriginEasting; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns the Northing coordinate of the true origin.
|
||||
/// </summary>
|
||||
public double TrueOriginNorthing
|
||||
{
|
||||
get { return _trueOriginNorthing; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns the Latitude coordinate of the true origin for the southern hemisphere.
|
||||
/// </summary>
|
||||
public double TrueOriginLatitude
|
||||
{
|
||||
get{ return _trueOriginLatitude; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns the Longitude coordinate of the true origin for the southern hemisphere.
|
||||
/// </summary>
|
||||
public double TrueOriginLongitude
|
||||
{
|
||||
get { return _trueOriginLongitude; }
|
||||
}
|
||||
//public static double DegreesToRadians(double degrees)
|
||||
//{
|
||||
// return degrees * (Math.PI / 180);
|
||||
//}
|
||||
//public static double RadiansToDegrees(double radians)
|
||||
//{
|
||||
// return radians * (180 / Math.PI);
|
||||
//}
|
||||
/// <summary>
|
||||
/// Returns the integer portion of a division operation.
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <param name="divisor"></param>
|
||||
/// <returns></returns>
|
||||
protected static double Div(double value, double divisor)
|
||||
{
|
||||
double dblResult = 0;
|
||||
bool blnNegative = false;
|
||||
|
||||
//make the division
|
||||
dblResult = value / divisor;
|
||||
|
||||
//do all calculations on positive numbers
|
||||
if (dblResult < 0)
|
||||
{
|
||||
blnNegative = true;
|
||||
dblResult = dblResult * -1;
|
||||
}
|
||||
|
||||
//see if there is any remainder
|
||||
if (dblResult % 1 > 0)
|
||||
{
|
||||
dblResult = Math.Ceiling(dblResult) - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dblResult = System.Convert.ToInt32(dblResult, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
if (blnNegative)
|
||||
{
|
||||
dblResult = dblResult * -1.0;
|
||||
}
|
||||
|
||||
return dblResult;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
76
GeoUK/Projections/UniversalTransverseMercator.cs
Normal file
76
GeoUK/Projections/UniversalTransverseMercator.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Globalization;
|
||||
|
||||
namespace GeoUK.Projections
|
||||
{
|
||||
/// <summary>
|
||||
/// This immutable class, derived from Projection, represents the Universal Transverse Mercator projection.
|
||||
/// The class handles all medidian calculations internally.
|
||||
/// </summary>
|
||||
public class UniversalTransverseMercator : Projection
|
||||
{
|
||||
private const double SCALE_FACTOR = 0.9996;
|
||||
private const double E = 500000;
|
||||
private const double TO_LAT = 0; //is this for britain? These will need to be calculated based on the lat and long being transfformed.
|
||||
private const double N_NH = 0;
|
||||
private const double N_SH = 10000000;
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="degreesLatitude"></param>
|
||||
/// <param name="degreesLongitude"></param>
|
||||
public UniversalTransverseMercator(double degreesLatitude, double degreesLongitude)
|
||||
: base(SCALE_FACTOR, E, CalculateOriginNorthing(degreesLatitude, degreesLongitude), TO_LAT, CalculateLongitudeOrigin(degreesLatitude, degreesLongitude))
|
||||
{
|
||||
|
||||
}
|
||||
private static double CalculateOriginNorthing(double degreesLatitude, double degreesLongitude)
|
||||
{
|
||||
double falseNorthing = 0.0;
|
||||
//sort out false northing
|
||||
if (degreesLatitude < 0)
|
||||
{
|
||||
falseNorthing = N_SH;
|
||||
}
|
||||
else
|
||||
{
|
||||
falseNorthing = N_NH;
|
||||
}
|
||||
return falseNorthing;
|
||||
}
|
||||
private static double CalculateLongitudeOrigin(double degreesLatitude, double degreesLongitude)
|
||||
{
|
||||
|
||||
double longOrigin = 0.0;
|
||||
|
||||
if (degreesLongitude < 0)
|
||||
{
|
||||
if (degreesLongitude > -6)
|
||||
{
|
||||
longOrigin = -3;
|
||||
}
|
||||
else
|
||||
{
|
||||
longOrigin = Div(degreesLongitude, 6.0);
|
||||
longOrigin = (System.Convert.ToInt32(longOrigin, CultureInfo.InvariantCulture)) * 6 - 3;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (degreesLongitude < 6)
|
||||
{
|
||||
longOrigin = 3.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
longOrigin = Div(degreesLongitude, 6);
|
||||
longOrigin = (System.Convert.ToInt32(longOrigin, CultureInfo.InvariantCulture)) * 6 + 3;
|
||||
}
|
||||
}
|
||||
return longOrigin;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
|
||||
[assembly: AssemblyTitle ("GeoUK")]
|
||||
[assembly: AssemblyDescription ("Geodetic transformations for UK based coordinate systems.")]
|
||||
[assembly: AssemblyConfiguration ("")]
|
||||
[assembly: AssemblyCompany ("")]
|
||||
[assembly: AssemblyProduct ("")]
|
||||
[assembly: AssemblyCopyright ("(c) John Newcombe 2015")]
|
||||
[assembly: AssemblyTrademark ("")]
|
||||
[assembly: AssemblyCulture ("")]
|
||||
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
|
||||
[assembly: AssemblyVersion ("1.0.*")]
|
||||
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
||||
|
||||
[InternalsVisibleTo("GeoUK.Tests")]
|
||||
28
GeoUK/Properties/AssemblyInfo.cs
Normal file
28
GeoUK/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
|
||||
[assembly: AssemblyTitle ("GeoUK")]
|
||||
[assembly: AssemblyDescription ("Geodetic transformations for UK based coordinate systems.")]
|
||||
[assembly: AssemblyConfiguration ("")]
|
||||
[assembly: AssemblyCompany ("")]
|
||||
[assembly: AssemblyProduct ("")]
|
||||
[assembly: AssemblyCopyright ("(c) John Newcombe 2015")]
|
||||
[assembly: AssemblyTrademark ("")]
|
||||
[assembly: AssemblyCulture ("")]
|
||||
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
|
||||
[assembly: AssemblyVersion ("1.2.0")]
|
||||
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
||||
|
||||
[assembly: InternalsVisibleTo("GeoUK.Tests")]
|
||||
39
GeoUK/ResourceManager.cs
Normal file
39
GeoUK/ResourceManager.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
|
||||
namespace GeoUK
|
||||
{
|
||||
internal static class ResourceManager
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to find and return the given resource from within the specified assembly.
|
||||
/// </summary>
|
||||
/// <returns>The embedded resource stream.</returns>
|
||||
/// <param name="assembly">Assembly.</param>
|
||||
/// <param name="resourceFileName">Resource file name.</param>
|
||||
public static Stream GetEmbeddedResourceStream (Assembly assembly, string resourceFileName)
|
||||
{
|
||||
var resourceNames = assembly.GetManifestResourceNames ();
|
||||
|
||||
var resourcePaths = resourceNames
|
||||
.Where (x => x.EndsWith (resourceFileName, StringComparison.CurrentCultureIgnoreCase))
|
||||
.ToArray ();
|
||||
|
||||
if (!resourcePaths.Any ()) {
|
||||
throw new Exception (string.Format ("Resource ending with {0} not found.", resourceFileName));
|
||||
}
|
||||
|
||||
if (resourcePaths.Count () > 1) {
|
||||
throw new Exception (string.Format ("Multiple resources ending with {0} found: {1}{2}", resourceFileName, Environment.NewLine, string.Join (Environment.NewLine, resourcePaths)));
|
||||
}
|
||||
|
||||
return assembly.GetManifestResourceStream (resourcePaths.Single ());
|
||||
}
|
||||
}
|
||||
}
|
||||
50451
GeoUK/Resources/OSGM02_NI.txt
Normal file
50451
GeoUK/Resources/OSGM02_NI.txt
Normal file
File diff suppressed because it is too large
Load Diff
175851
GeoUK/Resources/OSGM02_RoI.txt
Normal file
175851
GeoUK/Resources/OSGM02_RoI.txt
Normal file
File diff suppressed because it is too large
Load Diff
876951
GeoUK/Resources/OSTN02_OSGM02_GB.txt
Normal file
876951
GeoUK/Resources/OSTN02_OSGM02_GB.txt
Normal file
File diff suppressed because it is too large
Load Diff
275
GeoUK/Transform.cs
Normal file
275
GeoUK/Transform.cs
Normal file
@@ -0,0 +1,275 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using GeoUK.Coordinates;
|
||||
using GeoUK.Ellipsoids;
|
||||
using GeoUK.Projections;
|
||||
|
||||
namespace GeoUK
|
||||
{
|
||||
/// <summary>
|
||||
/// This class performs transformations between datums.
|
||||
/// </summary>
|
||||
public static class Transform
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Performs an ETRS89 to OSGB36 datum transformation. Accuracy is approximately 5 meters in all directions.
|
||||
/// For this method, ERTS89, ITRS2000 and WGS84 datums can be considered the same.
|
||||
/// </summary>
|
||||
/// <param name="coordinates">Cartesian Coordinates to be transformed.</param>
|
||||
/// <remarks>
|
||||
/// This method uses a Helmert transformation to determine the OSGB36 coordinates.
|
||||
/// Whilst only accurate to 5 meters in all directions, it is extremely fast.
|
||||
/// </remarks>
|
||||
public static Cartesian Etrs89ToOsgb36(Cartesian coordinates)
|
||||
{
|
||||
//tX (m) tY (m) tZ (m) s (ppm) rX (sec) rY (sec) rZ (sec)
|
||||
//-446.448 125.157 - 542.060 20.4894 - 0.1502 - 0.247 - 0.8421
|
||||
|
||||
//set up the parameters
|
||||
double tx = -446.448;
|
||||
double ty = 125.157;
|
||||
double tz = -542.060;
|
||||
double s = 20.4894;
|
||||
double rx = ToRadians(ToDecimelDegrees(0, 0, -0.1502));
|
||||
double ry = ToRadians(ToDecimelDegrees(0, 0, -0.247));
|
||||
double rz = ToRadians(ToDecimelDegrees(0, 0, -0.8421));
|
||||
|
||||
Cartesian result = HelmertTransformation(coordinates, tx, ty, tz, rx, ry, rz, s);
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Performs an OSGB36 to ETRS89 datum transformation. Accuracy is approximately 5 meters in all directions.
|
||||
/// For this method, ERTS89, ITRS2000 and WGS84 datums can be considered the same.
|
||||
/// </summary>
|
||||
/// <param name="coordinates">Cartesian Coordinates to be transformed.</param>
|
||||
/// <returns></returns>
|
||||
public static Cartesian Osgb36ToEtrs89(Cartesian coordinates)
|
||||
{
|
||||
//(BUT CHANGE SIGNS OF EACH PARAMETER FOR REVERSE)
|
||||
//tX (m) tY (m) tZ (m) s (ppm) rX (sec) rY (sec) rZ (sec)
|
||||
//-446.448 125.157 - 542.060 20.4894 - 0.1502 - 0.247 - 0.8421
|
||||
|
||||
double tx = 446.448;
|
||||
double ty = -125.157;
|
||||
double tz = 542.060;
|
||||
double s = -20.4894;
|
||||
double rx = ToRadians(ToDecimelDegrees(0, 0, 0.1502));
|
||||
double ry = ToRadians(ToDecimelDegrees(0, 0, 0.247));
|
||||
double rz = ToRadians(ToDecimelDegrees(0, 0, 0.8421));
|
||||
|
||||
return HelmertTransformation(coordinates, tx, ty, tz, rx, ry, rz, s);
|
||||
|
||||
}
|
||||
/*
|
||||
* //(BUT CHANGE SIGNS OF EACH PARAMETER FOR REVERSE)
|
||||
tX (m) tY (m) tZ (m) s (ppm) rX (sec) rY (sec) rZ (sec)
|
||||
-446.448 +125.157 -542.060 +20.4894 -0.1502 -0.2470 -0.8421
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/// <summary>
|
||||
/// Performs an ETRS89 to ITRS2000 datum transformation.
|
||||
/// </summary>
|
||||
/// <param name="coordinates">Cartesian Coordinates to be transformed.</param>
|
||||
/// <param name="epochYear">Refers to the year the data specified in coordinates was gathered.</param>
|
||||
/// <returns></returns>
|
||||
public static Cartesian Etrs89ToItrs2000(Cartesian coordinates, int epochYear)
|
||||
{
|
||||
//tX (m) tY (m) tZ (m) s (ppm) rX (sec) rY (sec) rZ (sec)
|
||||
//0.054 0.051 - 0.048 0 0.000081 dt 0.00049 dt - 0.000792 dt
|
||||
|
||||
//dt represents shift in years since time of survey to when ETRS89 was determined
|
||||
|
||||
int dt = epochYear - 1989;
|
||||
//set up the parameters
|
||||
double tx = Negate(0.054);
|
||||
double ty = Negate(0.051);
|
||||
double tz = Negate(-0.048);
|
||||
double s = 0;
|
||||
double rx = Negate(ToRadians(ToDecimelDegrees(0, 0, 0.000081) * dt));
|
||||
double ry = Negate(ToRadians(ToDecimelDegrees(0, 0, 0.00049) * dt));
|
||||
double rz = Negate(ToRadians(ToDecimelDegrees(0, 0, -0.000792) * dt));
|
||||
|
||||
return HelmertTransformation(coordinates, tx, ty, tz, rx, ry, rz, s);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Performs an ITRS2000 to ETRS89 datum transformation.
|
||||
/// </summary>
|
||||
/// <param name="coordinates">Cartesian Coordinates to be transformed.</param>
|
||||
/// <param name="epochYear">Refers to the year the data specified in coordinates was gathered.</param>
|
||||
/// <returns></returns>
|
||||
public static Cartesian Itrs2000ToEtrs89(Cartesian coordinates, int epochYear )
|
||||
{
|
||||
//tX (m) tY (m) tZ (m) s (ppm) rX (sec) rY (sec) rZ (sec)
|
||||
//0.054 0.051 - 0.048 0 0.000081 dt 0.00049 dt - 0.000792 dt
|
||||
|
||||
//dt represents shift in years since time of survey to when ETRS89 was determined
|
||||
|
||||
int dt = epochYear - 1989;
|
||||
//set up the parameters
|
||||
double tx = 0.054;
|
||||
double ty = 0.051;
|
||||
double tz = -0.048;
|
||||
double s = 0;
|
||||
double rx = ToRadians(ToDecimelDegrees(0, 0, 0.000081) * dt);
|
||||
double ry = ToRadians(ToDecimelDegrees(0, 0, 0.00049) * dt);
|
||||
double rz = ToRadians(ToDecimelDegrees(0, 0, -0.000792) * dt);
|
||||
|
||||
return HelmertTransformation(coordinates, tx, ty, tz, rx, ry, rz, s);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Performs an ITRS94/96/97 to ETRS89 datum transformation.
|
||||
/// </summary>
|
||||
/// <param name="coordinates">Cartesian Coordinates to be transformed.</param>
|
||||
/// <param name="epochYear">Refers to the year the data specified in coordinates was gathered.</param>
|
||||
/// <returns></returns>
|
||||
public static Cartesian Itrs97ToEtrs89(Cartesian coordinates, int epochYear)
|
||||
{
|
||||
//ITRS94/96/97 to ETRS89 datum transformation
|
||||
//tX (m) tY (m) tZ (m) s (ppm) rX (sec) rY (sec) rZ (sec)
|
||||
//0.041 0.041 - 0.049 0 0.00020 dt 0.00050 dt - 0.00065 dt
|
||||
|
||||
//dt represents shift in years since time of survey to when ETRS89 was determined
|
||||
|
||||
int dt = epochYear - 1989;
|
||||
//set up the parameters
|
||||
double tx = 0.041;
|
||||
double ty = 0.041;
|
||||
double tz = -0.049;
|
||||
double s = 0;
|
||||
double rx = ToRadians(ToDecimelDegrees(0, 0, 0.00020) * dt);
|
||||
double ry = ToRadians(ToDecimelDegrees(0, 0, 0.00050) * dt);
|
||||
double rz = ToRadians(ToDecimelDegrees(0, 0, -0.00065) * dt);
|
||||
|
||||
return HelmertTransformation(coordinates, tx, ty, tz, rx, ry, rz, s);
|
||||
}
|
||||
/// <summary>
|
||||
/// Performs an ETRS89 to ITRS94/96/97 datum transformation.
|
||||
/// </summary>
|
||||
/// <param name="coordinates">Cartesian Coordinates to be transformed.</param>
|
||||
/// <param name="epochYear">Refers to the year the data specified in coordinates was gathered.</param>
|
||||
/// <returns></returns>
|
||||
public static Cartesian Etrs89ToItrs97(Cartesian coordinates, int epochYear)
|
||||
{
|
||||
//ITRS94/96/97 to ETRS89 datum transformation (BUT CHANGE SIGNS OF EACH PARAMETER FOR REVERSE)
|
||||
//tX (m) tY (m) tZ (m) s (ppm) rX (sec) rY (sec) rZ (sec)
|
||||
//0.041 0.041 - 0.049 0 0.00020 dt 0.00050 dt - 0.00065 dt
|
||||
|
||||
//dt represents shift in years since time of survey to when ETRS89 was determined
|
||||
|
||||
int dt = epochYear - 1989;
|
||||
//set up the parameters
|
||||
double tx = Negate(0.041);
|
||||
double ty = Negate(0.041);
|
||||
double tz = Negate(-0.049);
|
||||
double s = 0;
|
||||
double rx = Negate(ToRadians(ToDecimelDegrees(0, 0, 0.00020) * dt));
|
||||
double ry = Negate(ToRadians(ToDecimelDegrees(0, 0, 0.00050) * dt));
|
||||
double rz = Negate(ToRadians(ToDecimelDegrees(0, 0, -0.00065) * dt));
|
||||
|
||||
return HelmertTransformation(coordinates, tx, ty, tz, rx, ry, rz, s);
|
||||
}
|
||||
private static double ToDecimelDegrees(int degrees, int minutes, double seconds)
|
||||
{
|
||||
//determine seconds as minutes
|
||||
double m = minutes + (seconds / 60.0);
|
||||
return ToDecimelDegrees(degrees, m);
|
||||
}
|
||||
private static double ToDecimelDegrees(int degrees, double minutes)
|
||||
{
|
||||
//determine minutes as derees
|
||||
return degrees + (minutes / 60.0);
|
||||
}
|
||||
private static double ToRadians(double degrees)
|
||||
{
|
||||
return degrees * (Math.PI / 180.0);
|
||||
}
|
||||
private static double ToDegrees(double radians)
|
||||
{
|
||||
return radians * (180.0 / Math.PI);
|
||||
}
|
||||
/// <summary>
|
||||
/// This seven parameter method can be used to transform coordinates between datums.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This method assumes that the rotation
|
||||
/// parameters are <20>small<6C>. Rotation parameters between geodetic cartesian systems are usually less than 5
|
||||
/// seconds of arc, because the axes are conventionally aligned to the Greenwich Meridian and the Pole.
|
||||
/// Do not use this formula for larger angles.
|
||||
/// </remarks>
|
||||
/// <param name="coordinates"></param>
|
||||
/// <param name="translationX"></param>
|
||||
/// <param name="translationY"></param>
|
||||
/// <param name="translationZ"></param>
|
||||
/// <param name="rotationX"></param>
|
||||
/// <param name="rotationY"></param>
|
||||
/// <param name="rotationZ"></param>
|
||||
/// <param name="scaleFactorPpm"></param>
|
||||
/// <returns></returns>
|
||||
public static Cartesian HelmertTransformation(Cartesian coordinates, double translationX, double translationY, double translationZ, double rotationX, double rotationY, double rotationZ, double scaleFactorPpm)
|
||||
{
|
||||
//to compute this helmert translation we have to multiply XYZa by R and add to T
|
||||
//
|
||||
// : X :B : TX : : 1+s -rz ry : : X :A
|
||||
// : : : : : : : :
|
||||
// : Y : = : TY : + : rz 1+s -rx :. : Y :
|
||||
// : : : : : : : :
|
||||
// : Z : : TZ : : -ry rx 1+s : : Z :
|
||||
|
||||
//scale factor passed in as a parts/million measure
|
||||
double scaleFactor = scaleFactorPpm / 1000000.0;
|
||||
|
||||
//create initial matrixes (cols, rows)
|
||||
double[] XYZa = new double[3]; //initial xyz
|
||||
XYZa[0] = coordinates.X;
|
||||
XYZa[1] = coordinates.Y;
|
||||
XYZa[2] = coordinates.Z;
|
||||
|
||||
//populate main matrix 'R'
|
||||
double[,] R = new double[3, 3];
|
||||
//top row
|
||||
R[0, 0] = 1 + scaleFactor; R[1, 0] = -rotationZ; R[2, 0] = rotationY;
|
||||
//second row
|
||||
R[0, 1] = rotationZ; R[1, 1] = 1 + scaleFactor; R[2, 1] = -rotationX;
|
||||
//third row
|
||||
R[0, 2] = -rotationY; R[1, 2] = rotationX; R[2, 2] = 1 + scaleFactor;
|
||||
|
||||
//populate matrix 'T'
|
||||
double[] T = new double[3];
|
||||
T[0] = translationX; T[1] = translationY; T[2] = translationZ;
|
||||
|
||||
//intermediate result of the multiplication goes here
|
||||
double[] temp = new double[3];
|
||||
|
||||
//final result goes here
|
||||
//double[,] XYZb = new double[1, 3]; //result
|
||||
|
||||
//start with the multiplication of matrix XYZa and R
|
||||
for (int row = 0; row < 3; row++)
|
||||
{
|
||||
for (int col = 0; col < 3; col++)
|
||||
{
|
||||
temp[row] = temp[row] + (R[col, row] * XYZa[col]);
|
||||
}
|
||||
}
|
||||
|
||||
//adding to T whilst creating the cartesian coordinates
|
||||
return new Cartesian(T[0] + temp[0], T[1] + temp[1], T[2] + temp[2]);
|
||||
}
|
||||
/// <summary>
|
||||
/// Helper funtion to reverse the sign of a value. Helps code to be more readable.
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
private static double Negate(double value)
|
||||
{
|
||||
return value * -1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
8
README.md
Normal file
8
README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Latest Stable Version #
|
||||
The source within the master branch represents the latest stable version and reflects the version that is published in Nuget.org.
|
||||
|
||||
# GeoUK #
|
||||
The project allows for a conversion from GPS coordinates to British National Grid and back again. The product is available as a NuGet package (GeoUK). GeoUK was built as a Portable Class Library project (Profile 78) and as such can be added to Visual Studio or Xamarin and runs against .Net 4.5+, Windows Phone 8+, Xamarin.IOS/Android, Windows 8 Store Apps and so on. The product is licensed under the [GNU Lesser General Public License (LGPL)](https://www.gnu.org/licenses/lgpl-3.0.en.html).
|
||||
|
||||
# GeoUK.OSTN #
|
||||
The GeoUk.OSTN project, also available as a NuGet package (GeoUK.OSTN) Adds OSTN02 and OSTN15 transformation which provide a greater accuracy. A full description of how to use this package can be found in the CodeProject article [Converting Latitude and Longitude to British National Grid in C#](http://www.codeproject.com/Articles/1007147/Converting-Latitude-and-Longitude-to-British-Natio)
|
||||
Reference in New Issue
Block a user