Opened 5 years ago

Last modified 5 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


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:


Change History (1)

comment:1 Changed 5 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...


Note: See TracTickets for help on using tickets.