我在Oracle Locator中有一个自定义函数,我将在cx_Oracle中使用此函数在GeoJSON中转换我的SDO_Geometry!
import cx_Oracle
import json
connection = cx_Oracle.Connection("TEST_3D/[email protected]:1521/sdetest")
cursor = connection.cursor()
cursor.execute("""SELECT a.id AS building_nr, c.Geometry AS geometry, d.Classname AS polygon_typ FROM building a, THEMATIC_SURFACE b, SURFACE_GEOMETRY c, OBJECTCLASS d WHERE a.grid_id_400 = 4158 AND a.id = b.BUILDING_ID AND b.LOD2_MULTI_SURFACE_ID = c.ROOT_ID AND c.GEOMETRY IS NOT NULL AND b.OBJECTCLASS_ID = d.ID""")
obj = cursor.fetchone()
obj = obj[1]
print obj
result = cursor.callfunc('sdo2geojson', cx_Oracle.OBJECT, [obj])
我的对象看起来像:cx_Oracle.OBJECT。此功能在SQLdeveloper内部起作用。
当我调用该函数时,出现以下错误:cx_Oracle.NotSupportedError:Variable_TypeByValue():未处理的数据类型cx_Orac le.OBJECTVAR
我做错了什么???
当前未发布的cx_Oracle版本中提供了此功能。您可以从https://bitbucket.org/anthony_tuininga/cx_oracle获取源。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句