[jira] Created: (LUCENE-1894) Spatial checks for a string in an int,double map

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (LUCENE-1894) Spatial checks for a string in an int,double map

JIRA jira@apache.org
Spatial checks for a string in an int,double map
------------------------------------------------

                 Key: LUCENE-1894
                 URL: https://issues.apache.org/jira/browse/LUCENE-1894
             Project: Lucene - Java
          Issue Type: Bug
            Reporter: Mark Miller
            Priority: Minor
             Fix For: 2.9


{code}
  private Map<Integer,Double> distances;
{code}

{code}
    if (precise != null) {
      double xLat = getPrecision(lat, precise);
      double xLng = getPrecision(lng, precise);
     
      String k = new Double(xLat).toString() +","+ new Double(xLng).toString();
   
      Double d = (distances.get(k));
      if (d != null){
        return d.doubleValue();
      }
    }
{code}

Something is off here eh?

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LUCENE-1894) Spatial checks for a string in an int,double map

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/LUCENE-1894?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Miller updated LUCENE-1894:
--------------------------------

    Component/s: contrib/spatial

> Spatial checks for a string in an int,double map
> ------------------------------------------------
>
>                 Key: LUCENE-1894
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1894
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/spatial
>            Reporter: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>
> {code}
>   private Map<Integer,Double> distances;
> {code}
> {code}
>     if (precise != null) {
>       double xLat = getPrecision(lat, precise);
>       double xLng = getPrecision(lng, precise);
>      
>       String k = new Double(xLat).toString() +","+ new Double(xLng).toString();
>    
>       Double d = (distances.get(k));
>       if (d != null){
>         return d.doubleValue();
>       }
>     }
> {code}
> Something is off here eh?

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-1894) Spatial checks for a string in an int,double map

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-1894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752199#action_12752199 ]

Mark Miller commented on LUCENE-1894:
-------------------------------------

This is from DistanceHandler by the way.

well I give up on this one - apparently, distances holds docIds to distance - not sure why the heck there is an attempt here to use it in this manner.

Not confident in changing it to anything either - the distance test class asserts nothing and just does System outs. And I don't know how the heck distances acts as a cache - no code inserts anything into it. It looks like it can just be used as a user override for pre chosen docs? They fill it and pass it?

Some of this spatial code is kind of hairy - and the tests/javadoc are very sparse. Many methods,constructors are not called anywhere (tests or not). Some are just called from random main methods.

> Spatial checks for a string in an int,double map
> ------------------------------------------------
>
>                 Key: LUCENE-1894
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1894
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/spatial
>            Reporter: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>
> {code}
>   private Map<Integer,Double> distances;
> {code}
> {code}
>     if (precise != null) {
>       double xLat = getPrecision(lat, precise);
>       double xLng = getPrecision(lng, precise);
>      
>       String k = new Double(xLat).toString() +","+ new Double(xLng).toString();
>    
>       Double d = (distances.get(k));
>       if (d != null){
>         return d.doubleValue();
>       }
>     }
> {code}
> Something is off here eh?

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-1894) Spatial checks for a string in an int,double map

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-1894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752201#action_12752201 ]

Mark Miller commented on LUCENE-1894:
-------------------------------------

And whats this class? Spatial does not live up to the standard of quality that Lucene generally delivers - contrib or not.


{code}
/**
 *
 */
public class PolyShape {

  private static double lat = 38.969398;
  private static double lng= -77.386398;
  private static int miles = 1000;
  /**
   * @param args
   */
  public static void main(String[] args) {
 
    CartesianPolyFilterBuilder cpf = new CartesianPolyFilterBuilder( "_localTier" );
    cpf.getBoxShape(lat, lng, miles);
   
  }

}

{code}

> Spatial checks for a string in an int,double map
> ------------------------------------------------
>
>                 Key: LUCENE-1894
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1894
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/spatial
>            Reporter: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>
> {code}
>   private Map<Integer,Double> distances;
> {code}
> {code}
>     if (precise != null) {
>       double xLat = getPrecision(lat, precise);
>       double xLng = getPrecision(lng, precise);
>      
>       String k = new Double(xLat).toString() +","+ new Double(xLng).toString();
>    
>       Double d = (distances.get(k));
>       if (d != null){
>         return d.doubleValue();
>       }
>     }
> {code}
> Something is off here eh?

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-1894) Spatial checks for a string in an int,double map

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-1894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752203#action_12752203 ]

Mark Miller commented on LUCENE-1894:
-------------------------------------

Okay - a little insight finally - it looks like the lookup should actually be on what is called elsewhere, distanceLookupCache - a weakhashmap mapping string to double. Thats on the DistanceFilter though, and I don't see how its usable here yet ...

> Spatial checks for a string in an int,double map
> ------------------------------------------------
>
>                 Key: LUCENE-1894
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1894
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/spatial
>            Reporter: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>
> {code}
>   private Map<Integer,Double> distances;
> {code}
> {code}
>     if (precise != null) {
>       double xLat = getPrecision(lat, precise);
>       double xLng = getPrecision(lng, precise);
>      
>       String k = new Double(xLat).toString() +","+ new Double(xLng).toString();
>    
>       Double d = (distances.get(k));
>       if (d != null){
>         return d.doubleValue();
>       }
>     }
> {code}
> Something is off here eh?

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LUCENE-1894) Spatial checks for a string in an int,double map

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/LUCENE-1894?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Miller updated LUCENE-1894:
--------------------------------

    Attachment: LUCENE-1894.patch

I guess I'll fix this one

> Spatial checks for a string in an int,double map
> ------------------------------------------------
>
>                 Key: LUCENE-1894
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1894
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/spatial
>            Reporter: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1894.patch
>
>
> {code}
>   private Map<Integer,Double> distances;
> {code}
> {code}
>     if (precise != null) {
>       double xLat = getPrecision(lat, precise);
>       double xLng = getPrecision(lng, precise);
>      
>       String k = new Double(xLat).toString() +","+ new Double(xLng).toString();
>    
>       Double d = (distances.get(k));
>       if (d != null){
>         return d.doubleValue();
>       }
>     }
> {code}
> Something is off here eh?

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (LUCENE-1894) Spatial checks for a string in an int,double map

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/LUCENE-1894?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Miller resolved LUCENE-1894.
---------------------------------

       Resolution: Fixed
         Assignee: Mark Miller
    Lucene Fields: [New, Patch Available]  (was: [New])

> Spatial checks for a string in an int,double map
> ------------------------------------------------
>
>                 Key: LUCENE-1894
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1894
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/spatial
>            Reporter: Mark Miller
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1894.patch
>
>
> {code}
>   private Map<Integer,Double> distances;
> {code}
> {code}
>     if (precise != null) {
>       double xLat = getPrecision(lat, precise);
>       double xLng = getPrecision(lng, precise);
>      
>       String k = new Double(xLat).toString() +","+ new Double(xLng).toString();
>    
>       Double d = (distances.get(k));
>       if (d != null){
>         return d.doubleValue();
>       }
>     }
> {code}
> Something is off here eh?

--
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: [hidden email]
For additional commands, e-mail: [hidden email]