From lucene-net-commits-return-2086-apmail-lucene-lucene-net-commits-archive=lucene.apache.org@lucene.apache.org Mon Aug 20 21:53:42 2012 Return-Path: X-Original-To: apmail-lucene-lucene-net-commits-archive@www.apache.org Delivered-To: apmail-lucene-lucene-net-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 41F0872E for ; Mon, 20 Aug 2012 21:53:42 +0000 (UTC) Received: (qmail 44359 invoked by uid 500); 20 Aug 2012 21:53:42 -0000 Delivered-To: apmail-lucene-lucene-net-commits-archive@lucene.apache.org Received: (qmail 44322 invoked by uid 500); 20 Aug 2012 21:53:42 -0000 Mailing-List: contact lucene-net-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucene.apache.org Delivered-To: mailing list lucene-net-commits@lucene.apache.org Received: (qmail 44314 invoked by uid 99); 20 Aug 2012 21:53:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2012 21:53:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2012 21:53:41 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 02DBD23888FE; Mon, 20 Aug 2012 21:52:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1375260 - in /incubator/lucene.net/trunk/src/contrib/Spatial: BBox/AreaSimilarity.cs Prefix/Tree/SpatialPrefixTree.cs Date: Mon, 20 Aug 2012 21:52:57 -0000 To: lucene-net-commits@lucene.apache.org From: synhershko@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120820215258.02DBD23888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: synhershko Date: Mon Aug 20 21:52:57 2012 New Revision: 1375260 URL: http://svn.apache.org/viewvc?rev=1375260&view=rev Log: GetArea is expecting a Context This is divergence from the Java origin, apparently spatial4j hasn't been updated there yet Modified: incubator/lucene.net/trunk/src/contrib/Spatial/BBox/AreaSimilarity.cs incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/Tree/SpatialPrefixTree.cs Modified: incubator/lucene.net/trunk/src/contrib/Spatial/BBox/AreaSimilarity.cs URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/contrib/Spatial/BBox/AreaSimilarity.cs?rev=1375260&r1=1375259&r2=1375260&view=diff ============================================================================== --- incubator/lucene.net/trunk/src/contrib/Spatial/BBox/AreaSimilarity.cs (original) +++ incubator/lucene.net/trunk/src/contrib/Spatial/BBox/AreaSimilarity.cs Mon Aug 20 21:52:57 2012 @@ -17,6 +17,7 @@ using System; using Lucene.Net.Search; +using Spatial4n.Core.Context; using Spatial4n.Core.Shapes; namespace Lucene.Net.Spatial.BBox @@ -53,16 +54,18 @@ namespace Lucene.Net.Spatial.BBox /** * Properties associated with the query envelope */ + private readonly SpatialContext ctx; private readonly Rectangle queryExtent; private readonly double queryArea; private readonly double targetPower; private readonly double queryPower; - public AreaSimilarity(Rectangle queryExtent, double queryPower, double targetPower) + public AreaSimilarity(SpatialContext ctx, Rectangle queryExtent, double queryPower, double targetPower) { + this.ctx = ctx; this.queryExtent = queryExtent; - this.queryArea = queryExtent.GetArea(); + this.queryArea = queryExtent.GetArea(ctx); this.queryPower = queryPower; this.targetPower = targetPower; @@ -75,7 +78,8 @@ namespace Lucene.Net.Spatial.BBox // } } - public AreaSimilarity(Rectangle queryExtent) : this(queryExtent, 2.0, 0.5) + public AreaSimilarity(SpatialContext ctx, Rectangle queryExtent) + : this(ctx, queryExtent, 2.0, 0.5) { } @@ -90,7 +94,7 @@ namespace Lucene.Net.Spatial.BBox { return 0; } - double targetArea = target.GetArea(); + double targetArea = target.GetArea(ctx); if (targetArea <= 0) { return 0; Modified: incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/Tree/SpatialPrefixTree.cs URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/Tree/SpatialPrefixTree.cs?rev=1375260&r1=1375259&r2=1375260&view=diff ============================================================================== --- incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/Tree/SpatialPrefixTree.cs (original) +++ incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/Tree/SpatialPrefixTree.cs Mon Aug 20 21:52:57 2012 @@ -77,7 +77,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree { return maxLevels; } - double bboxArea = shape.GetBoundingBox().GetArea(); + double bboxArea = shape.GetBoundingBox().GetArea(ctx); if (bboxArea == 0) { return maxLevels;