Go to content Go to navigation and search


Current Oracle Spatial Blog Articles

    Using Oracle's ST_GEOMETRY type hierarchy with SDO_GEOMETRY: ST_PointN and ST_NumPoints
    Making Sdo Geometry Metadata
    SC4O Test log
    The Frontage Problem: Creating references from land parcel street frontage boundary to point in street
    Scheduling the Export of Spatial Data in Oracle to a Shapefile each night
    Oracle CENTROID package update
    Book: "Applying And Extending Oracle Spatial"
    Create Polygons and Linestrings From Bearings And Distances (COGO)
    Simple Implementation Of Travelling Salesman Problem
    ST_Densify for Object PLSQL
    PLSQL ST_AsEWKT and ST_FromWKT Functions For Oracle (any version)
    Useful Package of Wrapper Functions for Sdo_Util.AffineTransforms
    GeoRaptor 4.x Update 2 (Project has Stalled)
    Tip: Drop that Spatial Index!
    Convert Single Geometry to Multi-part Geometry in Oracle Spatial
    Optimized Rectangle to 5 Point Polygon
    Centroid Package now supports Y ordinate seeding
    Convert GeoJSON document to Sdo_Geometry objects
    Function That Returns a Compass Point From a Whole Circle Bearing
    Playing around with Centroids by using different seed values
    Simple Oracle C Sprintf or Java String.format
    Some Oriented Point Functions
    Extracting Inner Rings Changed Ordinate Ordering: A Trap For Players Who Don't Read Documentation!
    PLS-00306: wrong number or types of arguments in call to 'SDO_GEOMETRY'
    Converting Google Earth Formatted Longitude/Latitude points to decimal degrees
    Oracle Business Intelligence Warehousing and Analytics - Spatial Summit
    How far inside, is inside? Measuring actual distance.
    Noding and building a polygon from single, overlapping linestrings
    Analyzing Spatial Query Performance Improvements in Oracle Spatial and Graph 12c Through Cross-Vendor Comparison
    ST_VertexN / ST_PointN - Extracting a specific point from any geometry
    Convert Single Point stored in SDO_ORDINATES to SDO_POINT_TYPE
    Aggregate APPEND Islands and XOR polygons
    Circular Arcs in Geodetic Polygons
    Some SDO_GEOMETRY/DIMINFO handling functions
    Changing all DIMINFO sdo_tolerance values for all metadata records in one go.
    Building Polygons from Incomplete Linestrings using ST_PolygonBuilder
    Computing Cardinal Directions to nearby geometries
    Intersecting two aggregated polygon layers with SC4O
    Spatial and Oracle 12c
    Update Triggers and SDO_GEOMETRY Equality
    Duplicate Geometry data and Data Models
    CENTROID package update
    How to calculate cumulative length of a linestring
    Compute Location from known Lat/Long point using delta easting and northing in miles
    Sorting SDO_GEOMETRY data using the ORDER BY clause of a SELECT statement
    Creating linestrings from points
    Rounding Coordinates or Ordinates in SDO_GEOMETRY
    Effects of Sdo_Geometry Ordinate Precision on Performance
    Effects of Sdo_Geometry Ordinate Precision on Storage
    The Spatial filtering of geometries: The effect of tolerances on relationships
    Application of Delaunay Triangulation and Inverse Distance Weighting (IDW) in Oracle for Soils Interpolation
    Selecting all SDO_GTYPE values for all tables/sdo_geometry columns in a schema
    CENTROID package - Tips for Use
    Announcing the Spatial Companion For Oracle (SC4O)
    Filtering Rings (Oracle Spatial)
    Splitting a polygon using one or more linestrings
    isValid, isSimple, Dimension and CoordDim methods for SDO_Geometry
    Line Merging or Collecting lines together: ST_LineMerger
    ST_DeleteVertex for Oracle SDO_Geometry based on Jaspa/JTS
    3D/4D and SRID aware Conversion functions for SDO_Geometry: WKT and EWKT
    Topological vs Non-Topological Simplification/Generalization of Aggregated Area Geometies in Oracle
    Filtering very short linestrings via bitmap function index
    CENTROID For Oracle
    Gridding a sdo_geometry line/polygon object (Oracle)
    Finding centre and radius of a circular geometry
    Constraining geometry type for sdo_geometry column in a table.
    CASE Statements and SDO_GEOMETRY
    The Power of Constraints and Indexes for Spatial Constraints: stopping duplicate points
    Replacement for SDO_GEOM.RELATE - ST_Relate based on JTS
    Changing Oracle Spatial Index Parameters on existing index
    Writing Excel Spreadsheets files from within the Oracle database using Java and PL/SQL
    Writing xSV (eg csv) files from within the Oracle database using Java and PL/SQL
    A simple spike finder for Spatial/Locator
    JTS Java class compilation for 11g and above
    Random Spatial Search Procedure
    Geometry Snapping using JTS in Oracle
    Exposing JTS's MinimumBoundingCircle functionality
    Exposing JTS's Densifier functionality
    Using JTS's Comparison Functions - HausdorffSimilarityMeasure & AreaSimilarityMeasure with SDO_GEOMETRY
    Free JTS-based Area/Length Functions
    Handy way of systematically fixing polygon geometries with 13349 and other errors
    Standalone CENTROID package now available for download
    Free Union, Intersection, Xor and Difference Functions for Oracle Locator - Part 4 Processing Geodetic data
    Configurable Buffer: JTS and Oracle
    Free Union, Intersection, Xor and Difference Functions for Oracle Locator - Part 3
    Free Union, Intersection, Xor and Difference Functions for Oracle Locator - Part 2
    Free Union, Intersection, Xor and Difference Functions for Oracle Locator - Part 1
    Building Lines into Polygons in Oracle Locator / Spatial
    Finding Intersection Points between Line and Polygon
    Free version of sdo_length
    Alternative to my SQL based GetNumRings function
    External Tables and SDO_Geometry data.
    layer_gtype keyword issue when indexing linear data on 11g
    String Tokenizer for Oracle
    Free Aggregate Method for Concatenating 2D Lines in Oracle Locator 10g
    Reducing 5 Vertex Polygon to Optimized Rectangle
    Square Buffer
    Converting decimal seconds to string
    Valid conversion unit values for Oracle sdo_geom.sdo_length()
    Removing Steps in Gridded Vector Data - SmoothGrid for Oracle
    Oracle Spatial DISJOINT search/filtering
    Creating SDO_Geometry from geometric data recorded in the columns of a table
    Concave Hull Geometries in Oracle 11gR2
    Projecting SDO_GEOM_METADATA DIMINFO XY ordinates
    Instantiating MDSYS.VERTEX_TYPE
    New PL/SQL Packages - Rotate oriented point
    GeoRaptor Development Team
    Fast Refreshing Materialized View Containing SDO_GEOMETRY and SDO_GEOM.SDO_AREA function
    Performance of PL/SQL Functions using SQL vs Pure Code
    Implementing the BEST VicGrid Projection in Oracle 10gR2
    ORA-13011 errors when using SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT()
    Extract Polygons from Compound Polygon
    Detecting sdo_geometries with compound (3-point Arcs) segments
    GEOMETRY_COLUMNS for Oracle Spatial
    Convert GML to SDO_Geometry in Oracle 10gR2
    Spatial Sorting of Data via Morton Key
    Swapping Ordinates in an SDO_GEOMETRY object
    New To_3D Function
    Extend (Reduce/Contract/Skrink) Function for Oracle
    Loading and Processing GPX 1.1 files using Oracle XMLDB
    Loading Spatial Data from an external CSV file in Oracle
    Calling the Oracle Spatial shapefile loader from within the Oracle database itself
    Implementing SDO_VertexUpdate/ST_VertexUpdate for Oracle
    Implementing SDO_RemovePoint/ST_RemovePoint for Oracle
    Implementing SDO_AddPoint/ST_AddPoint for Oracle
    ESRI ArcSDE Exverted and Inverted Polygons and Oracle Spatial
    Funky Fix Ordinates By Formula
    Implementing a SetPoint/ST_SetPoint function in Oracle
    Implementing an ST_SnapToGrid (PostGIS) function for Oracle Spatial
    Generating random point data
    Implementing an Affine/ST_Affine function for Oracle Spatial
    Implementing a Scale/ST_Scale function for Oracle Spatial
    Implementing a Parallel/ST_Parallel function for linestring data for Oracle Spatial
    Implementing a Rotate/ST_Rotate function for Oracle Spatial
    Limiting table list returned when connecting to Oracle Database using ODBC
    ST_Azimuth for Oracle: AKA Cogo.Bearing
    Implementing a Translate/ST_Translate/Move function for Oracle Spatial
    Elem_Info_Array Processing: An alternative to SDO_UTIL.GetNumRings and querying SDO_ELEM_INFO itself
    Minumum Bounding Rectangle (MBR) Object Type for Oracle
    How to extract elements from the result of an sdo_intersection of two polygons.
    How to restart a database after failed parameter change
    Fixing failed spatial indexes after import using data pump
    generate_series: an Oracle implementation in light of SQL Design Patterns
    Multi-Centroid Shootout
    Oracle Spatial Centroid Shootout
    On the use of ROLLUP in Oracle SELECT statements
    Surrounding Parcels
    Spatial Pipelining
    Using Oracle's SDO_NN Operator - Some examples
    Converting distances and units of measure in Oracle Locator
    Split Sdo_Geometry Linestring at a known point
    Forcing an Sdo_Geometry object to contain only points, lines or areas
    Unpacking USER_SDO_GEOM_METADATA's DIMINFO structure using SQL
    Generating multi-points from single point records in Oracle Spatial
    Object Tables of Sdo_Geometry
    Oracle Locator vs Oracle Spatial: A Reflection on Oracle Licensing of the SDO_GEOM Package
    FAST REFRESHing of Oracle Materialized Views containing Sdo_Geometry columns
    Australian MGA/AMG Zone Calculation from geographic (longitude/latitude) data
    Loading Shapefiles (SHP) into Oracle Spatial
    Oracle Spatial Mapping and Map Rendering Performance Tips
    The significance of sdo_lb/sdo_ub in USER_SDO_GEOM_METDATA: Do I need it?
    Oracle Spatial Forum - Melbourne April 2007
    Layer_GTypes for spatial indexes
    Oracle's SQL/MM Compliant Types
    Tips and Tricks



