Looking at the difference code found that the following function is being used to remove "empty" polygons:
/**
* Detect Empty Polygon
*
* @private
* @param {Geometry<Polygon|MultiPolygon>} geom Geometry Object
* @returns {Geometry<Polygon|MultiPolygon>|null} removed any polygons with no areas
*/
function removeEmptyPolygon(geom) {
switch (geom.type) {
case 'Polygon':
if (area(geom) > 1) return geom;
return null;
case 'MultiPolygon':
var coordinates = [];
flattenEach(geom, function (feature) {
if (area(feature) > 1) coordinates.push(feature.geometry.coordinates);
});
if (coordinates.length) return {type: 'MultiPolygon', coordinates: coordinates};
}
}
Now, in our use case we every now and then subtract polygons with areas smaller than one square foot, thus we have the following questions:
Thanks in advance for your help and keep the amazing work.
Hi @jesus-deepblocks
That does seem curious, I suspect it was probably put there to help handle errors.
In my v7 branch we're replacing the dependency that manages the difference operation and so we might be able to relook at whether that check is still required, I'll try and run a check and report back.
Cheers
Most helpful comment
Hi @jesus-deepblocks
That does seem curious, I suspect it was probably put there to help handle errors.
In my
v7branch we're replacing the dependency that manages the difference operation and so we might be able to relook at whether that check is still required, I'll try and run a check and report back.Cheers