locationtech / proj4j

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

Make BasicCoordinateTransform thread-safe #29

Closed sebasbaumh closed 5 years ago

sebasbaumh commented 5 years ago

Make BasicCoordinateTransform thread-safe to increase performance in multi-threaded environments by reusing the same instance.

The transform function does not need temporary variables anymore (which were the reason for having a stateful class). And inverseProjectRadians does only touch the target coordinate after calculating using the source coordinate, so it can get the same instance for both parameters.

So finally with this change it is possible to reuse a BasicCoordinateTransform across multiple threads instead of constructing one for every single thread. Especially servlets and enterprise applications transforming coordinates on a web request will benefit from it.

sebasbaumh commented 5 years ago

How do I handle this: Sebastian Baumhekel (sebastian.baumhekel@****.com) did not include the "Signed-off-by footer" which is required for all commits made by a contributor.

I already signed an Eclipse Contributor Agreement some time ago.

pomadchin commented 5 years ago

hey @sebasbaumh just do git commit --amend -s && git push origin -f threadsafeTransform

flag -s here would add a proper footer, just be sure that you're signing your commit with the same email you signed ECA.

sebasbaumh commented 5 years ago

@pomadchin Thank you 👍