You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-23Lines changed: 22 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,13 +33,12 @@ The primary functions available in this package are:
33
33
*```convert_bng``` Perform Lon, Lat to OSGB36 Eastings, Northings conversion, using OSTN15 data
34
34
*```convert_lonlat``` Convert OSGB36 Eastings, Northing coordinates to Lon, Lat using OSTN15 data
35
35
36
-
Coordinates can be passed to these functions as a single pair or as a 2-column array of any length. Transformed coordinates are always returned as a 2-column array, irrespective of the input format. Note that `lon`, `lat` coordinates outside the [UK bounding box](http://spatialreference.org/ref/epsg/27700/) will be transformed to `[NaN NaN]`, which cannot be mapped.
36
+
Coordinates can be passed to these functions as a single pair or as a 2-column array of any length. Transformed coordinates are returned as a tuple for a single point conversion or as a 2-column array for multiple point conversion. Note that `lon`, `lat` coordinates outside the [UK bounding box](http://spatialreference.org/ref/epsg/27700/) will be transformed to `(NaN NaN)`, which cannot be mapped.
37
37
38
38
Can be used to transform single points:
39
39
```julia
40
40
julia> e,n =convert_bng(-2.594679, 51.450521)
41
-
1×2 Array{Float64,2}:
42
-
358772.71172560.997
41
+
(358772.71, 172560.997)
43
42
44
43
julia> e
45
44
358772.71
@@ -86,43 +85,43 @@ Using the Caister Water Tower example in the OS Transformations and OSGM15 User
86
85
87
86
All of these coordinates can be interrelated using the following function calls, which give the corresponding return values:
The difference between ETRS89 and OSGB36 is determined by extracting the raw OSTN15 shifts for the area of interest and using bilinear interpolation to derive a more accurate set of shifts. For this example the raw shifts are ```[102.787, -78.242, 44.236]```, which are subsequently refined to ```[102.801, -78.236, 44.228]```.
96
+
The difference between ETRS89 and OSGB36 is determined by extracting the raw OSTN15 shifts for the area of interest and using bilinear interpolation to derive a more accurate set of shifts. For this example the raw shifts are ```(102.787, -78.242, 44.236)```, which are subsequently refined to ```(102.801, -78.236, 44.228)```.
98
97
99
98
## Benchmarks
100
99
Benchmarks were run on two different systems - a high performance Linux system with an 8-core i7-9700K CPU and a mainstream Windows 10 system with a 4-core i5-7500 CPU. The [benchmark code](/benchmark/runbenchmarks.jl) is derived from that used in the [lonlat_bng](https://github.com/urschrei/lonlat_bng) Rust library and involves getting the total time for converting 50 lots of 1 million random lon,lat pairs to BNG and vice versa. The code can be run in the Julia REPL: ```include("/path/to/package/benchmark/runbenchmarks.jl")```.
101
100
* The benchmarks were run a number of times to ensure that the total times for each case were consistent and the best time from any run is quoted in the results tables below.
102
-
* Julia versions ```v1.0.5```, ```v1.3.1``` and the latest ```v1.4.0-rc2.0``` were tested - all quoted times are those using Julia ```v1.3.1```.
103
-
*The quoted times for Julia ```v1.3.1``` were very consistent and similar to those obtained with the latest ```v1.4.0-rc2.0```. However, Julia ```v1.0.5``` times were upto 25% slower and inconsistent - it is recommended to use later versions.
101
+
* Julia versions ```v1.0.5```, ```v1.3.1``` and ```v1.4.0``` were tested - all quoted times are those using Julia ```v1.4.0```.
102
+
*Note that Julia ```v1.0.5``` times were upto 25% slower than the later veriosns and inconsistent - it is recommended to use later versions.
104
103
* All Julia benchmarks were run with multi-threading, using 1, 4 or 8 CPU cores for comparison.
105
-
* For context, the tables also include the equivalent benchmark times for the [convertbng](https://github.com/urschrei/convertbng) library which uses a [Rust binary](https://github.com/urschrei/lonlat_bng). This has been run in both exposed operational modes (Ctypes and Cython). These binaries are setup to fully utilise the CPU.
104
+
* For context, the tables also include the equivalent benchmark times for the [convertbng](https://github.com/urschrei/convertbng) library which uses a [Rust binary](https://github.com/urschrei/lonlat_bng). This has been run in both exposed operational modes (Ctypes and Cython). These binaries are setup to fully utilise the CPU and so times are only shown for use of all cores.
106
105
107
106
Results for **8-Core** i7-9700K CPU @ 3.60GHz
108
107
109
108
| Function | Threads/Cores | Julia (s) | Rust Ctypes (s) | Rust Cython (s) |
110
109
| :---: | :---: | :---: | :---: | :---: |
111
-
| convert_bng | 1 |14.0| - | - |
112
-
| convert_bng | 4 |4.6| - | - |
113
-
| convert_bng | 8 |3.1| 3.3 | 2.0 |
114
-
| convert_latlon | 1 |22.8| - | - |
115
-
| convert_latlon | 4 |6.8| - | - |
116
-
| convert_latlon | 8 |4.2| 6.3 | 3.2 |
110
+
| convert_bng | 1 |11.8| - | - |
111
+
| convert_bng | 4 |3.1| - | - |
112
+
| convert_bng | 8 |1.6| 3.3 | 2.0 |
113
+
| convert_latlon | 1 |19.9| - | - |
114
+
| convert_latlon | 4 |5.2| - | - |
115
+
| convert_latlon | 8 |2.7| 6.3 | 3.2 |
117
116
118
117
Results for **4-Core** i5-7500 CPU @ 3.40GHz
119
118
120
119
| Function | Threads/Cores | Julia (s) | Rust Ctypes (s) | Rust Cython (s) |
121
120
| :---: | :---: | :---: | :---: | :---: |
122
-
| convert_bng | 1 |22.3| - | - |
123
-
| convert_bng | 4 |8.0| 8.5 | 5.5 |
124
-
| convert_latlon | 1 |34.5| - | - |
125
-
| convert_latlon | 4 |10.8| 16.2 | 9.8 |
121
+
| convert_bng | 1 |16.0| - | - |
122
+
| convert_bng | 4 |4.4| 8.5 | 5.5 |
123
+
| convert_latlon | 1 |26.8| - | - |
124
+
| convert_latlon | 4 |7.3| 16.2 | 9.8 |
126
125
127
126
## Tests
128
127
After installation, the unit tests can (and should) be run by entering the following at the Julia REPL:
0 commit comments