OpenTopoMap
OpenTopoMap copied to clipboard
Improve Schraffur
Wohngebäude 45°, Nutzgebäude 90°
More information: http://www.katastermodernisierung.nrw.de/documente/broschuerenerlasse/zvaut.pdf (page 17-19) and: https://forum.openstreetmap.org/viewtopic.php?id=23611
Hatching in 45° for building = yes / residential / commercial (?) ... and 0° or 135° for all others? We could try... Maybe the other way: one hatching for building=barn, carport, bridge, stable... and one for each other.
The rule "Alle anderen Gebäude werden rechtwinklig zur längsten Gebäudeseite schraffiert." ("all other hatching 90° to the longest wall of the building") seems heavy, we don't have the rotation of a building. And it's ugly: All buildings will look like terraced houses.
Yes, I think this issue is very hard to implement. We would have to calculate the main direction of EVERY building. It would be only necessary for zoom 17...
mapnik-de and the french style are the only mapnik maps with on-the-fly rotation, as far as I know. They use some confusing queries to rotate the symbol for sports grounds... Maybe something like that, but easier, some of the variables there are only for estimating wether a pitch is a rectangle.
Wow, great! That is a good starting point... By the way: Drawing sports grounds as a rotated and scaled symbols (on zoom 13-15) would be nice, too! I received a lot of requests by users.
The code for the soccer fields needs a rectangular field. Sometimes we have more than 4 corners mapped and thats why the code uses a simplification of the way to calculate the rotation of the yard lines. We need something similar to get the longest wall without smaller details.
I rendered such a simplification for all buildings:
(this area)
That works fine for rectangular buildings, but not for complex architecture like the one between Heß- and Gabelsbergerstraße or L-shaped buildings (corner of Gabelsberger/Arcis). So maybe this code will work under the assumption, that not-residential buildings are rectangular (ok, most barns are rectangular... offices and museums and hospitals are not...)
(It looks worse than it really is. For example the L-building Theresien/Luisenstr: It is rather deformed but the direction of the longest way in the left image is correct)
The simplified buildings are not for being rendered, but only for the calculation of the hatching, right?
Yes, I just needed a feeling, what this "ST_SimplifyPreserveTopology" is doing with an area. The hatching could be 90° to the longest way of a simplified shape.
Just a question: Is there any easy way to get rotated hatches with mapnik? If I take a small svg like mapnik/symbols-otm/building_z17.svg i get hatches with 45°. If I rotate this svg by 20°, each 5x5px tile is rotated and then these tiles are stitched together:

If there is no easy way, I could make a svg with 400x400px and rotate this (and hope no building is larger than 400px...)
Yes, I think it is the best way to create a very large svg pattern. It should be no problem to have a pattern of (1000x1000) px² ;-)
Revoke: Mapnik is stupid. It always stitches the pattern together, so you can not avoid ugly joints. :-1: