Ted Piotrowski

Code to live. Live to spend time outdoors.

Page 2


How to find the current time for any location using Mapbox free tier

shademap.app simulates shadows based on the current time of day, but the current time of day in Seattle is not the current time of day in London. When it’s morning in Seattle and the shadows are cast to the west, it’s already evening in London and the shadows are being cast to the east.

While ShadeMap has always displayed the correct shadows, it has never adjusted times based on the location of the map. This meant that if a user from Seattle wanted to view 7AM shadows in London, they would have to set the time slider to 11PM Pacific Standard Time (which is 7AM in London). This is confusing as most people would not consider 11PM to be an early morning time. You can see an example of this below.

ShadeMap user time

ShadeMap needed to display times using the map’s timezone, not the user’s timezone. In this case, September 22nd in London, the correct timezone to use is British Summer Time. Using British...

Continue reading →


Chromecast and Motorolla MG7700 cable modem

Writing this down in case someone else experiences the issue.

I recently bought a Motorolla MG7700 cable modem to replace our Xfinity xFi Advanced Gateway (XB6). I configured it to use a single SSID for both the 2.4ghz and 5ghz frequencies and right away we noticed that our 1st generation Chromecast started having connectivity issues. We could stream videos from our phone but the pause and fast forward controls would immediately stop working. After about 15 minutes of video the Chromecast would always error out. Afterwards, there was no way to reconnect to the Chromecast without factory resetting it.

To solve the issue we gave dedicated SSID’s for the 2.4ghz and 5ghz frequencies. The Chromecast uses the 2.4ghz and ever since the two frequencies were given unique SSID’s, it’s worked flawlessly. This was an important lesson that it’s safer to manually choose which frequency to connect a...

Continue reading →


A new Walden

IMG_9140.jpg

When I’m outside

I don’t need to create a new account to see the sun rise
There’s no 6-digit verification code to climb the next ridge
An upper case letter, a number and a special character,
are not required to swim in the rivers
There’s no callback to schedule when I want to breathe the cold air
No need to verify my email before I can smell the ocean

I want to live deliberately
Front only the most basic technology
And find the marrow of life

View →


I like e-bikes

I sold my van before heading to Europe for the summer. I’m looking to buy a hybrid or plugin hybrid for my next car. I considered a full electric but our apartment complex does not allow anyone to use the 110V sockets next to the carports. I’m not sure why they were installed there in the first place. We could use the Level 2 and Level 3 chargers at UW-Bothell, but my understanding is that fast-charging reduces the lifetime of a battery.

RadRunner 1 with LCD display

RadRunner 1 with LCD display

I bought a used RadRunner 1 on Facebook Marketplace. It was a bargain, but it came with several defects. The front fork was bent so I visited the local Rad Power Bikes store and bought a new one for $45. The rear tire had a slow leak that I located and patched. The rear disk brake rotor was bent but it was easy enough to reshape using an adjustable wrench. It was also missing the rear torque arm and bolt which Rad Power...

Continue reading →


Leaflet JS Shadow Simulator

Yesterday I published the first version 0.1.0 of leaflet-shadow-simulator on NPM. Today I will show you how to simulate shadows on some popular online maps. I will use a Bookmarklet to inject leaflet-shadow-simulator into these maps. Let’s begin.

Sun hits trail camp at 7:00

Sun hits Trail Camp around 7am

A favorite newcomer in the online mapping scene is Felt. Felt allows you to build data-rich collaborative maps and best of all, it’s based on Leaflet JS. Once you create an account, you are given some example maps and one of them is the Mount Whitney summit hike. It outlines the trail and a camping location where you will spend the first night. If you’re like me and have a hard time using your fingers when they’re cold, you probably don’t want to get up until the sun warms your tent. But when will that be? We can find out by injecting leaflet-shadow-simulator into the map.

The following 50 lines of code

  • load...

Continue reading →


Finding max elevation of a DEM tile

There are several sources of Digital Elevation Model (DEM) tiles, sometimes called “terrain tiles” online. Instead of containing cartographic features such as roads, rivers and cities, each pixel of a DEM tile encodes the elevation found in the corresponding location. Recently, I became interested in finding the maximum elevation for each one of these tiles in order to accelerate shadow calculation on shademap.app

