Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8381347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:40:45+00:00 2026-06-09T16:40:45+00:00

this is probably simple to those who know (I hope!) I have an Oracle

  • 0

this is probably simple to those who know (I hope!)

I have an Oracle spatial database with a geometry column containing a list of node points, in northing/easting format (if it’s relevent!)

I need to select those objects which fall within a given radius of a given point.

Northings and Eastings are 1 meter apart which makes it a bit easier.

Ideally this should include objects which cross the area even if their node points fall outside it.

Is this an easy-ish query? Maybe using SDO_WITHIN_DISTANCE?

The table looks like this:

MyTable
ID NUMBER
NAME VARCHAR2(20)
DESC VARCHAR2(50)
GEOM SDO_GEOMETRY

Thanks for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:40:46+00:00Added an answer on June 9, 2026 at 4:40 pm

    You can do this one of two ways. First, as you mentioned, SDO_WITHIN_DISTANCE is a valid approach.

    select 
        *
    from center_point a
    inner join target_points b
        on a.id = 1
        and sdo_within_distance( b.shape, a.shape, 'distance = 10' ) = 'TRUE'
    ;
    

    In this case, the distance is in linear units defined by a’s spatial reference. Oracle treats the coordinates as Cartesian so you will need to make sure you have a linear coordinate system before using this operator (as opposed to angular lat/lon units). Since you are working with northings/eastings, I think you’ll be okay as long as the points you are comparing against are in the same spatial reference.

    This approach uses an inner-loop to solve the query so not very efficient if you have a lot of points to compare against. Also, Oracle Spatial is VERY picky about the order of operands in the SDO functions so you might need to play around with parameter order to find the sweetspot. If your query runs for a long period, try switching the first and second parameter of your sdo operator. You can also play with the order of the ‘from’ and ‘inner join’ tables using the /*+ ORDERED */ hind after SELECT.

    Another approach is to buffer the geometry and compare against the buffer.

    select 
        *
    from center_point a
    inner join target_points b
        on a.id = 1
        and sdo_relate( b.shape, sdo_buffer(a.shape, 0.05 ), 'mask=anyinteract' ) = 'TRUE'
    ;
    

    Keep in mind that whatever is in the second parameter of the SDO_RELATE (called the window) will not have a spatial index if you transform it like we are here with the buffer.

    If you plan on doing this with several points, it is recommended to build a table where all of the source points are buffered. Then create a spatial index against the buffered areas and compare that to your target points.

    For example:

    create table point_bufs unrecoverable as
    select sdo_buffer (a.shape, b.diminfo, 1.35)
    from centerpoint a, user_sdo_geom_metadata b
    where table_name='CENTERPOINT'
      and column_name='SHAPE';
    
    select
        a.gif,
        b.gid 
    from target_points a, 
         point_bufs b
    where sdo_relate(a.shape, b.shape, 'mask=anyinteract querytype=join') = 'TRUE'
    ;
    

    NOTE: When intersecting points with polygons, you always want to polygon to be in the window position of the sdo_relate (which is the second parameter). This will ensure your spatial index is used correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this is probably one of those you just have to try it
I know this probably really simple but Im not sure what im doing wrong...
This is probably a simple misunderstanding on my part. Have a simple interface: public
this is probably pretty simple, but I've got this text file containing a bunch
This is probably a simple question, but i have been unable to find a
This is probably quite simple, but I just don't know how to do this...
This is probably a simple question... I have a multidimensional array called $form. I
I know this is probably simple and has probably been asked before, but I'm
This is probably a simple question but I can't seem to figure out how
This is probably very simple but it's really confusing me. When I implement the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.