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

Ignacio Vera commented on LUCENE-8581:
--------------------------------------

{quote}I think it would be good to keep the calls to encodeLatitude and 
encodeLongitude here.
{quote}
+1
{quote}Encoding should be orientation agnostic, but congruent (order 
preserved). I think we should remove the orientation dependency.
{quote}
I still think it is worthy to encode triangles always with the same orientation 
so we do not need to add that information for the encoding. I was having 
troubles in this part but now I think it was because a was working with the 
original triangle not with the encoded values.
{quote}For maintenance I'd really like to reduce this tree of conditionals.
{quote}
I totally agree, I need to see which pattern can use here to improve 
readability.

I attach a new version. It is missing documentation and maybe some test for the 
encoding.

Just for my curiosity. when creating a triangle in the tessellator points get 
order. is that really needed? what is the purpose?
{code:java}
protected Triangle(Node a, Node b, Node c) {
      this.vertex = new Node[] {a, b, c};
      // sort nodes by morton value
      Arrays.sort(this.vertex, (x, y) -> x.compareLat(y));
    }
{code}

> Change LatLonShape encoding to use 4 BYTES Per Dimension
> --------------------------------------------------------
>
>                 Key: LUCENE-8581
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8581
>             Project: Lucene - Core
>          Issue Type: New Feature
>            Reporter: Nicholas Knize
>            Assignee: Ignacio Vera
>            Priority: Major
>         Attachments: LUCENE-8581.patch, LUCENE-8581.patch
>
>
> {{LatLonShape}} tessellated triangles currently use a relatively naive 
> encoding with the first four dimensions as the bounding box of the triangle 
> and the last three dimensions as the vertices of the triangle. To encode the 
> {{x,y}} vertices in the last three dimensions requires {{bytesPerDim}} to be 
> set to 8, with 4 bytes for the x & y axis, respectively. We can reduce 
> {{bytesPerDim}} to 4 by encoding the index(es) of the vertices shared by the 
> bounding box along with the orientation of the triangle. This also opens the 
> door for supporting {{CONTAINS}} queries.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to