Opened 4 years ago

Last modified 4 years ago

#589 new defect

Rules for rendering sport pitch not accurate in Brasil

Reported by: couchmapper Owned by: cquest
Priority: major Component: style osmfr
Keywords: Cc: couchmapper

Description

in a thread in the German OSM forum some mappers were wondering why so few soccer pitches in Brasil are rendered with special soccer field style. If you compare this to France or Germany, you'll notice that most soccer places are shown with the style.

After some discussion we came to the conclusion that the mercator projection and the use of st_distance seems to be the reason for the strange behavior.

To qualify a soccer field must have a certain length/width, which is calculated using st_distance() and compared with a value in units of the current projection (epsg:900913).

One of the conditions says that a soccer field has to be 130 units long. At 50° lat this corresponds to roughly 85 meters. At 20° the same field needs to be 122m long to qualify.

To resolve the issue, a transformation to epsg 4326 might be an option. This however would mean that all relevant render rules need to be adjusted to real meters instead of some projection unit.

Another option could be to use some calculation like cos(lat)/cos(50°) which would adjust the length. The current projection based approach could then be used along with a correction factor.

Relevant Links:

[1] http://forum.openstreetmap.org/viewtopic.php?pid=425474#p425474
[2] http://tile.openstreetmap.fr/?zoom=18&lat=-22.91218&lon=-43.22948&layers=B0000000FFFFFFF
[3] https://lists.openstreetmap.de/pipermail/mapnik-de/2014-June/000219.html

Change History (1)

comment:1 Changed 4 years ago by maxbe

We made a fix for the german mapnik style. Feel free to copy the (Style name="sports")-part an the (Layer name="sports")-datasource from (1).

We changed the conditions from "mercator units" to meters and adjusted the rules. Maybe we will have to do some more adjustments for pitches with uncommon dimensions...

(1) http://svn.openstreetmap.org/applications/rendering/mapnik-german/inc-de/layer-landcover.xml.inc

Note: See TracTickets for help on using tickets.