ThomasDekeyser opened a new issue, #2901:
URL: https://github.com/apache/sedona/issues/2901

   ## Expected behavior
   
   For a LineString or any (small) geometry g near the poles, the best SRID 
returned by should return South/North Pole Lambert Azimuthal Equal Area 
projection.
   As a result, the ST_Buffer(g,..., useSpheroid=true)  that is using 
ST_BestSRID, is also returning wrong results.
   
   ```
   int result = Functions.bestSRID(geomFromWKT("LINESTRING (-179.9999994 
-82.42408, -157.330902 -85.0511284)", 4326));
   assertEquals(Spheroid.EPSG_SOUTH_LAMBERT, result);
   ```
   
   ## Actual behavior
   
   ```
   int result = Functions.bestSRID(geomFromWKT("LINESTRING (-179.9999994 
-82.42408, -157.330902 -85.0511284)", 4326))
   assertEquals(Spheroid.EPSG_WORLD_MERCATOR, result);
   ```
   
   ## Reproducer
   
   
   ### `src/test/java/org/apache/sedona/common/FunctionsTest2.java`
   
   ```java
   
   package org.apache.sedona.common;
   
   import org.apache.sedona.common.sphere.Spheroid;
   import org.junit.Test;
   import org.locationtech.jts.io.ParseException;
   
   import static org.apache.sedona.common.Constructors.geomFromWKT;
   import static org.junit.Assert.assertEquals;
   
   public class FunctionsTest2 extends TestBase {
   
     @Test
     public void testBestSRIDNearSouthPole() throws ParseException {
       int actualEPSG = Functions.bestSRID(geomFromWKT("LINESTRING 
(-179.9999994 -82.42408, -157.330902 -85.0511284)", 4326));
   
       assertEquals(
         "Expected South Pole Lambert Azimuthal Equal Area projection near the 
south pole", Spheroid.EPSG_SOUTH_LAMBERT, actualEPSG);
   
     }
   }
   ```
   
   Test fails with:
   
   ```
   java.lang.AssertionError: Expected South Pole Lambert Azimuthal Equal Area 
projection near the south pole 
   Expected :3409
   Actual   :3395
   ```
   
   ## Environment
   
   - `sedona`: reproduced on `1.8.0` but bug is also on `1.8.1`, `1.9.0` & 
master 
   - Apache Spark: `3.4.0`
   - Scala: `2.12.18`
   - Java: ZuluJDK 11
   - OS: MacOS Tahoe 26.4.1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to