---
title: Could AI Hunt Down the Perfect Feng Shui Site? — A Map That Translates Seven Feng Shui Conditions into Terrain Numbers
url: https://oosioo.com/en/p/ai%EB%A1%9C-%ED%92%8D%EC%88%98%EC%A7%80%EB%A6%AC-%EB%AA%85%EB%8B%B9%EC%9D%84-%EC%B0%BE%EB%8A%94-%EC%9D%BC%EC%9D%84-%ED%95%B4%EB%B3%BC-%EC%88%98-%EC%9E%88%EC%A7%80-%EC%95%8A%EC%9D%84%EA%B9%8C-%ED%92%8D%EC%88%98-%EC%9D%BC%EA%B3%B1-%EC%A1%B0%EA%B1%B4%EC%9D%84-%EC%A7%80%ED%98%95-%EC%88%98%EC%B9%98%EB%A1%9C-%EB%B2%88%EC%97%AD%ED%95%9C-%EC%A7%80%EB%8F%84
date: 2026-09-10T12:33:18+00:00
author: SYSOP
summary: I asked, in one line, to calculate a good site for building a house from terrain, water, buildings, and sunlight. Out came a map that turns old sayings like "mountain behind, water in front" and "wind-gathering, water-holding" into numbers — slope, orientation, even distance to water. I also dig into the spot where flat land scored the same everywhere, and the same problem I ran into in Part 1 showed up again.
---
# Could AI Hunt Down the Perfect Feng Shui Site? — A Map That Translates Seven Feng Shui Conditions into Terrain Numbers

The idea came to me while I was building a map to find the best viewing spots for a fireworks festival. In feng shui, a "prime site" (myeongdang) is generally a concept used for various purposes — picking good places for the living (yangtaek) and good grave sites for the dead (eumtaek). I'd worked with terrain maps and elevation maps often enough before, so this time I decided to use the same basic principles to build a feng shui map.

## What I Asked

It started with a single question.

> Is there a service that uses DEM, DSM, and other terrain, feature, and map data to mark out prime sites or good places to build a house?

Turns out there was, sort of. One service scores feng shui using maps and AI, and there are several papers that quantify feng shui through GIS. One study in particular stood out — it broke down the terrain around old imperial tombs in Nanjing, China into eight geographic indicators and scored them using the Analytic Hierarchy Process (AHP). After reading that, I added one more line:

> I'd like a service that does this quantitatively and precisely. Show the factor extraction and AHP fit from the Nanjing tomb study as a spider chart or a composite score, mapped precisely with a heatmap of scores at every location. Also break it into per-factor heatmaps. Since buildings exist now, factor those in too. Let's build it as a standalone HTML file.

That's the entirety of what I typed. Everything else was chosen by the machine. Knowing roughly what a spider chart is and what a heatmap is was enough to get this built.

## What Came Out

A single map file that opens in a browser. Pan the map to whatever neighborhood you want and hit a button — it slices that view into tens of thousands of cells (up to 40,000) and colors each one on a scale of 0 to 100 for "how good a house site is this." Greener is better, redder is worse. It doesn't cover very large areas, but it's more than enough to survey a neighborhood.

![A composite suitability map covering an 11.6 km area of central Seoul, divided into a 192×192 grid. Steep slopes and low-lying downtown areas show red, while slopes with high ground behind and open space in front show green. On the right are weight sliders for the seven factors.](/uploads/6dd98304c74d9c1d.webp =860)

The score weighs seven factors:

- **Slope** — the gentler, the better
- **Orientation (sunlight)** — south-facing slopes that catch the sun
- **Mountain behind** — terrain that's higher to the rear (north)
- **Wind-gathering** — flanked on both sides, open in front
- **Water-holding** — above a waterway, at a moderate elevation
- **Terrain stability** — ground that isn't rough
- **Overall configuration** — moderate relief, not too extreme

On top of that, I added an eighth factor: **buildings**. Something that had no place in classical feng shui.

Click anywhere on the map and it shows that point's composite score and grade (grand prime site, auspicious ground, favorable, average, caution), along with a spider chart radiating out across the seven (or eight) categories. At a glance you can see which conditions are driving the score up and which are dragging it down. Push a slider on the left — say, "water access matters most to me" — and the whole composite map recolors on the spot.

## How It Worked Under the Hood

The core task was **translating old sayings into numbers**.

"Mountain behind, water in front." "Wind-gathering, water-holding." I understood what they meant, but these are things a person says while looking at a mountain, not something a computer understands. So I converted each one into a value that could be extracted from the shape of the land.

- **Mountain behind** became "is the ground to my rear (north) higher than the ground in front (south)?" — the difference in average elevation between the two directions.
- **Wind-gathering** became "are the sides and rear high, wrapping around, while the front is low and open?" — scanning terrain in eight directions and comparing the sheltered side against the open side.
- **Slope and orientation** came from the land's incline and the direction it faces.
- **Overall configuration** became a measure of whether the surrounding relief (the difference between high and low points) is neither too flat nor too rugged.

Where does the elevation data come from? There are publicly available global terrain tiles. They look like ordinary map tiles, but elevation is hidden in the red, green, and blue values of each pixel's color — run that through a formula and out comes elevation in meters. I pull just the tiles for the visible screen and read the elevation for each cell.

