Code Monkey home page Code Monkey logo

Comments (3)

davidmoten avatar davidmoten commented on August 24, 2024

Hi, sorry I missed this question! I'm getting a lot of github issues from projects I'm interested in and it was lost in the noise.

When using Geometries.circle(x, y, radius) can you confirm that x is the lon and y is the lat (provided they've been normalized beforehand) ? Also what is the unit of the radius ? I assumed it was km but now that i'm looking at it, it seems it's not and it would be more of a x-y variation value.

The unit of the radius is that of the x and y points so it's in degrees.

Ultimately the performance of the rtree will be driven by searching with rectangles. Searching using other geometries still finds points in the bounding rectangle of a circle then filters the points for membership in the circle.

A couple of small test cases (with circles and without) would be great to benchmark if you can.

Using rectangles your run still sounds like its a bit slow so would be nice to narrow down.

from rtree.

Crystark avatar Crystark commented on August 24, 2024

Thanks for your answer :)
I'll be doing a little more tests. I don't suppose you have an util class that could convert a radius from KM to degrees ? :)

I'll do a lil more testing once I've been able to create proper cirlces. What do you mean by "narrow down" the test with rectangles ? You mean use smaller rectangles ?

Thanks again for your help.

from rtree.

davidmoten avatar davidmoten commented on August 24, 2024

I do have a util class in https://github.com/davidmoten/grumpy/blob/master/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java. The grumpy-core module is available on Maven Central.

The catch is that a degree of longitude varies in size depending on how close to the equator/poles it is. As a consequence converting a radius from km to degrees will only work on a local level (say where your range of data is within a few degrees of longitude). Any larger than that then it will be a distorted circle. However what you can do is use a rectangle that definitely contains the data then filter the data using the Point class to check distance from a centre.

I'll do a lil more testing once I've been able to create proper cirlces. What do you mean by "narrow down" the test with rectangles ? You mean use smaller rectangles ?

I meant don't test with circles initially because Rtree works by doing queries based on rectangles then filters the results based on circles. I'd just like to see if your queries are performant with rectangles only to isolate any problems. 4K ops/s sounds slow.

from rtree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.