petern48 commented on PR #231:
URL: https://github.com/apache/sedona-db/pull/231#issuecomment-3419799997

   I personally agree with the proposed behavior. [PostGIS's 
implementation](https://postgis.net/docs/doxygen/3.5/d4/d06/postgis_2lwgeom__geos_8c_aee8112fca59e61cf6c5938ba03096865.html)
 is odd imo. For non-linestrings, it returns `ERROR:  ST_IsRing() should only 
be called on a linear feature` if it's non-empty, but returns False if it's 
empty. The thing I don't like about this is that if you have **any** non-empty 
non-linestring geometry in your column, your query will just fail.
   
   ```sql
   CREATE TABLE geom (geom GEOMETRY);
   INSERT INTO geom VALUES (ST_GeomFromText('LINESTRING EMPTY')), (ST_Point(3, 
4));
   SELECT st_isring(geom) FROM geom;
   -- ERROR:  ST_IsRing() should only be called on a linear feature
   ```
   
   DuckDB returns `False` instead of the error, which agrees with the natural 
behavior of the `is_ring()` function. Sedona actually returns `NULL` for any 
non-linestring geometry (empty or not).
   
   WDYT @paleolimbot?


-- 
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