Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-4828

ST_GeomFromGeoJson fails for certain geometry types

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 9.3, 8.12.11.6_4, 9.2.2
    • 9.3, 8.12.10.6_3
    • Query Engine
    • None

      ST_GeomFromGeoJson fails to decode GeoJSON with certain geometry types. The following queries work:

      Working Queries
      select ST_GeomFromGeoJson(ST_AsGeoJSON(ST_GeomFromText('POINT (30 10)')))
      select ST_GeomFromGeoJson(ST_AsGeoJSON(ST_GeomFromText('POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))')));
      select ST_GeomFromGeoJson(ST_AsGeoJSON(ST_GeomFromText('POLYGON ((35 10, 45 45, 15 40, 10 20, 35 10),(20 30, 35 35, 30 20, 20 30))')));
      select ST_GeomFromGeoJson(ST_AsGeoJSON(ST_GeomFromText('MULTIPOLYGON (((30 20, 45 40, 10 40, 30 20)),((15 5, 40 10, 10 20, 5 10, 15 5)))')));
      select ST_GeomFromGeoJson(ST_AsGeoJSON(ST_GeomFromText('MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)),((20 35, 10 30, 10 10, 30 5, 45 20, 20 35),(30 20, 20 15, 20 25, 30 20)))')));
      

      but these fail:

      Failing Queries
      select ST_GeomFromGeoJson(ST_AsGeoJSON(ST_GeomFromText('MULTIPOINT ((10 40), (40 30), (20 20), (30 10))')));
      select ST_GeomFromGeoJson(ST_AsGeoJSON(ST_GeomFromText('MULTIPOINT (10 40, 40 30, 20 20, 30 10)')));
      select ST_GeomFromGeoJson(ST_AsGeoJSON(ST_GeomFromText('MULTILINESTRING ((10 10, 20 20, 10 40),(40 40, 30 30, 40 20, 30 10))')));
      select ST_GeomFromGeoJson(ST_AsGeoJSON(ST_GeomFromText('LINESTRING (30 10, 10 30, 40 40)')));
      

      The server log when running with master says

      TEIID30328 Unable to evaluate ST_GeomFromGeoJson(?): TEIID30384 Error while evaluating function st_geomfromgeojson'. Originally ExpressionEvaluationException 'Conflicting property-based creators: already had explicitly marked [constructor for org.wololo.geojson.MultiPoint, annotations: {interface com.fasterxml.jackson.annotation.JsonCreator=@com.fasterxml.jackson.annotation.JsonCreator(mode=DEFAULT)}], encountered [constructor for org.wololo.geojson.MultiPoint, annotations: {interface com.fasterxml.jackson.annotation.JsonCreator=@com.fasterxml.jackson.annotation.JsonCreator(mode=DEFAULT)}]' CreatorCollector.java:304. 
      

      When running with latest 6.3 patch, the server log says

      TEIID30328 Unable to evaluate ST_GeomFromGeoJson(?): TEIID30384 Error while evaluating function st_geomfromgeojson'. Originally ExpressionEvaluationException '1' BasicDeserializerFactory.java:394. 
      

      The difference seems to be due to different versions of jackson-databind (which also seems to be the source of the problem).

              rhn-engineering-shawkins Steven Hawkins
              asmigala@redhat.com Andrej Smigala
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: