Alright, so I was messing around with some GIS data the other day, and the question popped into my head: “how long is that quarry?”. You know, just one of those random things you wonder about. I thought, “Hey, why not figure it out?”. Here’s how I did it.

First thing’s first, I needed to grab the data. Luckily, I had access to a database with some pretty decent geospatial info. I fired up my GIS software (QGIS, in this case, because it’s free and does the job) and connected to the database. I found the layer with the quarry polygons. This took a bit, because the layer names weren’t exactly descriptive, but eventually, I spotted the one that looked right.
Now, to the actual calculation. I needed to find the longest dimension of the quarry. Just measuring a straight line wouldn’t cut it, because quarries aren’t usually perfect rectangles. What I needed was the length of its “bounding box” oriented along its longest side.
So, I started with a few options for finding the longest dimension:
- Minimum Bounding Geometry: This is a pretty handy tool in QGIS. You can use it to create a minimum bounding rectangle around the quarry polygon. The key is to use the “oriented” option. This aligns the rectangle with the longest axis of the quarry.
- Calculated field and some geometry functions: This way is bit more involved, but it gives you direct access to the numbers. You’ll need functions like
oriented_minimum_bounding_box()
to create the oriented bounding box, and thenlength()
to measure the sides.
I decided to go with the calculated field approach, because I wanted to see the actual numbers and maybe do some other calculations later. So, in the attribute table, I created a new field called “longest_dimension” (naturally!).
Then, in the field calculator, I typed in the expression:

length(longest_side(oriented_minimum_bounding_box($geometry)))
…or something like that. I’m paraphrasing because I didn’t save the exact expression, but that was the gist. Basically, it calculates the oriented minimum bounding box of the geometry and then gets the length of the longest side of that box.
I hit “OK”, and boom! The “longest_dimension” field was populated with the lengths. I scrolled through the attribute table, checking the values to make sure they seemed reasonable. They did! Awesome.
The longest quarry turned out to be about 1.5 kilometers long. Not bad for a day’s work… or, you know, a few minutes of messing around in QGIS.
Learnings? GIS can be surprisingly fun, and even simple questions can lead to interesting explorations. Also, don’t underestimate the power of oriented minimum bounding boxes!
