Uploaded image for project: 'Apache Sedona'
  1. Apache Sedona
  2. SEDONA-626

SRID of geometries returned by many ST functions are incorrect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.6.0
    • 1.6.1

    Description

      Some ST functions that transform geometry to geometry do not preserve the SRID of the input geometry. For instance:

      SELECT ST_SRID(ST_Collect(ST_GeomFromText('POINT (10 20)', 1000)))
      +---------------------------------------------------------+
      |st_srid(st_collect(st_geomfromtext(POINT (10 20), 1000)))|
      +---------------------------------------------------------+
      |                                                        0|
      +---------------------------------------------------------+
      

      While some other functions do preserve the SRID of the input geometry:

      SELECT ST_SRID(ST_Buffer(ST_GeomFromText('POINT (10 20)', 1000), 1))
      +-----------------------------------------------------------+
      |st_srid(st_buffer(st_geomfromtext(POINT (10 20), 1000), 1))|
      +-----------------------------------------------------------+
      |                                                       1000|
      +-----------------------------------------------------------+
      

      Additionally, ST_Transform should alter the SRID of the output geometry, but it preserves the SRID of the input geometry:

      sedona.sql("SELECT ST_SRID(ST_Transform(ST_GeomFromText('POINT (10 20)', 3857), 'EPSG:4326'))").show()
      +----------------------------------------------------------------------+
      |st_srid(st_transform(st_geomfromtext(POINT (10 20), 3857), EPSG:4326))|
      +----------------------------------------------------------------------+
      |                                                                  3857|
      +----------------------------------------------------------------------+
      

      User has to put ST_SetSRID everywhere when they want geometries with proper SRIDs.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kontinuation Kristin Cowalcijk
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m