RSS / Atom

Email me


Creative Commons License
All Blog Articles, Data Models and Free Source Code by Simon Greener, The SpatialDB Advisor is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Compute Location from known Lat/Long point using delta easting and northing in miles

Saturday May 12 2012 at 07:46

Keywordscompute new point delta easting northing longitude latitude point

This article shows how to compute a new point location when all you have is a known or existing point in longitude/latitude (geographic/geodetic) and a delta easting and northing value in miles (or in other units).

Over on the Oracle Spatial Forum at the Technology Network, Wojciech asked the following question:

My problem looks that way:
lets say we have a point:

 8307, -- SDO_SRID
 -77, -- Longitude
 39 -- Latitude

I want to get a location of a point 50 miles east and 30 miles north from the point presented here.

Do you know how to achieve this?

There is a function in the SDO_UTIL package – SDO_UTIL.POINT_AT_BEARING -that allows you to create a new point at a bearing and distance from a known point, but there is no function that allows one to compute a new point from an existing point using a delta distance in x and y.

Obviously for projected data one can do this via Pythagoras on the X and Y ordinates but for geographic/geodetic there is no method available to do this accurately. You have to write it yourself.

Which is what this blog article is all about.


Now, the function presented will only generate an approximate location for the new point but it may suffice for some.

