Show HN: QuadTree model for generating random road networks
github.comAre there really towns and cities that look like the generated maps in the readme? As a European, the maps look completely alien; but perhaps this looks like a US city?
Sorta. There are places that are almost completely on a grid, like Salt Lake City[0]. Even then, there is a dense downtown core, and sparser suburbs with more organic neighborhood streets further out (if not blocked by mountains), as opposed to random clusters dense roads that aren't anywhere near each other. Then there's Pittsburgh[1], whose topography prevents a large grid, and there are several colliding grids at different orientations, and the suburbs gave up.
[0] https://www.google.com/maps/place/Salt+Lake+City,+UT/@40.737...
[1] https://www.google.com/maps/place/Pittsburgh,+PA/@40.4424429...
I spent two minutes with Google Maps and managed to confirm, somewhat to my surprise, that these generated maps are actually a reasonably good approximation to areas in Nebraska.
Must make map making easier as someone actually appears to have created a physical grid system... :-)
Not an expert, but generally the further west you go in the US (until you hit the west coast, which was already settled before the big westward expansion), the more grid-like things are, especially in areas without many geographic features
as I understand it, this is because the land was more and more allocated in logical blocks -
https://en.wikipedia.org/wiki/Public_Land_Survey_System#Size...
I mean, we even have completely square or nearly completely square states -
https://en.wikipedia.org/wiki/Colorado
etc
Not explicitly, they are just dense parts of the network. But towns and cities tend to have dense network of roads. The network is represented as square grids, so it resembles a city where roads are organized into blocks - like many US cities.
> For a given number n of nodes, the squares are randomly divided into four quadrants, i.e. add four children to leaf nodes in the QuadTree. Each edge of the square forms a road connecting two points.
If I understand this correctly, then the edges of every final quadtree node are assumed to be roads. As a result, if a given quadtree node isn't subdivided, its edges form a large square road 'box'. I think this makes the resultant road grids look artificial, at least for viewers who are used to twiddly networks that have developed organically over decades/centuries.