Coder Social home page Coder Social logo

azureumbra / repeatertrek Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 1.16 MB

Plots RepeaterBook data onto a map. Can also filter that data by distance from route, and generate a CHIRP file (in route order) for that route.

License: GNU General Public License v3.0

Python 100.00%

repeatertrek's Introduction

RepeaterTrek

Currently in its infancy, RepeaterTrek will allow you to pull data from RepeaterBook and store it locally. These local copies can be updated without having to pull a full repository again. These repeaters can then be plotted on a map, with tooltips giving all of the information about them, including a link to it's page. Finally, the primary use of RepeaterTrek is that it allows you to take a Google Maps trip and map out a your route with a list of all of the repeaters along your route. This route can then be generated into a CHIRP file in order of your trip for easy radio programming!

Route Image

Getting Started

Currently the program exists as a single Python file with only definitions inside it. Call the functions you want to run from the main function at the bottom.

Prerequisites

pip install beautifulsoup4
pip install requests
pip install gmplot
pip install geopy

Installing

Once all the prerequisites are installed, just clone the repo and open RepeaterTrek.py in Idle.

git clone https://github.com/AzureUmbra/RepeaterTrek.git

Basic Functions

parseFromWeb

Pass the function the name of the state, and a URL to a RepeaterBook Multi-State Search. Additionally, pass it the same search while selecting 'Wide Area' Only for wide area repeater functionality.

parseFromWeb('Texas','https://www.repeaterbook.com/repeaters/msResult.php?state_id%5B%5D=48&band=14&freq=&loc=&call=&features=%25&emcomm=%25&coverage=%25&status_id=1&order=%60freq%60%2C+%60state_abbrev%60+ASC',wideArea='https://www.repeaterbook.com/repeaters/msResult.php?state_id%5B%5D=48&band=14&freq=&loc=&call=&features=%25&emcomm=%25&coverage=wide&status_id=1&order=%60freq%60%2C+%60state_abbrev%60+ASC')

RepeaterBook

This will create a local repeater database for plotting your trips against.

Repeaters Collected
Parsing Repeater Information
Requesting Repeater List
Repeaters Collected
Parsing Repeater Information
Repeaters Parsed and Sorted
Repeaters Parsed and Sorted
511 Repeaters Found
Beginning Location Collection
Getting Repeater Number 0 of 511
Getting Repeater Number 1 of 511
Getting Repeater Number 2 of 511
.
.
.
Getting Repeater Number 510 of 511
All Coordinates Received
Saved in File: TexasWA.rl

updateFromWeb

Identical to above, this gets around the slow website issues and only checks for differences between your local list and the online list, so the slow initial download only has to happen once.

parseFromWeb('Texas','https://www.repeaterbook.com/repeaters/msResult.php?state_id%5B%5D=48&band=14&freq=&loc=&call=&features=%25&emcomm=%25&coverage=%25&status_id=1&order=%60freq%60%2C+%60state_abbrev%60+ASC',wideArea='https://www.repeaterbook.com/repeaters/msResult.php?state_id%5B%5D=48&band=14&freq=&loc=&call=&features=%25&emcomm=%25&coverage=wide&status_id=1&order=%60freq%60%2C+%60state_abbrev%60+ASC')

It will prompt you before any changes are made, and if any downloads need to happen.

511 Repeaters found of 503 in File
2 Repeaters Outdated
10 New Repeaters to Download
Enter "Y" to Delete Outdated and Download New: y
.
.
.
TexasWA.rl Updated to 511 Repeaters

plotMap

Pass it a file name and it will generate a map.

plotMap('TexasWA')
Generating Map
Opening File TexasWA.rl
Map Saved as TesasWA.html

Texas Image

blendMap

Pass it two or more maps and it will plot them together.

blendMap(['MississippiWA','AlabamaWA'],'MS and AL Blended')
Generating Map
Opening File MississippiWA.rl
Opening File AlabamaWA.rl
Map Saved as MS and AL Blended.html

