Opened 8 years ago

Closed 7 years ago

#3869 closed defect (fixed)

Polygon label placement is broken for tiny polygons

Reported by: Peter Owned by: potlatch-dev@…
Priority: minor Milestone:
Component: potlatch2 Version: 2.0
Keywords: Cc:


I've been long struggling with this (118596170) polygon's label - I was not being able to find it displayed on map, until I've noticed it being incorrectly placed a few hundred meters to the side. (The object is a simple 6-point polygon approx. 6 meter long - a tourism attraction.)

Create a 2x2 meter large 4 point polygon, tag and name it appropriately (e.g. amenity=school, name="School placed on our street"). The label will be most probably not 'visible' (zoom out might be necessary to locate it). Move around the corner points by ± few pixels - the label will erratically jump around in up to multiple hundred meter steps.

I understand that if a label is much larger than its objects, it is impossible to place it inside. But why not over the object or tightly near it???

Change History (2)

comment:1 Changed 7 years ago by stevage

Summary: Polygon name (label) placement is too randomPolygon label placement is broken for tiny polygons

Confirmed, there is something seriously amiss with the label placement for very small area ways. Dragging nodes around causes wild fluctuations in the label placement, frequently appearing well outside the bounds of the way.

I suspect a rounding error.

comment:2 Changed 7 years ago by stevage

Resolution: fixed
Status: newclosed

Fixed here:

It was indeed a floating point issue, solved by Jeffrey Sax at StackOverflow?.

Note: See TracTickets for help on using tickets.