bounding box queries over the dateline are not always returning results
See original GitHub issueWhen 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:
- Created 6 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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)
Should be fixed in #71 (thanks @mattlubner!). @Andrekra Does the PR look good to you?