mourner / rbush

RBush — a high-performance JavaScript R-tree-based 2D spatial index for points and rectangles
MIT License
2.48k stars 237 forks source link

Does RBUSH supports to use Latitude and Longitude? #111

Closed raj1127 closed 4 years ago

raj1127 commented 4 years ago

Can we use starting latitude/longitude and ending latitude/longitude of the rectangle instead of minx, miny, maxx and maxy to insert and search rbush tree?

mourner commented 4 years ago

Yes.

raj1127 commented 4 years ago

Thanks for your reply. Just one question what is then

                    minX: (is it LEFT?)
                    minY: (is it TOP?)
                    maxX (is it RIGHT?)
                    maxY (is it BOTTOM?)

I will appreciate your reply.

mourner commented 4 years ago

In case of geographic locations, latitude goes from south to north, so minY is bottom and maxY is top. minX and maxX (longitude) are west and east respectively.

raj1127 commented 4 years ago

Thanks Vladimir. I appreciate it.

elie-chaaban commented 2 years ago

hi,

how can i use it on react native? Let's say list of coordinates, how can i calculate minX and Y and MaxX and Y