Skip to content

radius=0 leads to zero results with PIP #36

@mapsam

Description

@mapsam

When radius is 0, we expect point in polygon style results (ie 1 result if we’re within a single polygon). Right now we get zero results since the query point is a double (lng lat) but by the time we’re comparing the distance from closest_point we’re in integers, which then get converted to a lng lat and can be different than the original query point since it’s an interpolation. This means the distance check looks something like if (0.00011241241 <= 0) { ... } which evaluates to false.

Three possible solutions:

  1. We’ll want to use something other than closest_point for PIP (radius=0) operations
  2. Do all calculations in doubles instead of ints
  3. Instead of using zero (if radius is zero) we use some sort of very small number like if (0.0000234 < 0.5) to catch these instances

cc @flippmoke

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions