3 ms·
I'm not much of a one for write-ups I confess, but broadly: The raw data comes from the Environment Agency and Natural Resources Wales as .asc files, which are
by hanoz 6y ago
I'm not much of a one for write-ups I confess, but broadly:
The raw data comes from the Environment Agency and Natural Resources Wales as .asc files, which are just a big 2d array of height values in text file, in this case covering 1km2 each.
I downloaded all these and wrote a script to produce .png tiles using a "hill shading" algorithm, i.e. make pixel darker if pixel to top left is taller, using C#.
Once I was getting nice results I rented a hefty server at AWS to run it on the whole dataset for 24 hours, generating 2 million .png files, then used leafletjs to display them slippy map style.
I was originally hosting the tiles on AWS but the egress fees were too much so I move them all to a 3€/month bare metal arm server at Scaleway.
The 3D stuff re-fetches the raw .asc files from the source agencies on demand using a AWS Lambda script which cuts out the 1km2 of interest and passes it back to the web server, which renders it using three.js for the surface texture mode, or potree for the pointcloud version.
The website itself is built in asp.net core, running on a $10/month box at Digital Ocean.
- wizzwizz4 6y agoThat hill-shading algorithm explains why forests are so staticky. In theory, you could combine terrain and surface models[0] to detect and colour features… but that's tricky. [0]: https://lle.gov.wales/catalogue/item/LidarCompositeDataset/ https://lle.gov.wales/catalogue/item/LidarCompositeDataset/