This discussion is archived
1 Reply Latest reply: Mar 21, 2013 11:35 AM by jsharma RSS

Can't show Greate Circle Route (in SRID 8307) in Map Viewer

840769 Newbie
Currently Being Moderated
I've got a task to show flight tracks on the world map in Map Viewer.

I've got a table with appropriate geometry

INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID) VALUES (
'TMP_LEG_ARC_001', 'LEG_GEOM',
SDO_DIM_ARRAY(
SDO_DIM_ELEMENT('LONG', -180.0, 180.0, 0.05),
SDO_DIM_ELEMENT('LAT', -90.0, 90.0, 0.05)
),
8307);

I've got a theme created from this column. It's evident that flights (and any other straight lines on the earth surface) should look like arcs but in MapViwer I can see straight lines.
It looks like Map Viewer just projected ends of line on the map and then draw straight line between them, instead of projecting whole line on the map (which should be converted into arc)

What have I done wrong?!

Edited by: Wishmaster on 08.11.2012 21:38
  • 1. Re: Can't show Greate Circle Route (in SRID 8307) in Map Viewer
    jsharma Pro
    Currently Being Moderated
    MapViewer doesn't display them as great circles. This will be fixed in a future release.

    Meanwhile you can use Oracle Spatial functions to create the sissified lines which will approximate/be displayed as flight paths/great circles.
    That is use something like Dan Geringer's (sample code so usual disclaimers apply) densify_line plsql stored procedure below.

    The densify_line function takes two arguments:
    •     two_pt_line - The line to densify
    •     arc_tolerance - The interval (in meters) used to densify the line
    The first argument calls for a two point line. It ensures the endpoints are included in the densified result.

    You can also pass in a linestring with more than two points. The end points are ensured to be part of the densified line, but the intermediate shape points are not. To guarantee shape points, you can call densify_line iteratively with the 2 point line segments of a linestring.

    CREATE OR REPLACE FUNCTION densify_line (two_pt_line MDSYS.SDO_GEOMETRY,
    arc_tolerance number) RETURN MDSYS.SDO_GEOMETRY
    DETERMINISTIC IS
    lrs_segment MDSYS.SDO_GEOMETRY;
    new_point MDSYS.SDO_GEOMETRY;
    densified_line MDSYS.SDO_GEOMETRY := mdsys.sdo_geometry (two_pt_line.sdo_gtype,
    two_pt_line.sdo_srid,
    null,
    mdsys.sdo_elem_info_array (1,2,1),
    mdsys.sdo_ordinate_array ());
    curr_measure NUMBER;
    times_to_loop NUMBER;
    BEGIN
    IF two_pt_line IS NOT NULL
    THEN
    densified_line.sdo_ordinates.extend(2);
    densified_line.sdo_ordinates(1) := two_pt_line.sdo_ordinates(1);
    densified_line.sdo_ordinates(2) := two_pt_line.sdo_ordinates(2);

    lrs_segment := SDO_LRS.CONVERT_TO_LRS_GEOM (two_pt_line);

    times_to_loop := FLOOR (lrs_segment.sdo_ordinates(lrs_segment.sdo_ordinates.count) / arc_tolerance);

    curr_measure := 0;
    FOR i IN 1 .. times_to_loop LOOP
    curr_measure := curr_measure + arc_tolerance;
    densified_line.sdo_ordinates.extend(2);

    new_point := sdo_lrs.locate_pt (lrs_segment, curr_measure);
    densified_line.sdo_ordinates(densified_line.sdo_ordinates.count-1) := new_point.sdo_ordinates(1);
    densified_line.sdo_ordinates(densified_line.sdo_ordinates.count) := new_point.sdo_ordinates(2);
    END LOOP;

    IF curr_measure < lrs_segment.sdo_ordinates(lrs_segment.sdo_ordinates.count)
    THEN
    densified_line.sdo_ordinates.extend(2);
    densified_line.sdo_ordinates(densified_line.sdo_ordinates.count - 1) :=
    two_pt_line.sdo_ordinates(two_pt_line.sdo_ordinates.count - 1);
    densified_line.sdo_ordinates(densified_line.sdo_ordinates.count) :=
    two_pt_line.sdo_ordinates(two_pt_line.sdo_ordinates.count);
    END IF;
    END IF;

    RETURN densified_line;
    END;
    /

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points