@@ -22,7 +22,7 @@ def get_coord_matrix(
2222def get_affine_transform (
2323 from_coord : np .ndarray , to_coord : np .ndarray
2424) -> tuple [float , float , float , float , float , float ]:
25- A , res , rank , s = np .linalg .lstsq (from_coord , to_coord , rcond = None )
25+ A , res , rank , s = np .linalg .lstsq (from_coord , to_coord , rcond = None ) # noqa: N806
2626
2727 np .testing .assert_array_almost_equal (res , np .zeros_like (res ), decimal = 15 )
2828 np .testing .assert_array_almost_equal (A [:, 2 ], np .array ([0.0 , 0.0 , 1.0 ]), decimal = 15 )
@@ -57,7 +57,7 @@ def _segmented(linestring: LineString) -> list[LineString]:
5757# reference: https://gis.stackexchange.com/questions/367228/using-shapely-interpolate-to-evenly-re-sample-points-on-a-linestring-geodatafram
5858def redistribute_vertices (geom , distance ):
5959 if isinstance (geom , LineString ):
60- if (num_vert := int ( round (geom .length / distance ) )) == 0 :
60+ if (num_vert := round (geom .length / distance )) == 0 :
6161 num_vert = 1
6262 return LineString (
6363 [
@@ -78,9 +78,13 @@ class UnitTransformer:
7878 _degree2meter : pyproj .Transformer
7979 _meter2degree : pyproj .Transformer
8080
81- def __init__ (
82- self , degree_crs = pyproj .CRS ("EPSG:4326" ), meter_crs = pyproj .CRS ("EPSG:3857" )
83- ):
81+ def __init__ (self , degree_crs : pyproj .CRS | None , meter_crs : pyproj .CRS | None ):
82+ if degree_crs is None :
83+ degree_crs = pyproj .CRS ("EPSG:4326" )
84+
85+ if meter_crs is None :
86+ meter_crs = pyproj .CRS ("EPSG:3857" )
87+
8488 self ._degree2meter = pyproj .Transformer .from_crs (
8589 degree_crs , meter_crs , always_xy = True
8690 )
0 commit comments