Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

apex map

mpumi madibaApr 14 2023

i have loaded json file that cointains coordinates of polygon to apex but some other polygons are missing of which i dont know if maye its the structure of my table or package code that is where i need assistnce this is how they are supposed to be displayed as shown in my vs code then when i load them to apex they display one polygon of which it has to display a number of polygons which represent towns please assist in making my apex map to display polygons the way they are on my vs code

polygons of gauteng province.PNG

then this is how it is on apex when loaded

there is the table and package code i used CREATE TABLE json_data (
id VARCHAR2(200),
label VARCHAR2(200),
color VARCHAR2(100),
name varchar2(100),
polygon SDO_GEOMETRY

);

create or replace PACKAGE BODY "EBA_DEMO_JSON_DATA_PKG" is
procedure load_json_data(p_json_data clob) is
v_id varchar2(200);
v_label varchar2(200);
v_color varchar2(100);
v_name varchar2(100);
v_polygon sdo_geometry;
v_json_object json_object_t;
v_json_array json_array_t;
v_json_element json_element_t;
begin
v_json_array := json_array_t.parse(p_json_data);
for v_i in 0..v_json_array.get_size - 1 loop
begin
v_json_object := treat(v_json_array.get(v_i) as json_object_t).get_object('data');
v_id := v_json_object.get_string('id');
v_label := v_json_object.get_string('label');
v_name := v_json_object.get_string('name');
v_json_array := v_json_object.get_array('color');
v_color := v_json_array.get_string(0) || ',' || v_json_array.get_string(1) || ',' || v_json_array.get_string(2);
v_json_array := v_json_object.get_array('allData');
v_json_element := treat(v_json_array.get(0) as json_array_t).get(0);
v_json_object := treat(v_json_element as json_object_t).get_object('geometry');
v_polygon := sdo_util.from_json(v_json_object.to_clob);
insert into eba_demo_json_data(id, label,name, color, polygon) values(v_id, v_label, v_name, v_color, v_polygon);
exception
when others then
dbms_output.put_line('error in json data: ' || sqlerrm);
end;
end loop;
end;
end;

how it is displayed on apex map.PNGi ll attach the json file i loaded

gauteng d.docx

Comments
Post Details
Added on Apr 14 2023
0 comments
419 views