1

I'm using Oracle Database 11.2. I've loaded a geometry column with multipolygons, using sdo_elem_info_array and sdo_ordinate_array variables. But when I try to retrieve the text version of the shapes, I just get MULTIPOLYGON ().

This block illustrates my problem:

DECLARE
    v_elem_info_array sdo_elem_info_array;
    v_ordinate_array sdo_ordinate_array;
    v_boundary sdo_geometry;
BEGIN
    -- This works:
    dbms_output.put_line(SDO_UTIL.TO_WKTGEOMETRY( SDO_UTIL.FROM_WKTGEOMETRY('MULTIPOLYGON(((-109.2693 45.00528,-104.0577 44.99743,-104.05325 41.0014,-111.04673 40.99795,-111.0552 45.00132,-109.2693 45.00528)))')));

    -- This does not work:
    v_elem_info_array := sdo_elem_info_array();
    v_ordinate_array := sdo_ordinate_array();

    v_elem_info_array.extend(3);
    v_elem_info_array(1) := 1;
    v_elem_info_array(2) := 103;
    v_elem_info_array(3) := 1;

    v_ordinate_array.extend(12);
    v_ordinate_array(1) := -109.2693;
    v_ordinate_array(2) := 45.00528;
    v_ordinate_array(3) := -104.0577;
    v_ordinate_array(4) := 44.99743;
    v_ordinate_array(5) := -104.05325;
    v_ordinate_array(6) := 41.0014;
    v_ordinate_array(7) := -111.04673;
    v_ordinate_array(8) := 40.99795;
    v_ordinate_array(9) := -111.0552;
    v_ordinate_array(10) := 45.00132;
    v_ordinate_array(11) := -109.2693;
    v_ordinate_array(12) := 45.00528;

    v_boundary := sdo_geometry (2007, 8307, null, v_elem_info_array, v_ordinate_array);

    dbms_output.put_line(SDO_UTIL.TO_WKTGEOMETRY(v_boundary));
END;
4

1 に答える 1

1

問題は SDO_ELEM_INFO_ARRAY の構成にあると思いますが、外部ポリゴンを示すのに 1003 ではないでしょうか?

v_elem_info_array := sdo_elem_info_array(1, 1003, 1);
于 2012-06-19T03:25:39.530 に答える