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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:51:58+00:00 2026-06-02T22:51:58+00:00

I have grid showing on a map. I know your location and the location

  • 0

I have grid showing on a map. I know your location and the location of 2 objects on the map. Objects appear where grid lines cross. Consider the world flat and not round since the area on the map is only a short distance. I want to determine which object is closest to you without using trigonometry and multiplication for performance reasons. I’m not looking for accuracy as much as just getting a ballpark indication. I should be able to determine the shortest distance between the difference in latitude and longitude from my current location. My table, Locations, looks like this:

ID   Latitude   Longitude
1       50         70
2       30         40

If my location is Latitude = 40 and Longitude = 60, then the location with ID = 1 would be closer to me.

If my location is Latitude = 30 and Longitude = 60, probably both locations are about the same distance, so just pick one.

If my location is latitude = 30 and Longitude = 50, then the location with ID = 2 would be closer.

  • 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-02T22:51:59+00:00Added an answer on June 2, 2026 at 10:51 pm

    I would just do a min of the sum of the differences. I tried it out,and it works pretty well.

    SELECT MIN(ABS(s.Latitude - 47) + ABS(s.Longitude - -122)), s.ID FROM Sites as s Group By ID;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a simple Line Chart: Which is showing 4 grid-lines at points
I am a beginner to WPF . I have a data grid for showing
I have an AJAX grid which refreshes every 60 seconds showing new rows. It's
I have an asp.net page where two grid views are available showing current stock
I have a telerik grid showing 2 levels of details, and for the first
I have implemented the getAdditionalData in ExtJS's grid.panel . I have it showing the
I have a Grid in which I am showing some records in each row.
I have a strongly typed Category View, showing all Category (in a grid) ...
Please have a look at this image Grid Showing Pending Work http://softwaregenius.net/myimages/grid.png The image
I have problems showing my data inside the data into the data grid view.

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.