Thanks Connor
Vatsa Ramanathan, September 25, 2024 - 12:16 pm UTC
Thanks for your answer Connor. But that will give the geometry for one location of a project. I have 4 sets of lat and long for that project and I want to draw a polygon using those four locations. Could you please let me know how to do that? Thanks again for your help!
September 25, 2024 - 2:15 pm UTC
Where are you getting these lat & long values? What's the end result you're expecting? What have you tried?
Thanks for your response.
Vatsa Ramanathan, September 25, 2024 - 2:44 pm UTC
Hi Connor,
I am getting the lat and long values for a project from a table called PM_PROJECT_LOCATION which has the project number and multiple rows with lat and long values for a project. I want to use those lat and long values to generate a polygon to be shown on a map.
Thanks for your response.
Vatsa Ramanathan, September 25, 2024 - 2:55 pm UTC
I get these four points when I query the locations and plot it on the map. I want to make a polygon with these locations as it's corners.
September 26, 2024 - 7:00 am UTC
You need to build an array from the points, eg
declare
t sdo_ordinate_array := sdo_ordinate_array();
begin
t.extend();
t(t.count) := first_lon_value;
t.extend();
t(t.count) := first_lat_value;
t.extend();
t(t.count) := second_lon_value;
t.extend();
t(t.count) := second_lat_value;
end;
/
and so forth
my_polygon := SDO_GEOMETRY(2003,4326,null,SDO_ELEM_INFO_ARRAY(1,1003,1),t);
should then give you a polygon
Thanks Connor
Vatsa Ramanathan, September 26, 2024 - 1:50 pm UTC
That worked like a charm. THanks a lot for your guidance and help!
-Vatsa
September 30, 2024 - 7:06 am UTC
Glad we could help