diff --git a/packages/turf-intersect/index.js b/packages/turf-intersect/index.js index 280f409dd3..d8d8da86d3 100644 --- a/packages/turf-intersect/index.js +++ b/packages/turf-intersect/index.js @@ -39,11 +39,15 @@ module.exports = function (poly1, poly2) { var geom2 = (poly2.type === 'Feature') ? poly2.geometry : poly2; var reader = new jsts.io.GeoJSONReader(); - var a = reader.read(JSON.stringify(truncate(geom1))); - var b = reader.read(JSON.stringify(truncate(geom2))); + var a = reader.read(truncate(geom1)); + var b = reader.read(truncate(geom2)); var intersection = a.intersection(b); - if (intersection.isEmpty()) return null; + if (intersection.isEmpty()) return { + type: 'Feature', + properties: {}, + geometry: null + }; var writer = new jsts.io.GeoJSONWriter(); var geojsonGeometry = writer.write(intersection);