The approach requires us to convert miles into decimal degrees in both longitude and latitude at the actual location of the known point. Why? Because the length subtended by a degree of longitude changes as you move from the Equator to the Pole. And at any one point on the globe that length in longitude is different from that in latitude.

So, how can I compute this value. The following method takes the starting point and creates two points a whole number of degrees of longitude and latitude away from it (in the case below 0.1 degrees). Then, Oracle’s sdo_geom.sdo_distance method is used to find out how many miles each of these decimal degree values subtends.

  1. WITH longLat AS (
  2.   SELECT sdo_geometry(2001,8307,sdo_point_type(-77.0     ,39.0,NULL),NULL,NULL) AS pt1,
  3.          sdo_geometry(2001,8307,sdo_point_type(-77.0+unit,39.0,NULL),NULL,NULL) AS pt2,
  4.          sdo_geometry(2001,8307,sdo_point_type(-77.0     ,39.0+unit,NULL),NULL,NULL) AS pt3
  5.     FROM (SELECT 0.1 AS unit FROM dual)
  6. )
  7. SELECT sdo_geom.sdo_distance(l.pt1,l.pt2,0.005,'unit=MILE') AS unitLongMiles,
  8.        sdo_geom.sdo_distance(l.pt1,l.pt3,0.005,'unit=MILE') AS unitLatMiles
  9.   FROM longLat l;
  10. -- Results
  12. ---------------- ----------------
  13. 5.38271491729028 6.89824146515357

