OpenTopoMap icon indicating copy to clipboard operation
OpenTopoMap copied to clipboard

Improve Schraffur

Open der-stefan opened this issue 8 years ago • 10 comments

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

der-stefan avatar Jun 12 '17 07:06 der-stefan

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.

max-dn avatar Jun 18 '17 11:06 max-dn

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...

der-stefan avatar Jun 18 '17 20:06 der-stefan

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.

max-dn avatar Jun 19 '17 11:06 max-dn

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.

der-stefan avatar Jun 19 '17 12:06 der-stefan

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: simplified 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)

max-dn avatar Jul 04 '17 19:07 max-dn

The simplified buildings are not for being rendered, but only for the calculation of the hatching, right?

der-stefan avatar Jul 04 '17 20:07 der-stefan

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.

max-dn avatar Jul 04 '17 20:07 max-dn

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:

rotated building_z17.svg

If there is no easy way, I could make a svg with 400x400px and rotate this (and hope no building is larger than 400px...)

max-dn avatar Oct 28 '17 19:10 max-dn

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² ;-)

der-stefan avatar Nov 01 '17 10:11 der-stefan

Revoke: Mapnik is stupid. It always stitches the pattern together, so you can not avoid ugly joints. :-1:

der-stefan avatar Mar 03 '18 17:03 der-stefan