Comments (3)
I don't think so. If so, it wouldn't really be anything that ProjNet4GeoAPI adds, since this library is just concerned with coordinate transformations.
You could, for example, use a conformal projection and compute angles there using NetTopologySuite, but that wouldn't really be different than just computing the angles on the unprojected coordinates.
Mike Gavaghan wrote a Geodesy library in both Java and C#... I copied the C# one onto GitHub (with his permission) at airbreather/Gavaghan.Geodesy, which seems a bit more promising.
GeodeticCalculator.CalculateGeodeticCurve
can give you a GeodeticCurve
which has the Azimuth
/ ReverseAzimuth
, which you should be able to translate to bearing / reverse bearing, right?
from projnet4geoapi.
Rolled back around to this and had a hard time remembering where I'd asked the question. but thank you I'll look into it. I appreciate the referral.
from projnet4geoapi.
Something like this?
/// <summary>
///
/// </summary>
public enum CompassDirection
{
N,
NE,
E,
SE,
S,
SW,
W,
NW
}
/// <summary>
///
/// </summary>
/// <param name="bearing"></param>
/// <returns></returns>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public static CompassDirection GetCompassDirection(double bearing)
{
if (bearing >= 0 && bearing <= 22.5)
{
return CompassDirection.N;
}
else if (bearing >= 22.5 && bearing <= 67.5)
{
return CompassDirection.NE;
}
else if (bearing >= 67.5 && bearing <= 112.5)
{
return CompassDirection.E;
}
else if (bearing >= 112.5 && bearing <= 157.5)
{
return CompassDirection.SE;
}
else if (bearing >= 157.5 && bearing <= 205.5)
{
return CompassDirection.S;
}
else if (bearing >= 202.5 && bearing <= 247.5)
{
return CompassDirection.SW;
}
else if (bearing >= 247.5 && bearing <= 292.5)
{
return CompassDirection.W;
}
else if (bearing >= 292.5 && bearing <= 337.5)
{
return CompassDirection.NW;
}
else
{
return CompassDirection.N;
}
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public static double DegreeBearing(double lon1, double lat1, double lon2, double lat2)
{
var dLon = ToRadians(lon2 - lon1);
var dPhi = Math.Log(Math.Tan(ToRadians(lat2) / 2 + Math.PI / 4) / Math.Tan(ToRadians(lat1) / 2 + Math.PI / 4));
if (Math.Abs(dLon) > Math.PI) dLon = dLon > 0 ? -(2 * Math.PI - dLon) : (2 * Math.PI + dLon);
return ToBearing(Math.Atan2(dLon, dPhi));
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public static double ToBearing(double radians)
{
// convert radians to degrees (as bearing: 0...360)
return (ToDegrees(radians) + 360) % 360;
}
See also: StackOverflow
from projnet4geoapi.
Related Issues (20)
- Add Orthographic Projection HOT 2
- Handle WKT Extension Tag HOT 1
- License change to MIT HOT 3
- Coordinate Conversion - WGS84 to SPCS (NAD83) HOT 3
- Latitude & Longitude order confusing HOT 1
- Convert map view objects to svg
- How can i transforme a point from EPSG:2154 to EPSG:3857 ?
- Getting an error saying PROJCRS not recognized HOT 1
- How convert proj4js source to this lib source?
- Typo in code sample on Wiki HOT 1
- Migrate to Proj.6
- WGS84 -> Lambert Azimuthal Equal Area -> WGS84 fails when x = 0 HOT 3
- Add support for EPSG 5515 S-JTSK/05 / Modified Krovak HOT 2
- confusing documentation for axis orientation
- ProjNET only supports [] objects
- Release version ?
- Sqlite/sqlserver server side vs client side evaluation
- creating a transformation factory fails on ios HOT 1
- Add support of modern coordinate systems that includes height HOT 4
- Seeking help HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from projnet4geoapi.