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 6038887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:17:15+00:00 2026-05-23T06:17:15+00:00

I am trying to work out the most efficient query to get points within

  • 0

I am trying to work out the most efficient query to get points within a radius of a given point. The results do not have to be very accurate so I would favor speed over accuracy.

We have tried using a where clause comparing distance of points using STDistance like this (where @point and v.GeoPoint are geography types):

WHERE v.GeoPoint.STDistance(@point) <= @radius

Also one using STIntersects similar to this:

WHERE @point.STBuffer(@radius).STIntersects(v.GeoPoint) = 1

Are either of these queries preferred or is there another function that I have missed?

  • 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-05-23T06:17:16+00:00Added an answer on May 23, 2026 at 6:17 am

    If accuracy is not paramount then using the Filter function might be a good idea:
    http://msdn.microsoft.com/en-us/library/cc627367.aspx

    This can i many cases be orders of magnitude faster because it does not do the check to see if your match was exact.
    In the index the data is stored in a grid pattern, so how viable this approach is probably depends on your spatial index options.

    Also, if you don’t have to many matches then doing a filter first, and then doing a full intersect might be viable.

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

Sidebar

Related Questions

I'm trying to work out the most efficient way to count the number of
I'm trying to work out the most efficient method to find the linear regression
I am trying to work out how to get the value of table cell
I am trying to work out a solution to share most of my VBA
I'm trying to work out the best method (i.e. most simple and foolproof) for
I have been trying for quite a while to work out how to accomplish
I am trying to work out the most appropriate design to pass a session
I am trying to figure out the most efficient way to find my element.
I'm trying to work out what's not working in this code: #!/usr/bin/python import cmd
I am trying to work out the best way to display solr results in

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.