anowacki / britishnationalgrid.jl Goto Github PK
View Code? Open in Web Editor NEWConvert between British National Grid coordinates and WGS84 longitude and latitude, in Julia
License: Other
Convert between British National Grid coordinates and WGS84 longitude and latitude, in Julia
License: Other
It would be great to have a method which simply takes as input (x, y)
and returns (lon, lat)
(and the inverse) in order to allow any Julia point type to be roundtripped without going through the struct!
That would enable pretty simple integration with GeoMakie, IMO.
I have a UK postcode picked more or less at random: BT3 9DT.
Google tells me this has the following properties:
Latitude: 54.6136 / 54°36'49"N
Longitude: -5.8986 / 5°53'54"W
OS Eastings: 335812
OS Northings: 375965
I thought I’d try to convert between grid and lat lon, but I can’t get the right answer.
using BritishNationalGrid
p1 = BNGPoint(335812, 375965)
println("p1 = ",p1)
println("lonlat(p1) = ", lonlat(p1))
println("BNGpoint = ", BNGPoint(lat=54.613625, lon=-5.898562))
println("BNGPoint = ", BritishNationalGrid.lonlat2bng(-5.898562, 54.613625))
I get the results
p1 = BNGPoint{Int64}(335812, 375965)
lonlat(p1) = (-2.9640652376747165, 53.27677828095288)
BNGpoint = BNGPoint{Float64}(148376.87358622215, 531260.3815596306)
BNGPoint = (148376.87358622215, 531260.3815596306)
What am I doing wrong?
https://discourse.julialang.org/t/converting-uk-national-grid-to-lat-lon-and-vice-versa/109628
Proj4 installation on Windows seems tricky. It would be good to rely on something else which doesn't have this issue.
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
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.