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

Add wkt validation and an optional srid to ST_GeomFromWKT/ST_GeomFromText

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0

    Description

      Currently wkt parser errors are swallowed and null is returned. That is a bit dangerous as errors in input are hidden.

      https://github.com/apache/incubator-sedona/blob/master/core/src/main/java/org/apache/sedona/core/formatMapper/FormatUtils.java#L211

      Postgis:
       

      # select ST_GeomFromText('not valid');
      ERROR:  parse error - invalid geometry
      HINT:  "no" <-- parse error at position 2 within geometry
      

      The srid parameter is required for OGC compatibility. See postgis docs: https://postgis.net/docs/ST_GeomFromText.html
       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              umartin Martin Andersson
              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