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

Bertil Chapuis edited comment on CALCITE-4294 at 8/28/22 4:06 PM:
------------------------------------------------------------------

[~julianhyde] I encounter differences between the values returned by JTS in 
different environements. For instance, the following query produces returns 
123.79793787843437 on macOS (JDK 18) and 123.79793787843424 on Windows (JDK 8). 
Any suggestion on the best way to tackle this issue ? (e.g., simplifying the 
values in the test cases, rounding the results in the query, rounding the 
results when writing the wkt, etc.)

{{SELECT ST_Distance(}}
{{ST_Transform(ST_GeomFromText('POINT(-72.1235 42.3521)',4326),26986),}}
{{ST_Transform(ST_GeomFromText('LINESTRING(-72.1260 42.45, -72.123 42.1546)', 
4326),26986));}}

Here is the most relevant question I found that may be related to this issue:

[https://stackoverflow.com/questions/64586096/math-pow-in-java-8-and-java-13-returns-different-result]

The following run lists all the failing test cases:

[https://github.com/apache/calcite/runs/8058676733]


was (Author: bchapuis):
[~julianhyde] I encounter differences between the values returned by JTS in 
different environements. For instance, the following query produces returns 
123.79793787843437 on macOS (JDK 18) and 123.79793787843424 on Windows (JDK 8). 
Any suggestion on the best way to tackle this issue ? (e.g., simplifying the 
values in the test cases, rounding the results in the query, rounding the 
results when writing the wkt, etc.)

{{SELECT ST_Distance(}}
{{ST_Transform(ST_GeomFromText('POINT(-72.1235 42.3521)',4326),26986),}}
{{ST_Transform(ST_GeomFromText('LINESTRING(-72.1260 42.45, -72.123 42.1546)', 
4326),26986));}}

Here is the most relevant question I found that may be related to this issue:

[https://stackoverflow.com/questions/64586096/math-pow-in-java-8-and-java-13-returns-different-result]

> Use JTS rather than ESRI as the underlying library for geospatial (ST_) 
> functions
> ---------------------------------------------------------------------------------
>
>                 Key: CALCITE-4294
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4294
>             Project: Calcite
>          Issue Type: Bug
>          Components: spatial
>            Reporter: Julian Hyde
>            Assignee: Bertil Chapuis
>            Priority: Major
>             Fix For: 1.32.0
>
>
> The geospatial functions are currently implemented using the ESRI library. We 
> should consider using JTS instead. AT the time we started work on geospatial 
> the JTS did not have a suitable license, but this is no longer the case. I 
> gather that JTS is a superior library.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to