OK, now that we know the distances in miles we can compute the number of degrees of longitude and latitude covered by the required delta of 50 miles east and 30 miles north from that point.

  1. WITH longLat AS (
  2.   SELECT sdo_geometry(2001,8307,sdo_point_type(-77.0     ,39.0,NULL),NULL,NULL) AS pt1,
  3.          sdo_geometry(2001,8307,sdo_point_type(-77.0+unit,39.0,NULL),NULL,NULL) AS pt2,
  4.          sdo_geometry(2001,8307,sdo_point_type(-77.0     ,39.0+unit,NULL),NULL,NULL) AS pt3,
  5.          50.0 AS eastMile,
  6.          30.0 AS northMile,
  7.          unit
  8.     FROM (SELECT 0.1 AS unit FROM dual)
  9. )
  10. SELECT round(sdo_geom.sdo_distance(l.pt1,l.pt2,0.005,'unit=MILE'),9) AS unitLongMiles,
  11.        round(sdo_geom.sdo_distance(l.pt1,l.pt3,0.005,'unit=MILE'),9) AS unitLatMiles,
  12.        round(l.eastMile /sdo_geom.sdo_distance(l.pt1,l.pt2,0.005,'unit=MILE') * l.unit,9) AS eastDeltaInDegrees,
  13.        round(l.northMile/sdo_geom.sdo_distance(l.pt1,l.pt3,0.005,'unit=MILE') * l.unit,9) AS northDeltaInDegrees
  14.   FROM longLat l;
  15. -- Results
  17. ------------- ------------ ------------------ -------------------
  18. 5.382714917   6.898241465  0.928899278        0.434893446

We can compute the new point via the following SQL:

  1. WITH longLat AS (
  2.   SELECT sdo_geometry(2001,8307,sdo_point_type(-77.0     ,39.0,NULL),NULL,NULL) AS pt1,
  3.          sdo_geometry(2001,8307,sdo_point_type(-77.0+unit,39.0,NULL),NULL,NULL) AS pt2,
  4.          sdo_geometry(2001,8307,sdo_point_type(-77.0     ,39.0+unit,NULL),NULL,NULL) AS pt3,
  5.          50.0 AS eastMile,
  6.          30.0 AS northMile,
  7.          unit
  8.     FROM (SELECT 0.1 AS unit FROM dual)
  9. )
  10. SELECT f.pt1,f.pt2,
  11.        ROUND(sdo_geom.sdo_distance(f.pt1,f.pt2,0.005,'unit=MILE'),3) AS dist,
  12.        ROUND(SQRT(50.0*50.0+30.0*30.0),3) AS roughDistCheck
  13.   FROM (SELECT b.pt1,
  14.                sdo_geometry(2001,8307,
  15.                             sdo_point_type(ROUND(b.pt1.sdo_point.x+b.longDelta,8),
  16.                                            ROUND(b.pt1.sdo_point.y+b.latDelta,8),NULL),
  17.                             NULL,NULL) AS pt2
  18.           FROM (SELECT round(l.eastMile/sdo_geom.sdo_distance(l.pt1, l.pt2,0.005,'unit=MILE')*l.unit,9) AS longDelta,
  19.                        round(l.northMile/sdo_geom.sdo_distance(l.pt1,l.pt3,0.005,'unit=MILE')*l.unit,9) AS latDelta,
  20.                        l.pt1
  21.                   FROM longLat l
  22.               ) b
  23.       ) f;
  24. -- Results
  25. PT1                                                           PT2                                                                             DIST   ROUGHDISTCHECK
  26. ------------------------------------------------------------- ------------------------------------------------------------------------------- ------ --------------
  27. SDO_GEOMETRY(2001,8307,SDO_POINT_TYPE(-77,39,NULL),NULL,NULL) SDO_GEOMETRY(2001,8307,SDO_POINT_TYPE(-76.07110072,39.43489345,NULL),NULL,NULL) 58.178 58.31

