Provides geographical services for Inner Drive applications
$ dotnet add package InnerDrive.GeographyThe Inner Drive Extensible Architecture implements common .NET development situations including time zones, money, measurements and conversions, and Microsoft Azure features.
This package runs on .NET 10. It depends on these packages:
Find the distance and bearing between two points:
// 40°42'47"N 74°00'47"W, 11.0 m
var origin = new Node(
new Latitude(40d, 42d, 47d),
new Longitude(-74d, 0d, 47d),
11d.Meters()
);
// 41°52'44"N 87°38'09"W, 181.0 m
var destination = new Node(
new Latitude(41d, 52d, 44d),
new Longitude(-87d, 38d, 9d),
181d.Meters()
);
var distance = origin.Distance(destination);
var bearing = origin.Bearing(destination);
// Google Earth says 1,147,086 m
var refDistance = 1147068d.Meters();
var accuracy = distance.Accuracy; // Distance is about 99.5% accurate over longer ranges because the calculation assumes a spherical earth
Trace.WriteLine($"From {origin} to {destination} is {distance.ToString("0,0.000", MetricExponent.Kilo)}");
Trace.WriteLine($"(accuracy {accuracy.ToString("0.000", MetricExponent.Kilo)}; reference distance {refDistance.ToString("0,0.0", MetricExponent.Kilo, CultureInfo.InvariantCulture)})");
Output > From 40.71305°N, 74.01305°W, 11 m to 41.87889°N, 87.63583°W, 181 m is 1,143.566 km at 280.97528°
(accuracy 5.718 km; reference distance 1,147.1 km)
The Inner Drive Technology website has a full SDK and example code. We also have a demo weather site that uses all the IDEA components.
Comments or questions? Send feedback