Bug 1296213 - Unable to convert Geometry Collection to GeoJSON
Unable to convert Geometry Collection to GeoJSON
Status: CLOSED CURRENTRELEASE
Product: JBoss Data Virtualization 6
Classification: JBoss
Component: Teiid (Show other bugs)
6.3.0
Unspecified Unspecified
medium Severity high
: ER1
: 6.3.0
Assigned To: Van Halbert
Andrej Smigala
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-06 10:44 EST by Andrej Smigala
Modified: 2016-08-24 07:48 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-08-24 07:48:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker TEIID-3882 Major Resolved Unable to convert Geometry Collection to GeoJSON 2016-04-20 08:25 EDT

  None (edit)
Description Andrej Smigala 2016-01-06 10:44:03 EST
Running the following query results in the error below:


select ST_AsGeoJson(ST_GeomFromText('GEOMETRYCOLLECTION(POINT(4 6),LINESTRING(4 6,7 10))')) as g


It appears that jts2geojson only supports converting geometry collections since version 0.6 (teiid uses version 0.4), compare https://github.com/bjornharrtell/jts2geojson/blob/v0.4.0/src/main/java/org/wololo/jts2geojson/GeoJSONWriter.java#L34 and https://github.com/bjornharrtell/jts2geojson/blob/0.6.0/src/main/java/org/wololo/jts2geojson/GeoJSONWriter.java#L35


Error log:

16:38:00,967 WARN  [org.teiid.PROCESSOR] (Worker2_QueryProcessorQueue7) TEIID30020 Processing exception for request SqO0xtySU9j7.0 'TEIID30328 Unable to evaluate ST_AsGeoJson(?): TEIID30384 Error while evaluating function st_asgeojson'. Originally ExpressionEvaluationException GeoJSONWriter.java:35.: org.teiid.api.exception.query.ExpressionEvaluationException: TEIID30328 Unable to evaluate ST_AsGeoJson(?): TEIID30384 Error while evaluating function st_asgeojson
        at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:695) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.rewriter.QueryRewriter.evaluate(QueryRewriter.java:2151) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.rewriter.QueryRewriter.rewriteExpressionDirect(QueryRewriter.java:2141) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.rewriter.QueryRewriter.access$000(QueryRewriter.java:101) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.rewriter.QueryRewriter$3.replaceExpression(QueryRewriter.java:640) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.sql.visitor.ExpressionMappingVisitor.visit(ExpressionMappingVisitor.java:157) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.sql.symbol.AliasSymbol.acceptVisitor(AliasSymbol.java:90) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:54) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.postVisitVisitor(PreOrPostOrderNavigator.java:61) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:80) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.sql.symbol.AliasSymbol.acceptVisitor(AliasSymbol.java:90) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:63) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.sql.navigator.AbstractNavigator.visitNodes(AbstractNavigator.java:76) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:342) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.sql.lang.Select.acceptVisitor(Select.java:168) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.sql.navigator.PostOrderNavigator.doVisit(PostOrderNavigator.java:40) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.rewriter.QueryRewriter.rewriteExpressions(QueryRewriter.java:647) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.rewriter.QueryRewriter.rewriteQuery(QueryRewriter.java:484) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.rewriter.QueryRewriter.rewriteCommand(QueryRewriter.java:224) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.rewriter.QueryRewriter.rewrite(QueryRewriter.java:169) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.rewriter.QueryRewriter.rewrite(QueryRewriter.java:173) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:413) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.dqp.internal.process.Request.processRequest(Request.java:463) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:640) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:337) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:274) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_65]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_65]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_65]
Caused by: org.teiid.api.exception.query.FunctionExecutionException: TEIID30384 Error while evaluating function st_asgeojson
        at org.teiid.query.function.FunctionDescriptor.invokeFunction(FunctionDescriptor.java:295) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:1384) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.eval.Evaluator.internalEvaluate(Evaluator.java:723) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:693) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        ... 32 more
Caused by: org.teiid.api.exception.query.FunctionExecutionException
        at org.teiid.query.function.GeometryUtils.geometryToGeoJson(GeometryUtils.java:118) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at org.teiid.query.function.GeometryFunctionMethods.asGeoJson(GeometryFunctionMethods.java:71) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_65]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_65]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_65]
        at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_65]
        at org.teiid.query.function.FunctionDescriptor.invokeFunction(FunctionDescriptor.java:281) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        ... 35 more
Caused by: java.lang.UnsupportedOperationException
        at org.wololo.jts2geojson.GeoJSONWriter.write(GeoJSONWriter.java:35) [jts2geojson-0.4.0.jar:]
        at org.teiid.query.function.GeometryUtils.geometryToGeoJson(GeometryUtils.java:113) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
        ... 41 more
Comment 2 JBoss JIRA Server 2016-01-06 12:56:38 EST
Steven Hawkins <shawkins@redhat.com> updated the status of jira TEIID-3882 to Resolved

Note You need to log in before you can comment on or make changes to this bug.