ieuanwalker / geouk Goto Github PK
View Code? Open in Web Editor NEWThis is a simple to use Geodetic Library for .Net that will allow simple transformation to and from British National Grid.
License: GNU Lesser General Public License v3.0
This is a simple to use Geodetic Library for .Net that will allow simple transformation to and from British National Grid.
License: GNU Lesser General Public License v3.0
Downloading multiple massive lookup tables in executable takes many minutes to startup in MAUI.
In binary no delay and executable is smaller.
I'm currently working on a project that requires converting WGS84 LatLon coordinates to Osgb36 coordinates.
While the library does facilitate this, it's unfortunately only possible to create 6-digit Osgb36 values:
e.g. (note: the below aren't real values)
LatLon: 50.5253453, 1.535435353
becomes
Osgb36: NR395295
Ideally I need this to be 10-digits (NR3954129562) so the ability to specify the conversion accuracy as a function parameter would be fantastic.
As an aside to this, assuming these changes can't be made would I be correct in thinking that accuracy is lost during the rounding stage on the last line of the code clipped below? (GeoUK/GeoUK/Coordinates/Osgb36.cs)
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
*/
double easting = Easting;
double northing = Northing;
string bngSquare = GetBngSquare(easting, northing);
//get the number of complete 500k squares
int indexNorthing = (int)Math.Floor(northing / 500000);
int indexEasting = (int)Math.Floor(easting / 500000);
//reduce E and N by the number of 500k squares
northing -= indexNorthing * 500000;
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 -= indexNorthing * 100000;
easting -= indexEasting * 100000;
northing = Math.Round(northing / 100);
easting = Math.Round(easting / 100);
return $"{bngSquare}{Math.Round(easting):000}{Math.Round(northing):000}";
}
}
Thanks,
Sam
6 digit grid reference has only 100 metre accuracy which is poor for all GPS
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.