Zoom level 0 DEM tile

DEM tile for zoom level 0

At zoom level 0, the entire world map is encoded on just one tile. I would expect the max elevation of any pixel of this tile to equal the height of Mount Everest (8848m), since this is the highest point on earth. In reality, I found that the maximum value was actually (5887m). My theory is that there is some averaging or interpolation that is done when reducing the data to a single 256x256 pixel tile. Each pixel of a tile at zoom level 0...

Continue reading →


Bonanza Peak

Bonanza Peak route

For a long time I thought Mount Stuart was the tallest non-volcanic peak in the Cascades, but it’s actually Bonanza Peak. I think Stuart mistakenly gets that reputation because it’s a lot more accessible than the latter.

Boarding the Lady of the Lake

Boarding the Lady of the Lake

At 10am we caught the Lady of the Lake boat to Lucern. A bus was waiting on the Lucern dock to take us the rest of the way to Holden village. On the way we tried to catch a glimpse of Bonanza. It was still June, early season, and we wanted to know how much snow we’d have to deal with. We dropped off extra gear at the village and started hiking up to Holden lake. The weather was sunny but a cool wind was blowing. With the summer melt in progress, we had to take off our shoes to wade across two creeks. Patches of snow appeared on the trail near the lake and the shores of Holden Lake were completely covered by snow.

Bus to Holden

Bus to Holden

From...

Continue reading →


Ram Promaster City camper van build

IMG_3517.JPG

I’m considering selling my first camper van so I’m going to write down some notes for posterity.

IMG_4403.JPG

The original build

I bought the van from an electrician right after Covid restrictions went into place. Los Angeles would not be able to offer big city perks (meetups, lectures, clubs, food, socializing) during the lock-down so it was a good time to head into the mountains. The most important feature of the van had to be fuel efficiency because I wanted to move around frequently and not dread how much it was going to cost. I considered the Ford Transit Connect, Nissan NV200 and the Ram Promaster City. The Ram Promaster City had the largest cargo space and the best fuel efficiency (I’ve been able to top 31 mpg driving between Seattle and LA) on the highway, so that is what I went with.

IMG_3170.JPG

Bed with storage underneath

The electrician I bought the van from had already installed solar...

Continue reading →


Thoughts on refilling isobutane canisters

IMG_2481.JPG

I have a hard time throwing things away and that can turn into a hoarding habit at times. For over 10 years I’ve been holding on to various isobutane fuel canisters in the hopes of burning that last bit of gas. So finally I purchased a refill valve on Amazon and decided to consolidate the gas into a single canister.

I punctured (swift blow with the pick of an ice axe) empty canisters to make sure all the gas was gone and weighed them:

  • 3.4oz (small)
  • 4.5oz (medium)
  • 7.3oz (large)

Then I weighed full canisters:

  • 7.4oz (small)
  • 13.1oz (medium)
  • 23oz (large)

IMG_2485.JPG

Now I knew when to stop transferring gas either because a canister was empty or a canister was full. (I should also say MSR does an excellent job putting gross/net weight on their canisters which aligns with these numbers)

Next I took an bowl, filled it with an ice cube tray’s worth of ice, placed the destination canister inside...

Continue reading →


Full Day Sun Exposure

ShadeMap now displays the sunniest and shadiest locations over the course of a day. Click the full day sun exposure button located near the lower left corner of the screen to try it in Manhattan.

IMG_0107.jpeg

Initially ShadeMap answered the question: where can I find shade now (or at a specific date and time)? However, knowing how much sun or shade a location gets over the course of an entire day can be valuable as well. For example, finding a parking spot in the shade on a hot day or determining what snow fields will melt the fastest.

Untitled_Artwork.jpeg

To implement this feature, ShadeMap takes a snapshot of shadows over the course of a day and overlays them on top of each other in real-time. The darkest areas receive the least sun and the lightest areas, the most.

IMG_0097.jpeg

In the image above the dark splotches are Pennsylvania pit mines. These massive pits receive virtually no sunlight during the winter. Below you...

Continue reading →