Open elmirjagudin opened 6 years ago
Ah, yes. That probably is the best way to fix it, even though the bounds check itself is the problem, because it's a rectangle, whereas the actual OSGB36 boundary is an irregular polygon – I could do a containment check for that, though I'll have to benchmark it to see how much slower it is.
The lonlat_bng returns error result while converting points TP01, TP31, TP32 from Ordnance Survey OSTN15-OSGM15 test set.
The lonitude latitude for these points are:
The code below demonstrates the problem:
The code above will panic, instead of printing OSGB36 coordinates.
The reason the convert_osgb36() above returns Err result is because the specified long/lat coordinates are outside of the allowed min/max values.
Interesting enough I tried to just increase the allowed bound box, and appear that it gives correct result. However I'm not sure is this is a right way to solve this problem.