Buffer exterior rings when creating polygons.
Rationale
This is already done for interior rings, and prevents invalid geometries from crashing things later.
Fixes #956.
Implications
WIP, since I need to write a test and I might try some benchmarking.
I've added a test, pared down from the oceans feature to the limit of what's needed to trigger the error.
I tried running the tests a few times on master vs this branch and don't see any appreciable change in runtimes.
Test failure looks real, but I can't readily tell if it's because of your change or upstream.
Well, it didn't fail for me in testing, but I didn't try the older versions...
OK, it does fail with 2.7 locally, so I will try and investigate.
Well, I'm a bit confused; the values of the points are going in the same, and the init strings going into proj are the same, but somehow pj_transform in CartesianInterpolator::project is returning slightly different values that makes a broken exterior which buffer deletes entirely.
Oops, apparently I missed the obvious that I was not running the same versions of Proj!
Just a reminder that if you want this for 0.17, there's just a few days left.
IIRC, this is difficult to get working for both versions of Proj, since they return different values. I think this can't move forward until we bump minimum Proj requirements.
TBH, I'm not really sure about this; as you can see tests fail and I'm not sure whether this can be corrected.
This looks like it passes all tests, and I do not see a speed regression. Seems good to go after a rebase?
This commit
[ 50.00%] ··· ============================ ============= ============
-- resolution
---------------------------- --------------------------
projection 110m 50m
============================ ============= ============
PlateCarree 24.5±0.3ms 2.96±0.02s
NorthPolarStereo 24.6±0.08ms 3.12±0s
Robinson 10.9±0.1ms 3.43±0.02s
InterruptedGoodeHomolosine 11.1±0.07ms 3.72±0.01s
============================ ============= ============
Current master
[100.00%] ··· ============================ ============= ============
-- resolution
---------------------------- --------------------------
projection 110m 50m
============================ ============= ============
PlateCarree 25.8±0.6ms 2.90±0.01s
NorthPolarStereo 25.4±0.4ms 3.07±0.01s
Robinson 11.1±0.2ms 3.34±0.01s
InterruptedGoodeHomolosine 11.1±0.06ms 3.61±0.01s
============================ ============= ============
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.