You don't have to solve the model creation bit or the texturing bit because we think that bits in the bag. This is an example of what we need. You specify the res and white and some app places in the black. Preferably you specify a greyscale map of regions, the white polygon and it spits out the black buildings on a full white background so that if you took the input and masked it with output then you would get bounded buildings.
The point about the buildings are that they cannot just be randomly placed like trees because you have to ensure that they share edges as much as possible and yet leave several sides of the building free for light and access. If possible no building should end up being enclosed by other buildings and it should produce natural paths between them. Also the buildings need to make an attempt to align with the polygon edges. You need some kind of 'goodness factor' for all these things and when the app thinks it has a shape, rotation and position which is good enough then it pops it in.
I don't know whether it needs to look at what its got so far and make an educated guess or whether you just pump zillions of random numbers at the place checking the quality goodness factor until you accept one and let the rubbish results just die out. You could store all the quality factors for each house and start by accepting almost anything then as you progress you remove the worst ones and put in better ones and keep going until you reach a threshold quality. I don't know what way is best there.
I think we could generate a vector set of regions from a raster and vice-versa so I don't think working in vector or raster is better either way. Just whatever is easiest to script up.
On the image below the gaps between the houses could be closed or not. If that's something we could adjust then that would be ideal but I think I could live with either really.
We could use a fixed set of house shapes or get the app to generate them. Again I think we could live with either though I expect it would be easier in some respects to make the houses on the fly and in other cases might be easier to pick from a predetermined set.