Skip to content

Library to perform 1D & 2D geo[graphic|metric] filtering of pub/sub messages

License

Notifications You must be signed in to change notification settings

aaron-613/pubsub-geo-filtering

Repository files navigation

pubsub-geo-filtering

Finally getting my geo-filtering code posted up to GitHub. Will document more later.

To build and run simple subscription replier. Note: this uses Solace MicroGateway, your REST Mode must be in gateway for your Message VPN.

./gradlew assemble
cd geo-submgr/build/distributions
unzip geo-submgr.zip
cd geo-submgr
bin/SubsReplier localhost default default

Then, for example: a 100 mile zone around Atlanta airport with 90% accuracy:

curl "http://192.168.42.35:9000/geo/subs/circle?lat=33.749&lon=-84.388&radiusMetres=160934&accuracy=90"

{"subs":
  ["032.8*/-082.98*","032.8*/-082.99*","032.9*/-082.9*","032.38*/-083.7*","032.39*/-083.7*","032.3*/-083.8*","032.3*/-083.9*","032.4*/-083.5*","032.4*/-083.6*","032.4*/-083.7*","032.4*/-083.8*","032.4*/-083.9*","032.5*/-083*","032.6*/-083*","032.7*/-083*","032.8*/-083*","032.9*/-083*","032.29*/-084.3*","032.29*/-084.4*","032.3*/-084*","032.4*/-084*","032.5*/-084*","032.6*/-084*","032.7*/-084*","032.8*/-084*","032.9*/-084*","032.39*/-085.0*","032.4*/-085.0*","032.4*/-085.1*","032.4*/-085.2*","032.5*/-085.0*","032.5*/-085.1*","032.5*/-085.2*","032.5*/-085.3*","032.5*/-085.4*","032.6*/-085.0*","032.6*/-085.1*","032.6*/-085.2*","032.6*/-085.3*","032.6*/-085.4*","032.6*/-085.5*","032.7*/-085*","032.8*/-085*","032.9*/-085*","033.6*/-082.65*","033.7*/-082.65*","033.8*/-082.65*","033.5*/-082.66*","033.6*/-082.66*","033.7*/-082.66*","033.8*/-082.66*","033.9*/-082.66*","033.4*/-082.67*","033.5*/-082.67*","033.6*/-082.67*","033.7*/-082.67*","033.8*/-082.67*","033.9*/-082.67*","033.4*/-082.68*","033.5*/-082.68*","033.6*/-082.68*","033.7*/-082.68*","033.8*/-082.68*","033.9*/-082.68*","033*/-082.69*","033*/-082.7*","033*/-082.8*","033*/-082.9*","033*/-083*","033*/-084*","033*/-085*","033*/-086.0*","033.5*/-086.10*","033.6*/-086.10*","033.7*/-086.10*","033.8*/-086.10*","033.9*/-086.10*","033.5*/-086.11*","033.6*/-086.11*","033.7*/-086.11*","033.8*/-086.11*","033.9*/-086.11*","033.6*/-086.12*","033.7*/-086.12*","033.8*/-086.12*","034.0*/-082.6*","034.0*/-082.7*","034.1*/-082.7*","034.2*/-082.7*","034.3*/-082.78*","034.3*/-082.79*","034.0*/-082.8*","034.1*/-082.8*","034.2*/-082.8*","034.3*/-082.8*","034.4*/-082.8*","034*/-082.9*","034*/-083*","034*/-084*","034*/-085*","034.0*/-086.0*","034.1*/-086.0*","034.2*/-086.0*","035.0*/-083.5*","035.0*/-083.6*","035.0*/-083.7*","035.0*/-083.8*","035.0*/-083.9*","035.0*/-084*","035.0*/-085.0*","035.0*/-085.1*","035.0*/-085.2*","035.10*/-083.7*","035.11*/-083.7*","035.1*/-083.8*","035.1*/-083.9*","035.1*/-084*","035.10*/-085.0*"],
"perimiter":
  "POLYGON ((-82.98 32.9, -82.98 32.8, -82.99 32.8, -83 32.8, -83 32.7, -83 32.6, -83 32.5, -83.5 32.5, -83.5 32.4, -83.6 32.4, -83.7 32.4, -83.7 32.39, -83.7 32.38, -83.8 32.38, -83.8 32.3, -83.9 32.3, -84 32.3, -84.3 32.3, -84.3 32.29, -84.4 32.29, -84.5 32.29, -84.5 32.3, -85 32.3, -85 32.39, -85.1 32.39, -85.1 32.4, -85.2 32.4, -85.3 32.4, -85.3 32.5, -85.4 32.5, -85.5 32.5, -85.5 32.6, -85.6 32.6, -85.6 32.7, -86 32.7, -86 32.8, -86 32.9, -86 33, -86.1 33, -86.1 33.5, -86.11 33.5, -86.12 33.5, -86.12 33.6, -86.13 33.6, -86.13 33.7, -86.13 33.8, -86.13 33.9, -86.12 33.9, -86.12 34, -86.11 34, -86.1 34, -86.1 34.1, -86.1 34.2, -86.1 34.3, -86 34.3, -86 35, -85.3 35, -85.3 35.1, -85.2 35.1, -85.1 35.1, -85.1 35.11, -85 35.11, -85 35.2, -84 35.2, -83.9 35.2, -83.8 35.2, -83.8 35.12, -83.7 35.12, -83.7 35.11, -83.7 35.1, -83.6 35.1, -83.5 35.1, -83.5 35, -83 35, -82.9 35, -82.9 34.5, -82.8 34.5, -82.8 34.4, -82.79 34.4, -82.78 34.4, -82.78 34.3, -82.7 34.3, -82.7 34.2, -82.7 34.1, -82.6 34.1, -82.6 34, -82.66 34, -82.66 33.9, -82.65 33.9, -82.65 33.8, -82.65 33.7, -82.65 33.6, -82.66 33.6, -82.66 33.5, -82.67 33.5, -82.67 33.4, -82.68 33.4, -82.69 33.4, -82.69 33, -82.7 33, -82.8 33, -82.9 33, -82.9 32.9, -82.98 32.9))"
}

This includes an array of subscriptions (in lat/lon format), and also a WKT string defining the perimeter of the shape, useful for visualization. E.g. https://arthur-e.github.io/Wicket/sandbox-gmaps3.html Atlanta

Using the geo-api

Circular search area

Basics

  • includes both 2D and 1D versions
    • 2D can be used for lat/lon coordinates, or any planar geometric coordinates (e.g. [x,y], UTM, MGRS)
    • 1D can be used for any scalar (e.g. altitude, heading, speed)
  • Have updated code to support multiple radixes/bases, from binary base 2 to base 36

Live Demo

https://sg.solace.com/bus

Papers

https://worldcomp-proceedings.com/proc/p2016/ICM3967.pdf

The Algorithm

blah

Significant changes to the algorithm have been made to greatly simplify it and improve its usability.

Improvments made during the process

  1. Moved from Decimal base 10 to any radix, base n, where n=[2,36].
    1. Issue: floating point representation in base n with a radix point is weird. E.g. 123.456 =
  2. Something else

About

Library to perform 1D & 2D geo[graphic|metric] filtering of pub/sub messages

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published