So far I have found similar questions like this one but none have quite expressed or fixed my exact issue.
I'm using Openlayers v4.6.5 and JSTS 1.4.0
The problem I'm having is with the buffer() method of the JSTS library. My conde snippets are as follows:
var feats = vectorSource.getFeatures();
// Takes in multiple features and combines them into one
var geom = joinGeoms(feats);
var parser = new jsts.io.OL3Parser();
var jstsGeom = parser.read(geom);
var meters = toMeters(500, 'ft'); // Result is 152.4 meters
var buffered = jstsGeom.buffer(meters);
// This is where the issue happens
var finalGeom = parser.write(buffered); <---
The geometry that is generated from the buffer()
method and assigned to finalGeom
is then used to select other features that intersect. I have captured this geometry and have shown it below along with measurements done with the my measure tool (which I have tested separately and know is accurate).
The buffer distance should be 500 feet or 152.4 meters but comes back as a different distance. I have to tried seeing if this is from a different projection or unit conversion but I cant find anything that would take my inputs and result in the numbers I am getting.
My projection is EPSG:3857
, which I know isn't the best for these kinds of measurements but I have been unable to successfully convert where its accurate.
Any thoughts?