Shallow Thoughts : : mapping

Akkana's Musings on Open Source Computing and Technology, Science, and Nature.

Mon, 27 Nov 2023

A Smaller, Lighter Dataset: Clip Layers in QGIS

[QGIS screenshot showing a manufactured polygon to clip a river layer]

The dataset I used for mapping fire perimeters is huge: not surprising if it's all historic fires for the US. Classifying it in QGIS gave a warning, and operations were very slow. Here's how to clip a big dataset in QGIS to restrict it to a smaller geographic area.

Read more ...

Tags: , , ,
[ 11:43 Nov 27, 2023    More mapping | permalink to this entry | ]

Thu, 23 Nov 2023

How to Use QGIS to Identify Fire Areas


(A QGIS beginner's tutorial.)

For quite a while I've been wanting a map showing the perimeters of the big local fires. When walking through a burned area, I wonder, was this one from the Cerro Grande fire? Or Las Conchas? Or another fire?

Yesterday, inspired by Ryan Peek's #30DayMapChallenge toot on California Fire Perimeters, I decided to look for the data and load it in QGIS.

Also, I never did an entry for Day 3 of the #30DayMapChallenge, "Polygons", so this is it, not quite three weeks late.

Read more ...

Tags: , , , ,
[ 12:34 Nov 23, 2023    More mapping | permalink to this entry | ]

Mon, 20 Nov 2023

Pixel 6a Stores the Wrong GPS in Images: an Analysis

[Map of GPS from Pixel 6a photos compared with actual positions]

I've been relying more on my phone for photos I take while hiking, rather than carry a separate camera. The Pixel 6a takes reasonably good photos, if you can put up with the wildly excessive processing Google's camera app does whether you want it or not.

That opens the possibility of GPS tagging photos, so I'd have a good record of where on the trail each photo was taken.

But as it turns out: no. It seems the GPS coordinates the Pixel's camera app records in photos is always wrong, by a significant amount. And, weirdly, this doesn't seem to be something anyone's talking about on the web ... or am I just using the wrong search terms?

Read more ...

Tags: , , , , , , ,
[ 19:09 Nov 20, 2023    More mapping | permalink to this entry | ]

Thu, 16 Nov 2023

Lost and Found: Missed the Mitchell but Found Something Unexpected (also, 30-day Map Challenge #15)

[GPS Track of a hike in Los Alamos, NM] Yesterday's 30-Day Map Challenge theme was OpenStreetMap.

I use (and contribute to) OpenStreetMap quite a bit, and I use OSM basemaps in pretty much all my mapping. (I have used Google in the past, but between their changing or withdrawing APIs every few years, and suddenly deciding to charge for previously free APIs, I switched to using only open source maps.)

But that was yesterday, which was group hiking day, so I was out tramping over mountains instead of sitting at the computer making maps. But a wrong turn on the hike led to a serendipitous discovery that wouldn't have happened without OpenStreetMap.

Read more ...

Tags: , , , ,
[ 11:08 Nov 16, 2023    More mapping | permalink to this entry | ]

Sun, 05 Nov 2023

30-Day Map Challenge #5: An Old Paper Mountain Biking Map

Day 5 of the 30-Day Map Challenge is an analog map.

That got me searching back through old scans, and I found a couple good ones. In particular, some of my old El Corte de Madera maps. [Scan of an old hand-drawn map of El Corte de Madera OSP]

El Corte de Madera Open Space Preserve is one of the open space parks in the Bay Area, above Woodside, CA. It's beautiful, dense redwood forest on a steep hillside. When I lived (and biked) there in the 1990s, ECdM (as it was abbreviated) was particularly popular with mountain bikers for its highly technical trails.

Unfortunately, not everybody agreed about those trails. The Mid-Peninsula Open Space District (MROSD), which administers them, had a policy that there should never be more than one trail going to any particular place, and it also had guidelines for trails that would have eliminated most of the technical ones. The official maps mostly showed the fire roads, which were especially steep, not at all technical, and generally not very interesting for biking.

But there were a lot of good trails at ECdM that weren't on the official MROSD maps. The property had once been used for logging, then for a while it was owned by a motorcycle (dirt bike) club, so there are all sorts of unofficial trails.

Mountain bikers passed around many-times-photocopied unofficial maps, some dating back to the motorcycle club days. One of my treasures in those days was a much-annotated map, marked up with ink of many colors, carried so much in my bike bag that it was coming apart at the folds. Of course, the hand-drawn trails are all approximate: none of us carried any sort of GPS then, and the GPS of the day probably wouldn't have gotten a signal in the deep redwood forests anyway.

In 2013 as we were preparing to move to New Mexico, I tried to find and scan old documents that were prone to getting lost during a move. I found a couple of old ECdM maps, though I'm not sure I found my main one; I remember it being more colorful than this one. Still, this one has a lot of my annotations, so I scanned it in case I lost the paper copy. Looking at it now brings back a rush memories of mountain biking adventures. And the map seems perfect for the 30-Day Map Challenge Day 5: Analog Maps.

Day 4: A Bad Map

By the way, although I didn't do any new work for challenge Day 4: A Bad Map, I wrote an article this past September wherein I go through several quite bad iterations of a choropleth map (regions shaded according to a particular variable — in this case a red-blue voting map) before figuring out how to get the colors right: Los Alamos Voting Data on a Folium Choropleth Map.

Tags: , , ,
[ 15:23 Nov 05, 2023    More mapping | permalink to this entry | ]

Sat, 04 Nov 2023

Pytopo: Colorizing Lines According to Speed or Elevation (30 Day Map Challenge #2)

[PyTopo screen with a track colorized by elevation] I've been wistfully watching the hashtag #30DayMapChallenge on Mastodon. For several years in a row, I've told myself I'm going to try the 30 Day Map Challenge ... and each time, I get busy with other stuff. And this year is no different.

So instead of trying to do all thirty exercises, I'll just do a few of the challenges when I have time and motivation. Better than nothing, right?

And as it happened, yesterday I got the urge to do a map-related project. Except it lined up with Day 2, whereas I didn't get it working til this morning.

So, two days late, here is my:

30 Day Map Challenge Day 2: Lines

During a bike ride along the fast section of one of our fantastic White Rock trails, I found myself wishing I could view my track logs colorized according to how fast I was going. And I realized that I could pretty easily add that to PyTopo's track log displaying code. And as long as I was doing that, why not also add the ability to colorize by elevation as well?

Most GPX track logs already include elevation (though the ones I get from OsmAnd aren't super accurate: they're GPS elevation rather than using the barometric sensor that some phones have). Track logs from OsmAnd sometimes include speed, via the nonstandard construct

which PyTopo already knows how to parse; and of course, for track logs that don't include speed, it can be calculated according to the distance and time difference from the previous track point.

[PyTopo screen with a track colorized by speed] Indeed, it was pretty easy to add. I put it on the context menu as a new submenu, Colorize Tracks.

I probably should play with the colormaps and use something smarter than a simple blue-to-red gradient, but even as it is, it's fun to look at a hike to Nambe Lake colorized by altitude (first image) or a mountain bike ride along Potrillo Mesa and the Boundary Trail colorized by speed (second image).

The code is on GitHub, in this commit.

Again, that's for the challenge two days ago. Today's Map Challenge is "A Bad Map". No promises that I'll have time for another mapping project today ... but I'm looking forward to seeing what other people come up with.

Tags: , , ,
[ 12:28 Nov 04, 2023    More mapping | permalink to this entry | ]

Fri, 08 Jul 2022

Not Only Not a State, but Not in North America Either?

[North and Central American rivers in New Mexico] New Mexicans are used to people thinking we're not part of the US.

Every New Mexican has stories, like trying to mail-order something and being told "We don't ship outside the US".

I had a little spare time and decided I'd follow a tutorial that's been on my to-do list for a while: Creating Beautiful River Maps with Python. It combines river watercourse data from with watershed boundaries from the HydroSheds project using Python and GeoPandas, making a map that is, as promised in the title, beautiful.

Read more ...

Tags: , , ,
[ 18:05 Jul 08, 2022    More mapping | permalink to this entry | ]

Fri, 13 May 2022

Mapping Fire Perimeters

[Fire map from mapping] I've been using the Wildland Fires map from to keep an eye on the Cerro Pelado fire and the larger (though more distant from me) Hermit's Peak/Calf Canyon fires raging in the Pecos.

It's an excellent map, but it's a little sporadic in whether it shows the fire perimeter. In any case, as a data junkie, I wanted to know how to get the data and make my own display, maybe for a quick viewer that I can pop up when I sign on in the morning.

Also, Los Alamos County, on its Cerro Pelado Information page, has a map showing the "Go" lines (if the fire crosses these lines, we have to evacuate) for Los Alamos and White Rock and I'd like to be able to view those lines on the same map with the fire perimeter and hot spots.

Read more ...

Tags: , , , , ,
[ 10:46 May 13, 2022    More mapping | permalink to this entry | ]