Checking a 3D Sagrada Família against photographs
The airports in Chronotopia are checked against aerial photographs: lay the model’s outlines on a 1956 orthophoto and see whether the runway is where the photo says. The Sagrada Família, the next site, can’t be checked from above, because what matters is its height, and the heights of many of its parts have never been published. So we check it the way people see it: from the street, against photographs, one silhouette at a time.
The site has been open in the app since 5 October 2026. This article describes the checking tool, what it measured, and the one decision it settled, the height of two of the Passion façade’s towers. Gaudí’s geometry in code explains how the model itself is built.
Sources that give two heights
The Passion façade has four Apostle towers. The two in the middle are 112.1 m, a figure from Josep Gómez Ramió’s doctoral thesis at the UPC, which also gives 101.9 m for the two outer ones. Other secondary sources, and OpenStreetMap, put the outer towers at about 107 m. From the square the difference is easy to miss, but the model needs one number.
The Nativity façade is harder. Its towers are 98 to 107 m depending on the source, and for its portals, its rose window and the stone cypress between the towers we found no published dimensions at all. Every one of those had to be read off a photo.
A camera fitted to each photo
The tool lives on a development page, pilot.html, which is not part of the app’s build. For each reference photo it does four things.
-
It finds the sky in the photo. Within a region of interest, any pixel that is blue sky or white cloud is sky, and everything else is “structure”. Rectangles can be left out: cranes, trees, lamp posts, and parts of the building not modelled yet. For old sepia prints, sky is simply any pixel brighter than a threshold.
-
It renders the model as a mask. The model is drawn as flat white on black from a camera with seven parameters: position (three), yaw, pitch, roll and field of view.
-
It scores the two silhouettes. The comment at the top of
src/pilot/match.tsdescribes the score:The score is the mean distance between the two outlines (XOR area / outline length), as a share of the image height.
The pixels where photo and model disagree, divided by the length of the outline, give an average distance between the two outlines in pixels, which is then divided by the image’s height. The tool also reports the overlap of the two masks (IoU).
-
It moves the camera to minimise the score. The starting camera comes from the GPS position the photographer’s camera stored in the photo. A coarse grid search over field of view, yaw and pitch comes first, then a Nelder–Mead search over all seven parameters, up to 400 iterations.
The comparison runs at 240 pixels wide. All the photos are from Wikimedia Commons under free licences, and each one’s author and licence is recorded with it.
What a good fit looks like
Before trusting the numbers, there is a simple test: the fit is allowed to change the field of view freely, and the photo’s metadata says what lens was used. If the model’s scale and position are right, the fitted field of view should land near the real one. If the model were 10% too tall, the fit would compensate by zooming, and the field of view would drift.
On the first three photos of the Passion towers, it landed close:
| Photo | Error from the GPS camera | Error after the fit | Fitted vs real field of view |
|---|---|---|---|
| From the square, 70 mm lens | 4.7% | 1.23–1.29% | 20.0° vs 19.45° |
| From carrer de Sardenya, 28 mm | 1.1% | 0.31–0.34% | 63–68° vs 65.5° |
| Telephoto from the south | 0.8% | 0.66% | 15.6° vs about 15.8° |
The ranges are the two candidate heights for the outer towers. The target we set before running it was under 2%, and all three met it. The third photo was kept only as a reference for detail: in it, the nearer tower looks clearly taller than the other, which matches neither the GPS position nor any of the heights, so either its position or our reading of which towers it shows is wrong.
101.9 metres, by a small margin
With the outer Passion towers at 101.9 m, the error was 1.24% on the photo from the square and 0.31% on the one from the street. At 107.4 m it was 1.29% and 0.34%. Both photos prefer the lower height, though not by much: at 240 pixels wide, one pixel is 0.3 to 0.6% of the image’s height, so the whole measured error is two to four pixels.
The research notes record the decision and why: the thesis says 101.9 m, and so does the Basilica’s own blog, about 102 m; and the photo comparison leans the same way. The model uses 101.9 m. The photos didn’t decide it alone, and the notes are careful to say so, but they turned a conflict between sources into two sources and a measurement on one side.
The Nativity façade, read off one photo
For the Nativity façade there was nothing to choose between, because there were no figures. The towers’ proportions, the portals, the rose window and the cypress were read off one photo, a view of about 1935 from the KITLV collection, scaled by the 107.25 m height of the two inner towers. The model’s code keeps the readings in a comment: the Charity portal at about 20 m, the rose window at 36 m, the gable at about 43 m, and the cypress from about 43 to 57 m with its cross reaching about 62 m. Each is marked as read, not published.
Then the model was checked against four photos of the façade: three taken between 2013 and 2022, and the 1935 one itself.
| Photo | Error after the fit | Overlap (IoU) |
|---|---|---|
| 2013 | 0.31% | 0.93 |
| 2019 | 0.39% | 0.77 |
| c.1935 (KITLV) | 0.49% | 0.63 |
| 2022 | 0.97% | 0.83 |
Earlier, the main body of the temple, its nave, transept and apse, had been checked the same way against five other photos, with errors between 0.35% and 1.10%.
What the comparison can’t tell you
- It measures silhouettes. The research notes say it plainly: the figures hold for the outline against the sky, not for the detail of the windows. A louvre in the wrong place doesn’t change the score.
- Distance and focal length can trade off. On two of the Nativity photos, a free fit moved the camera back and zoomed in, or forward and zoomed out, and scored almost the same. Fixing the camera at its GPS position raised one error from 0.31% to 0.43%. The silhouette can be read; the exact camera position can’t.
- One photo can disagree with the others. Modern photos put the top of the cypress at about 66 m, against about 57 m in the 1935 photo. The model keeps the 1935 reading for now, and the conflict is in the notes.
- The resolution is low. Two to four pixels of error is good at 240 pixels wide; the planned next step is to repeat the comparisons at 960.
- There is a gap in the photos. Of about 95 free photos we selected from roughly 2,400 on Commons, none is from the 1940s or the 1970s, and there is no aerial view between 1931 and 2003. Those decades of the timeline will rest on texts, as Ibiza’s 1956-1984 does in the aerial photo article.
The tool doesn’t make the model right. What it does is turn “looks about right” into a number we can write down, compare between two candidate heights, and repeat when the model changes. If you have a dated photo of the Sagrada Família from the 1940s or 1970s, ideally with the place it was taken from, send it to us.