Now, let’s put this all together into a function.

  2. FUNCTION pointFromDelta(p_geometry IN mdsys.sdo_geometry,
  3.                         p_delta_x  IN NUMBER,
  4.                         p_delta_y  IN NUMBER,
  5.                         p_unit_deg IN NUMBER,
  6.                         p_units    IN varchar2 := NULL,
  7.                         p_tolerance IN NUMBER  := 0.05,
  8.                         p_round_factor IN pls_integer := 9)
  9. RETURN sdo_geometry deterministic
  10. AS
  11.   v_pt           mdsys.sdo_geometry := p_geometry;
  12.   v_ptX          mdsys.sdo_geometry;
  13.   v_ptY          mdsys.sdo_geometry;
  14.   v_round_factor NUMBER :=  NVL(p_round_factor,9);
  15.   v_units        varchar2(100) := CASE WHEN p_units IS NOT NULL
  16.                                        THEN CASE WHEN INSTR(UPPER(p_units),'UNIT=')=0
  17.                                                  THEN 'UNIT=' || UPPER(p_units)
  18.                                                  ELSE p_units
  19.                                              END
  20.                                    END;
  21. BEGIN
  22.    IF (p_geometry IS NULL OR p_geometry.sdo_point IS NULL OR p_unit_deg IS NULL) THEN
  23.       RETURN p_geometry;
  24.    END IF;
  25.   v_pt  := NEW mdsys.sdo_geometry(p_geometry.sdo_gtype,
  26.                                   p_geometry.sdo_srid,
  27.                                   sdo_point_type(p_geometry.sdo_point.x,
  28.                                                  p_geometry.sdo_point.y,
  29.                                                  NULL),
  30.                                   NULL,NULL);
  31.   v_ptX := NEW mdsys.sdo_geometry(p_geometry.sdo_gtype,
  32.                                   p_geometry.sdo_srid,
  33.                                   sdo_point_type(p_geometry.sdo_point.x+p_unit_deg,
  34.                                                  p_geometry.sdo_point.y,
  35.                                                  NULL),
  36.                                   NULL,NULL);
  37.   v_ptY := NEW mdsys.sdo_geometry(p_geometry.sdo_gtype,
  38.                                   p_geometry.sdo_srid,
  39.                                   sdo_point_type(p_geometry.sdo_point.x,
  40.                                                  p_geometry.sdo_point.y+p_unit_deg,
  41.                                                  NULL),
  42.                                   NULL,NULL);
  43.    RETURN CASE WHEN v_units IS NULL
  44.                THEN sdo_geometry(2001,
  45.                        p_geometry.sdo_srid,
  46.                        sdo_point_type(ROUND(v_pt.sdo_point.x+(p_delta_x/sdo_geom.sdo_distance(v_pt,v_ptX,p_tolerance)*p_unit_deg),v_round_factor),
  47.                                       ROUND(v_pt.sdo_point.y+(p_delta_y/sdo_geom.sdo_distance(v_pt,v_ptY,p_tolerance)*p_unit_deg),v_round_factor),
  48.                                       NULL),
  49.                        NULL,NULL)
  50.                ELSE sdo_geometry(2001,
  51.                        p_geometry.sdo_srid,
  52.                        sdo_point_type(ROUND(v_pt.sdo_point.x+(p_delta_x/sdo_geom.sdo_distance(v_pt,v_ptX,p_tolerance,v_units)*p_unit_deg),v_round_factor),
  53.                                       ROUND(v_pt.sdo_point.y+(p_delta_y/sdo_geom.sdo_distance(v_pt,v_ptY,p_tolerance,v_units)*p_unit_deg),v_round_factor),
  54.                                       NULL),
  55.                        NULL,NULL)
  56.           END;
  57. END pointFromDelta;
  58. /
  59. FUNCTION pointFromDelta compiled
  60. SHOW errors
  61. No Errors.

