locationtech / proj4j

Java port of the Proj.4 library for coordinate reprojection
Other
181 stars 71 forks source link

1 degree == 1 metre according to units #68

Open dzfranklin opened 3 years ago

dzfranklin commented 3 years ago

Because degrees have a value of 1, the following test passes

val degrees = Units.DEGREES
val metres = Units.METRES
val metresPerUnit = Units.convert(1.0, degrees, metres)
assertThat(metresPerUnit, `is`(1.0))

I expected that I could convert a number in metres into the unit of an arbitrary CRS with Units.convert. Instead, it appears from the source that I can only convert similar units, such as metric to metric or imperial to imperial.

Is this the indented behavior?