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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:11:01+00:00 2026-05-15T11:11:01+00:00

I have geographic data that was loaded into the geography datatype. For very specific

  • 0

I have geographic data that was loaded into the geography datatype. For very specific purposes, I now need to have store this as a geometry. However, I need to perform a query like this.

DECLARE @radius INT -- e.g. 3000 metres

DECLARE @geo geometry -- my starting shape

SET @geo = @geo.STBuffer(@radius) -- this obviously doesnt work.. 

SELECT Geo FROM GeometryTable 
WHERE Geo.STWithin (@geo) = 1
  • 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-15T11:11:02+00:00Added an answer on May 15, 2026 at 11:11 am

    This trick might work, if someone can validate this technique or provide a better alternative then they’ll get the accepted answer.

    Basically, I am thinking I can use the STBuffer of a geography which will apply the correct radius in metres around my geographical shape and then I convert back to a geometry. As the shapes were loaded originally as geography all the points are the same. This shape-flip should give me a resulting geometry with a pretty accurate buffer around it.

    DECLARE @radius INT -- e.g. 3000 metres
    
    DECLARE @geo geometry -- my starting shape
    
    SET @geo = GEOMETRY::STGeomFromWKB(GEOGRAPHY::STGeomFromWKB(@geo.STAsBinary(),
               4326).STBuffer(@radius).STAsBinary(),4326)
    
    SELECT Geo FROM GeometryTable 
    WHERE Geo.STWithin (@geo) = 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have huge amont of geographic data represented in simple object structure consisting only
Have a matrix report now that has Position, Hours and Wages for a location
I am working on a project where I need to have data inherit at
I'm developing an application in C# that will use and store geographic locations using
I have been experimenting with geography datatype lately and just love it. But I
Variants of this question have been asked several times now here, but my question
I am writing an application that fetches data from MS AX Dynamics once-in-a-very-long-while The
I have a class that performs some operations on a set of data. The
I have a SQL Server 2008 GEOGRAPHY data type in my database containing a
I'm creating a new DB and have a bunch of static data that won't

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.