@@ -139,29 +139,51 @@ class RouteConstructionFailed(RouteSearchException):
139139
140140
141141class MapDatabase (object ):
142- """ The map database is an abstract interface used by the decoder object.
143- Implementor of database should inherit from this abstract class.
144- """
142+ """ Abstract interface used by the decoder object.
145143
146- """ Node interface
147- distance: the distance from the search location
144+ Implementor of database should inherit from this abstract class.
145+
146+ MapDatabase defines two data structure as named tuples:
147+
148+ :py:class:`MapDatabase.Node`
149+
150+ :py:class:`MapDatabase.Line`
151+
152+ These structures may be extended by MapDatabase implementor accordings to their specific needs.
148153 """
154+
149155 Node = namedtuple ('Node' , ('distance' ,))
156+ """
157+ .. attribute:: distance
158+
159+ The distance from the search location
160+ """
150161
151- """ Line interface
152- distance: the distance from the search location
162+ Line = namedtuple ('Line' , ('id' , 'bear' , 'frc' , 'fow' , 'len' , 'projected_len' ))
163+ """
164+ .. attribute:: id
165+
166+ id of the line
167+
168+ .. attribute:: bear
169+
170+ the bearing according to the start node
171+
172+ .. attribute:: frc
173+
174+ the frc of the line
175+
176+ .. attribute:: fow
153177
154- id: id of the line
155- bear: the bearing according to the start node
156- frc: the frc of the line
157- fow: the fow of the line
158-
159- projected_len: return the value of the projected length of the search location
160- (i.e) the distance between the start node and the projection of the
161- point given by the search coordinates. None if the line is not
162- projected
178+ the fow of the line
179+
180+ .. attribute:: projected_len
181+
182+ return the value of the projected length of the search location
183+ (i.e) the distance between the start node and the projection of the
184+ point given by the search coordinates. None if the line is not
185+ projected
163186 """
164- Line = namedtuple ('Line' , ('id' , 'bear' , 'frc' , 'fow' , 'len' , 'projected_len' ))
165187
166188 def connected_lines (self , node , frc_max , beardir ):
167189 """ Return connected lines to/from the node 'node'
@@ -307,7 +329,7 @@ def singleline(candidates):
307329class ClassicDecoder (DecoderBase , RatingCalculator ):
308330 """ OpenLR location decoder that use an abstract map object
309331
310- See MapDatabase for map database interface.
332+ See :py:class:` MapDatabase` for map database interface.
311333
312334 """
313335 def __init__ (self , map_database ,
0 commit comments