Blended Image

tripPlanner

Pass it a trip name, the repeater file names you want to consider, a max repeater distance, and a wide area repeater distance; and it will generate a map with start and end points, valid repeaters with data, and your route.

tripPlanner('Cross Texas',['TexasWA'],15,30)

Currently, you must go to GPSVisualizer, copy the link from a Google Maps directions page into the URL box, select comma as the delimiter, and hit convert. Copy this into a .txt file with the same name as your trip, and save it into the same directory as RepeaterTrek.py.

GPS

Opening File TexasWA.rl
Getting Route Points
Checking Repeater 0 of 511
Checking Repeater 1 of 511
Checking Repeater 2 of 511
.
.
.
Checking Repeater 510 of 511
Found 94 Valid Repeaters
Trip Saved as Cross Texas.trip
Generating Map
Opening File Cross Texas.trip
Map Saved as Cross Texas.html

Now sit back and enjoy your map!

Route Image

Authors

License

This project is licensed under the GNU General Public License v3 - see the LICENSE.md file for details

Acknowledgments

  • Kostya Esmukov for his geopy library, as I suck at haversin and great circle vector math.
  • Michael Woods for his gmplot library, without which the primary goal of this project would be dead.

repeatertrek's People

Contributors

azureumbra avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

repeatertrek's Issues

Index out of range error when getting coordinates

I'm running the program with multiple parseweb calls (Iowa, Missouri, Kansas, Oklahoma, Texas, Illinois, and Nebraska) from one multistate search call. It returns 1,000 repeaters (which I confirmed by having it print them out). Then, when the parseweb function tries to pull out coordinates, it crashes. I'm including the last repeater that it lists, and showing the trackback below:

Repeater 999 out of 1000: {'Link': 'https://www.repeaterbook.com/repeaters/details.php?state_id=20&ID=3879', 'Frequency': '442.1250', 'Offset/shift': '+5 MHz', 'Tone': 'None', 'Location': 'Louisburg', 'County': 'Miami', 'state/province': 'KS', 'Call': 'K0HAM', 'Use': 'OPEN'}
Beginning Location Collection
Getting Repeater Number 0 of 1000
Traceback (most recent call last):
File "/home/patrickdickey/gitprojects/RepeaterTrek/RepeaterTrek.py", line 422, in
parseFromWeb('IA','https://www.repeaterbook.com/repeaters/msResult.php?state_id%5B%5D=17&state_id%5B%5D=19&state_id%5B%5D=20&state_id%5B%5D=29&state_id%5B%5D=31&state_id%5B%5D=40&state_id%5B%5D=48&band=%25&freq=&loc=&call=&features=%25&emcomm=%25&coverage=%25&status_id=%25&order=%60state_abbrev%60%2C+%60freq%60+ASC',wideArea='https://www.repeaterbook.com/repeaters/msResult.php?state_id%5B%5D=17&state_id%5B%5D=19&state_id%5B%5D=20&state_id%5B%5D=29&state_id%5B%5D=31&state_id%5B%5D=40&state_id%5B%5D=48&band=%25&freq=&loc=&call=&features=%25&emcomm=%25&coverage=wide&status_id=%25&order=%60state_abbrev%60%2C+%60freq%60+ASC')
File "/home/patrickdickey/gitprojects/RepeaterTrek/RepeaterTrek.py", line 130, in parseFromWeb
coords = (soup.split('LatLng')[1].split(';')[0]).strip('()').split(',')
IndexError: list index out of range

Do I need to select a different option in the multi-state search on RepeaterBook in order to get the coordinates, or is this completely unrelated to my issue?

Have a great day. :)
Patrick.

I'm also attaching my version of your file, so you can see if there's another issue (note, I put a for loop in to print out the repeaters that are stored in the array, so I could verify that something was there).
RepeaterTrek.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.