gridline fix for edge and feature buffers
This commit is contained in:
parent
1e7977cdba
commit
cdf6fb7b7e
@ -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 }));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user