Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1968

Support OpenGIS Simple Feature Access SQL

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.14.0
    • Component/s: None
    • Labels:
      None

      Description

      Support OpenGIS Simple Feature Access SQL. This is standard core functionality for spatial/geographical/geometry data, implemented by PostGIS and others.

      It basically consists of a GEOMETRY data type and about 150 functions whose names start with 'ST_', for example ST_GeomFromText and ST_Distance. H2 GIS has a good reference. (Look for the functions labeled 'OpenGIS 1.2.1'.)

      Adds a SqlConformance.allowGeometry() method to allow people to enable/disable this functionality.

      First commit will probably add a dozen or so functions, backed by a library such as ESRI Geometry API. I'd appreciate help implementing the rest.

      Spatial indexes are covered by CALCITE-1861 and are out of scope of this case. So with this feature, spatial queries will work, but predicates will be applied row-by-row.

        Issue Links

          Activity

          Hide
          julianhyde Julian Hyde added a comment - - edited
          Show
          julianhyde Julian Hyde added a comment - - edited Work in progress: https://github.com/julianhyde/calcite/tree/1968-spatial
          Hide
          julianhyde Julian Hyde added a comment -

          ESRI have released 2.0, so I have committed. Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/cc20ca13.

          I have implemented 35 of the 150 functions, so we can't say we implement OpenGIS Simple Feature Access SQL yet.

          We'd love to get contributions for the other functions. Many a straightforward to implement, because the ESRI library provides the necessary support. I suggest that you implement one at a time:

          1. Choose a function
          2. Look up the function in the PostGIS documentation, and use the test case on that page.
          3. Paste the test case(s) into spatial.iq.
          4. Add a public static method to GeoFunctions.java.
          5. Run QuidemTest via junit (or QuidemTest.main with argument sql/spatial.iq).
          6. Modify GeoFunctions.java or spatial.iq until it passes.
          7. When you have implemented a few functions, submit a PR.
          Show
          julianhyde Julian Hyde added a comment - ESRI have released 2.0, so I have committed. Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/cc20ca13 . I have implemented 35 of the 150 functions, so we can't say we implement OpenGIS Simple Feature Access SQL yet. We'd love to get contributions for the other functions. Many a straightforward to implement, because the ESRI library provides the necessary support. I suggest that you implement one at a time: Choose a function Look up the function in the PostGIS documentation, and use the test case on that page. Paste the test case(s) into spatial.iq. Add a public static method to GeoFunctions.java. Run QuidemTest via junit (or QuidemTest.main with argument sql/spatial.iq). Modify GeoFunctions.java or spatial.iq until it passes. When you have implemented a few functions, submit a PR.
          Hide
          michaelmior Michael Mior added a comment -

          Resolved in release 1.14.0 (2017-10-01)

          Show
          michaelmior Michael Mior added a comment - Resolved in release 1.14.0 (2017-10-01)

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              julianhyde Julian Hyde
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development