locationtech / geotrellis

GeoTrellis is a geographic data processing engine for high performance applications.
http://geotrellis.io
Other
1.33k stars 360 forks source link

ProjectedExtent.reproject is lossy #2797

Open metasim opened 6 years ago

metasim commented 6 years ago

"Lossy" may not be the right word, but IMO the reproject method on any of the data types should return the same type as it is invoked upon. In this case I think the signature should be:

def reproject(dest: CRS): ProjectedExtent

rather than: https://github.com/locationtech/geotrellis/blob/829b4faf0a4323de90a732f9cb2e3516bb9dc14c/vector/src/main/scala/geotrellis/vector/Extent.scala#L52-L53

The question is whether it's worth breaking the API over this. It is more of a frustration than an outright bug.

jpolchlo commented 6 years ago

It's a good notion to stay in type. At the moment, I'm looking into a complete revamping of the reprojection interface as it's confusing as anything, and probably just overcomplicated. We'll take into consideration these sorts of type issues as we move along.