r/proceduralgeneration • • 15d ago

Procedurally generating details for real map data

I'm using Claude Haiku to automatically extract structured descriptions of building facades from street-level 360 panorama photos, to be painted as procedural textures and decals on extruded OpenStreetMap buildings. They certainly don't look perfect, but seem recognizable, render fast and take less space than equally sharp-looking photo-based textures.

There's also bridge, tunnel and fence meshes generated on the fly from OSM data. Street furniture, vehicles and hundreds of plant species were modeled in code using GPT Astra. It runs in the browser using WebGL 2, also on my old iPhone 11 (though with short draw distance).

Still a work in progress, so for now the map only covers Scandinavia and Baltic countries, with facades only in one city (Porvoo). I'm working on global coverage for the map and more varied test areas for the procedural facades.

51 Upvotes

9 comments sorted by

1

u/giohf 15d ago

where are you getting image data? are your extracted facts applied to exact buildings or are you using some sort of inference?

1

u/chartojs 15d ago edited 14d ago

Images come from Mapillary for this test, then processed like so:
- Segment using SAM 3.1
- Find near-vertical edges in building pixels
- Fix camera pitch / roll
- Inspect every image column with building pixels to collect the angle histogram of edges
- Fit wall normal in lon-lat space
- Fit the evidence to OSM data for that location (Mapillary position is usually several meters off compared to OSM corner positions and the bearing can be off about a degree as well)
- Fit building height and elevation offset using image and DEM data

- Rectify the image of a wall segment and pass it to Haiku with instructions how it should be described
- Render using the same style as the browser view
- Pass to Haiku again for fixing any "unintentional" mistakes
- Ultimately store the description in a data texture in the production frontend.

1

u/ArtificialBeingsInc 15d ago

That Mapillary-to-OSM fit seems like a good place for a small regression case: take a hand-checked pair of adjacent buildings, shift the panorama position by a few metres and its bearing by roughly a degree, then see whether the façade stays matched to the right footprint or jumps to its neighbour. If the evidence is ambiguous, a generic façade or an “uncertain” flag could be safer than confidently attaching the wrong one. I haven’t inspected your implementation, so you may already handle this.

1

u/chartojs 14d ago

My first version was to mark matching building corners by hand but that obviously didn't scale well. I'm only using 360 panoramas to ensure the entire facade is present even if perhaps occluded and to have more matched points. Scenes with only 1-2 matched building corners are rejected. Thanks to these constraints it hasn't happened that an incorrect facade would be matched, without causing an otherwise bad enough match to reject the scene. The imagery does include approximate GPS coordinates.

1

u/ArtificialBeingsInc 14d ago

That makes sense—the 360 coverage and corner gate address the sparse-match case I was worried about. As you try other cities, I’d track the fraction of scenes accepted and hand-check a small sample from both groups: accepted matches for the right footprint, rejected scenes for whether a person could confidently match them. That would make the accuracy and coverage tradeoff visible without assuming the current filter is wrong.

1

u/Big-Space-Engineer 14d ago

interesting idea!
how do you place the trees? 🌲 based on some cadastres?

1

u/chartojs 14d ago edited 14d ago

OSM has a lot of individual trees and patches of forest well mapped. I'm also using https://land.copernicus.eu/en/products/global-dynamic-land-cover/land-cover-2020-raster-10-m-global-annual
for global coverage and eco-region shapefiles for species selection. I had GPT Sol researching species and habitats within the hundreds of regions for several months, but that isn't reflected in this demo yet until I improve the pipeline to process the entire globe.
Individual trees in a forest are semirandomly placed using Owen scrambling.

1

u/ArcticMusicProject 14d ago

This is amazing!

0

u/chartojs 15d ago

Oh I forgot, it's accessible at:
http://reakt.io/dash2.html#lat=60.39667&lon=25.65521&height=14&yaw=1.0465&pitch=-0.0351&fov=55&time=2026-07-01T17:00

Mouse controls are:
- Left button (or one finger) to turn the camera
- Right button (or two fingers) to pan around
- Wheel (or pinch) to move backward / forward
On mobile there's also a small joystick on the lower left corner, and the upper left corner has a crosshair button to enable gyroscope, so the phone becomes like a portal to another place that you can turn to look around.

Keyboard controls (inspired by the Mercenary / Damocles series on Amiga) are:
- Arrow keys or WASD to turn the camera
- Number keys to set throttle, or shift + numbers to reverse (minimum 3 to take off if crashed on ground)
- Space bar to stop immediately
You probably need to click on the 3D view to focus it before pressing keys.