I'm reading out an Oracle DB with geospatial geometries which I save in a pandas dataframe, say df
having a geometric object of format <cx_Oracle.Object MDSYS.SDO_GEOMETRY at 0x7f28
in a column named 'geometry'. Let's store it as:
g = df.geometry[0]
What I want to do:
Transform the data stored g
to present it on a folium map as a PolyLine from shapely. I know that it consists of a bunch of points representing a line object.
What I can do:
I can read out the SDO_GTYPE, i.e. g.SDO_GTYPE
gives 2002
.
I can read out SDO_ORDINATES, but it won't show me the coordinates, saying: <cx_Oracle.Object MDSYS.SDO_ORDINATE_ARRAY at 0x7f287848e4f0>
.
What I cannot do:
from shapely.geometry import asShape
shape = asShape(g)
gives error: 'Context does not provide geo interface'.
There are colleagues reading the data with a GIS-tool, i.e. why I doubt that the data is corrupt. I would be happy about any suggestions regarding this issue.
Thanks a lot.
Don't have any experience with Oracle DB, but this SO question seems similar to yours.