Spatial (MOSC)

MOSC Banner

Spatial Functions (Derive polygon from point)

edited Apr 16, 2014 5:41AM in Spatial (MOSC) 2 commentsAnswered ✓

Problem Description:

I have two fields defined as sdo_geometry, a point and polygon, belonging to two different tables.

I want to establish to which area (polygon) a specific point belongs to and wrote the following SQL to derive that:

select

    p.legal_entity_id

    , p.city

    , p.location point

    , c.geometry polygon

    , sdo_geom.relate(c.geometry, 'CONTAINS',  p.location, 0.05) AS sdo_relate

from

    rfiling_legal_entity_point p

    , zaf_adm1 c

where p.legal_entity_id in

(

    -- Test Cases

    '1263',

    '1289'

)

and c.name_1 = 'Eastern Cape' -- province / area (polygon);

The problem with this SQL is that I need to compare every point with every polygon, which is not an very effective way of processing all the records.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center