Skip to content

Support Geometry#buffer with GEOS 3.2 #10

Merged
merged 1 commit into from May 31, 2012

2 participants

@dazuma
dazuma commented Apr 15, 2012

GEOS 3.2 supports buffers but via GEOSBuffer_r() rather than GEOSBufferWithParams_r(). This pull request fixes buffer support when running GEOS 3.2.

@dark-panda
Owner

Is GEOS 3.2 still being used enough to worry about compatibility? This fixes one method, but there's still plenty of areas where ffi-geos just doesn't want to work on versions of GEOS prior to 3.3.

Any idea what the overall use is for those older GEOS versions?

@dazuma
dazuma commented May 8, 2012

To be honest, the main reason I'm asking for this one is that distro used by Travis-CI includes only 3.2, so I was getting failures in rgeo's test suite when run by Travis. I had to disable my buffer-related test cases for the time being just to keep Travis happy, and I'm kind of loathe to do that.

The larger issue is that, yes, 3.3 is the standard now, but it hasn't been out for all that long yet, and some distros take a while to update. There are still a lot of people on 3.2, so I'm trying to maintain compatibility with 3.2 as much as I can for as long as I can.

Maybe another consideration is, I think it's best to be consistent with our messaging on what versions of geos are supported. Right now the messaging suggests that 3.2 is still supported, and it's just that the 3.3 features won't be available. People will understand if the library fails because they tried to access a 3.3-specific feature when running geos 3.2. But Geometry#buffer itself (minus the extended parameters) is present in 3.2, so users will expect that it should still work. I think it's better either to degrade properly, or just to state clearly that 3.3 is the minimum.

@dark-panda
Owner

Alright, that's sounds good. I think I'll rework some of the tests involving buffer so they recognize this difference then. I wonder how close we could get buffer to work seamlessly across versions. I'll have to take a look to see if it's possible.

@dark-panda
Owner

Okay, patch committed and pushed to d256f25. I've made a few modifications to allow the Geos::BufferParams structure to be used with older GEOS versions for the sake of backwards compatibility, although the various options it provides simply go unused in those older versions. The patch for that is at 59e1c8c if you'd like to take a gander.

@dark-panda dark-panda merged commit d256f25 into dark-panda:master May 31, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.