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

  • SEARCH
  • Home
  • 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 8723155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:33:51+00:00 2026-06-13T07:33:51+00:00

I need to find the best way for a circles overlapping given point system.

  • 0

I need to find the best way for a “circles overlapping given point” system.

I have a lot of points e.g. restaurants, and every item has a point of the place, and a radius for e.g. “bringing out food”. The radius differ, some have 3 km, others 10 km.
I am searching from a point. e.g. “My position” latitude/longitude.

I need to find the best way to find all restaurants that overlaps my point. (Will bring food to me). (Not is point in circle, but what circles are overlapping my point.)

I am thinking of storing lat/lng as geography type in SQLServer 2008. Is this the way to do it?

Can I query directly on top of sqlserver? Or do I need to do it in code?
And what is the way to do it?

  • 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-13T07:33:52+00:00Added an answer on June 13, 2026 at 7:33 am

    Yes, this is exactly the kind of thing that geography and spatial methods are good at. Here is a short example:

    DECLARE @Restaurant TABLE (
        Name nvarchar(50),
        Location geography,
        DeliveryRadiusMetres int
    );
    
    INSERT @Restaurant
    VALUES
    -- long lat
    ('Dominos','POINT(-0.109339 51.532835)',2000 ),
    ('Pizza Hut','POINT(-0.102961 51.541157)',2000 );
    

    Note that here to construct the geography values I am using an implicit conversion from string, which behind the scenes calls geography::Parse.

    DECLARE @MyLocation geography = 'POINT(-0.115063 51.550231)';
    
    SELECT
        Name
    FROM
        @Restaurant R
    WHERE
        R.Location.STDistance(@MyLocation) <= R.DeliveryRadiusMetres
    ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to find the best way to record an audio stream. I have
I've researched and need to find the best way to replace a need with
Using Javascript I need to find the best way to add a iframe element
I need to find the best way to insert or update data in database
I need to find a best way to generate a million tcp connections. (More
I am trying to find the best way to have a DIV be hidden
Trying to find the best way to write this SQL statement. I have a
I have been researching around trying to find the best way to begin developing
I need to find the best way to limit my DateTime field to today's
I need to find a way to get actual page size in Google Chrome.

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.