question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bounding box queries over the dateline are not always returning results

See original GitHub issue

When the bounding box covers bother sides of 0 (Quandrant 4 and 1 of a circle). for example index.getClusters([2, -10, -178, 10], 1) I expect it to return the points from 0 to 2 and -178 to -180.

I’ve wrote a test:

describe('group', () => {
  const createSpot = (horizonral, vertical) => {
    return {
      type: "Feature",
      geometry: {
        type: "Point",
        coordinates: [horizontal, vertical]
      }
    }
  }

  var index = supercluster({
    radius: 0.01,
    maxZoom: 1,
    extent: 512
  })

  it('should group spots near the edge', () => {
    index.load([
      createSpot(-179.989, 0),
      createSpot(-179.990, 0),
      createSpot(-179.991, 0),
      createSpot(-179.992, 0),
    ])

    const spots = index.getClusters([2, -10, -178, 10], 1)

    return expect(spots.length).toEqual(4)
  })
})

But it fails. Am I missing something? Isn’t the horizontal range -180 to 180 (vertical 90 to -90)? http://wiki.openstreetmap.org/wiki/Bounding_Box

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mournercommented, Dec 4, 2017

I think we’ll have to split any bboxes that go over the dateline into two queries — one on the right side (up to 180), and the other on the left (starting from -180)

0reactions
mournercommented, Dec 22, 2017

Should be fixed in #71 (thanks @mattlubner!). @Andrekra Does the PR look good to you?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Search - CCHDO
Only one field on this page must be filled in for results to be returned. The results are the cruises which match ALL...
Read more >
How to search geo-point with polygon across dateline?
At the moment geo_polygon queries for geo_point types do not work across the dateline. You will either have to: manually split the polygon ......
Read more >
NetCDF Subset Service - Unidata Software Documentation
Bounding box requests on grid datasets must have the same vertical levels. All the vertical levels will be returned. accept, no, Used to...
Read more >
Chapter 4. Using PostGIS: Data Management and Queries
PostGIS prior to 1.4 does not support compound curves in a curve polygon, but PostGIS 1.4 ... All the calculations have no conception...
Read more >
AWC - ADDS Text Data Server - Aviation Weather Center
start and end times in ISO8601 date/time format; query based on aircraft ... Date Line; The LonLatRect constraint does not support bounding boxes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found