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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:45:04+00:00 2026-06-02T23:45:04+00:00

I have an SQL table with geo-tagged values (Longitude, Latitude, value). The table is

  • 0

I have an SQL table with geo-tagged values (Longitude, Latitude, value). The table is accumulated quickly and has thousands entries. Therefore, querying the table for values in some area return very large data-set.

I would like to know the way to average value with close location proximity to one value, here is an illustration:

Table:

Long            lat           value
10.123001       53.567001      10
10.123002       53.567002      12
10.123003       53.567003      18
10.124003       53.568003      13

lets say my current location is 10.123004, 53.567004. If I am querying for the values near by I will get the four raws with values 10, 12, 18, and 13. This works if the data-set is relatively small. If the data is large I would like to query sql for rounded location (10.123, 53.567) and need sql to return something like

Long            lat           value
10.123       53.567      10 (this is the average of 10, 12, and 18)
10.124       53.568      13

Is this possible? how we can average large data set based on locations?

Is sql database is the right choice in the first place?

  • 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-02T23:45:05+00:00Added an answer on June 2, 2026 at 11:45 pm

    GROUP BY rounded columns, and the AVG aggregate function should work fine for this:

    SELECT ROUND(Long, 3) Long, 
           ROUND(Lat, 3) Lat, 
           AVG(value) 
     FROM Table
     GROUP BY ROUND(Long, 3), ROUND(Lat, 3) 
    

    Add a WHERE clause to filter as needed.

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

Sidebar

Related Questions

I have a SQL table which has a number of fields ID | Value
I have a sql table of payroll data that has wage rates and effective
I have an sql table which has the following rows. (4081, 3, '', 'contrapreneurship.jpg',
I have SQL table that has a varchar(8) column that occasionally has binary data
I have a sql table which has 7 column and the first six column
I have a sql table images which has columns id , imagePath , caption``count
I have this SQL Table: TABLE: Info COLUMNS:| Name | Value --------|----------|------------------ ROW: |
I have a sql table which has a date column (let say deployDate). Now
I have a sql table which has five columns Count1 float Count2 float Total
I have a sql table, it has many coloumns. For Instance; The Table :

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.