Skip to main content

Posts

Showing posts with the label google maps api

Today I Learned: Google Geocoding Costs More but ChatGPT Helped Me Fix It

 Google changed their billing scheme for geocoding in March. Previously, all users were given a $200 credit for Google geocoding per month. Google removed the credit and replaced it with 10,000 geocoding calls per month, and my bill went up! I've known for a while that my pytest code is running every time the QSO tracker is automatically kicked off by github, (which is about 4 times per hour.) Those test cases make seven Google geocoding API calls each. As of April, they mattered. Adding up all the calls assuming that my QSO tracker spots me zero times in a month and that I log no QSOs, so just the calls from the test cases, gives: geocodes runs/hour hours days/month geocodes/month 7 4 24 30 20160 which is well over the free limit. I asked ChatGPT to change my action  so that the test cases would only run when Python files in the repo changed. This was NOT vibe coding. I had to ask ChatGPT to fix its own coding errors 3 times, handing it the error message each time. It did i...

Things I Learned: The Google Maps Elevation API and jq

This is moving kind of fast! Regarding the goal of automating elevations using Datasette and the Google Maps Elevation API. I pulled a QSO out of a hat last night and tried the coordinates between stations in a call to the Google Maps Elevation API.  The URL to use the API looked like this: https://maps.googleapis.com/maps/api/elevation/json?path=37.7248952%2C-122.4229361%7C37.7247294%2C-122.4207246&samples=200&key= where the path parameter contains two coordinates separated by %7C (html encoding for the pipe symbol: '|') and commas (aka %2C) define the coordinates of the tx station and the coordinate of a point 200 meters along the path to the rx station, and the samples parameter tells the API how many points to split the path into and return elevations for. It's all documented by Google here . I was quickly rewarded with data that looked like the following: { "results" : [ { "elevation" : 123.6165237426758, ...

New Distance Record for the KD0FNR Rockmite and the Google Maps Geometry Library

 The KD0FNR Rockmite transmitted it's furthest disnce ever last night. It was spotted by an SDR in Newton, NH, W1NT. The heading to the station, interestingly, lines up with the previous record in Maui. I used the maps API to find out how straight the line was. The previous record, (set almost daily), is off to the West in Maui .  Here's the two spots on the same map. For those of who might be wondering if the Boston, NH and the Maui station are on a perfectly straight line, I wondered the same thing. They're not. They miss by about 4 degrees. How do I know? Turns out Google Maps has an API for that. ( and a demo ).  Using the demo, I was able to get the two headings and then add them to determine how close to a straight line (180 degrees it actually is). OK, let's look at the headings. To Newton, NH, we have To Maui we have Adding the two headings we get 176.0069 degrees. So not quite on the exact same line to the antenna, but close. I also wondered if my imprecision a...