Modify

Opened 6 years ago

#16174 new enhancement

please consider adding offset-start and offset-end style setting for lines

Reported by: josm@… Owned by: team
Priority: normal Milestone:
Component: Core mappaint Version:
Keywords: Cc:

Description

I've looked into modifying the lane and road attributes mapstyle to support placement:start and placement:end (used to indicate that the placement changes between the start and end of the way), but this will require drawing lines that are not parallel to the way, which is currently not supported.

I've looked through JOSM's source code, and think adding this should be possible with relatively low effort.

In LineElement.paintPrimitive, painter.drawWay would need to be called with a start and end offset instead of just a single offset.

In StyledMapRenderer.drawWay start and end offsets need to be passed to OffsetIterator.

In OffsetIterator, if the start and end offset are different, then instead of applying a constant offset for every node, a per node offset value is calculated like this:

total_distance = sum of distance between nodes

if total_distance is 0, then:

current_node_offset = offset_start - ( (offset_start-offset_end) * 0.5 )

otherwise:

current_distance = sum of distance from first to current node

current_node_offset = offset_start - ( (offset_start-offset_end) * (current_distance / total_distance) )

Attachments (0)

Change History (0)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to josm@….
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.