[Python] "Convert an oracledb.Lob into a geometry type compatible with GeoPandas."

Discussão em 'Python' iniciado por Stack, Abril 7, 2025.

  1. Stack

    Stack Membro Participativo

    I have a DataFrame where the geometry data was imported from an Oracle database. It looks like this:

    df_wkt.head()


    The output is:

    FID WKT_GEOM
    0 214213 CURVEPOLYGON (COMPOUNDCURVE ((2694062.785 1263...
    1 214214 CURVEPOLYGON (COMPOUNDCURVE (CIRCULARSTRING (2...
    2 214209 CURVEPOLYGON (COMPOUNDCURVE ((2700414.355 1262...
    3 214210 CURVEPOLYGON (COMPOUNDCURVE (CIRCULARSTRING (2...
    4 214211 CURVEPOLYGON (COMPOUNDCURVE ((2696513.166 1263...


    A single object looks like this:

    df_wkt["WKT_GEOM"].iloc[1]:

    <oracledb.LOB at 0x7244f423ca70>


    I want to convert these geometries (currently of type <oracledb.LOB>) into a format that is compatible with a PostGIS database.

    There are two main challenges:


    1. Converting the Oracle LOB objects into usable geometries.


    2. Converting the CURVEPOLYGON geometries into linear polygons, as I need the final output to contain only linear (non-curved) geometries.

    Continue reading...

Compartilhe esta Página