Skip to content

Getting error when finding tile covers for extremely small polygons #78

@amishas157

Description

@amishas157

Here is the code snippet: https://jsfiddle.net/dfzaq1m2/ to request tile cover

It fails for both of these features:

Stack trace:

/Users/AmishaSingla/Documents/osm-compare/node_modules/tile-cover/index.js:229
    if (ring && y === ring[0][1]) ring.pop();
                             ^

TypeError: Cannot read property '1' of undefined
    at lineCover (/Users/AmishaSingla/Documents/osm-compare/node_modules/tile-cover/index.js:229:30)
    at polygonCover (/Users/AmishaSingla/Documents/osm-compare/node_modules/tile-cover/index.js:152:9)
    at Object.getTiles [as tiles] (/Users/AmishaSingla/Documents/osm-compare/node_modules/tile-cover/index.js:77:9)
    at feature_overlap (/Users/AmishaSingla/Documents/osm-compare/comparators/feature_overlap.js:111:19)
    at /Users/AmishaSingla/Documents/osm-compare/tests/test_compare_function.js:23:3
    at Array.forEach (native)
    at Object.<anonymous> (/Users/AmishaSingla/Documents/osm-compare/tests/test_compare_function.js:22:19)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)

cc @mourner

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions