Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 30537 invoked from network); 21 Sep 2010 14:12:05 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Sep 2010 14:12:05 -0000 Received: (qmail 87539 invoked by uid 500); 21 Sep 2010 14:12:04 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 87024 invoked by uid 500); 21 Sep 2010 14:12:01 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 86808 invoked by uid 99); 21 Sep 2010 14:12:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Sep 2010 14:12:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Sep 2010 14:11:58 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8LEBaGk015519 for ; Tue, 21 Sep 2010 14:11:37 GMT Message-ID: <18825321.316411285078296913.JavaMail.jira@thor> Date: Tue, 21 Sep 2010 10:11:36 -0400 (EDT) From: "Grant Ingersoll (JIRA)" To: dev@lucene.apache.org Subject: [jira] Commented: (SOLR-2125) Spatial filter is not accurate In-Reply-To: <1899572.306531285026574327.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/SOLR-2125?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D12912= 993#action_12912993 ]=20 Grant Ingersoll commented on SOLR-2125: --------------------------------------- {code} if (options.measStr =3D=3D null || options.measStr.equals("hsin")) { ur =3D DistanceUtils.latLonCornerDegs(point[LAT], point[LONG], option= s.distance, null, true, options.radius); ll =3D DistanceUtils.latLonCornerDegs(point[LAT], point[LONG], option= s.distance, null, false, options.radius); } {code} It could very well be in the determination of the two corners. That being = said, in the test I just posted, the point 18.71111, 19.79750 is 3000KM awa= y from 0,0 according to movable-type when traveling along a 45 degree beari= ng and the tests=20 {code} checkHits(fieldName, "0,0", 3000, 2, 14, 15); checkHits(fieldName, "0,0", 3001, 3, 14, 15, 16); checkHits(fieldName, "0,0", 3000.1, 3, 14, 15, 16); {code} Pass for me now that Yonik's patch is applied. Please check my logic. > Spatial filter is not accurate > ------------------------------ > > Key: SOLR-2125 > URL: https://issues.apache.org/jira/browse/SOLR-2125 > Project: Solr > Issue Type: Bug > Components: Build > Affects Versions: 1.5 > Reporter: Bill Bell > Assignee: Grant Ingersoll > > The calculations of distance appears to be off. > Note: "The radius of the sphere to be used when calculating distances on = a sphere (i.e. haversine). Default is the Earth's mean radius in kilometers= (see org.apache.solr.search.function.distance.Constants.EARTH_MEAN_RADIUS_= KM) which is set to 3,958.761458084784856. Most applications will not need = to set this." > The radius of the earth in KM is 6371.009 km (=E2=89=883958.761 mi). > Also filtering distance appears to be off - example data: > 45.17614,-93.87341 to 44.9369054,-91.3929348 Approx 137 miles Google. 169= miles =3D 220 kilometers > http://....../solr/select?fl=3D*,score&start=3D0&rows=3D10&q=3D{!sfilt%20= fl=3Dstore_lat_lon}&qt=3Dstandard&pt=3D44.9369054,-91.3929348&d=3D280&sort= =3Ddist(2,store,vector(44.9369054,-91.3929348)) asc=20 > Nothing shows. d=3D285 shows results. This is off by a lot. > Bill --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org