Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zero copy coordinate transformer when not reprojecting? #129

Closed
springmeyer opened this issue Jun 26, 2015 · 1 comment
Closed

zero copy coordinate transformer when not reprojecting? #129

springmeyer opened this issue Jun 26, 2015 · 1 comment

Comments

@springmeyer
Copy link
Contributor

The solution to #116 was to add a "skipping transformer" such that when using a strategy that could return false we'd skip these coordinates and continue on. The context is that proj4 may fail and therefore if used in a strategy would return false.

Okay, so then a followup fix of #121 added another case where the strategy could return false: when totally wacky coordinates (like from some overflow in the separate tool that created the geometry) get passed into the processor and are out of range for the angus clipper. Despite this being really oddball and rare - because it happened in production at Mapbox - I added this as another "skippable" case.

Now we need to think about optimizing. I'm seeing that:

  • when not reprojecting
  • we could clamp instead of skipping for out of range coordinates
  • and then in this case the skipping transformer could be replaced with an in-place transformer
  • therefore you'd be able to safely apply the transformation strategy on all coordinates without ever needing to skip and this could be zero-copy and therefore faster
  • However: the problem is that the input geometry is double and the output is int64: hmmmm
@springmeyer
Copy link
Contributor Author

However: the problem is that the input geometry is double and the output is int64: hmmmm

This is a showstopper. Technically int64 and double use the same space so you could reinterpret_cast to change the values in place, but that is far from a good/safe idea. Closing. Let's focus on optimizations like #126 first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant