Hi Marek, unfortunately your network did not make it to the list. Am 18.11.2016 um 12:40 schrieb sumo.mahei: > I am currently refactoring edge.getShape():
in which way does the current code need refactoring? Is it for adding 3D or are there more issues? > and I do find the following legacy behaviour (in the last release version): I would not consider this legacy (well at least not a bad one ;-)), see below. > Unclear Part: ###################################### > for an edge without a shape tag in the net.xml > > edge = self.sumo_net.getEdge('this_way') > result_legacy_buggy = edge.getShape(includeJunctions=True) > print( result_legacy_buggy ) >>>> [(100.0, 0.0), (100.0, -1.05), (200.0, -1.05), (200.0, 0.0)] > (shape of lane merged into here) That is perfectly fine and consistent with the output with includeJunctions=False, which is probably (100.0, -1.05), (200.0, -1.05) here. The shape of an edge should be equivalent to the shape of the lane for a single lane road and spreadtype=center (because in fact the lane _is_ the edge then). This is important for matching detectors, bus stops etc. to the correct location and it also makes the length of the edge in better agreement with the geometric length of the drawn shape. Including the junctions is just a helper if you want to map points which are very close to junctions but still want to find the "best" edge or lane. > but when I look at the source-code I do believe originally the following > output was intended: >>>> [(100.0, 0.0), (200.0, 0.0)] No, I don't think so. > edge.getShape(includeJunctions=False): > -> returns the from and to node's coords in 2d for an edge without shape > -> edges shape coords in 2d for an edge with shape (from and to node's > coords might be included if no spacious junction is engaged) The reason for not including the edge shape for straight edges is that it is identical to (or can easily be calculated from) the lane shape not that it is identical to "from" - "to". So includeJunctions=False should not include node coordinates (as explained above). I am fine though with restricting the result to two dimensions. (I suppose you want to add a 3D version of the method similar to Jakobs proposal for node coordinates?) Best regards, Michael ------------------------------------------------------------------------------ _______________________________________________ sumo-devel mailing list sumo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sumo-devel