Testing this we get:

  1. WITH pt AS (
  2.   SELECT sdo_geometry(2001,8307,sdo_point_type(-77,39,NULL),NULL,NULL) AS pt,
  3.          0.1 AS unit
  4.     FROM dual
  5. )
  6. SELECT p.pt,
  7.        pointFromDelta(p.pt,50.0,30.0,p.unit,'UNIT=MILE',0.05,9),
  8.        ROUND(sdo_geom.sdo_distance(p.pt,
  9.                                    pointFromDelta(p.pt,50.0,30.0,p.unit,'UNIT=MILE',0.05,9),
  10.                                    0.005,'unit=MILE'),4) AS dist,
  11.        ROUND(SQRT(50.0*50.0+30.0*30.0),4) AS roughDistCheck
  12.   FROM pt p;
  13. -- Results
  14. PT                                                            POINTFROMDELTA(P.PT,50.0,30.0,0.1,'UNIT=MILE',0.05,9)                             DIST   ROUGHDISTCHECK
  15. ------------------------------------------------------------- --------------------------------------------------------------------------------- ------ --------------
  16. SDO_GEOMETRY(2001,8307,SDO_POINT_TYPE(-77,39,NULL),NULL,NULL) SDO_GEOMETRY(2001,8307,SDO_POINT_TYPE(-76.071100722,39.434893446,NULL),NULL,NULL) 58.178 58.3095

Don’t forget that the ROUGHDISTCHECK is just a Pythagoras of the delta east and north on a flat plane. This approach isn’t all that accurate.

Alternate method using SDO_UTIL POINT_AT_BEARING

There is an alternate approach that writing this article reminded me was possible. And that is to use the SDO_UTIL.POINT_AT_BEARING function as follows:

  1. WITH longLat AS (
  2.   SELECT sdo_geometry(2001,8307,sdo_point_type(-77.0,39.0,NULL),NULL,NULL) AS pt1,
  3.          50.0 AS eastMile,
  4.          30.0 AS northMile,
  5.          unit
  6.     FROM (SELECT 0.1 AS unit FROM dual)
  7. )
  8. SELECT f.pt2,
  9.        ROUND(sdo_geom.sdo_distance(f.pt1,f.pt2,0.005,'unit=MILE'),3) AS dist
  10.   FROM (SELECT l.pt1,
  11.                SDO_UTIL.POINT_AT_BEARING(
  12.                         SDO_UTIL.POINT_AT_BEARING(l.pt1,
  13.                                                   DECODE(SIGN(l.eastMile),1.570796326794895,0,-1.570796326794895),
  14.                                                   codesys.geom.Convert_Unit( 'MILE',l.eastMile, 'Meter')),
  15.                                          DECODE(SIGN(l.northMile),3.14159265358979,0,-3.14159265358979),
  16.                                          codesys.geom.Convert_Unit('MILE',l.northMile, 'Meter')) AS pt2
  17.          FROM longLat l
  18.       ) f;
  19. -- Results
  20. PT2                                                                                                            DIST
  21. -------------------------------------------------------------------------------------------------------------- ------
  22. SDO_GEOMETRY(2001,8307,NULL,SDO_ELEM_INFO_ARRAY(1,1,1),SDO_ORDINATE_ARRAY(-77.9288670026001,38.5613888205277)) 58.571

That is, go either 90 degrees to the East for +Eastings and 0 degrees to the North for +northings (or -90/270 for -Eastings and 180 degrees south for -northings).

Note that the distance difference between the two methods is 58.178 for my method and 58.571 for the method using the Oracle function. Knowing that a distance in longitude changes by latitude this may be affecting the second method as the conversion routine from Miles to Meters (SDO_UTIL.POINT_AT_BEARING requires distances in Meters) will not take this into account.

Something could be done using spherical or spheroidal math, but you would have to approach me directly to see if I would be interested coding something.

Anyway, I hope this is of help to someone.

Creative Commons License

post this at del.icio.uspost this at Diggpost this at Technoratipost this at Redditpost this at Farkpost this at Yahoo! my webpost this at Windows Livepost this at Google Bookmarkspost this to Twitter

Comment [2]

I want to get items from table that contains item information with a position (latitude and longtitude).

The user requests to get item’s name in polygon of below ABCD areas with below 4 points value (latitude and longtitude)

A: 35N;104W
B: 34N;112W
C: 33N,97 W
D: 32N,108W

How do I find these items in requested polygon ABCD area?


Jim 28 June 2013, 17:57 #


I have no idea what you mean.

If you want to execute a point in polygon query against another column containing area data then something like this would do:

select a.point_id, b.area_item from table_of_points a, table_of_areas b where sdo_contains(b.geom,sdo_geometry(2001,<<b’s SRID>>,sdo_point_type(a.longitude,a.latitude,null),null,null)) = ‘TRUE’;


Simon Greener 17 July 2013, 05:49 #