ProductPromotion
Logo

Rust

made by https://0x3d.site

GitHub - gx0r/rrgeo: A fast, offline, reverse geocoder
A fast, offline, reverse geocoder. Contribute to gx0r/rrgeo development by creating an account on GitHub.
Visit Site

GitHub - gx0r/rrgeo: A fast, offline, reverse geocoder

GitHub - gx0r/rrgeo: A fast, offline, reverse geocoder

Rust Reverse Geocoder

A fast reverse geocoder in Rust. Inspired by Python reverse-geocoder.

Links

Description

rrgeo takes a latitude and longitude as input and returns the closest city, country, latitude, and longitude, using a k-d tree to efficiently find the nearest neighbour based on a known list of locations. This can be useful if you need to reverse geocode a large number of coordinates quickly, or just need the rough location of coordinates but don't want the expense or complication of an online reverse geocoder.

This project contains (via Cargo workspaces) a library, an Axum REST API, an Actix REST API, a Warp REST API, and a command-line utility.

Usage

Command line search

Example usage:

> cargo run -p rrgeo-cmd --release 40 -73
0 ms to search
Location: (40.72788, -73.09761): West Sayville, New York, Suffolk County, US
Distance: 0.539337006499999

Web Servers

Example usage:

cargo run -p rrgeo-axum --release
cargo run -p rrgeo-actix --release
cargo run -p rrgeo-warp --release

Benchmarks

Benchmarked on Apple M2.

  • Core library benchmarked with cargo bench and criterion
  • Web servers benchmarked with oha

Core library:

> cargo bench
time:   [154.16 ns 155.34 ns 157.00 ns]
> cargo run -p rrgeo-axum --release
>  oha http://localhost:3000/\?lat\=40\&long\=\-73 -z 5sec
Summary:
  Success rate:	100.00%
  Total:	5.0004 secs
  Slowest:	0.0099 secs
  Fastest:	0.0000 secs
  Average:	0.0002 secs
  Requests/sec:	221767.0303

  Total data:	162.86 MiB
  Size/request:	154 B
  Size/sec:	32.57 MiB

Response time histogram:
  0.000 [1]       |
  0.001 [1108827] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.002 [21]      |
  0.003 [49]      |
  0.004 [9]       |
  0.005 [4]       |
  0.006 [1]       |
  0.007 [1]       |
  0.008 [2]       |
  0.009 [1]       |
  0.010 [2]       |

Response time distribution:
  10.00% in 0.0001 secs
  25.00% in 0.0002 secs
  50.00% in 0.0002 secs
  75.00% in 0.0003 secs
  90.00% in 0.0003 secs
  95.00% in 0.0004 secs
  99.00% in 0.0005 secs
  99.90% in 0.0006 secs
  99.99% in 0.0009 secs


Details (average, fastest, slowest):
  DNS+dialup:	0.0016 secs, 0.0011 secs, 0.0019 secs
  DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0002 secs

Status code distribution:
  [200] 1108918 responses
> cargo run --release --bin rrgeo-actix
> oha http://localhost:3000/\?lat\=40\&long\=\-73 -z 5sec
Summary:
  Success rate:	100.00%
  Total:	5.0007 secs
  Slowest:	0.2502 secs
  Fastest:	0.0000 secs
  Average:	0.0002 secs
  Requests/sec:	204563.3764

  Total data:	106.34 MiB
  Size/request:	109 B
  Size/sec:	21.26 MiB

Response time histogram:
  0.000 [1]       |
  0.025 [1021753] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.050 [432]     |
  0.075 [165]     |
  0.100 [101]     |
  0.125 [218]     |
  0.150 [266]     |
  0.175 [7]       |
  0.200 [1]       |
  0.225 [7]       |
  0.250 [12]      |

Response time distribution:
  10.00% in 0.0000 secs
  25.00% in 0.0001 secs
  50.00% in 0.0001 secs
  75.00% in 0.0001 secs
  90.00% in 0.0002 secs
  95.00% in 0.0003 secs
  99.00% in 0.0011 secs
  99.90% in 0.0323 secs
  99.99% in 0.1263 secs


Details (average, fastest, slowest):
  DNS+dialup:	0.0015 secs, 0.0012 secs, 0.0019 secs
  DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0002 secs

Status code distribution:
  [200] 1022963 responses

> cargo run --release --bin rrgeo-warp
> oha http://localhost:3000/\?lat\=40\&long\=\-73 -z 5sec
SuSummary:
  Success rate:	100.00%
  Total:	5.0003 secs
  Slowest:	0.0111 secs
  Fastest:	0.0000 secs
  Average:	0.0002 secs
  Requests/sec:	232498.2550

  Total data:	170.74 MiB
  Size/request:	154 B
  Size/sec:	34.15 MiB

Response time histogram:
  0.000 [1]       |
  0.001 [1162216] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.002 [167]     |
  0.003 [52]      |
  0.004 [56]      |
  0.006 [56]      |
  0.007 [4]       |
  0.008 [3]       |
  0.009 [1]       |
  0.010 [1]       |
  0.011 [2]       |

Response time distribution:
  10.00% in 0.0001 secs
  25.00% in 0.0002 secs
  50.00% in 0.0002 secs
  75.00% in 0.0003 secs
  90.00% in 0.0003 secs
  95.00% in 0.0004 secs
  99.00% in 0.0004 secs
  99.90% in 0.0007 secs
  99.99% in 0.0038 secs


Details (average, fastest, slowest):
  DNS+dialup:	0.0018 secs, 0.0013 secs, 0.0025 secs
  DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0005 secs

Status code distribution:
  [200] 1162559 responses

License

Licensed under either of

at your option.

Contribution

Any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory