@@ -26,7 +26,7 @@ fn liblrs_python(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
2626 Ok ( ( ) )
2727}
2828
29- #[ derive( Clone , Copy ) ]
29+ #[ derive( Clone , Copy , Debug ) ]
3030/// A geographical [`Point`], it can be either a projected or spherical coordinates.
3131#[ pyclass]
3232pub struct Point {
@@ -47,6 +47,10 @@ impl Point {
4747 fn new ( x : f64 , y : f64 ) -> Self {
4848 Self { x, y }
4949 }
50+
51+ fn __repr__ ( & self ) -> String {
52+ format ! ( "{:?}" , self )
53+ }
5054}
5155
5256impl From < geo_types:: Point > for Point {
@@ -83,7 +87,7 @@ impl From<Point> for geo_types::Coord {
8387}
8488
8589#[ pyclass]
86- #[ derive( Clone ) ]
90+ #[ derive( Clone , Debug ) ]
8791/// Represent a position on an [`LrmScale`] relative as an `offset` to an [`Anchor`].
8892pub struct LrmScaleMeasure {
8993 #[ pyo3( get, set) ]
@@ -122,6 +126,10 @@ impl LrmScaleMeasure {
122126 scale_offset,
123127 }
124128 }
129+
130+ fn __repr__ ( & self ) -> String {
131+ format ! ( "{:?}" , self )
132+ }
125133}
126134
127135#[ derive( Clone , Copy ) ]
@@ -156,7 +164,7 @@ impl From<SegmentOfTraversal> for liblrs::builder::SegmentOfTraversal {
156164 }
157165}
158166
159- #[ derive( Clone , Copy ) ]
167+ #[ derive( Clone , Copy , Debug ) ]
160168#[ pyclass]
161169/// The linear position of an anchor doesn’t always match the measured distance
162170/// For example if a road was transformed into a bypass, resulting in a longer road,
@@ -181,6 +189,10 @@ impl AnchorOnLrm {
181189 distance_along_lrm,
182190 }
183191 }
192+
193+ fn __repr__ ( & self ) -> String {
194+ format ! ( "{:?}" , self )
195+ }
184196}
185197
186198impl From < AnchorOnLrm > for liblrs:: builder:: AnchorOnLrm {
@@ -192,6 +204,7 @@ impl From<AnchorOnLrm> for liblrs::builder::AnchorOnLrm {
192204 }
193205}
194206
207+ #[ derive( Debug ) ]
195208#[ pyclass]
196209/// An `Anchor` is a reference point for a given [`Curve`].
197210/// It can be a milestone, a bridge…
@@ -210,6 +223,13 @@ pub struct Anchor {
210223 pub scale_position : f64 ,
211224}
212225
226+ #[ pymethods]
227+ impl Anchor {
228+ fn __repr__ ( & self ) -> String {
229+ format ! ( "{:?}" , self )
230+ }
231+ }
232+
213233#[ pyclass]
214234/// The result of a projection onto an [`LrmScale`].
215235pub struct LrmProjection {
0 commit comments