]
Steven Hawkins commented on TEIID-3882:
---------------------------------------
I'll see if we can move up to .7 instead.
Unable to convert Geometry Collection to GeoJSON
------------------------------------------------
Key: TEIID-3882
URL:
https://issues.jboss.org/browse/TEIID-3882
Project: Teiid
Issue Type: Bug
Affects Versions: 8.12.3
Reporter: Andrej Šmigala
Assignee: Steven Hawkins
Running the following query results in the error below:
{code:sql}
select ST_AsGeoJson(ST_GeomFromText('GEOMETRYCOLLECTION(POINT(4 6),LINESTRING(4 6,7
10))')) as g{code}
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/or...
and
https://github.com/bjornharrtell/jts2geojson/blob/0.6.0/src/main/java/org...
{noformat}
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
{noformat}