gridline fix for edge and feature buffers
All checks were successful
Server Tests / Mocha – Unit & Utility Tests (push) Successful in 1m11s
Server Tests / Jest – Integration Tests (push) Successful in 1m35s

This commit is contained in:
Devin Major 2026-05-08 13:18:28 -04:00
parent 1e7977cdba
commit cdf6fb7b7e

View File

@ -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 // Convert line buffers to xcl zones then also include them within the next process
if (bufs && bufs.length) { if (bufs && bufs.length) {
for (let i = 0; i < bufs.length; i++) { 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)) { if (!utils.isEmptyArray(polyCoors)) {
xclZones.push(jobUtil.createXclArea({ name: `XCL${i + 1}`, coors: polyCoors })); xclZones.push(jobUtil.createXclArea({ name: `XCL${i + 1}`, coors: polyCoors }));
} }