lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trejkaz <trej...@trypticon.org>
Subject Where did earthDiameter go?
Date Thu, 12 Jan 2017 01:00:31 GMT
Hi.

I don't know why, but we have some kind of esoteric logic in our own
code to simplify a circle on the Earth to a bounding box, clearly
something to do with computing geo queries.

    double lonMin = -180.0, lonMax = 180.0;
    if (!closeToPole(latMin, latMax)) {
       double D = SloppyMath.earthDiameter(lat);
        double d = D * Math.sin((90.0 - lat) * Math.PI / 180.0); //
diameter of a disk formed by parallel at latitude = lat
       double kmPerLonDeg = Math.PI * d / 360.0;
        double distanceInLonDeg = distanceKm / kmPerLonDeg;
       lonMin = lon - distanceInLonDeg;
        lonMax = lon + distanceInLonDeg;
    }

This SloppyMath.earthDiameter(latitude) method appears to be gone in
v6.3.0 but I don't see any mention of a replacement in the changelog.
Is there a replacement? Do I just slot in a constant and hope that
nobody notices? I mean, if the maths are supposed to be "sloppy"... :D

TX

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message