Skip to content

Call to geojson-polygon-self-intersections sets useSpatialIndex to undefined #18

@ChrisLoer

Description

@ChrisLoer

This call leaves the third argument undefined:

var selfIsectsData = isects(feature, function filterFn(isect, ring0, edge0, start0, end0, frac0, ring1, edge1, start1, end1, frac1, unique){
    return [isect, ring0, edge0, start0, end0, frac0, ring1, edge1, start1, end1, frac1, unique];
  });

But over in geojson-polygon-self-intersections there's backwards compatibility code that treats any non-object argument as a bare useSpatialIndex argument, so in this case the "undefined" value overwrites the default value of true.

https://github.com/mclaeysb/geojson-polygon-self-intersections/blob/aaa2fd26e9c457ab1b95fff52c28ceb914f2dcb3/index.js#L23-L29

I noticed this when I got unexpectedly slow performance using simplepolygon outside of turf's unkinkPolygon (which I think uses a slightly older fork of this code).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions