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

Refactor Raster construction in sedona to use AffineTransform instead of envelope

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.1
    • 1.5.0

    Description

      Currently, the RS_MakeEmptyRaster function constructs a referenced envelope from the affine transformation parameters and then uses the envelope to construct the GridCoverage2D object. This approach may be ambiguous as it does not specify whether the (x,y) axes are interchanged or if the y-axis is oriented downward. We've encountered problems when making rasters in EPSG:4326:

      spark.sql("SELECT RS_Metadata(RS_MakeEmptyRaster(1, 5, 5, -40, 30, 5, -5, 0, 0, 4326))").show(10, False)
      +--------------------------------------------------------------------+
      |rs_metadata(rs_makeemptyraster(1, 5, 5, -40, 30, 5, -5, 0, 0, 4326))|
      +--------------------------------------------------------------------+
      |[-40.0, 55.0, 5.0, 5.0, 0.0, 0.0, -5.0, 5.0, 4326.0, 1.0]           |
      +--------------------------------------------------------------------+
      

      The expected result is [-40.0, 30.0, 5.0, 5.0, 5.0, -5.0, 0.0, 0.0, 4326.0, 1.0].

      The correct approach is to construct the GridCoverage2D object using the affine transformation directly. We'll also make geo-referencing parameters exposed by Sedona RS functions compliant with the GDAL convention so that users can get results consistent with PostGIS.

      Attachments

        Activity

          People

            kontinuation Kristin Cowalcijk
            nileshgajwani Nilesh Gajwani
            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 - 1h 10m
                1h 10m