From cdf6fb7b7ea34011d0854c4801a1bf2ea18c4a83 Mon Sep 17 00:00:00 2001 From: Devin Major Date: Fri, 8 May 2026 13:18:28 -0400 Subject: [PATCH] gridline fix for edge and feature buffers --- Development/server/helpers/gridline_util.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Development/server/helpers/gridline_util.js b/Development/server/helpers/gridline_util.js index e9971b0..f9669a7 100644 --- a/Development/server/helpers/gridline_util.js +++ b/Development/server/helpers/gridline_util.js @@ -99,7 +99,15 @@ async function getLinesLatLng(job, sprayIds, halfSwathOffset = true, x, y, headi // Convert line buffers to xcl zones then also include them within the next process if (bufs && bufs.length) { for (let i = 0; i < bufs.length; i++) { - const polyCoors = bufUtil.lineBuffer(bufs[i].geometry.coordinates, utils.toMeter(bufs[i].properties.width, job.measureUnit)); + const geoType = bufs[i].geometry.type; + let polyCoors; + if (geoType === 'Polygon') { + // Edge buffers and feature buffers are already polygons — use the outer ring directly + polyCoors = bufs[i].geometry.coordinates[0]; + } else { + // Segment/corridor buffers are LineStrings — expand to polygon using corridor width + polyCoors = bufUtil.lineBuffer(bufs[i].geometry.coordinates, utils.toMeter(bufs[i].properties.width, job.measureUnit)); + } if (!utils.isEmptyArray(polyCoors)) { xclZones.push(jobUtil.createXclArea({ name: `XCL${i + 1}`, coors: polyCoors })); }