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

David Smiley commented on CALCITE-1861:
---------------------------------------

Hi.  Is Lucene/Solr related; that is might you use either for this?  I'm not 
very familiar with Calcite other than that it contains an SQL parser module 
used by Solr.

If we're just talking about computing spatial relationships (intersects, 
contains, within, ...) between shapes where one of those shapes could be a 
polygon, then you have some options:
* JTS (with Spatial4j maybe).  JTS has historically been LGPL licensed but it's 
undergoing transition to LocationTech (part of the Eclipse Foundation) where it 
is relicensed with a BSD style license.  You can find the code there with this 
license on GitHub.  It is going through IP review process still (I monitor 
this).  It has yet to be officially released (thus published to Maven central 
etc.) under this new more permissive license.
* ESRI's Geometry API: https://github.com/Esri/geometry-api-java   ASL.  Isn't 
used a lot for whatever reason; maybe because it's relatively new whereas JTS 
is the gold standard.

If you only need to compute relationships with a polygon and a rectangle, then 
Lucene has internal code for this that you could copy. 
https://github.com/o19s/lucene-solr/blob/7be69c60387a99df8a7caaed18725d00568104f5/lucene/core/src/java/org/apache/lucene/geo/Polygon2D.java#L39-L39

If you wish to do spatial indexing on top of another store that doesn't 
necessarily have 1st class spatial support, I recommend investigating and 
participating in a new LocationTech project called SFCurve: 
https://www.locationtech.org/proposals/sfcurve  
https://github.com/locationtech/sfcurve   I've been monitoring this.  GeoWave's 
indexing code is being contributed right now.

> Spatial Indexes
> ---------------
>
>                 Key: CALCITE-1861
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1861
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Atri Sharma
>            Assignee: Julian Hyde
>
> Many Calcite users, like Phoenix and Flink can benefit from support of 
> Spatial indexes.
> See:
> http://revenant.ca/www/postgis/workshop/indexing.html



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to