Opened 13 years ago

Closed 11 years ago

#58 closed defect (fixed)

deny 0 length segments

Reported by: steve@… Owned by: steve@…
Priority: major Milestone: OSM 0.5
Component: admin Version:
Keywords: Cc:

Description

The applet and API should check for segments where node_a==node_b

Change History (2)

comment:1 Changed 12 years ago by nickblack1@…

I've adapted my local version of the applet so that you cannot delete a node that is joined to a segment. This stops 0 length segs, but also means it isnt possible to delete existing 0 length segs. Would this be better controlled by the server?

comment:2 Changed 11 years ago by Sebastian@…

  • Resolution set to fixed
  • Status changed from new to closed

root/sites/rails_port/app/controllers/segment_controller.rb
View revision: Revision 2864

7 def create
...
18 if segment.from_node == segment.to_node
19 render :nothing => true, :status => HTTP_EXPECTATION_FAILED
20 return
21 end

The API does check if the segment has the same start and end node. I guess 0 length is still possible if both nodes have exactly the same position, but that is probably not even an error. As the Server deals with that now, clients cannot create them by accident anymore. Closing this bug. Please reopen if this does not satisfy the original bug report.

Note: See TracTickets for help on using tickets.