Once all seven values are computed, I assign a **weight** to each factor, the same way the Nanjing study did — heavier weight on "mountain behind," lighter weight on roughness, and so on. Multiply and sum, and that's the composite score. The weights are exposed as sliders because there isn't "one right answer" — the idea is to let each viewer rebalance the scale according to their own priorities.

## Where It Went Wrong

This is the real substance of this piece.

**First, everything came out identical on flat land.** When I first built the tool and tried it on flat terrain like Seoul, the whole screen came back nearly one uniform color. There was no way to distinguish scores.

But that was, in a sense, a correct calculation. Concepts like "mountain behind" or "wind-gathering" only make sense to begin with if the land actually has elevation differences. On genuinely flat ground, terrain alone gives you almost no basis to say "this spot beats that one." The machine was answering honestly: "they're all roughly the same."

The problem was that this made the map look useless. So I fixed **how it's displayed**. Instead of absolute scores, I added a toggle that repaints the map by rank (percentile) within the current view. Even the faintest differences get stretched out across the full spectrum from red to green. I didn't manipulate the underlying score — clicking a cell still shows the real number — I just boosted the contrast of the map's colors. It's essentially finding a scale that makes poorly separated data visually easier to distinguish.

**Second, the same problem from Part 1 showed up again.** What actually varies on flat land? Proximity to water, and buildings. But the terrain tiles I was using measure the "ground" — no buildings, and rivers barely register. This is the exact same story as Part 1, where the global elevation data measured the 63 Building at 18 meters tall.

So I added one more line as the user: "Water access, buildings, and sunlight all matter — let's factor in all of them."

- **Water-holding**: pulled rivers and lakes from open map data, measured the actual distance from each cell to the nearest water, and scored it. Closer is better, but a slight penalty kicks in if it's too close (flood risk).
- **Buildings**: pulled building heights from the same data source and penalized taller, denser clusters. These are spots hemmed in by high-rises and cut off from sunlight. Translate the classical "wind-gathering" into a modern downtown, and this is essentially what it becomes.
- **Sunlight**: originally this just checked "does it face south," but I changed it to place the sun at three positions — morning, noon, and afternoon — and calculate how much light each location actually receives.

**Third, some small but worth-noting details.** When I added the building factor, I forgot to set its initial weight, so it defaulted to zero — meaning even turning it on had no effect. I fixed it by filling in the initial value. I also caught, belatedly, a stray character that had slipped into the styling code (CSS).

## Why One Line Is Enough

Translating feng shui into terrain metrics isn't something I invented. Multiple academic papers already exist on it. Which public terrain datasets are available, how elevation is hidden in their color values, where to pull rivers and buildings from — all of this is knowledge that already exists in the world.

The point is that I didn't need to know all of it myself. I only gave a direction — "do it the way the Nanjing study did, and factor in buildings too" — and the machine pulled in the right data and the right calculations on its own. One line being enough isn't magic; it's simply that the machine stands at the intersection where already-organized knowledge meets public data.

## If You Want to Try This Yourself

Not much different from what I wrote in Part 1.

**Don't specify the dataset.** If I'd insisted on "use this specific terrain dataset," it would have ended up without buildings or rivers. The machine knows better than I do which public data sources are good. If there's something I know better, I can just add it in.

**When the result looks off, have it work through it on the spot.** When the flat terrain came back as one uniform color, asking "why is this happening" produced the answer: "flat ground genuinely can't be distinguished this way — instead, let's show relative rank." If I hadn't asked, I would have just accepted the flat, uninformative map.

**Ask about the limitations up front.** Asking "what part of this score shouldn't be trusted" is what produces answers like the ones in the section below.

## What It Can't Do

This was built for fun, so of course it isn't highly accurate. Think of it as a demonstration of what's possible, rather than something rigorous. To take it seriously would require much deeper study and consideration of service-level concerns.

**Feng shui is an interpretation, not an answer.** This map isn't a device that declares "this is a prime site." It's simply a numerical imitation of the conditions that people in the past considered favorable in terrain. It shouldn't be used as grounds for belief.

**The sunlight calculation is still only half-finished.** It accounts for the amount of light based on which direction the ground tilts, but it still can't account for actual shadows cast by a distant mountain to the south or a building in front. A spot that's actually in shade could show up as well-lit.

**Building heights are only as accurate as what's recorded.** Buildings with no floor count or height listed in the public map data get treated as short. This makes them appear to block less than they actually do.

**Ground elevation is an approximation.** It isn't precise surveying — it's derived from public tiles — so it fits better at the scale of hills and ridgelines than at the scale of a narrow alley.

As is usually the case with this kind of calculation, it's far more useful for filtering out "this is definitely not it" than for pinpointing "this is the best spot." That's about as far as it goes: painting red over the places that are exposed at the back, blocked in front, far from water, and hemmed in by high-rises.

### If you enjoyed this, please leave your thoughts.
As before, the writing itself wasn't just carelessly generated by AI.
Calculating a prime site from the shape of the land might sound plausible, but in the end, far more of what makes a place good to live in lies outside the numbers. I plugged in places I used to live and companies I used to work at, and some came out better than expected, others worse. In the end, I think it's people who decide everything.
